/* ==========================================================
   Comandia · Paneles (admin general y gestión del local)
   ========================================================== */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: #17120F; color: #D6D3E2; display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; z-index: 50; }
.side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 50% at 0% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%); pointer-events: none; }
.side > * { position: relative; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; color: #fff; }
.side-brand .logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; font-weight: 800; color: #fff; overflow: hidden; box-shadow: 0 8px 20px -8px var(--brand); flex-shrink: 0; }
.side-brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.side-brand b { display: block; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.2; }
.side-brand small { color: #9E98B8; font-size: 12px; }
.side-group { margin: 14px 8px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7D7896; font-weight: 700; }
.side a.nav { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; font-size: 14px; font-weight: 500; color: #CFCBDC; transition: background .15s, color .15s; margin-bottom: 2px; }
.side a.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.nav.active { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 30%, transparent), rgba(255,255,255,.04)); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.side a.nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.side a.nav .lock { margin-left: auto; opacity: .45; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.07); }
.side-user { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; }
.side-user b { color: #fff; font-size: 13.5px; display: block; line-height: 1.2; }
.side-user small { color: #9E98B8; font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.topbar .crumbs { font-size: 12.5px; color: var(--muted); }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.burger { display: none; border: 0; background: #fff; width: 40px; height: 40px; border-radius: 12px; place-items: center; box-shadow: var(--sh-1); }
.content { padding: 26px 28px 60px; max-width: 1440px; width: 100%; }

.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r); margin-bottom: 20px; font-size: 14px; }
.banner.warn { background: linear-gradient(90deg, #FFF4D9, #FFF9EC); border: 1px solid #F5DE9F; color: #6E4A00; }
.banner.bad { background: linear-gradient(90deg, #FDE7E7, #FFF3F3); border: 1px solid #F6C6C6; color: #8A1F1F; }
.banner.info { background: linear-gradient(90deg, #E6EEFD, #F3F7FF); border: 1px solid #C9D8FA; color: #1C4FB0; }
.banner.demo { background: linear-gradient(90deg, #1C1714, #3A2A1F); color: #FFE2CC; }
.banner .btn { margin-left: auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 22px; }
.card + .card { margin-top: 20px; }
.cols { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-1); }
.kpi .lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .lbl .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.kpi .val { font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi .up { color: var(--ok); font-weight: 700; } .kpi .down { color: var(--bad); font-weight: 700; }
.kpi.dark { background: linear-gradient(145deg, #1F1814, #3B2618); color: #fff; border: 0; }
.kpi.dark .lbl { color: #CFC9E3; } .kpi.dark .sub { color: #B8B2CC; } .kpi.dark .lbl .ic { background: rgba(255,255,255,.1); color: #FFC089; }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 52px; opacity: .9; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FAFAFD; white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #FAFAFD; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .who { display: flex; align-items: center; gap: 11px; }
.tbl .who b { display: block; font-weight: 600; }
.tbl .who small { color: var(--muted); font-size: 12.5px; }
.tbl tr.click { cursor: pointer; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--line-2); color: var(--muted); margin: 0 auto 14px; }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .input, .toolbar select { height: 40px; width: auto; min-width: 160px; }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px !important; min-width: 240px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: #ECEAF3; border-radius: 13px; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.tabs a, .tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.tabs .on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.tab-pane { display: none; } .tab-pane.on { display: block; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); flex-shrink: 0; }

.module-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; transition: border .2s, box-shadow .2s; }
.module-card:hover { box-shadow: var(--sh-2); }
.module-card.on { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: linear-gradient(180deg, #FBFFFC, #fff); }
.module-card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex-shrink: 0; }
.module-card h4 { margin: 0 0 3px; font-size: 15.5px; }
.module-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.module-card .grow + * { margin-top: 4px; }

.chart { width: 100%; height: 260px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .grid { stroke: var(--line-2); }
.chart-tip { position: fixed; pointer-events: none; z-index: 999; background: var(--ink); color: #fff; padding: 7px 11px; border-radius: 10px; font-size: 12.5px; box-shadow: var(--sh-2); opacity: 0; transition: opacity .12s; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-list .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin-bottom: 14px; font-size: 13.5px; }
.bar-list .track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-list .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.thumb { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--line-2); overflow: hidden; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.color-dot { width: 14px; height: 14px; border-radius: 5px; display: inline-block; vertical-align: -2px; }

.chat { display: flex; flex-direction: column; gap: 14px; padding: 22px; max-height: 560px; overflow-y: auto; background: linear-gradient(180deg, #FAFAFD, #fff); }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 75%, var(--brand-2))); color: #fff; border: 0; border-bottom-right-radius: 6px; }
.msg.them { border-bottom-left-radius: 6px; }
.msg .meta { display: block; font-size: 11.5px; opacity: .75; margin-top: 6px; }
.chat-form { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line-2); }
.chat-form textarea { flex: 1; min-height: 48px; height: 48px; resize: vertical; }

.hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: #F1F0F7; padding: 3px 8px; border-radius: 7px; word-break: break-all; color: var(--ink-2); }
.verify-ok { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--r); background: var(--ok-soft); color: #0F5C37; }
.verify-bad { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--r); background: var(--bad-soft); color: #8A1F1F; }

.steps-check { display: grid; gap: 10px; }
.steps-check a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 500; transition: .15s; }
.steps-check a:hover { border-color: var(--brand); }
.steps-check .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.steps-check .done .ck { background: var(--ok); border-color: var(--ok); }
.steps-check .done span { color: var(--muted); text-decoration: line-through; }

.preview-phone { width: 300px; height: 600px; border-radius: 42px; background: #111; padding: 12px; box-shadow: var(--sh-3); margin: 0 auto; }
.preview-phone iframe { width: 100%; height: 100%; border: 0; border-radius: 32px; background: #fff; }

.qr-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.qr-card { border: 2px dashed var(--line); border-radius: 20px; padding: 20px; text-align: center; background: #fff; break-inside: avoid; }
.qr-card [data-qr] { width: 170px; height: 170px; margin: 10px auto; }
.qr-card h3 { margin: 0; font-family: var(--serif); }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #140F0C; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ""; position: absolute; width: 720px; height: 720px; right: -260px; top: -200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 70%, transparent), transparent 65%); filter: blur(20px); opacity: .7; }
.auth-art::after { content: ""; position: absolute; width: 520px; height: 520px; left: -180px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand-2) 55%, transparent), transparent 65%); filter: blur(30px); opacity: .5; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h2 { font-family: var(--serif); font-size: 44px; font-weight: 600; line-height: 1.08; max-width: 480px; }
.auth-art h2 em { color: #FFB27A; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-form .box { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 30px; letter-spacing: -.03em; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--sh-3); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; }
  .burger { display: grid; }
  .cols-2, .cols-21, .cols-12, .cols-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; } .content { padding: 18px 16px 50px; }
  .qr-sheet { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi .val { font-size: 22px; } .kpi { padding: 14px; } .topbar h1 { font-size: 17px; } }
@media print {
  .side, .topbar, .toolbar, .btn, .banner { display: none !important; }
  .shell { display: block; } .content { padding: 0; } .card { box-shadow: none; border-color: #ddd; }
  .qr-sheet { grid-template-columns: repeat(3, 1fr); }
}
