/* =====================================================================
   Comandas — diseño tipo Chatwoot · Light mode base + Dark mode
   Tema con variables CSS. Dark = [data-theme="dark"] en <html>.
   Fuente: Inter (look SaaS).
   ===================================================================== */

/* ---- Tipografía del logo: Sneaky Times ---- */
@font-face { font-family: "Sneaky Times"; src: url("../fonts/Sneaky-Times.woff2") format("woff2"), url("../fonts/Sneaky-Times.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  --font-logo: "Sneaky Times", Georgia, serif;
  /* Gradiente del login (réplica de la referencia: gris azulado → vino oscuro) */
  --lg-a: #5a5e66; --lg-b: #4e4046; --lg-c: #3a1f25; --lg-d: #1c0a0f;
  /* Paleta COMANDAS — "Vino" (neutros fríos finos + acento vino profundo, como el login)
     Alternativas listas para probar (reemplazar --primary/--primary-hover/--primary-soft):
       · Petróleo:  #1f6f6b / #185955 / #e3f1f0
       · Grafito:   #2e2a33 / #1f1c26 / #eceaf1
       · Oliva:     #5f7040 / #4d5c32 / #eef1e5  */
  --bg: #f5f4f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --sidebar: #ffffff;
  --border: #e7e4e0;
  --border-strong: #d5d0ca;
  --text: #1d191b;
  --text-muted: #6c6468;
  --text-faint: #a09a9e;
  --primary: #722f41;
  --primary-hover: #5d2434;
  --primary-soft: #f6e9ed;
  --primary-contrast: #ffffff;
  --green: #3d8553; --green-soft: #e9f3ec;
  --amber: #c07f1d; --red: #c43e35; --red-soft: #fbebe9;
  --shadow: 0 1px 2px rgba(33,22,16,.04), 0 4px 14px rgba(33,22,16,.06);
  --shadow-lg: 0 12px 40px rgba(33,22,16,.18);
  --radius: 12px; --radius-sm: 9px;
  --sidebar-w: 244px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html[data-theme="dark"] {
  --bg: #121013;
  --surface: #1b181c;
  --surface-2: #211d22;
  --sidebar: #161317;
  --border: #2f2a31;
  --border-strong: #423a44;
  --text: #ebe6e8;
  --text-muted: #a59da2;
  --text-faint: #716a70;
  --primary: #b4596f;
  --primary-hover: #c66f84;
  --primary-soft: #34202a;
  --primary-contrast: #ffffff;
  --green: #5aa973; --green-soft: #1d2e23;
  --red-soft: #2e1715;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 50px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ---------- Íconos ---------- */
.icn { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.icn svg { width: 100%; height: 100%; display: block; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: .15s; }
.btn:hover { border-color: var(--text-faint); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn .icn { font-size: 15px; }

/* ---------- Campos de formulario (modales y secciones) — estilo refinado tipo referencia ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
  border-radius: 11px; background: var(--surface-2); color: var(--text); font-size: 14px; transition: .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

/* =====================================================================
   LOGIN
   ===================================================================== */
/* marca KOM4NDER (logo) — Sneaky Times */
.brand-name { font-family: var(--font-logo); font-size: 20px; font-weight: 400; letter-spacing: .1em; }

/* ---- LOGIN: réplica de la referencia (cascada diagonal, fotos cuadradas) ---- */
#login-view { position: relative; min-height: 100vh; overflow: hidden; display: flex; align-items: center;
  justify-content: flex-end; padding: 4vw 6vw;
  background: linear-gradient(118deg, var(--lg-a) 0%, var(--lg-b) 38%, var(--lg-c) 70%, var(--lg-d) 100%); }
.login-stage { position: absolute; inset: 0; overflow: hidden; }
.lph { position: absolute; margin: 0; transform: translate(-50%, -50%); aspect-ratio: 1 / 1; overflow: visible; will-change: left, top, width; }
.lph img { width: 100%; height: 100%; object-fit: cover; display: block; } /* cuadradas y PLANAS (sin sombra) */
.lph figcaption { position: absolute; left: calc(100% + 18px); top: 4px; display: flex; gap: 22px; align-items: baseline;
  font-family: var(--font-logo); color: #fff; white-space: nowrap; }
.lph figcaption .rn { font-size: 13px; letter-spacing: .08em; }
.lph figcaption .nm { font-size: 13px; letter-spacing: .06em; }

.login-panel { position: relative; z-index: 60; width: 100%; max-width: 320px; }
.login-card { color: #fff; }
.lg-brand { font-family: var(--font-logo); font-size: 32px; letter-spacing: .12em; margin-bottom: 6px; }
.lg-sub { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 40px; }
.lfield { margin-bottom: 24px; }
.lfield label { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.52); margin-bottom: 7px; }
.lfield input { width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,.3);
  border-radius: 0; color: #fff; padding: 8px 2px; font-size: 15px; transition: border-color .2s; }
.lfield input::placeholder { color: rgba(255,255,255,.32); }
.lfield input:focus { outline: none; border-bottom-color: #fff; }
/* botón pill estilo referencia: contorno fino + glifo en círculo */
.pill-btn { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; padding: 9px 24px 9px 11px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.05);
  color: #fff; font-family: var(--font); font-size: 14px; font-weight: 500; letter-spacing: .04em; cursor: pointer; transition: .22s; }
.pill-btn .pb-circle { width: 27px; height: 27px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7);
  display: grid; place-items: center; font-size: 13px; transition: .22s; }
.pill-btn:hover { background: #fff; color: #1d0c10; }
.pill-btn:hover .pb-circle { border-color: #1d0c10; }
.pill-btn:disabled { opacity: .55; cursor: default; }
.login-error { color: #ff9d92; font-size: 13px; min-height: 18px; margin: 14px 0 0; }
.login-hint { margin-top: 12px; font-size: 11.5px; color: rgba(255,255,255,.38); }
@media (max-width: 820px) {
  #login-view { justify-content: center; }
  .login-stage { opacity: .3; }
}

/* ---- Splash / pantalla de carga: cuadrícula C O M / A N D / A S, letras que aparecen y desaparecen ---- */
.splash { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--bg); transition: opacity .5s ease; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-word { font-family: var(--font-logo); font-size: 26px; color: var(--text);
  display: grid; grid-template-columns: repeat(3, 1.05em); gap: .42em .5em; justify-items: start; }
.splash-word span { opacity: 0; animation: sp-blink 2s ease-in-out infinite; animation-delay: var(--d); }
@keyframes sp-blink { 0%, 100% { opacity: 0; } 30%, 62% { opacity: 1; } }

/* =====================================================================
   APP SHELL (sidebar + main)
   ===================================================================== */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar { width: var(--sidebar-w); flex: none; background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; }
.sb-brand .brand-name { font-size: 17px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--text-muted);
  font-weight: 600; font-size: 13.5px; cursor: pointer; margin-bottom: 2px; transition: .12s; border: none; background: none; width: 100%; text-align: left; }
.sb-item:hover { background: var(--surface-2); color: var(--text); }
.sb-item.active { background: var(--primary-soft); color: var(--primary); }
.sb-item .icn { font-size: 18px; }
.sb-foot { border-top: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.theme-toggle { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 9px; cursor: pointer; color: var(--text-muted); font-weight: 600; font-size: 13px; background: none; border: none; width: 100%; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .icn { font-size: 17px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.sb-user:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: none; overflow: hidden; background-size: cover; background-position: center; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.sb-user .u-name { font-size: 13px; font-weight: 600; line-height: 1.1; }
.sb-user .u-sub { font-size: 11.5px; color: var(--text-faint); }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 60px; flex: none; border-bottom: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; gap: 12px; padding: 0 22px; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.topbar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 11px; color: var(--text-faint); width: 230px; max-width: 30vw; }
.search input { border: none; background: none; color: var(--text); width: 100%; outline: none; font-size: 13px; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .icn { font-size: 17px; }

.content { flex: 1; overflow-y: auto; padding: 24px; }
.content-wrap { max-width: 1100px; margin: 0 auto; }

/* ---------- Encabezado de sección ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-head .ph-title { font-size: 20px; font-weight: 700; }
.page-head .ph-sub { color: var(--text-muted); font-size: 13.5px; }
.page-head .spacer { flex: 1; }

/* ---------- Stat cards (Resumen) ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .s-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 12px; }
.stat .s-ic .icn { font-size: 19px; }
.stat .s-val { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.stat .s-lbl { color: var(--text-muted); font-size: 13px; }

/* ---------- Grids de tarjetas (venues, etc.) ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; cursor: pointer; transition: transform .08s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card.add { display: grid; place-items: center; gap: 8px; border: 1.6px dashed var(--border-strong); box-shadow: none;
  color: var(--text-muted); font-weight: 600; min-height: 150px; }
.card.add .icn { font-size: 26px; color: var(--text-faint); }
.card.add:hover { border-color: var(--primary); color: var(--primary); transform: none; }
.venue-logo { width: 46px; height: 46px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 18px; font-weight: 800; color: var(--text-muted); overflow: hidden; object-fit: cover; }
.venue-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.venue-name { font-weight: 700; font-size: 15px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.venue-meta { color: var(--text-muted); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Select inline (encabezados) ---------- */
.sel { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; max-width: 220px; }
.sel:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Loading ---------- */
.loading { text-align: center; color: var(--text-muted); padding: 56px 20px; font-size: 14px; }

/* ---------- Mesas: selector de modo (3 opciones) ---------- */
.plano-thumb { width: 100%; max-width: 460px; height: 190px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2) center/contain no-repeat; margin: 0 auto 20px; display: grid; place-items: center;
  color: var(--text-faint); font-size: 13px; gap: 6px; box-shadow: var(--shadow); }
.plano-thumb .icn { font-size: 22px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.opt-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; cursor: pointer; transition: transform .1s, box-shadow .15s, border-color .15s; }
.opt-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.opt-card:disabled { opacity: .45; cursor: not-allowed; }
.opt-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 12px; }
.opt-ic .icn { font-size: 20px; }
.opt-t { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.opt-d { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.hint-muted { color: var(--text-faint); font-size: 12.5px; margin-top: 14px; }

/* ---------- Mesas: editor de distribución a escala ---------- */
.mesas-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.mesas-toolbar .spacer { flex: 1; }
.space-ctrl { font-size: 13px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.space-ctrl input { width: 62px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.scale-pill { font-size: 12px; color: var(--green); background: var(--green-soft); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.zoom-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.zoom-ctrl .icon-btn { width: 30px; height: 30px; font-size: 18px; font-weight: 700; }
.zoom-ctrl #z-lbl { font-size: 12.5px; color: var(--text-muted); min-width: 42px; text-align: center; }
.calib-banner { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); color: var(--primary);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; margin-bottom: 12px; }
.calib-banner span { flex: 1; }
.calib-banner .icn { font-size: 16px; }

.editor-scroll { width: 100%; max-height: 72vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); box-shadow: var(--shadow); }
.editor { position: relative; width: 100%; margin: 0 auto; background: var(--surface-2); overflow: hidden; }
.editor-bg { position: absolute; inset: 0; background-repeat: no-repeat; background-position: center; }
.editor-bg.croquis { background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px; opacity: .9; }
.editor-bg canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.editor-layer { position: absolute; inset: 0; }
.calib-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.calib-svg.active { pointer-events: auto; cursor: crosshair; }
.calib-dot { fill: var(--red); }
.calib-line { stroke: var(--red); stroke-width: 2.5px; vector-effect: non-scaling-stroke; }

.mesa-node { position: absolute; transform: translate(-50%, -50%); background: none; border: none; padding: 0;
  cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
.mesa-node:active { cursor: grabbing; }
.mesa-svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* representación minimalista: trazo fino + relleno suave, sillas como líneas */
.t-shape { fill: color-mix(in srgb, var(--primary) 14%, transparent); stroke: var(--primary); stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.mesa-node.asignada .t-shape { fill: color-mix(in srgb, var(--green) 16%, transparent); stroke: var(--green); }
.t-chair { fill: none; stroke: var(--text-faint); stroke-width: 1.1px; vector-effect: non-scaling-stroke; opacity: .8; }
.t-num { fill: var(--primary); font-weight: 700; }
.mesa-node.asignada .t-num { fill: var(--green); }
.mesa-node:hover .t-shape { fill: color-mix(in srgb, var(--primary) 26%, transparent); }
/* el trazo no escala, así que TODO se ve fino y limpio a cualquier zoom */

/* líneas guía de snap (estilo Revit) */
.snap-guide { position: absolute; z-index: 26; pointer-events: none; }
.snap-guide.v { top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--red); }
.snap-guide.h { left: 0; right: 0; height: 0; border-top: 1px dashed var(--red); }

/* HUD de comandos CAD */
.cmd-hud { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 140;
  display: flex; align-items: baseline; gap: 14px; background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 9px 20px; box-shadow: var(--shadow-lg); }
.cmd-hud b { font-size: 14px; letter-spacing: .2em; }
.cmd-hud span { font-size: 11px; opacity: .65; }

/* multi-cuenta por mesa (mesas compartidas): una línea por cuenta */
.om-ticks { position: absolute; top: 9px; right: 10px; display: flex; gap: 4px; align-items: center; }
.om-tick { width: 2.5px; height: 13px; border-radius: 2px; background: var(--primary); transform: skewX(-18deg); }
.om-tick.amber { background: var(--amber); }
.om-more { font-size: 9.5px; font-weight: 700; color: var(--text-muted); }

/* ===== Configuración (perfil + usuarios y roles) ===== */
.sb-config { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none;
  color: var(--text-muted); font-size: 13.5px; font-weight: 600; padding: 9px 12px; border-radius: 10px; cursor: pointer; transition: .12s; }
.sb-config:hover { background: var(--surface-2); color: var(--text); }
.sb-config .icn { font-size: 16px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cfg-grid { grid-template-columns: 1fr; } }
.cfg-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.cfg-card h3 { margin: 0 0 14px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cfg-users { display: flex; flex-direction: column; gap: 8px; }
.cfg-user { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; }
.cfg-user .avatar { width: 36px; height: 36px; font-size: 13px; }
.cfg-avatar { width: 46px !important; height: 46px !important; font-size: 16px !important; }
.cfg-u-txt { display: flex; flex-direction: column; line-height: 1.3; margin-right: auto; }
.cfg-u-txt small { color: var(--text-muted); font-size: 11.5px; }
.cfg-legend { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.cfg-rol { display: flex; gap: 10px; font-size: 12.5px; align-items: baseline; }
.cfg-rol b { min-width: 64px; color: var(--primary); }
.cfg-rol span { color: var(--text-muted); }
.cta-list { display: flex; flex-direction: column; gap: 8px; }
.cta-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; transition: .12s; font-size: 13.5px; }
.cta-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.cta-row .cta-name { font-weight: 700; }
.cta-row .cta-meta { color: var(--text-muted); font-size: 11.5px; margin-right: auto; }
.mesa-node.selected .t-shape { stroke: var(--red); stroke-width: .1px; filter: brightness(1.12); }
.mesa-node.selected { outline: 2px dashed var(--red); outline-offset: 2px; border-radius: 4px; }
.obj-node.selected { outline: 2px dashed var(--red); outline-offset: 2px; }

/* selección por rectángulo (rubber-band) y dibujo de área para generar mesas */
.sel-rect { position: absolute; z-index: 30; pointer-events: none; border: 1.5px dashed var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent); border-radius: 2px; }
.sel-rect.area { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); }
/* área de forma libre (polígono) al generar mesas */
.poly-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.poly-shape { fill: color-mix(in srgb, var(--primary) 12%, transparent); stroke: var(--primary); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-dasharray: 5 3; stroke-linejoin: round; }
.poly-line { fill: none; stroke: var(--primary); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-dasharray: 5 3; }
.poly-handles { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.poly-pt { position: absolute; width: 13px; height: 13px; transform: translate(-50%, -50%); border-radius: 50%;
  background: #fff; border: 2.5px solid var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.28);
  pointer-events: auto; cursor: grab; transition: background .1s, transform .1s; }
.poly-pt:hover { background: var(--primary); transform: translate(-50%, -50%) scale(1.18); }
.poly-pt:active { cursor: grabbing; }

/* ===== Chief — chatbot flotante ===== */
/* FAB = la FORMA de Hydra (PNG transparente) con sombra propia, sin círculo */
.chief-fab { position: fixed; right: 18px; bottom: 16px; width: 70px; height: 60px;
  border: none; background: none; padding: 0; cursor: pointer; z-index: 130; }
.chief-fab .hydra-img { width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(2px 4px 4px rgba(0,0,0,.38)); transform-origin: 42% 80%; transition: transform .2s; }
.chief-fab:hover .hydra-img { animation: hydra-sway 1.7s ease-in-out infinite; } /* sus hydras se mecen 🐍 */
html[data-theme="dark"] .chief-fab .hydra-img { filter: invert(1) drop-shadow(2px 4px 4px rgba(0,0,0,.55)); }
@keyframes hydra-sway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg); }
  55% { transform: rotate(4deg); }
  80% { transform: rotate(-3deg); }
}
.chief-fab.open .hydra-img { transform: scale(.88); }
.chief-panel { position: fixed; right: 22px; bottom: 90px; width: 360px; max-width: calc(100vw - 28px);
  height: 520px; max-height: calc(100vh - 120px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 18px 50px rgba(20,28,50,.28); z-index: 130; display: flex; flex-direction: column; overflow: hidden; }
.chief-panel.hidden { display: none; }
.chief-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chief-ttl { font-weight: 800; display: flex; align-items: center; gap: 7px; margin-right: auto; }
.chief-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.chief-who { font-size: 12px; color: var(--text-muted); }
.chief-x { border: none; background: none; color: var(--text-faint); font-size: 15px; cursor: pointer; margin-left: 8px; }
.chief-x:hover { color: var(--red); }
.chief-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chief-ask { margin: auto 0; text-align: center; }
.chief-ask p { color: var(--text); font-size: 15px; }
.chief-people { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; text-align: left; }
.chief-person { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); cursor: pointer; transition: .12s; }
.chief-person:hover { border-color: var(--primary); background: var(--primary-soft); }
.cp-txt { display: flex; flex-direction: column; line-height: 1.25; }
.cp-txt small { color: var(--text-muted); font-size: 11.5px; }
.chief-msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; }
.chief-msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chief-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chief-msg.typing { display: flex; gap: 4px; align-items: center; }
.chief-msg.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: chief-blink 1s infinite; }
.chief-msg.typing span:nth-child(2) { animation-delay: .2s; }
.chief-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chief-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chief-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chief-input input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; background: var(--surface); color: var(--text); font-size: 14px; }
.chief-input input:focus { outline: none; border-color: var(--primary); }
.chief-send { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--primary); color: #fff; cursor: pointer; font-size: 15px; flex: none; }
.chief-send:hover { filter: brightness(1.08); }
.sel-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.sel-bar .btn { padding: 5px 12px; }

.mesas-empty-hint { color: var(--text-muted); font-size: 12.5px; margin: 12px 2px 0; line-height: 1.6; }
.mesa-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mesa-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; transition: .12s; }
.mesa-chip:hover { border-color: var(--primary); color: var(--primary); }

/* paleta de tipos de mesa */
.modal-wide { max-width: 640px; }
.tipo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin-top: 6px; }
.tipo-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; cursor: pointer; text-align: center; transition: .12s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tipo-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.tipo-card.add { justify-content: center; color: var(--text-muted); border-style: dashed; min-height: 124px; }
.tipo-card.add .icn { color: var(--text-faint); }
.tipo-prev { width: 86px; height: 64px; }
.tipo-name { font-size: 12.5px; font-weight: 700; }
.tipo-dim { font-size: 11px; color: var(--text-muted); }
.tipo-del { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-faint); }
.tipo-del .icn { font-size: 12px; }
.tipo-del:hover { color: var(--red); border-color: var(--red); }
.tipo-edit { position: absolute; top: 6px; right: 30px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-faint); }
.tipo-edit .icn { font-size: 11px; }
.tipo-edit:hover { color: var(--primary); border-color: var(--primary); }

/* regla de escala + pan + rotación */
.scale-bar { position: absolute; left: 12px; bottom: 12px; height: 8px; border: 2px solid var(--text);
  border-top: none; opacity: .65; pointer-events: none; }
.scale-bar span { position: absolute; left: 0; bottom: 10px; font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; }
.editor-scroll.panning { cursor: grabbing; }
.cal-or { text-align: center; color: var(--text-faint); font-size: 12px; margin: 12px 0; }
.rot-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rot-chip { padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2);
  color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.rot-chip:hover { border-color: var(--primary); color: var(--primary); }
input[type="range"] { width: 100%; accent-color: var(--primary); margin-top: 6px; }
.link-del { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; background: none; border: none; color: var(--red); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; }
.link-del .icn { font-size: 14px; }
.link-del:hover { text-decoration: underline; }

/* mobiliario / objetos (no-mesa) en el editor */
.obj-node { position: absolute; transform: translate(-50%, -50%); background: color-mix(in srgb, var(--oc) 7%, transparent);
  border: 1px solid var(--oc); border-radius: 2px; cursor: grab; touch-action: none; display: grid; place-items: center; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.obj-node.zona { border-style: dashed; background: color-mix(in srgb, var(--oc) 4%, transparent); }
.obj-node:active { cursor: grabbing; }
.obj-node:hover { background: color-mix(in srgb, var(--oc) 15%, transparent); }
.obj-label { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--oc); padding: 2px 4px; text-align: center; line-height: 1.1;
  pointer-events: none; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.obj-prev { display: grid; place-items: center; width: 88px; height: 54px; border: 2px solid var(--oc); border-radius: 8px;
  background: color-mix(in srgb, var(--oc) 14%, transparent); color: var(--oc); font-size: 11.5px; font-weight: 700; text-align: center; padding: 4px; }
.obj-prev.zona { border-style: dashed; }

/* ---------- Menú ---------- */
.menu-cat { margin-bottom: 18px; }
.menu-cat-h { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.menu-cat-n { font-size: 11px; font-weight: 700; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 8px; }
.menu-items { display: flex; flex-direction: column; gap: 8px; }
.menu-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 11px 15px; cursor: pointer; transition: .12s; }
.menu-row:hover { border-color: var(--border-strong); transform: translateX(2px); }
.menu-row.off { opacity: .55; }
.menu-row .mr-main { flex: 1; min-width: 0; }
.menu-row .mr-name { font-weight: 600; }
.menu-row .mr-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.menu-row .mr-off { font-size: 10.5px; font-weight: 700; color: var(--amber); border: 1px solid var(--amber); border-radius: 999px; padding: 1px 7px; margin-left: 6px; text-transform: uppercase; }
.menu-row .mr-price { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- OCR / importación ---------- */
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary);
  margin: 6px auto 0; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cota-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.cota-chip { padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2);
  color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer; transition: .12s; }
.cota-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.im-table-wrap { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 4px; }
.im-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.im-table th { text-align: left; font-size: 11.5px; color: var(--text-muted); padding: 8px 8px; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.im-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.im-table input[type="text"], .im-table input:not([type]), .im-table .im-n, .im-table .im-c, .im-table .im-p {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--text); font-size: 13px; }
.im-table .im-p { width: 90px; }
.im-table td:first-child { width: 28px; text-align: center; }

/* ---------- Órdenes ---------- */
.ord-floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.ord-mesa { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 12px; cursor: pointer; text-align: center; transition: .12s; display: flex; flex-direction: column; gap: 4px; }
.ord-mesa:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.ord-mesa.occ { border-color: var(--primary); background: var(--primary-soft); }
.ord-mesa .om-num { font-size: 22px; font-weight: 800; }
.ord-mesa .om-state { font-weight: 700; font-size: 14px; color: var(--text-muted); }
.ord-mesa.occ .om-state { color: var(--primary); }
.ord-mesa .om-cap { font-size: 11.5px; color: var(--text-faint); }
.ord-mesa.cuenta { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.ord-mesa.cuenta .om-state { color: var(--amber); }
.ord-mesa { cursor: grab; -webkit-user-select: none; user-select: none; }
.ord-mesa:active { cursor: grabbing; }
.ord-mesa.dragging { opacity: .45; }
.ord-mesa.drop-on { outline: 2px dashed var(--primary); outline-offset: 3px; transform: scale(1.04); box-shadow: var(--shadow-lg); }

/* Tablero POSICIONAL de Órdenes (mesas en su lugar real, arrastrables) */
.ord-board { position: relative; width: 100%; max-height: 72vh; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; }
.ob-mesa { position: absolute; transform: translate(-50%, -50%); width: 92px; min-height: 64px; padding: 8px 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: var(--shadow);
  cursor: grab; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  touch-action: none; -webkit-tap-highlight-color: transparent; transition: box-shadow .12s, border-color .12s; }
.ob-mesa:hover { box-shadow: var(--shadow-lg); border-color: var(--text-faint); z-index: 5; }
.ob-mesa.dragging { cursor: grabbing; box-shadow: var(--shadow-lg); z-index: 20; opacity: .95; }
.ob-mesa.occ { border-color: var(--primary); background: var(--primary-soft); }
.ob-mesa.cuenta { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, var(--surface)); }
.ob-mesa .ob-num { font-size: 19px; font-weight: 800; line-height: 1; }
.ob-mesa .ob-tot { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.ob-mesa.occ .ob-tot { color: var(--primary); }
.ob-mesa.cuenta .ob-tot { color: var(--amber); }
.ob-mesa .ob-foot { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--primary); color: var(--primary-contrast); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.btn.on-amber { border-color: var(--amber); color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.ord-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.ord-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.ord-legend .lg::before { content: ""; width: 13px; height: 13px; border-radius: 3px; border: 1.5px solid var(--border-strong); background: var(--surface); }
.ord-legend .lg-occ::before { border-color: var(--primary); background: var(--primary-soft); }
.ord-legend .lg-cuenta::before { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.ord-actions { flex-wrap: wrap; }

.ord-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.ord-cart { display: flex; flex-direction: column; gap: 14px; }
.oi-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  min-height: 180px; padding: 6px; }
.oi-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-bottom: 1px solid var(--border); }
.oi-row:last-child { border-bottom: none; }
.oi-qty { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px; }
.oi-qty button { width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; line-height: 1; }
.oi-qty button:hover { background: var(--surface); color: var(--primary); }
.oi-qty span { min-width: 18px; text-align: center; font-weight: 700; font-size: 13px; }
.oi-name { flex: 1; font-weight: 600; font-size: 13.5px; }
.oi-sub { font-weight: 700; font-variant-numeric: tabular-nums; }
.oi-del { border: none; background: none; color: var(--text-faint); cursor: pointer; padding: 4px; display: grid; place-items: center; }
.oi-del:hover { color: var(--red); }
.oi-del .icn { font-size: 16px; }
.oi-empty { padding: 32px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

.ord-tot { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.ot-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.ot-row.ot-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 17px; font-weight: 800; }
.ot-row.ot-total b { color: var(--primary); }
.tip-btns { display: inline-flex; align-items: center; gap: 6px; }
.tip-btns .tip { padding: 4px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.tip-btns .tip:hover { border-color: var(--primary); color: var(--primary); }
.tip-btns input { width: 78px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); text-align: right; }
.tip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.tip-row { padding-top: 0; }
.tip-custom { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); margin-left: 2px; }
.tip-custom input { width: 56px; padding: 4px 7px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface-2); color: var(--text); text-align: right; }
.iva-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text); }
.iva-toggle input { width: auto; }
.scale-ratio { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; margin-top: 4px; }
.scale-ratio input { width: 110px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 700; }
.gen-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; max-height: 52vh; overflow: auto; }
.gen-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.gen-name { font-size: 13.5px; font-weight: 600; }
.gen-q { width: 66px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); text-align: right; font-weight: 700; }
.ord-actions { display: flex; gap: 8px; }
.ord-actions .btn { flex: 1; justify-content: center; }
.ord-actions .btn-primary { flex: 1.4; }

.ord-menu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: sticky; top: 0; }
.mp-head { padding: 12px 14px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.mp-list { max-height: 64vh; overflow-y: auto; padding: 8px; }
.mp-cat { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding: 10px 8px 4px; }
.mp-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; border: none; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text); text-align: left; }
.mp-item:hover { background: var(--primary-soft); color: var(--primary); }
.mp-item .mp-n { font-size: 13.5px; font-weight: 600; }
.mp-item b { font-variant-numeric: tabular-nums; }

.cobrar-total { text-align: center; font-size: 40px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.pay-btns { display: flex; gap: 8px; }
.pay-btn { flex: 1; padding: 12px 8px; border: 1.5px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text-muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.pay-btn.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.cambio { margin-top: 8px; font-weight: 700; color: var(--primary); min-height: 18px; }

@media (max-width: 760px) { .ord-grid { grid-template-columns: 1fr; } .ord-menu { position: static; } }

/* ---------- Corte de caja ---------- */
.corte-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.corte-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.corte-card h4 { margin: 0 0 10px; font-size: 14px; }
.corte-hint { font-weight: 400; color: var(--text-faint); font-size: 12px; }
.corte-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.corte-row:last-child { border-bottom: none; }
.corte-row b { font-variant-numeric: tabular-nums; }
.corte-row3 .cm-n { flex: 1; font-weight: 600; }
.corte-row3 .cm-x { color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.corte-scroll { max-height: 340px; overflow-y: auto; }
input[type="date"].sel { max-width: 160px; }
@media (max-width: 760px) { .corte-cols { grid-template-columns: 1fr; } }

/* ---------- Empty states ---------- */
.empty { text-align: center; color: var(--text-muted); padding: 60px 20px; }
.empty .e-ic { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; margin: 0 auto 14px; color: var(--text-faint); }
.empty .e-ic .icn { font-size: 26px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; }
.empty p { margin: 0 0 16px; font-size: 13.5px; }
.empty .badge { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

/* =====================================================================
   Modal
   ===================================================================== */
.modal-bg { position: fixed; inset: 0; background: rgba(10,12,16,.5); display: grid; place-items: center; z-index: 60; padding: 18px; }
.modal { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 22px 24px; }
.modal-x { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 15px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; z-index: 2; transition: .12s; }
.modal-x:hover { color: var(--red); border-color: var(--red); background: var(--surface-2); }
.modal h3 { padding-right: 34px; }
.modal h3 { margin: 0 0 16px; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.uploader { border: 1.6px dashed var(--border-strong); border-radius: 10px; padding: 16px; text-align: center; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.uploader:hover { border-color: var(--primary); color: var(--primary); }
.uploader .icn { font-size: 22px; display: block; margin: 0 auto 6px; }
.uploader.has { border-style: solid; color: var(--text); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #111418; color: #fff;
  padding: 11px 18px; border-radius: 11px; font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 70; opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 720px) {
  .sidebar { position: fixed; z-index: 40; height: 100%; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid !important; }
  .search { display: none; }
  .row2 { grid-template-columns: 1fr; }
}
.menu-btn { display: none; }
