:root{
  --bg:#0b1220; --panel:#0f1a2e; --card:#121f36;
  --muted:#9fb0d0; --text:#e7eeff; --line:rgba(255,255,255,.09);
  --accent:#6ea8ff; --danger:#ff5d5d; --ok:#3ddc97; --warn:#ffd166;
  --shadow: 0 20px 50px rgba(0,0,0,.35); --radius: 16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 700px at 15% 10%, rgba(110,168,255,.16), transparent 60%),
              radial-gradient(900px 600px at 85% 20%, rgba(61,220,151,.10), transparent 55%),
              var(--bg);
  color:var(--text);
}
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background: rgba(11,18,32,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  background: linear-gradient(135deg, rgba(110,168,255,.35), rgba(61,220,151,.25));
  border:1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  font-weight:800;
}
.title{font-weight:800}
.subtitle{color:var(--muted); font-size:12px; margin-top:2px}
.top-actions{display:flex; gap:10px; flex-wrap:wrap}
.filebtn{display:inline-flex; align-items:center; gap:8px}

.layout{
  display:grid; grid-template-columns: 260px 1fr; gap:18px;
  padding:18px; max-width: 1280px; margin:0 auto;
}
.sidebar{
  position:sticky; top:74px; align-self:start;
  background: rgba(15,26,46,.75);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:10px; box-shadow: var(--shadow);
}
.navbtn{
  width:100%; background: transparent; border:1px solid transparent; color: var(--text);
  padding:12px 12px; border-radius: 14px; text-align:left; cursor:pointer;
  display:flex; gap:10px; align-items:center; font-weight:650;
}
.navbtn:hover{background: rgba(255,255,255,.05); border-color: var(--line)}
.navbtn.active{background: rgba(110,168,255,.14); border-color: rgba(110,168,255,.25)}

.content{
  background: rgba(15,26,46,.55);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:18px;
  box-shadow: var(--shadow);
  min-height: calc(100vh - 120px);
}

.viewhead{display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:14px}
h2{margin:0 0 4px 0}
p{margin:0;color:var(--muted)}
h3{margin:0}

.filters{
  display:grid; grid-template-columns: 1fr 220px; gap:12px; margin: 14px 0;
}
.field label{display:block; color:var(--muted); font-size:12px; margin-bottom:6px}
.field input,.field select,.field textarea{
  width:100%; padding:10px 12px; border-radius: 14px; border:1px solid var(--line);
  outline:none; background: rgba(18,31,54,.85); color: var(--text);
}
.field textarea{min-height:90px; resize:vertical}

.tablewrap{
  overflow:auto; border:1px solid var(--line); border-radius: 14px; background: rgba(18,31,54,.65);
}
.table{
  width:100%; border-collapse:separate; border-spacing:0; min-width: 900px;
}
.table thead th{
  text-align:left; font-size:12px; color: var(--muted); padding:12px 12px;
  border-bottom:1px solid var(--line); background: rgba(18,31,54,.9);
}
.table tbody td{
  padding:12px 12px; border-bottom:1px solid rgba(255,255,255,.06); vertical-align:top;
}
.table tbody tr:hover{background: rgba(255,255,255,.03)}
.right{text-align:right}

.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius: 999px; border:1px solid var(--line);
  font-size:12px; color: var(--text); background: rgba(255,255,255,.04);
}
.dot{width:8px;height:8px;border-radius:50%; background: var(--muted)}
.dot.ok{background: var(--ok)}
.dot.warn{background: var(--warn)}
.dot.danger{background: var(--danger)}
.dot.accent{background: var(--accent)}

.btn{
  border:none; padding:10px 12px; border-radius: 14px; cursor:pointer;
  font-weight:700; color:#081022;
  background: linear-gradient(135deg, rgba(110,168,255,1), rgba(61,220,151,1));
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
}
.btn:hover{filter:brightness(1.05)}
.btn:active{transform: translateY(1px)}
.btn.ghost{
  background: rgba(255,255,255,.05); color: var(--text); border:1px solid var(--line); box-shadow:none;
}
.btn.danger{
  background: rgba(255,93,93,.18); color: #ffd9d9; border:1px solid rgba(255,93,93,.35); box-shadow:none;
}
.iconbtn{
  background: transparent; color: var(--text); border:1px solid transparent;
  cursor:pointer; border-radius: 12px; padding:8px 10px;
}
.iconbtn:hover{background: rgba(255,255,255,.06); border-color: var(--line)}
.hidden{display:none !important}

.modal{
  position:fixed; inset:0; background: rgba(0,0,0,.55);
  display:grid; place-items:center; padding:18px; z-index:50;
}
.modal-card{
  width:min(980px, 100%); background: rgba(18,31,54,.92);
  border:1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 14px; border-bottom:1px solid var(--line);
}
.modal-actions{
  display:flex; justify-content:flex-end; gap:10px;
  padding:14px; border-top:1px solid var(--line);
}
.grid{
  display:grid; grid-template-columns: repeat(2, 1fr); gap:12px; padding:14px;
}

.card{
  border:1px solid var(--line); border-radius: 16px;
  background: rgba(18,31,54,.70); padding:14px;
}
.row{display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap}
.grow{flex:1}
.small{font-size:12px;color:var(--muted)}
.pill{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  padding:8px 10px;
  border-radius: 999px;
  color: var(--text);
}

.gridMesas{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
}
.mesaCard{
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  padding:12px;
  cursor:pointer;
}
.mesaCard:hover{background: rgba(255,255,255,.06)}
.mesaCard .top{display:flex; justify-content:space-between; gap:8px; align-items:flex-start}
.mesaCard .meta{margin-top:8px; color:var(--muted); font-size:12px}
.mesaCard .total{margin-top:8px; font-size:18px; font-weight:800}
.mesaCard.open{border-color: rgba(61,220,151,.25)}
.mesaCard.pay{border-color: rgba(255,209,102,.25)}
.mesaCard.closed{opacity:.6}

.comItem{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  margin-bottom:10px;
  background: rgba(255,255,255,.03);
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.qty{
  display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap;
}
.qty button{
  padding:6px 10px; border-radius: 12px; border:1px solid var(--line);
  background: rgba(255,255,255,.05); color: var(--text); cursor:pointer;
}
.qty button:hover{background: rgba(255,255,255,.08)}

.totals{margin-top:12px; border-top:1px solid var(--line); padding-top:10px}
.totals .line{display:flex; justify-content:space-between; padding:6px 0}
.totals .line.total{border-top:1px dashed rgba(255,255,255,.12); margin-top:6px; padding-top:10px; font-size:18px}

.kboard{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.kcol{
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(18,31,54,.70);
  padding:12px;
}
.kticket{
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  padding:10px;
  margin-top:10px;
}
.kticket .hdr{display:flex; justify-content:space-between; gap:10px}
.kticket .meta{color:var(--muted); font-size:12px; margin-top:4px}
/*Boton de Whatsapp*/
.btn-wsp{
    position:fixed;
    width: 55px;
    height:55px;
    line-height: 55px;
    bottom:30px;
    right:30px;
    background:#25d366;
    color:#FFF;
    border-radius:50px;
    text-align:center;
    font-size:35px;
    box-shadow: 0px 1px 10px rgba(0,0,0,0.3);
    z-index:100;
    transition: all 300ms ease;
}
.btn-wsp:hover{
    background: #fff/*#20ba5a*/;
    color: #20ba5a;
}
@media (max-width: 1040px){
  .gridMesas{grid-template-columns: repeat(3,1fr)}
  .kboard{grid-template-columns: 1fr}
}
@media (max-width: 940px){
  .layout{grid-template-columns: 1fr}
  .sidebar{position:relative; top:0}
  .table{min-width: 760px}
  .gridMesas{grid-template-columns: repeat(2,1fr)}
}
@media (max-width: 700px){
  .grid{grid-template-columns:1fr}
  .filters{grid-template-columns:1fr}
  .table{min-width:0}
  .gridMesas{grid-template-columns: 1fr}
}

/* Tabla -> Cards en mobile */
@media (max-width: 700px){
  .tablewrap{border:none; background:transparent}
  .table thead{display:none}
  .table, .table tbody, .table tr, .table td{display:block; width:100%}
  .table tbody tr{
    border:1px solid var(--line);
    border-radius: 14px;
    padding:10px;
    margin-bottom:10px;
    background: rgba(255,255,255,.03);
  }
  .table tbody td{
    border:none;
    padding:6px 4px;
    position:relative;
    padding-left: 120px;
    min-height: 28px;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .table tbody td::before{
    content: attr(data-label);
    position:absolute;
    left: 4px;
    top: 6px;
    color: var(--muted);
    font-size: 12px;
    width: 110px;
  }
  .table tbody td.right{
    padding-left: 4px;
    text-align:left;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    padding-top:10px;
  }
  .table tbody td.right::before{content:""}
}
