@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

:root {
  --bg: #f6f1ec;
  --bg-2: #efe7df;
  --card: #ffffff;
  --surface: #faf6f2;
  --border: #ece3da;
  --border-2: #e2d7cc;
  --text: #2a2230;
  --muted: #8a7f86;
  --burgundy: #7a1422;
  --burgundy-soft: #9b2333;

  --orange: #f4571e;
  --orange-bg: #fdeee6;
  --orange-soft: #fff4ee;
  --blue: #1f6fd4;
  --blue-bg: #e7f0fb;
  --blue-soft: #f1f6fd;
  --purple: #7b2e9e;
  --purple-bg: #f2e7f7;
  --purple-soft: #f8f1fb;
  --green: #2fa44d;
  --amber: #f4a932;
  --grey: #9b9098;

  --shadow: 0 16px 40px -22px rgba(80,40,40,0.45);
  --shadow-sm: 0 4px 14px -8px rgba(80,40,40,0.30);
  --r: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(155,35,51,0.06), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(31,111,212,0.05), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1560px; margin: 0 auto; padding: 24px 26px 56px; }
svg { display: block; }

/* ---------- Header ---------- */
header.top { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.brand h1 { font-family: 'Sora'; font-size: 34px; font-weight: 800; letter-spacing: 0.5px; color: var(--burgundy); line-height: 1; }
.brand p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.head-actions { display: flex; gap: 12px; margin-left: 20px; }
.hbtn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--border-2); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .16s; box-shadow: var(--shadow-sm); position: relative;
}
.hbtn:hover { border-color: var(--burgundy-soft); color: var(--burgundy); transform: translateY(-1px); }
.hbtn svg { width: 18px; height: 18px; }
.hbtn-badge {
  background: var(--burgundy); color: #fff; font-size: 11.5px; font-weight: 800;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
}
.live { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.live .status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: ping 2s infinite; }
.dot.off { background: var(--amber); animation: none; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(47,164,77,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(47,164,77,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,164,77,0); }
}
.live .sep { width: 1px; height: 20px; background: var(--border-2); }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
/* Cajero con sesión activa + botón de salir (login con usuario/contraseña) */
.live .cajero { font-weight: 700; color: var(--text); font-size: 12.5px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live .salir { background: none; border: 1px solid var(--border-2); color: var(--muted); border-radius: 8px; padding: 4px 10px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: .15s; }
.live .salir:hover { color: #d23b3b; border-color: #d23b3b; background: #fdf1f1; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 18%;
  background: linear-gradient(135deg, #fff, var(--surface)); border: 2px solid var(--border-2); box-shadow: var(--shadow-sm); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 22px; align-items: start; }
.board { min-width: 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer;
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm); transition: .16s;
  border-bottom-width: 3px;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat.active { outline: 2px solid currentColor; outline-offset: -2px; }
.stat-ic { width: 46px; height: 46px; min-width: 46px; border-radius: 13px; display: grid; place-items: center; }
.stat-ic svg { width: 26px; height: 26px; }
.stat .k { font-family: 'Sora'; font-size: 34px; font-weight: 800; line-height: 1; }
.stat .l { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 5px; line-height: 1.25; text-transform: uppercase; letter-spacing: .3px; }

.stat.pend  { border-bottom-color: var(--orange); color: var(--orange); }
.stat.pend  .stat-ic { background: var(--orange-bg); color: var(--orange); }
.stat.pend  .k { color: var(--orange); }
.stat.trans { border-bottom-color: var(--blue); color: var(--blue); }
.stat.trans .stat-ic { background: var(--blue-bg); color: var(--blue); }
.stat.trans .k { color: var(--blue); }
.stat.libre { border-bottom-color: var(--grey); color: var(--grey); }
.stat.libre .stat-ic { background: #f0ecef; color: var(--grey); }
.stat.libre .k { color: #6f656d; }
.stat.preg  { border-bottom-color: var(--purple); color: var(--purple); }
.stat.preg  .stat-ic { background: var(--purple-bg); color: var(--purple); }
.stat.preg  .k { color: var(--purple); }

/* ---------- Grid de mesas ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.card {
  position: relative; border-radius: var(--r); padding: 14px 15px 15px; min-height: 116px;
  background: var(--card); border: 1px solid var(--border); cursor: default;
  display: flex; flex-direction: column; transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
  box-shadow: var(--shadow-sm);
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .chead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 24px; }
.card .chead .right { display: flex; align-items: center; gap: 7px; }
.card .mesa-lbl { font-family: 'Sora'; font-weight: 800; font-size: 16px; letter-spacing: .3px; color: var(--text); }
.bell-btn { background: none; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; }
.card .people { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.card .people svg { width: 16px; height: 16px; }
.card .stxt { margin-top: auto; padding-top: 12px; font-size: 13.5px; font-weight: 700; line-height: 1.25; }

/* recuento naranja (productos por transcribir) */
.badge {
  background: var(--orange); color: #fff; font-weight: 800; font-size: 12.5px;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center;
  box-shadow: 0 3px 8px -3px rgba(244,87,30,.7);
}

/* iconos de estado en la esquina de la card */
.card .corner { width: 20px; height: 20px; }

/* Libre (gris, plano) */
.card.libre { background: var(--surface); }
.card.libre .mesa-lbl { color: var(--muted); }
.card.libre .stxt { color: var(--muted); font-weight: 600; }
.card.libre .corner { color: var(--grey); }

/* Pendiente (naranja) */
.card.pendiente { background: var(--orange-soft); border-color: rgba(244,87,30,0.30); }
.card.pendiente .mesa-lbl { color: var(--orange); }
.card.pendiente .stxt { color: var(--orange); }
.card.pendiente.alert { animation: glow 2s infinite; }
@keyframes glow {
  0% { box-shadow: 0 0 0 0 rgba(244,87,30,0.30); }
  70% { box-shadow: 0 0 0 10px rgba(244,87,30,0); }
  100% { box-shadow: 0 0 0 0 rgba(244,87,30,0); }
}

/* Transcrito (azul) */
.card.transcrito { background: var(--blue-soft); border-color: rgba(31,111,212,0.28); }
.card.transcrito .mesa-lbl { color: var(--blue); }
.card.transcrito .stxt { color: var(--blue); }
.card.transcrito .corner { color: var(--blue); }

/* Pregunta del cliente (morado) — tiene prioridad de color */
.card.pregunta { background: var(--purple-soft); border-color: rgba(123,46,158,0.30); }
.card.pregunta .mesa-lbl { color: var(--purple); }
.card.pregunta .stxt { color: var(--purple); }
.card.pregunta .corner { color: var(--purple); }
.card.pregunta.alert { animation: glowp 2s infinite; }
@keyframes glowp {
  0% { box-shadow: 0 0 0 0 rgba(123,46,158,0.28); }
  70% { box-shadow: 0 0 0 10px rgba(123,46,158,0); }
  100% { box-shadow: 0 0 0 0 rgba(123,46,158,0); }
}

/* campana de aviso (parpadea) */
.bell { color: var(--orange); animation: bellshake 1.1s infinite; cursor: pointer; }
.card.pregunta .bell { color: var(--purple); }
@keyframes bellshake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-12deg); } 40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); } 80% { transform: rotate(8deg); }
}

/* ---------- Panel lateral ---------- */
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.panel-h h2 { font-family: 'Sora'; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text); }
.panel-ico { width: 20px; height: 20px; }
.panel-ico.info { color: var(--burgundy); }
.panel-ico.mega { color: var(--orange); }

/* Acordeones de la guía */
.acc { border-bottom: 1px solid var(--border); }
.acc:last-child { border-bottom: 0; }
.acc > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--text); user-select: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: var(--surface); }
.acc .ac-ic { width: 18px; height: 18px; min-width: 18px; color: var(--burgundy); }
.acc .ac-ic.green { color: var(--green); }
.acc .ac-ic.amber { color: var(--amber); }
.acc .ac-ic.purple { color: var(--purple); }
.acc summary > span { flex: 1; }
.acc .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.acc[open] > summary .chev { transform: rotate(180deg); }
.acc-body { padding: 2px 16px 14px; }
.acc-body .hp { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin-top: 8px; }
.acc-body .hp:first-child { margin-top: 0; }
.acc-body b { color: var(--text); }
.leg { display: flex; gap: 11px; align-items: flex-start; margin: 11px 0; }
.leg:first-child { margin-top: 4px; }
.leg .sw { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; margin-top: 2px; }
.leg .sw.pend { background: var(--orange); }
.leg .sw.trans { background: var(--blue); }
.leg .sw.libre { background: var(--grey); }
.leg .sw.preg { background: var(--purple); }
.leg b { font-size: 12.5px; color: var(--text); }
.leg p { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.5; }

/* Novedades del día */
.panel.nov .panel-h { background: var(--orange-soft); }
.edit-nov { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: var(--orange-bg); border: 1px solid var(--orange); color: var(--orange); cursor: pointer; padding: 6px 11px; border-radius: 9px; font-family: inherit; font-size: 13px; font-weight: 700; transition: .15s; }
.edit-nov:hover { color: #fff; background: var(--orange); }
.edit-nov svg { width: 15px; height: 15px; }
.nov-list { padding: 8px 8px 10px; cursor: pointer; }
.nov-list:hover .nov-item { background: var(--orange-bg); }
.nov-empty:hover { color: var(--orange); }
.nov-item { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 10px; }
.nov-por { padding: 8px 8px 2px; font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--border); margin-top: 6px; }
.nov-item + .nov-item { border-top: 1px solid var(--border); }
.nov-ico { width: 22px; height: 22px; min-width: 22px; border-radius: 50%; display: grid; place-items: center; }
.nov-ico svg { width: 14px; height: 14px; color: #fff; }
.nov-ico.danger { background: var(--orange); }
.nov-ico.promo { background: var(--amber); }
.nov-item span { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.nov-empty { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; line-height: 1.5; }

/* ---------- Modal de pedido ---------- */
.scrim { position: fixed; inset: 0; background: rgba(40,25,30,0.42); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.scrim.open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(720px, 96vw); max-height: 94vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); animation: pop .22s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { transform: translateY(18px) scale(.97); opacity: 0; } }
.modal .mh { padding: 20px 22px; background: linear-gradient(135deg, var(--burgundy), var(--burgundy-soft)); color: #fff; }
.modal .mh.pendiente { background: linear-gradient(135deg, #d6481b, var(--orange)); }
.modal .mh.transcrito { background: linear-gradient(135deg, #1858ab, var(--blue)); }
.modal .mh.pregunta { background: linear-gradient(135deg, #5f2080, var(--purple)); }
.modal .mh .row { display: flex; align-items: center; justify-content: space-between; }
.modal .mh h2 { font-family: 'Sora'; font-size: 15px; opacity: .92; font-weight: 600; }
.modal .mh .big { font-family: 'Sora'; font-size: 40px; font-weight: 800; line-height: 1; margin-top: 2px; }
.modal .mh .when { color: rgba(255,255,255,.85); font-size: 12.5px; margin-top: 6px; }
.x { background: rgba(255,255,255,.18); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 10px; font-size: 18px; cursor: pointer; transition: .15s; }
.x:hover { background: rgba(255,255,255,.3); }
.items { padding: 8px 22px 4px; max-height: 60vh; overflow: auto; }
.it { display: flex; gap: 11px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.it:last-child { border-bottom: 0; }
.it .itck { appearance: none; -webkit-appearance: none; width: 21px; height: 21px; min-width: 21px; margin-top: 1px; border: 2px solid var(--border-2); border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-items: center; transition: .15s; }
.it .itck:hover { border-color: var(--blue); }
.it .itck:checked { background: var(--blue); border-color: var(--blue); }
.it .itck:checked::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 900; line-height: 1; }
.it .itck:disabled { opacity: .4; cursor: default; }
.it .itnm { flex: 1; }
.qty { font-family: 'Sora'; font-weight: 700; color: var(--burgundy-soft); min-width: 26px; }
.it .nm { font-weight: 600; font-size: 14.5px; }
.it .sz { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.it .nt { color: var(--orange); font-size: 12px; margin-top: 3px; }
.it .pr { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.it.done { opacity: .5; }
.it.done .nm { text-decoration: line-through; }
.it.done .qty { color: var(--muted); }
.comensal { margin: 4px 0 2px; }
.comensal .ch { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 6px; margin-top: 6px; border-bottom: 1px solid var(--border); }
.comensal:first-child .ch { margin-top: 0; }
.comensal .ch span:first-child { font-family: 'Sora'; font-weight: 700; font-size: 12.5px; letter-spacing: .3px; color: var(--burgundy-soft); text-transform: uppercase; }
.comensal .ch .csub { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.comensal .it { padding-left: 2px; }
.sum { padding: 16px 22px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); }
.sum .t { color: var(--muted); font-size: 13px; }
.sum .v { font-family: 'Sora'; font-size: 24px; font-weight: 800; }
/* Filas de desglose cuando la mesa incluye el servicio voluntario (10%) */
.sum.sub { padding: 9px 22px; }
.sum.sub .v { font-size: 16px; font-weight: 700; color: var(--muted); }
.sum.sub + .sum, .sum.sub + .sum.sub { border-top: 1px dashed var(--border); }
.actions { padding: 0 22px 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn { flex: 1; border: 0; border-radius: 12px; padding: 13px; font-weight: 700; font-size: 14px; cursor: pointer; transition: .15s; font-family: inherit; }
.btn.primary { background: linear-gradient(135deg, var(--green), #258a3e); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); flex: 0 0 auto; padding: 13px 16px; }
.btn.ghost:hover { background: var(--bg-2); }
.btn:disabled { opacity: .5; cursor: default; }
.act-note { flex: 1 1 100%; font-size: 12px; color: var(--muted); line-height: 1.45; margin-bottom: 4px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }

/* Preguntas del cliente en el modal */
.preguntas { padding: 14px 22px 4px; border-bottom: 1px solid var(--border); max-height: 38vh; overflow: auto; }
.preguntas h3 { font-family: 'Sora'; font-size: 13px; color: var(--purple); margin-bottom: 10px; letter-spacing: .2px; }
.preguntas .q { background: var(--purple-soft); border: 1px solid var(--purple-bg); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.preguntas .q .qtxt { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 9px; }
.preguntas .qresp { width: 100%; resize: vertical; min-height: 44px; background: #fff; color: var(--text); border: 1px solid var(--border-2); border-radius: 10px; padding: 9px 11px; font-family: inherit; font-size: 14px; margin-bottom: 9px; }
.preguntas .qresp:focus { outline: none; border-color: var(--purple); }
.preguntas .qsend { width: 100%; }
.preguntas .q.done { opacity: .8; }
.preguntas .q.done .qtxt { font-weight: 500; color: var(--muted); }
.preguntas .qans { font-size: 13.5px; color: var(--green); font-weight: 600; }

/* Pago / factura en el modal */
.pago { padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--blue-soft); }
.pago h3 { font-family: 'Sora'; font-size: 13.5px; color: var(--blue); margin-bottom: 8px; letter-spacing: .2px; }
.pago .pgrow { font-size: 13.5px; color: var(--text); margin: 3px 0; }
.pago .pgrow span { color: var(--muted); }

/* Editor de novedades */
.reglas-modal { width: min(520px, 100%); }
.reglas-body { padding: 18px 22px 24px; }
.reglas-body .hp { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.reglas-body .hp b { color: var(--text); }
.reglas-body textarea { width: 100%; margin-top: 14px; resize: vertical; min-height: 150px; background: #fff; color: var(--text); border: 1px solid var(--border-2); border-radius: 12px; padding: 12px 14px; font-family: inherit; font-size: 14.5px; line-height: 1.6; }
.reglas-body textarea:focus { outline: none; border-color: var(--orange); }
.reglas-body .reglas-err { color: #d23b3b; font-size: 13px; min-height: 18px; margin: 8px 0 4px; }
.reglas-body .reglas-por { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 8px; }
.reglas-body .btn { width: 100%; margin-top: 6px; }

/* ---------- Login ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 80;
  background: radial-gradient(900px 600px at 50% -10%, rgba(155,35,51,0.10), transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2)); }
.login.hidden { display: none; }
.login .box { width: min(360px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 32px 28px; text-align: center; box-shadow: var(--shadow); }
.login .logo { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; background: linear-gradient(135deg, var(--burgundy), var(--burgundy-soft)); display: grid; place-items: center; font-family: 'Sora'; font-weight: 800; font-size: 26px; color: #fff; }
.login h2 { font-family: 'Sora'; font-size: 20px; margin-bottom: 4px; color: var(--text); }
.login p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login input { width: 100%; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; padding: 14px; color: var(--text); font-size: 22px; text-align: center; letter-spacing: 6px; font-family: 'Sora'; font-weight: 700; }
.login input:focus { outline: none; border-color: var(--burgundy-soft); }
/* Credenciales de cajero (usuario + contraseña): texto normal, no estilo PIN */
.login input.cred { font-size: 15px; letter-spacing: 0; font-weight: 600; text-align: left; font-family: inherit; }
.login .pwrap { position: relative; margin-top: 10px; }
.login .pwrap input.cred { padding-right: 46px; }
.login .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; }
.login .eye:hover { color: var(--burgundy); background: var(--bg-2); }
.login .eye svg { width: 20px; height: 20px; }
.login .btn { width: 100%; margin-top: 14px; }
.login .err { color: #d23b3b; font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; flex-wrap: wrap; }
  .side .panel { flex: 1 1 320px; }
}
@media (max-width: 1440px) {
  .wrap { padding: 18px 18px 40px; }
  .stats { gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat .k { font-size: 28px; }
  .grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 720px) {
  .head-actions { margin-left: 0; order: 3; width: 100%; }
  .live { margin-left: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .brand h1 { font-size: 28px; }
}
