/* =============================================================================
   MESENG — Sistema visual
   Cálido, preciso y sobrio: papel marfil, tinta azul noche, esmeralda de marca.
   ========================================================================== */
:root {
  --bg: #F5F2EA;
  --bg-2: #EDE8DC;
  --surface: #FFFFFF;
  --surface-2: #FBF9F4;
  --surface-3: #F4F0E6;
  --line: #EAE5DA;
  --line-2: #DAD3C3;
  --ink: #13202F;
  --ink-2: #3A4656;
  --muted: #7A8290;
  --faint: #A9AEB6;

  --brand: #0D7A68;
  --brand-2: #14A487;
  --brand-ink: #054238;
  --brand-soft: #E2F2EC;
  --brand-glow: rgba(20, 164, 135, .18);
  --navy: #12233A;
  --navy-2: #1B3150;
  --gold: #B98A3E;
  --gold-soft: #F5ECDA;

  --pos: #1D8A57; --pos-soft: #E3F3EA;
  --neg: #BF3F2B; --neg-soft: #F9E6E1;
  --warn: #B57616; --warn-soft: #FAEFD9;
  --info: #2D6BAE; --info-soft: #E3EDF8;

  --w-meseng: linear-gradient(135deg, #0C6E5E 0%, #14A487 100%);
  --w-orange: linear-gradient(135deg, #C2571A 0%, #EE8A2F 100%);
  --w-sales:  linear-gradient(135deg, #1B3150 0%, #36577F 100%);

  --r-sm: 8px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(19,32,47,.05);
  --sh-2: 0 1px 2px rgba(19,32,47,.04), 0 10px 30px -14px rgba(19,32,47,.18);
  --sh-3: 0 24px 60px -20px rgba(19,32,47,.35);
  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  --side-w: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E141C; --bg-2: #121A24; --surface: #16202C; --surface-2: #1A2532; --surface-3: #1F2B3A;
    --line: #253244; --line-2: #2F3E52; --ink: #EDEAE2; --ink-2: #C5C8CC; --muted: #8C95A1; --faint: #5D6876;
    --brand: #23B596; --brand-2: #3ED1B0; --brand-ink: #B9F0E1; --brand-soft: #123A33; --brand-glow: rgba(62,209,176,.15);
    --navy: #0A111A; --navy-2: #111C29; --gold: #D9AE62; --gold-soft: #3A2F1C;
    --pos: #4CC48A; --pos-soft: #143526; --neg: #F07A64; --neg-soft: #3E1E19; --warn: #E3A548; --warn-soft: #3A2C14; --info: #6FA6E6; --info-soft: #172B42;
    --sh-2: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E141C; --bg-2: #121A24; --surface: #16202C; --surface-2: #1A2532; --surface-3: #1F2B3A;
  --line: #253244; --line-2: #2F3E52; --ink: #EDEAE2; --ink-2: #C5C8CC; --muted: #8C95A1; --faint: #5D6876;
  --brand: #23B596; --brand-2: #3ED1B0; --brand-ink: #B9F0E1; --brand-soft: #123A33; --brand-glow: rgba(62,209,176,.15);
  --navy: #0A111A; --navy-2: #111C29; --gold: #D9AE62; --gold-soft: #3A2F1C;
  --pos: #4CC48A; --pos-soft: #143526; --neg: #F07A64; --neg-soft: #3E1E19; --warn: #E3A548; --warn-soft: #3A2C14; --info: #6FA6E6; --info-soft: #172B42;
  --sh-2: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01', 'cv11';
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
.num, .money { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .02em; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn { color: var(--warn); }
.hidden { display: none !important; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.75; flex: none; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; color: #EAF6F2; padding: 56px;
  background: radial-gradient(1200px 600px at 10% -10%, #1C5A63 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #0E7C6B 0%, transparent 55%), var(--navy);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
}
.login-art .brand-plate { background: #fff; border-radius: 16px; padding: 10px 16px; display: inline-flex; width: max-content; box-shadow: var(--sh-3); position: relative; z-index: 1; }
.login-art .brand-plate img { height: 46px; display: block; }
.login-art h1 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 18px; max-width: 14ch; position: relative; z-index: 1; }
.login-art h1 em { font-style: italic; color: #7FE3C8; }
.login-art p { color: #A9C6C3; max-width: 46ch; margin: 0; position: relative; z-index: 1; }
.login-stats { display: flex; gap: 36px; position: relative; z-index: 1; }
.login-stats div { border-left: 1px solid rgba(255,255,255,.15); padding-left: 14px; }
.login-stats b { display: block; font-family: var(--display); font-size: 26px; font-weight: 500; color: #fff; }
.login-stats span { font-size: 12px; color: #8FB0AE; text-transform: uppercase; letter-spacing: .08em; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-family: var(--display); font-weight: 500; font-size: 30px; margin: 0 0 6px; letter-spacing: -.01em; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.login-foot { margin-top: 28px; font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 8px; }

/* ---------- Acceso (login) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-brand {
  position: relative; overflow: hidden; color: #E6F1EE; isolation: isolate;
  background:
    radial-gradient(900px 520px at 0% 0%, rgba(32, 104, 112, .55), transparent 62%),
    radial-gradient(760px 520px at 100% 100%, rgba(13, 122, 104, .45), transparent 60%),
    linear-gradient(160deg, #13253B 0%, #0F1D30 55%, #0C2A2C 100%);
}
.auth-brand::before { /* textura casi imperceptible */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth-brand::after { /* línea de luz */
  content: ''; position: absolute; z-index: -1; right: -1px; top: 12%; bottom: 12%; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(126, 227, 200, .35), transparent);
}
.auth-brand-in { height: 100%; max-width: 560px; margin: 0 auto; padding: 56px 56px 40px; display: grid; grid-template-rows: auto 1fr auto auto; gap: 40px; }
.auth-logo { background: #fff; border-radius: 16px; padding: 10px 16px; width: max-content; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06); }
.auth-logo img { height: 48px; display: block; }
.auth-copy { align-self: center; }
.auth-kicker { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #7FE3C8; margin-bottom: 18px; }
.auth-copy h1 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 3.4vw, 48px); line-height: 1.06; letter-spacing: -.02em; margin: 0 0 18px; color: #fff; }
.auth-copy h1 em { font-style: italic; color: #7FE3C8; }
.auth-copy p { margin: 0; max-width: 42ch; color: #A9C3C1; font-size: 15.5px; line-height: 1.6; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.auth-points li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; font-size: 13.5px; color: #9FB9B7; line-height: 1.45; }
.auth-points li > span { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(127, 227, 200, .08); border: 1px solid rgba(127, 227, 200, .16); color: #7FE3C8; }
.auth-points li [data-lucide] { width: 17px; height: 17px; }
.auth-points b { display: block; color: #EAF4F1; font-weight: 600; font-size: 14px; margin-bottom: 1px; }
.auth-brand-foot { font-size: 12px; color: #6F8C8E; border-top: 1px solid rgba(255,255,255,.07); padding-top: 18px; }
.auth-brand-foot i { color: #8FB0AE; }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px 28px; gap: 22px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px 32px 26px; box-shadow: 0 1px 2px rgba(19,32,47,.04), 0 24px 48px -28px rgba(19,32,47,.28); }
.auth-head { margin-bottom: 22px; }
.auth-head h2 { font-family: var(--display); font-weight: 500; font-size: 28px; letter-spacing: -.015em; margin: 0 0 6px; line-height: 1.15; }
.auth-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-field { margin-bottom: 16px; }
.auth-field > label, .auth-label-row label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.auth-label-row a { font-size: 12.5px; font-weight: 600; color: var(--brand); }
.auth-label-row a:hover { text-decoration: underline; }
.auth-input { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.auth-input > [data-lucide] { width: 17px; height: 17px; color: var(--faint); flex: none; transition: color .15s; }
.auth-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.auth-input input::placeholder { color: var(--faint); }
.auth-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }
.auth-input:focus-within > [data-lucide] { color: var(--brand); }
.auth-input.invalid { border-color: var(--neg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--neg) 14%, transparent); }
.auth-input.invalid > [data-lucide] { color: var(--neg); }
.auth-eye { border: 0; background: none; padding: 6px; margin-right: -6px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.auth-eye:hover { background: var(--surface-3); color: var(--ink); }
.auth-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.auth-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); margin: 2px 0 20px; cursor: pointer; user-select: none; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.auth-submit { height: 50px; }
.auth-submit:focus-visible { outline: 3px solid var(--brand-glow); outline-offset: 2px; }
.auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; margin-bottom: 16px; background: var(--neg-soft); color: var(--neg); font-size: 13.5px; font-weight: 500; border: 1px solid color-mix(in srgb, var(--neg) 25%, transparent); }
.auth-alert [data-lucide] { width: 17px; height: 17px; margin-top: 1px; }
.auth-help { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; margin-bottom: 14px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.auth-back:hover { color: var(--ink); }
.auth-back [data-lucide] { width: 15px; height: 15px; }
.auth-ok { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--pos-soft); color: var(--pos); margin-bottom: 16px; }
.auth-ok [data-lucide] { width: 24px; height: 24px; }
.auth-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.auth-foot [data-lucide] { width: 14px; height: 14px; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand::after { display: none; }
  .auth-brand-in { padding: 22px 20px 26px; grid-template-rows: auto auto; gap: 18px; max-width: none; }
  .auth-logo { padding: 7px 12px; border-radius: 12px; } .auth-logo img { height: 34px; }
  .auth-kicker { margin-bottom: 8px; font-size: 10.5px; }
  .auth-copy h1 { font-size: 27px; margin-bottom: 8px; } .auth-copy h1 br { display: none; }
  .auth-copy p { font-size: 14px; }
  .auth-points, .auth-brand-foot { display: none; }
  .auth-main { justify-content: flex-start; padding: 22px 16px 24px; margin-top: -14px; }
  .auth-card { padding: 26px 20px 20px; border-radius: 20px; }
  .auth-head h2 { font-size: 24px; }
}

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--navy); color: #C9D3DE;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; z-index: 30;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 6px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.side-foot { position: sticky; bottom: -18px; background: var(--navy); padding-bottom: 4px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.side-brand .plate { background: #fff; border-radius: 12px; padding: 6px 10px; display: flex; width: 100%; justify-content: center; }
.side-brand img { height: 46px; display: block; max-width: 100%; object-fit: contain; }
.side-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #6C7E94; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: #C1CCD8;
  font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(20,164,135,.22), rgba(20,164,135,.06)); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-2); }
.nav a .badge { margin-left: auto; }
/* categorías desplegables del menú */
.nav-sec { margin-top: 2px; }
.nav-sec.has-active > .nav-sec-h { color: #E6F6F1; }
.nav-sec.has-active > .nav-sec-h [data-lucide], .nav-sec.has-active > .nav-sec-h svg:not(.chev) { color: var(--brand-2); opacity: 1; }
.nav-sec.has-active.closed > .nav-sec-h { background: linear-gradient(90deg, rgba(20,164,135,.16), rgba(20,164,135,.03)); }
.nav-sec:not(.closed) > .nav-sec-h { color: #E6F6F1; }
.nav-sec-h { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #7D8FA5; transition: background .15s, color .15s; }
.nav-sec-h:hover { background: rgba(255,255,255,.04); color: #C1CCD8; }
.nav-sec-h:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.nav-sec-h [data-lucide], .nav-sec-h svg { width: 15px; height: 15px; flex: none; opacity: .85; }
.nav-sec-h .sec-n { margin-left: auto; font-size: 10.5px; letter-spacing: 0; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.06); color: #8FA1B5; }
.nav-sec-h .chev { transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.nav-sec.closed .nav-sec-h .chev { transform: rotate(-90deg); }
.nav-sec-h .sec-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 3px rgba(62,209,176,.18); }
.nav-sec.closed:has(.badge.count:not(.hidden)) .sec-dot { display: inline-block; } /* plegada con avisos dentro */
.nav-sec-b { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.nav-sec.closed .nav-sec-b { grid-template-rows: 0fr; opacity: 0; }
.nav-sec-in { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 1px; margin-left: -14px; padding-left: 14px; }
.nav-sec-in a { padding-left: 14px; }
@media (prefers-reduced-motion: reduce) { .nav-sec-b, .nav-sec-h .chev { transition: none; } }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; flex: none;
}
.me .who { min-width: 0; } .me .who b { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 12px; color: #7F91A6; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .burger { display: none; }
.search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.search kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); }
.dot.off { background: var(--neg); box-shadow: 0 0 0 3px var(--neg-soft); }
.dot.wait { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

.page { padding: 28px 32px 64px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -.015em; margin: 0; line-height: 1.1; }
.page-head .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); font-weight: 700; margin-bottom: 6px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 16px 20px 20px; }
.card-b.flush { padding: 8px 0 4px; }
.mt { margin-top: 18px; }

.wallet {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 20px 22px; color: #fff; min-height: 150px;
  display: flex; flex-direction: column; box-shadow: var(--sh-2); isolation: isolate;
}
.wallet::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--wb); }
.wallet::after {
  content: ''; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
}
.wallet.m { --wb: var(--w-meseng); } .wallet.o { --wb: var(--w-orange); } .wallet.s { --wb: var(--w-sales); }
.wallet .w-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .9; }
.wallet .w-amt { font-family: var(--display); font-size: 34px; font-weight: 500; letter-spacing: -.02em; margin-top: auto; line-height: 1.1; }
.wallet .w-amt small { font-family: var(--font); font-size: 13px; font-weight: 600; opacity: .75; margin-left: 4px; letter-spacing: 0; }
.wallet .w-foot { display: flex; justify-content: space-between; font-size: 12px; opacity: .85; margin-top: 8px; }

.kpi { padding: 18px 20px; }
.kpi .k-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .k-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .k-ico.gold { background: var(--gold-soft); color: var(--gold); }
.kpi .k-ico.info { background: var(--info-soft); color: var(--info); }
.kpi .k-ico.neg { background: var(--neg-soft); color: var(--neg); }
.kpi .k-val { font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin-top: 10px; line-height: 1.1; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: transform .06s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px -8px var(--brand); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
:root[data-theme="dark"] .btn.primary:hover { background: var(--brand-2); color: #062b24; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 35%, var(--line)); }
.btn.danger:hover { background: var(--neg-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { padding: 12px 18px; font-size: 15px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.field label .hint { color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-glow); }
.input.big { font-family: var(--display); font-size: 26px; padding: 12px 14px; letter-spacing: -.01em; }
textarea.input { resize: vertical; min-height: 70px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink-2);
}
.seg button.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.err-text { color: var(--neg); font-size: 12.5px; margin-top: -6px; margin-bottom: 10px; }

.preview {
  border-radius: 14px; background: var(--surface-3); border: 1px dashed var(--line-2); padding: 14px 16px; display: grid; gap: 8px; margin: 4px 0 14px;
}
.preview .pl { display: flex; justify-content: space-between; font-size: 13.5px; }
.preview .pl.total { border-top: 1px solid var(--line-2); padding-top: 8px; font-weight: 700; font-size: 15px; }

/* ---------- Tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.t td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr:hover { background: var(--surface-2); }
.t .r { text-align: right; }
.t tr.voided td { color: var(--faint); text-decoration: line-through; }
.cell-main { font-weight: 600; } .cell-sub { font-size: 12px; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.badge.pos { background: var(--pos-soft); color: var(--pos); }
.badge.neg { background: var(--neg-soft); color: var(--neg); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.count { background: var(--brand-2); color: #062b24; min-width: 20px; justify-content: center; padding: 2px 7px; }

.orders { display: grid; gap: 12px; }
.order {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.order:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.order.new { animation: pulse 1.6s ease-out 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--brand-glow); } 100% { box-shadow: 0 0 0 14px transparent; } }
.order .o-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12px; }
.order .o-main b { font-size: 14.5px; } .order .o-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.order .o-amt { text-align: right; }
.order .o-amt b { font-family: var(--display); font-size: 21px; font-weight: 500; letter-spacing: -.01em; display: block; }
.order .o-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .e-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--faint); }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }

/* acciones rápidas */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.quick b, .quick span:not(.q-ico) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick button {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; min-width: 0;
  padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s, transform .06s;
}
.quick button:hover { border-color: var(--brand); background: var(--brand-soft); }
.quick button:active { transform: translateY(1px); }
.quick .q-ico { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--brand); border: 1px solid var(--line); }
.quick b { font-size: 13px; line-height: 1.2; }
.quick span:not(.q-ico) { font-size: 11.5px; color: var(--muted); line-height: 1.25; }

/* barras (gráfico) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; max-width: 42px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); min-height: 3px; transition: height .4s; position: relative; }
.bars .bar.today i { background: linear-gradient(180deg, var(--gold), #8E6524); }
.bars .bar span { font-size: 11px; color: var(--muted); }
.bars .bar em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-2); }

.split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.split > i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 17, 26, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-3); animation: rise .2s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { max-width: 760px; }
@keyframes rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 4px; }
.modal-h h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.modal-h p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 16px 24px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 6px 24px 22px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 13px 16px; border-radius: 14px;
  background: var(--navy); color: #fff; box-shadow: var(--sh-3); animation: rise .2s; font-size: 13.5px;
}
.toast.ok [data-lucide] { color: #6FE0BD; } .toast.err [data-lucide] { color: #FF9C88; } .toast.warn [data-lucide] { color: #F5C26B; }

.palette { max-width: 620px; align-self: start; margin-top: 10vh; }
.palette .input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 18px 22px; font-size: 16px; box-shadow: none; }
.palette .res { max-height: 50vh; overflow: auto; padding: 8px; }
.palette .res a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.palette .res a:hover, .palette .res a.sel { background: var(--surface-3); }

.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; font-size: 13.5px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.neg { background: var(--neg-soft); color: var(--neg); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner b { color: inherit; }

/* chat */
/* altura fija y SOLO los mensajes hacen scroll: min-height:0 impide que la columna crezca con su contenido */
.chat { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: calc(100vh - 190px); height: calc(100dvh - 190px); min-height: 420px; overflow: hidden; }
.chat-rooms { border-right: 1px solid var(--line); padding: 10px; overflow: auto; min-height: 0; }
.chat-rooms button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.chat-rooms button.on { background: var(--brand-soft); color: var(--brand); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.chat-msgs > * { flex-shrink: 0; }
.chat-input { flex-shrink: 0; }
.msg { overflow-wrap: anywhere; white-space: pre-wrap; max-width: 70%; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--surface-3); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg .m-who { font-size: 11.5px; font-weight: 700; opacity: .75; margin-bottom: 2px; }
.msg .m-time { font-size: 10.5px; opacity: .6; margin-top: 3px; text-align: right; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-compose, .chat-rec { display: flex; gap: 8px; align-items: center; flex: 1 1 auto; min-width: 0; }
.chat-compose .input { flex: 1 1 auto; min-width: 0; }
.chat-rec .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--neg); animation: rec-blink 1s ease-in-out infinite; flex-shrink: 0; }
@keyframes rec-blink { 50% { opacity: .25; } }
.msg.has-file { padding: 5px; }
.msg.has-file .m-who, .msg.has-file .m-text, .msg.has-file .m-time { padding: 0 8px; }
.msg .m-text { margin-top: 4px; }
.msg .m-img { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: min(280px, 60vw); max-height: 360px; overflow: hidden; border-radius: 10px; }
.msg .m-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg .m-audio { display: flex; align-items: center; gap: 6px; }
.msg .m-audio audio { width: min(260px, 62vw); height: 40px; }
.msg .m-dur { font-size: 11px; opacity: .7; padding-right: 6px; }
.msg .m-time { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
/* marcas ✓ / ✓✓ / ✓✓ azul (en mis mensajes la hora va sin transparencia para que el azul se distinga bien) */
.msg.mine .m-time { opacity: 1; color: rgba(255, 255, 255, .72); }
.msg.mine.deleted .m-time { color: var(--muted); }
.msg .ticks { display: inline-flex; align-items: center; line-height: 0; }
.msg .ticks.read { color: var(--tick-read, #8EDBFF); }
:root { --tick-read: #8EDBFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tick-read: #0B4FB3; } }
:root[data-theme="dark"] { --tick-read: #0B4FB3; }
.msg .m-del { border: 0; background: none; color: inherit; padding: 5px; margin: -5px 0; cursor: pointer; opacity: .75; display: inline-grid; place-items: center; border-radius: 6px; }
.msg .m-del:hover, .msg .m-del:focus-visible { opacity: 1; background: rgba(255, 255, 255, .18); }
.msg .m-del svg { width: 14px; height: 14px; }
.msg.deleted { font-style: italic; opacity: .7; background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }
.msg.deleted.mine { background: transparent; color: var(--muted); }
.msg.deleted .m-text { display: flex; align-items: center; gap: 6px; margin: 0; } .msg.deleted svg { width: 14px; height: 14px; }
.chat-head { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.chat-head b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-head .call-btn { flex: none; color: var(--neg); border-color: color-mix(in srgb, var(--neg) 35%, transparent); }
.msg-call { align-self: center; display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--neg-soft); color: var(--neg); font-size: 12.5px; max-width: 92%; }
.msg-call svg { width: 15px; height: 15px; flex: none; }
/* llamada de atención entrante: pantalla completa por encima de todo */
.call-ov { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(10, 18, 30, .72); backdrop-filter: blur(4px); }
.call-card { width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 28px 22px 22px; border-radius: 22px; background: var(--surface); box-shadow: var(--sh-3); }
.call-card b { font-size: 19px; line-height: 1.25; }
.call-card > span { color: var(--muted); }
.call-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--neg); color: #fff; margin-bottom: 6px; animation: call-pulse 1.1s ease-out infinite; }
.call-ico svg { width: 34px; height: 34px; animation: call-shake .5s ease-in-out infinite; }
.call-ico.sm { width: 34px; height: 34px; margin: 0; flex: none; animation: none; } .call-ico.sm svg { width: 18px; height: 18px; }
.call-a { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 10px; }
.call-a .btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.call-out { position: fixed; z-index: 150; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: min(460px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--neg); box-shadow: var(--sh-3); }
.call-out .call-t { flex: 1 1 auto; min-width: 0; } .call-out .call-t b { display: block; font-size: 13.5px; } .call-out .call-t span { font-size: 12px; color: var(--muted); }
body:has(.shell.chat-mode) .call-out { /* en el chat, por encima del campo de escribir */ bottom: calc(76px + env(safe-area-inset-bottom)); }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--neg) 55%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
@keyframes call-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .call-ico, .call-ico svg { animation: none; } }
.chat-photo-full { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; border-radius: 8px; }

/* recibo imprimible */
.receipt { font-family: var(--mono); font-size: 12.5px; background: #fff; color: #111; padding: 18px; border-radius: 12px; border: 1px solid var(--line); }
.receipt img { height: 40px; display: block; margin: 0 auto 8px; }
.receipt .rl { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
@media print {
  body * { visibility: hidden !important; }
  .receipt, .receipt * { visibility: visible !important; }
  .receipt { position: fixed; left: 0; top: 0; width: 80mm; border: 0; }
}

/* ---------- Panel refinado ---------- */
.sync-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: -12px 0 20px; }
.sync-line [data-lucide] { width: 15px; height: 15px; color: var(--pos); }
.sync-line.off [data-lucide] { color: var(--warn); }
.seg.period { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg.period button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; }
.seg.period button.on { background: var(--ink); color: var(--surface); }

.card.lift { transition: box-shadow .2s, transform .2s, border-color .2s; }
.card.lift:hover { box-shadow: var(--sh-2); transform: translateY(-1px); border-color: var(--line-2); }
.kpi { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.kpi .k-label { min-width: 0; white-space: nowrap; }
.kpi .k-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-ico { flex: none; }
.kpi .k-badge { margin-left: auto; flex: none; padding-left: 6px; }
.kpi .k-badge .badge { font-size: 11px; }
.kpi .k-val { font-size: clamp(22px, 1.9vw, 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-spark { margin-top: 8px; height: 30px; }
.kpi .k-spark .spark { width: 100%; height: 30px; display: block; }
.kpi .k-sub { margin-top: 8px; }
.kpi .k-val .cur, .cur { font-family: var(--font); font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.kpi .k-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; line-height: 1.45; }
.kpi .leg { display: inline-flex; align-items: center; gap: 5px; }
.kpi .leg i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.spark { width: 100%; height: 30px; }

.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .ax.today { fill: var(--ink); font-weight: 700; }
.chart .avg-l { stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart .avg-t { fill: var(--gold); font-weight: 700; }
.chart .zero-b { fill: var(--line-2); }
.chart .hit { fill: transparent; }
.chart .bar-g:hover .hit { fill: var(--surface-3); }
.chart-empty { position: absolute; inset: 0 0 30px 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); font-size: 13px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.chart-empty [data-lucide] { width: 28px; height: 28px; color: var(--faint); }
.chart-empty b { color: var(--ink-2); font-size: 14px; }
.chart-empty .btn { margin-top: 6px; }
.legend .dash { display: inline-block; width: 16px; height: 0; border-top: 2px dashed var(--gold); vertical-align: middle; margin-right: 6px; border-radius: 0; background: none; }

.al-group + .al-group { margin-top: 14px; }
.al-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.al-head span:last-child { margin-left: auto; }
.al-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--info); }
.al-head.neg .al-dot { background: var(--neg); } .al-head.warn .al-dot { background: var(--warn); }
.al-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 6px; border-left: 3px solid var(--info); }
.al-item.neg { border-left-color: var(--neg); } .al-item.warn { border-left-color: var(--warn); }
.al-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.al-item.neg .al-ico { background: var(--neg-soft); color: var(--neg); } .al-item.warn .al-ico { background: var(--warn-soft); color: var(--warn); }
.al-txt { min-width: 0; flex: 1; } .al-txt b { display: block; font-size: 13px; line-height: 1.3; } .al-txt span { font-size: 12px; color: var(--muted); }
.al-item .btn { flex: none; }

.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.list-row.hov { transition: background .15s; } .list-row.hov:hover { background: var(--surface-2); }
.k-ico.neg { background: var(--neg-soft); color: var(--neg); }

.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; } .login-art { padding: 32px 24px; min-height: 300px; } .login-stats { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--sh-3); overflow-y: auto; }
  .shell.open .side { transform: none; }
  .shell.open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .top { padding: 12px 16px; } .top .burger { display: inline-flex; }
  .search kbd, .top .hide-sm { display: none; }
  .page { padding: 20px 16px 56px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  /* Chat en móvil: ocupa toda la pantalla visible bajo la barra superior (la altura la fija chat.js con --chat-vh,
     que sigue al teclado); sin cabecera de página, salas en una fila deslizable y campo de escribir pegado abajo */
  .shell.chat-mode { height: var(--chat-vh, 100dvh); min-height: 0; overflow: hidden; }
  .shell.chat-mode .main { height: 100%; min-height: 0; }
  .shell.chat-mode .page { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0; }
  .shell.chat-mode .page-head { display: none; }
  .shell.chat-mode .chat { flex: 1 1 auto; height: auto; min-height: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: none; margin: 0; }
  .chat { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 150px); min-height: 0; }
  .chat-rooms { display: flex; gap: 6px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chat-rooms::-webkit-scrollbar { display: none; }
  .chat-rooms button { width: auto; flex: none; white-space: nowrap; padding: 7px 12px; gap: 6px; font-size: 13px; border-radius: 999px; background: var(--surface-3); }
  .chat-rooms button svg { width: 15px; height: 15px; }
  .chat-rooms button .badge { margin-left: 2px !important; }
  .chat-msgs { padding: 12px 10px; gap: 8px; }
  .msg { max-width: 86%; }
  .msg .m-img { width: min(260px, 66vw); }
  .msg .m-audio audio { width: min(240px, 64vw); }
  .chat-input { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  .chat-compose, .chat-rec { gap: 6px; }
  .chat-input .input { font-size: 16px; padding: 9px 12px; border-radius: 999px; } /* 16px: el iPhone no hace zoom al escribir */
  .chat-input .btn.icon { flex: none; }
  .chat-head { padding: 6px 10px; }
  .t th, .t td { padding: 10px 14px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr; }
  .order { grid-template-columns: 1fr; } .order .o-ico { display: none; } .order .o-amt { text-align: left; } .order .o-actions { justify-content: flex-start; }
  .wallet .w-amt { font-size: 28px; }
  .page-head h1 { font-size: 25px; }
}
@media (max-width: 420px) { .chat-rec .rec-lbl { display: none; } }

/* operaciones por billetera: entradas / salidas */
.wq-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--faint); flex: none; }
.wq-dot.m { background: #14A487; } .wq-dot.o { background: #E07B2C; } .wq-dot.s { background: #36577F; } .wq-dot.t { background: var(--gold); }
.wq { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wq:first-child { padding-top: 0; } .wq:last-child { border-bottom: 0; padding-bottom: 0; }
.wq-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.wq-lab { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; padding: 0 2px; }
.wq-lab.in { color: var(--pos); } .wq-lab.out { color: var(--neg); }
.wq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wq-cols > div { display: grid; gap: 6px; align-content: start; }
.wq-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wq-b { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; font-size: 12.5px; cursor: pointer; text-align: left; min-width: 0; transition: background .15s, border-color .15s; }
.wq-b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wq-b [data-lucide] { width: 15px; height: 15px; flex: none; }
.wq-b.in { border-left: 3px solid var(--pos); } .wq-b.in [data-lucide] { color: var(--pos); }
.wq-b.in:hover { background: var(--pos-soft); border-color: var(--pos); }
.wq-b.out { border-left: 3px solid var(--neg); } .wq-b.out [data-lucide] { color: var(--neg); }
.wq-b.out:hover { background: var(--neg-soft); border-color: var(--neg); }
.wq-b.mv { border-left: 3px solid var(--gold); } .wq-b.mv [data-lucide] { color: var(--gold); }
.wq-b.mv:hover { background: var(--gold-soft); border-color: var(--gold); }

.opick-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--surface-3); border-radius: 12px; margin-bottom: 12px; }
.opick-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: 9px; background: none; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.opick-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.op-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.op-col { display: grid; gap: 7px; align-content: start; }
.op-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 2px 2px 4px; }
.op-h.in { color: var(--pos); } .op-h.out { color: var(--neg); } .op-h.mv { color: var(--gold); }
.op-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, background .15s, box-shadow .15s; min-width: 0; }
.op-tile .op-sign { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.op-tile.in .op-sign { background: var(--pos-soft); color: var(--pos); }
.op-tile.out .op-sign { background: var(--neg-soft); color: var(--neg); }
.op-tile.mv .op-sign { background: var(--gold-soft); color: var(--gold); font-size: 14px; }
.op-txt { min-width: 0; display: grid; } .op-txt b { font-size: 13.5px; } .op-txt small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-tile:hover { border-color: var(--faint); }
.op-tile.in.on { border-color: var(--pos); background: var(--pos-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 18%, transparent); }
.op-tile.out.on { border-color: var(--neg); background: var(--neg-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--neg) 18%, transparent); }
.op-tile.mv.on { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }

.wsum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 14px; }
.wsum > div { background: var(--surface-2); padding: 10px 20px; display: grid; gap: 2px; }
.wsum span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.wsum b { font-size: 16px; } .wsum .in b { color: var(--pos); } .wsum .out b { color: var(--neg); }
.t th.in-h { color: var(--pos); } .t th.out-h { color: var(--neg); }
#wtabs button { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) { .op-cols, .wq-moves { grid-template-columns: 1fr; } .wsum { grid-template-columns: 1fr 1fr; } }

/* modal de operación en dos pasos */
.modal.opm-modal { max-width: 920px; }
.opm .op-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opm .op-tile { padding: 9px 12px; }
.opm-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.opm-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-2); margin-bottom: 16px; }
.opm-chip b { display: block; font-size: 15px; } .opm-chip small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.opm-chip .btn { margin-left: auto; }
.opm-chip .op-sign { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 19px; flex: none; }
.opm-chip.in { background: var(--pos-soft); border-color: color-mix(in srgb, var(--pos) 40%, var(--line)); } .opm-chip.in .op-sign { background: var(--surface); color: var(--pos); }
.opm-chip.out { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); } .opm-chip.out .op-sign { background: var(--surface); color: var(--neg); }
.opm-chip.mv { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); } .opm-chip.mv .op-sign { background: var(--surface); color: var(--gold); font-size: 15px; }
.opm .row { grid-template-columns: 1fr 1fr; }
.op-note-btn { margin-top: -4px; }
.opm-sum { position: sticky; top: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; }
.opm-sum-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.opm-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.opm-total span { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.opm-total b { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -.02em; line-height: 1.1; }
.opm-total small { font-size: 12px; font-weight: 700; color: var(--muted); }
.opm-total.in b { color: var(--pos); } .opm-total.out b { color: var(--neg); } .opm-total.mv b { color: var(--gold); }
.opm-sum .pl { display: flex; justify-content: space-between; font-size: 13.5px; padding: 0 2px; }
.opm-ws { display: grid; gap: 6px; border-top: 1px dashed var(--line-2); padding-top: 10px; }
.opm-w { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.opm-w > span:first-child { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.opm-w > span:nth-child(2) { text-align: right; color: var(--ink-2); }
.opm-w.bad > span:nth-child(2) b { color: var(--neg); }
.opm-w.muted { grid-template-columns: 1fr; color: var(--muted); }
.opm-warn { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; }
.opm-sum .btn.block + .btn.block { margin-top: -2px; }
.hint.neg { color: var(--neg); }
@media (max-width: 760px) { .opm-grid { grid-template-columns: 1fr; } .opm-sum { position: static; } .opm .op-grid2 { grid-template-columns: 1fr; } }

/* traspasos pendientes */
.trf-card { margin-bottom: 18px; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); }
.trf-card .card-h h3 { display: flex; align-items: center; gap: 8px; }
.trf-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px; }
.trf-row:last-child { margin-bottom: 0; }
.trf-row.in { border-left: 3px solid var(--pos); } .trf-row.in .al-ico { background: var(--pos-soft); color: var(--pos); }
.trf-row.out { border-left: 3px solid var(--gold); } .trf-row.out .al-ico { background: var(--gold-soft); color: var(--gold); }
.trf-row .btn { flex: none; }
@media (max-width: 560px) { .trf-row { flex-wrap: wrap; } }

/* campana de avisos */
.bell { position: relative; }
.bell-n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--neg); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

/* ajustes de seguridad */
.sec-card { border-color: color-mix(in srgb, var(--info) 30%, var(--line)); }
.sec-card .card-h h3 { display: flex; align-items: center; gap: 8px; }

/* Historial global — compacto y responsive */
.hist { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.h-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.h-src { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.h-src::-webkit-scrollbar { display: none; }
.h-src button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.h-src button svg { width: 15px; height: 15px; }
.h-src button.on { background: var(--ink); color: var(--surface); }
.h-dl { margin-left: auto; display: flex; gap: 6px; }
.h-filters { padding: 12px 14px; }
.h-grid { display: grid; grid-template-columns: 1fr 1fr 1.1fr 1.2fr 1.8fr; gap: 8px 10px; }
.h-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; }
.h-f > span { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.h-f .input { height: 36px; padding: 6px 10px; font-size: 13.5px; border-radius: 10px; }
.h-qw { position: relative; }
.h-qw svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.h-qw .input { padding-left: 32px; }
.h-chips { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.h-chips::-webkit-scrollbar { display: none; }
.h-chips button { flex: none; padding: 4px 11px; font-size: 12.5px; font-weight: 600; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.h-chips button:hover { border-color: var(--faint); }
.h-chips button.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.h-res { overflow: hidden; }
.h-head { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.h-head b { font-size: 14.5px; }
.h-head span { font-size: 12.5px; color: var(--muted); }
.h-note { padding: 14px 16px; color: var(--muted); font-size: 13px; }
.t.hist { font-size: 13px; }
.t.hist th { padding: 8px 12px; font-size: 10.5px; }
.t.hist td { padding: 8px 12px; }
.t.hist th.num, .t.hist td.num { text-align: right; white-space: nowrap; }
.t.hist td small { display: block; font-size: 11.5px; color: var(--muted); }
.t.hist .h-when { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.t.hist .c-main { font-weight: 600; color: var(--ink); white-space: nowrap; }
.t.hist .c-main .badge { margin-left: 4px; }
.t.hist .h-who { white-space: nowrap; color: var(--ink-2); }
.t.hist .c-det { color: var(--muted); font-size: 12.5px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t.hist .h-dash { color: var(--faint); }
.t.hist tr.h-void > td { opacity: .5; }
.t.hist .m-only { display: none; }
@media (max-width: 1100px) {
  .h-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .h-q { grid-column: span 3; }
}
@media (max-width: 760px) {
  .h-top { gap: 8px; }
  .h-src { width: 100%; }
  .h-src button { flex: 1; justify-content: center; padding: 7px 8px; }
  .h-dl { margin-left: 0; width: 100%; }
  .h-dl .btn { flex: 1; justify-content: center; }
  .h-grid { grid-template-columns: 1fr 1fr; }
  .h-q { grid-column: 1 / -1; order: -1; }
  .h-filters { padding: 10px 12px; }
  .t.hist thead { display: none; }
  .t.hist, .t.hist tbody { display: block; width: 100%; }
  .t.hist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amt" "meta badge" "det det"; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .t.hist td { padding: 0; border: 0; text-align: left; min-width: 0; }
  .t.hist .d-only { display: none; }
  .t.hist .m-only { display: block; }
  .t.hist .c-main { grid-area: main; white-space: normal; font-size: 14px; }
  .t.hist .c-amt { grid-area: amt; text-align: right; font-weight: 600; }
  .t.hist .c-meta { grid-area: meta; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t.hist .c-badge { grid-area: badge; justify-self: end; align-self: center; }
  .t.hist .c-det { grid-area: det; max-width: none; font-size: 12px; }
  .t.hist .h-wm { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12.5px; }
  .t.hist .c-badge .badge { font-size: 11px; }
}
/* Historial de la cajera: sin selector de caja ni de usuario */
.h-grid.h-mine { grid-template-columns: 1fr 1fr 1fr 2fr; }
.t.hist.h-mine .h-cash { display: none; }
@media (max-width: 1100px) { .h-grid.h-mine { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .h-grid.h-mine { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------------------
   Pantalla de carga inicial (index.html) y carga de sección (app.js)
   --------------------------------------------------------------------------- */
.splash { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; overflow: hidden; padding: 24px 16px; background: var(--bg); }
.splash::before, .splash::after { content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; animation: splash-drift 12s ease-in-out infinite alternate; }
.splash::before { width: 520px; height: 520px; left: -140px; top: -160px; background: radial-gradient(circle, var(--brand-glow), transparent 70%); }
.splash::after { width: 460px; height: 460px; right: -120px; bottom: -150px; background: radial-gradient(circle, rgba(185, 138, 62, .16), transparent 70%); animation-delay: -6s; }
.splash-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; animation: splash-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.splash-mark { position: relative; width: 132px; height: 132px; display: grid; place-items: center; margin-bottom: 26px; }
.splash-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: splash-spin 1.6s linear infinite; }
.splash-mark .track { stroke: var(--line); }
.splash-mark .arc { stroke: url(#splash-grad); stroke-linecap: round; stroke-dasharray: 90 290; }
.splash-logo { width: 96px; height: 96px; border-radius: 26px; background: #fff; display: grid; place-items: center; box-shadow: 0 18px 40px -18px rgba(13, 122, 104, .45), 0 0 0 1px var(--line); animation: splash-breathe 2.4s ease-in-out infinite; }
.splash-logo img { width: 88px; height: 88px; object-fit: contain; }
.splash-title { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 6vw, 36px); letter-spacing: -.02em; line-height: 1.05; color: var(--ink); margin: 0; }
.splash-title b { font-weight: 600; color: var(--brand); }
.splash-sub { margin: 8px 0 26px; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.splash-bar { width: min(220px, 70vw); height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; }
.splash-bar i { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); animation: splash-bar 1.4s cubic-bezier(.65, 0, .35, 1) infinite; }
.splash-status { margin-top: 14px; font-size: 13px; color: var(--muted); min-height: 20px; display: inline-flex; align-items: center; gap: 8px; }
.splash-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 0 var(--brand-glow); animation: splash-pulse 1.6s ease-out infinite; }
.splash-foot { position: absolute; bottom: 22px; left: 0; right: 0; z-index: 1; text-align: center; font-size: 12px; color: var(--faint, var(--muted)); display: flex; justify-content: center; align-items: center; gap: 6px; }
.splash-foot svg { width: 13px; height: 13px; }

/* carga de una sección dentro de la app */
.page-loading { display: grid; gap: 16px; padding: 8px 0 40px; animation: splash-in .4s ease both; }
.page-loading .pl-head { display: grid; gap: 10px; margin-bottom: 8px; }
.page-loading .pl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.page-loading .pl-card { height: 120px; border-radius: 18px; }
.page-loading .pl-wide { height: 260px; border-radius: 18px; }

@keyframes splash-spin { to { transform: rotate(360deg); } }
@keyframes splash-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes splash-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes splash-bar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes splash-pulse { 0% { box-shadow: 0 0 0 0 var(--brand-glow); } 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes splash-drift { from { transform: translate(0, 0); } to { transform: translate(40px, 30px); } }
@media (prefers-reduced-motion: reduce) {
  .splash::before, .splash::after, .splash-mark svg, .splash-logo, .splash-bar i, .splash-status::before, .splash-inner, .page-loading { animation: none !important; }
  .splash-bar i { width: 100%; opacity: .5; }
}

/* ---------------------------------------------------------------------------
   Perfiles de operador (cuenta Reference compartida) · «Qui êtes-vous ?»
   --------------------------------------------------------------------------- */
.op-screen { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 16px; overflow: hidden;
  background: radial-gradient(1200px 600px at 15% -10%, #1f4a6e 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #0d5c50 0%, transparent 55%), var(--navy); }
.op-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--brand-2); filter: blur(140px); opacity: .18; top: 50%; left: 50%; transform: translate(-50%, -60%); pointer-events: none; animation: op-breathe 9s ease-in-out infinite; }
@keyframes op-breathe { 50% { opacity: .28; transform: translate(-50%, -55%) scale(1.08); } }
.op-card { position: relative; width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--r-xl); padding: 32px clamp(20px, 5vw, 44px) 36px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04); animation: op-in .45s cubic-bezier(.2,.8,.2,1); }
@keyframes op-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.op-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.op-brand .plate { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; display: flex; }
.op-brand img { height: 26px; }
.op-brand span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); font-weight: 600; }
.op-card h1 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.015em; margin: 0 0 6px; color: var(--ink); }
.op-sub { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.op-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; text-align: center; font: inherit; color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.op-tile:hover, .op-tile:focus-visible { transform: translateY(-3px); border-color: var(--brand-2); box-shadow: 0 14px 30px -16px var(--brand-glow), 0 0 0 4px var(--brand-glow); outline: none; }
.op-tile b { font-weight: 600; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-tile span { font-size: 12.5px; color: var(--muted); }
.op-tile small { font-size: 11.5px; color: var(--faint); }
.op-tile.add { border-style: dashed; background: transparent; }
.op-av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 22px; letter-spacing: .02em; margin-bottom: 6px;
  background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); box-shadow: 0 10px 24px -10px var(--c), inset 0 1px 0 rgba(255,255,255,.25); }
.op-av.big { width: 88px; height: 88px; font-size: 30px; margin: 0 auto 14px; }
.op-av.add { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.op-skel { height: 168px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: op-sk 1.2s infinite; }
@keyframes op-sk { to { background-position: -200% 0; } }
.op-center { text-align: center; max-width: 340px; margin: 0 auto; }
.op-dots { display: flex; justify-content: center; gap: 16px; margin: 6px 0 8px; }
.op-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); transition: background .15s, border-color .15s, transform .15s; }
.op-dots span.on { background: var(--brand); border-color: var(--brand); transform: scale(1.1); }
.op-dots.shake { animation: op-shake .42s; }
.op-dots.shake span { border-color: var(--neg); }
@keyframes op-shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.op-err { min-height: 20px; color: var(--neg); font-size: 13.5px; margin: 6px 0 10px; text-align: center; }
.op-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 290px; margin: 6px auto 0; }
.op-pad button { height: 64px; border-radius: 50%; aspect-ratio: 1; justify-self: center; width: 64px; border: 1px solid var(--line); background: var(--surface-2); font: 500 24px var(--display, inherit); color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: background .12s, transform .08s; }
.op-pad button:hover { background: var(--brand-soft); border-color: var(--brand-soft); }
.op-pad button:active { transform: scale(.94); background: var(--brand); color: #fff; }
.op-pad button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.op-form { display: grid; gap: 16px; }
.op-form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.op-form .input { height: 50px; font-size: 16px; }
.op-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.op-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.op-steps span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.op-steps span.on { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-glow); }
.op-steps span.done { background: var(--brand-soft); color: var(--brand); }
.op-steps i { flex: 0 0 26px; height: 2px; background: var(--line); border-radius: 2px; }
.op-signout { position: relative; background: none; border: 0; color: #9fb0c2; font: inherit; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; }
.op-signout:hover { color: #fff; background: rgba(255,255,255,.06); }
.op-signout svg { width: 16px; height: 16px; }
.me .op-switch { margin-left: auto; color: #9fb0c2; }
@media (max-width: 480px) {
  .op-card { padding: 26px 18px 28px; border-radius: 22px; }
  .op-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .op-pad button { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) { .op-card, .op-glow, .op-dots.shake { animation: none; } .op-tile { transition: none; } }

/* ---------------------------------------------------------------------------
   Personal (RR. HH.) · fichas y expediente
   --------------------------------------------------------------------------- */
.hr-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0 16px; }
.hr-bar .input { flex: 1 1 240px; max-width: 360px; margin-left: auto; }
.hr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hr-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-align: left; font: inherit; color: var(--ink); cursor: pointer; box-shadow: var(--sh-1); transition: transform .15s, box-shadow .15s, border-color .15s; }
.hr-card:hover, .hr-card:focus-visible { transform: translateY(-2px); border-color: var(--brand-2); box-shadow: var(--sh-2); outline: none; }
.hr-card.off { opacity: .55; }
.hr-card > svg { margin-left: auto; color: var(--faint); flex: none; }
.hr-main { min-width: 0; display: grid; gap: 3px; }
.hr-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-main > span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.hr-tags .badge svg { width: 12px; height: 12px; }
.hr-av { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; overflow: hidden;
  background: linear-gradient(140deg, var(--c, #0f7a5a), color-mix(in srgb, var(--c, #0f7a5a) 60%, #000)); }
.hr-av.photo { background: var(--surface-3); }
.hr-av img { width: 100%; height: 100%; object-fit: cover; }
.hr-av.big { width: 96px; height: 96px; font-size: 32px; }
.hr-ref { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 14px 14px 0; margin-bottom: 18px; background: var(--surface-2); }
.hr-ref-h { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; color: var(--brand); }
.hr-ref-h b { display: block; color: var(--ink); }
.hr-ref-h span { font-size: 12.5px; color: var(--muted); }
.hr-modal .modal-b { padding-top: 6px; }
.hr-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.hr-head-t { flex: 1 1 260px; display: grid; gap: 6px; }
.hr-head-t h2 { font-family: var(--display); font-weight: 500; font-size: 26px; margin: 0; }
.hr-head-a { display: flex; flex-wrap: wrap; gap: 8px; }
.hr-photo-btn { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.hr-photo-cam { position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; border: 3px solid var(--surface); }
.hr-photo-cam svg { width: 14px; height: 14px; }
.hr-vac { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.hr-vac > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 2px; }
.hr-vac span { font-size: 11.5px; color: var(--muted); }
.hr-vac b { font-size: 18px; font-weight: 600; }
.hr-vac .pos b { color: var(--pos); } .hr-vac .neg b { color: var(--neg); }
.hr-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.hr-cols.two { grid-template-columns: 1fr 1fr; }
.hr-sec { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--surface); min-width: 0; }
.hr-sec h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.hr-sec h4 svg { width: 16px; height: 16px; }
.hr-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.hr-kv:last-child { border-bottom: 0; }
.hr-kv span { color: var(--muted); flex: none; }
.hr-kv b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.hr-kv b.neg { color: var(--neg); }
.hr-notes { white-space: pre-wrap; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.hr-doc { margin-top: 10px; display: grid; gap: 8px; }
.hr-doc img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.hr-doc .faint { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 10px; justify-content: center; }
.hr-doc-a { display: flex; gap: 6px; }
.hr-timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.hr-timeline li { position: relative; }
.hr-timeline li.voided { opacity: .5; }
.hr-timeline li.voided p { text-decoration: line-through; }
.hr-dot { position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); border: 2px solid var(--surface); }
.hr-dot.info { background: var(--info); } .hr-dot.warn { background: var(--warn); } .hr-dot.neg { background: var(--neg); } .hr-dot.pos { background: var(--pos); }
.hr-w-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hr-timeline p { margin: 4px 0 0; font-size: 13.5px; }
@media (max-width: 900px) { .hr-cols, .hr-cols.two { grid-template-columns: 1fr; } .hr-vac { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .hr-grid { grid-template-columns: 1fr; } .hr-bar .input { max-width: none; margin-left: 0; } }

/* Reference · modo invitado (solo lectura) */
.op-guest { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 16px; padding: 14px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: transparent; font: inherit; color: var(--ink-2); text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.op-guest:hover { background: var(--surface-2); border-color: var(--line-2); }
.op-guest span { display: grid; gap: 2px; flex: 1; }
.op-guest b { font-weight: 600; color: var(--ink); }
.op-guest small { font-size: 12.5px; color: var(--muted); }
.op-guest > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.guest-chip { background: var(--warn-soft) !important; color: var(--warn) !important; border-color: transparent !important; cursor: pointer; font: inherit; }
.ref-guest [data-act="deposit"], .ref-guest [data-act="order"], .ref-guest [data-validate], .ref-guest [data-confirm], .ref-guest .chat-input { display: none !important; }

/* Envío Gabón · «Orden creada con éxito» */
.gx-modal .modal-h { display: none; }
.gx-ok { display: grid; gap: 16px; }
.gx-top { text-align: center; display: grid; justify-items: center; gap: 6px; padding-top: 6px; }
.gx-logo { height: 44px; margin-bottom: 6px; }
.gx-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--brand-2), var(--brand)); box-shadow: 0 0 0 8px var(--brand-glow); animation: gx-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.gx-check svg { width: 34px; height: 34px; stroke-width: 3; }
@keyframes gx-pop { from { transform: scale(.3); opacity: 0; } }
.gx-top h2 { font-family: var(--display); font-weight: 500; font-size: 26px; margin: 8px 0 0; }
.gx-top p { margin: 0; color: var(--muted); font-size: 13.5px; }
.gx-q { color: var(--warn); font-weight: 600; }
.gx-rows { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gx-rows > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.gx-rows > div:last-child { border-bottom: 0; }
.gx-rows span { color: var(--muted); }
.gx-rows b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.gx-rows .gx-total { background: var(--brand-soft); }
.gx-rows .gx-total b { font-size: 18px; color: var(--brand-ink); }
.gx-msg { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--gold-soft); color: var(--ink); }
.gx-msg.wu { background: var(--pos-soft); }
.gx-msg > svg { flex: none; width: 22px; height: 22px; color: var(--brand); margin-top: 2px; }
.gx-msg p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.gx-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; }
.gx-contact svg { width: 14px; height: 14px; }
.gx-contact a { color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.gx-print { display: none; }
@media print { .gx-print { display: block !important; } }
@media (prefers-reduced-motion: reduce) { .gx-check { animation: none; } }

.gx-logo.ref { height: 96px; width: auto; border-radius: 12px; }

/* logo de La Référence (vertical) */
.op-brand .op-ref-logo { height: 72px; width: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 4px; }
.side-brand .plate.ref img { height: 96px; width: auto; object-fit: contain; }

/* Envío Gabón · agenda de contactos (administración) */
.gx-book { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 16px; background: var(--surface-2); }
.gx-book-s { display: flex; align-items: center; gap: 8px; }
.gx-book-s > svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.gx-book-s .input { height: 42px; }
.gx-book-l { display: grid; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.gx-book-e { font-size: 13px; color: var(--muted); padding: 6px 4px; }
.gx-c { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.gx-c:hover, .gx-c:focus-visible { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-glow); outline: none; }
.gx-c-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; text-transform: uppercase; flex: none; }
.gx-c-t { display: grid; min-width: 0; flex: 1; }
.gx-c-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-c-t small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------------------
   Tienda · punto de venta y factura
   --------------------------------------------------------------------------- */
.modal.pos-modal { max-width: 1080px; }
.pos-wrap { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.45fr); gap: 18px; }
.pos-cat, .pos-cart { min-width: 0; }
.pos-search { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pos-search > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pos-list { display: grid; gap: 6px; max-height: 430px; overflow-y: auto; padding-right: 2px; }
.pos-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s; }
.pos-item:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.pos-item-t { display: grid; flex: 1; min-width: 0; }
.pos-item-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-item-t small { color: var(--muted); font-size: 12px; }
.pos-item-p { font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-item > svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.pos-empty { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 13.5px; padding: 22px 10px; border: 1px dashed var(--line-2); border-radius: 12px; }
.pos-cart h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.pos-cart h4 svg { width: 16px; height: 16px; }
#pos-lines { display: grid; gap: 8px; }
.pos-line { display: grid; grid-template-columns: 1fr auto 120px 92px auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pos-line-t { display: grid; min-width: 0; }
.pos-line-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-line-t small { color: var(--muted); font-size: 12px; }
.pos-qty { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.pos-qty button { width: 32px; height: 36px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.pos-qty button:hover { background: var(--brand-soft); }
.pos-qty button svg { width: 15px; height: 15px; }
.pos-qty .input { width: 46px; height: 36px; border: 0; border-radius: 0; text-align: center; padding: 0; -moz-appearance: textfield; }
.pos-qty .input::-webkit-inner-spin-button { -webkit-appearance: none; }
.pos-price { display: grid; gap: 2px; font-size: 11px; color: var(--muted); }
.pos-price .input { height: 38px; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; color: var(--ink); }
.pos-price .input.changed { border-color: var(--warn); background: var(--warn-soft); }
.pos-line-total { text-align: right; font-variant-numeric: tabular-nums; }
.pos-client { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.pos-client label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.pos-client label.full { grid-column: 1 / -1; }
.pos-totals { border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; margin-top: 10px; display: grid; gap: 4px; }
.pos-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; min-width: 0; }
.pos-totals span, .pos-totals b { white-space: nowrap; }
.pos-totals > div > b { margin-left: auto; text-align: right; }
.pos-totals span { color: var(--muted); }
.pos-totals .grand { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.pos-totals .grand span { color: var(--ink); font-weight: 600; }
.pos-totals .grand b { font-size: 22px; color: var(--brand-ink); }
.pos-war { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brand) !important; justify-content: flex-start !important; }
.pos-war svg { width: 15px; height: 15px; }
@media (max-width: 760px) {
  .pos-wrap { grid-template-columns: 1fr; }
  .pos-list { max-height: 220px; }
  .pos-line { grid-template-columns: 1fr auto; }
  .pos-line-t { grid-column: 1 / -1; }
  .pos-price, .pos-line-total { grid-column: auto; }
  .pos-client { grid-template-columns: 1fr; }
}
tr.click { cursor: pointer; }
/* factura */
.modal.inv-modal { max-width: 860px; }
.invoice { background: #fff; color: #12233A; border: 1px solid var(--line); border-radius: 14px; padding: 28px 30px; font-size: 13.5px; }
.inv-h { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 16px; border-bottom: 3px solid #0D7A68; }
.inv-brand { display: flex; gap: 12px; align-items: center; }
.inv-brand img { height: 54px; }
.inv-brand div { display: grid; gap: 2px; }
.inv-brand b { font-size: 15px; }
.inv-brand span { font-size: 12px; color: #6E7882; }
.inv-title { text-align: right; display: grid; gap: 3px; }
.inv-title h2 { margin: 0; font-size: 28px; letter-spacing: .08em; color: #0D7A68; font-family: var(--display); }
.inv-no { font-family: var(--mono, monospace); font-weight: 700; font-size: 14px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.inv-parties > div { background: #F4F7F6; border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; }
.inv-k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6E7882; font-weight: 700; }
.inv-parties b { font-size: 15px; }
.inv-parties span { color: #4a5563; }
.inv-t { width: 100%; border-collapse: collapse; }
.inv-t th { background: #0D7A68; color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 9px 10px; text-align: left; }
.inv-t th.r, .inv-t td.r { text-align: right; }
.inv-t td { padding: 10px; border-bottom: 1px solid #EAE5DA; vertical-align: top; font-variant-numeric: tabular-nums; }
.inv-sku { font-size: 11.5px; color: #8a93a0; }
.inv-sum { margin: 14px 0 0 auto; max-width: 320px; display: grid; gap: 4px; }
.inv-sum > div { display: flex; justify-content: space-between; gap: 12px; }
.inv-sum span { color: #6E7882; }
.inv-grand { background: #E2F2EC; border-radius: 10px; padding: 10px 12px; margin-top: 4px; }
.inv-grand span { color: #0D7A68 !important; font-weight: 700; letter-spacing: .05em; }
.inv-grand b { font-size: 20px; }
.inv-war { border: 1.5px solid #0D7A68; border-radius: 12px; padding: 12px 16px; margin-top: 20px; }
.inv-war-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #0D7A68; }
.inv-war-h svg { width: 18px; height: 18px; }
.inv-war-h b { font-size: 14.5px; }
.inv-war-h span { margin-left: auto; color: #12233A; }
.inv-war p { margin: 8px 0 0; color: #5b6573; font-size: 12.5px; line-height: 1.5; }
.inv-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 44px; }
.inv-sign div { text-align: center; color: #6E7882; font-size: 12px; }
.inv-sign i { display: block; border-top: 1px solid #9aa3ad; margin-bottom: 6px; }
.inv-f { text-align: center; color: #8a93a0; font-size: 11.5px; margin-top: 22px; padding-top: 12px; border-top: 1px dashed #DAD3C3; }
@media (max-width: 560px) {
  .invoice { padding: 18px 12px; font-size: 12.5px; }
  .inv-h { flex-direction: column; } .inv-title { text-align: left; } .inv-parties { grid-template-columns: 1fr; }
  .inv-t { table-layout: fixed; } .inv-t th { font-size: 10px; padding: 7px 5px; letter-spacing: 0; } .inv-t td { padding: 8px 5px; }
  .inv-t th:first-child { width: 40%; } .inv-t th:nth-child(2) { width: 13%; }
  .inv-sign { gap: 18px; }
}
@media print {
  body.printing-invoice * { visibility: hidden !important; }
  body.printing-invoice .invoice, body.printing-invoice .invoice * { visibility: visible !important; }
  body.printing-invoice .invoice { position: fixed; left: 0; top: 0; width: 100%; border: 0; border-radius: 0; padding: 10mm 12mm; }
}

/* Tienda · fotos de productos */
.shop-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 14px; }
.shop-bar .input { flex: 1 1 240px; max-width: 380px; }
.shop-bar .seg { margin-left: auto; }
.shop-bar .seg button svg { width: 15px; height: 15px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.prod-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); transition: transform .15s, box-shadow .15s; }
.prod-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.prod-card.off { opacity: .5; }
.prod-info { padding: 10px 12px 4px; display: grid; gap: 2px; min-width: 0; }
.prod-info > b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-info > span { font-size: 11.5px; color: var(--muted); min-height: 14px; }
.prod-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.prod-meta b { font-size: 15px; color: var(--brand-ink); }
.prod-act { display: flex; gap: 6px; padding: 8px 12px 12px; margin-top: auto; }
.prod-act .btn.primary { flex: 1; justify-content: center; }
.prod-ph { border: 0; padding: 0; background: var(--surface-3); display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--faint); width: 44px; height: 44px; border-radius: 10px; flex: none; }
.prod-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-ph svg { width: 20px; height: 20px; }
.prod-ph.big { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 0; background: #fff; border-bottom: 1px solid var(--line); }
.prod-ph.big img { object-fit: contain; padding: 8px; }
.prod-ph.big.empty { background: var(--surface-2); }
.prod-ph.big svg { width: 34px; height: 34px; }
.prod-ph.empty:hover { color: var(--brand); background: var(--brand-soft); }
.prod-row { display: flex; align-items: center; gap: 12px; }
.pos-ph { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex: none; background: #fff; border: 1px solid var(--line); }
.pos-ph.empty { display: grid; place-items: center; color: var(--faint); background: var(--surface-2); }
.pos-ph.empty svg { width: 18px; height: 18px; }
.pos-line-n { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos-line-n > small, .pos-line-t small { display: block; }
@media (max-width: 480px) { .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .shop-bar .seg { margin-left: 0; } }
.prod-meta { flex-wrap: wrap; gap: 4px 8px; }
.prod-meta b { white-space: nowrap; }
.prod-info > b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; min-height: 2.5em; }

.shortfall-card { border-color: var(--neg); box-shadow: 0 0 0 3px var(--neg-soft); }
.shortfall-card h3 { display: flex; align-items: center; gap: 8px; color: var(--neg); }
.shortfall-card h3 svg { width: 18px; height: 18px; }

/* filtro por mes (órdenes del agente) */
.month-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.month-bar > svg { width: 18px; height: 18px; color: var(--brand); }
.month-bar .input { width: auto; padding: 6px 10px; height: 38px; }
.month-bar .right { margin-left: auto; display: flex; gap: 6px; }

/* Alarma de órdenes de plataforma (cajeras) */
.plat-alarm { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; width: min(680px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #B4231A; color: #fff; box-shadow: 0 18px 40px -12px rgba(180, 35, 26, .6); animation: pa-pulse 1.6s ease-in-out infinite; }
.plat-alarm.hidden { display: none; }
.pa-ico { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.pa-ico svg { width: 22px; height: 22px; animation: pa-shake .8s ease-in-out infinite; }
.pa-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pa-t b { font-size: 14.5px; }
.pa-t span { font-size: 12.5px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-t .pa-warn { background: rgba(255,255,255,.2); border-radius: 8px; padding: 2px 8px; width: fit-content; font-weight: 600; }
.pa-a { display: flex; gap: 6px; align-items: center; flex: none; }
.pa-a .btn { background: #fff; color: #B4231A; border-color: #fff; }
.pa-a .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.pa-snz { font-size: 12px; opacity: .85; }
@keyframes pa-pulse { 50% { box-shadow: 0 18px 50px -8px rgba(180, 35, 26, .9); } }
@keyframes pa-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@media (max-width: 520px) { .plat-alarm { flex-wrap: wrap; bottom: 10px; } .pa-a { width: 100%; justify-content: flex-end; } }
@media (prefers-reduced-motion: reduce) { .plat-alarm, .pa-ico svg { animation: none; } }

/* presupuestos de la gestora: códigos parciales */
.budget-card .bud-codes { display: grid; gap: 6px; margin-top: 10px; }
.bud-code { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; text-align: left; }
.bud-code:hover { border-color: var(--brand-2); }
.bud-code .mono { font-weight: 700; letter-spacing: .08em; }
.bud-code b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* descripción del producto */
.prod-desc { margin: 4px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-desc-l { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* factura: foto y descripción por línea */
.inv-prod { display: flex; gap: 10px; align-items: flex-start; }
.inv-ph { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; border: 1px solid #EAE5DA; background: #fff; flex: none; }
.inv-desc { font-size: 11.5px; color: #6E7882; margin-top: 2px; line-height: 1.35; max-width: 380px; }
@media (max-width: 560px) { .inv-ph { width: 34px; height: 34px; } }

/* Arqueo por billetaje */
.t.bills td, .t.bills th { padding: 6px 8px; }
.t.bills input { width: 100%; max-width: 110px; margin-left: auto; display: block; }
.t.bills tr.tot td, .arqueo .t.bills tbody tr:nth-last-child(3) td { border-top: 2px solid var(--line-2); }
@media (max-width: 560px) { .t.bills td, .t.bills th { padding: 5px 4px; font-size: 13px; } .t.bills input { padding: 5px 6px !important; } }

/* Presupuestos de ingreso en cuenta: lista compacta y adaptable */
.bud-list { display: flex; flex-direction: column; }
.bud { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) auto; gap: 8px 18px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.bud:first-child { border-top: 0; }
.bud.cancelled { opacity: .6; }
.bud-who { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bud-name { font-weight: 600; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.bud-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.bud-ref { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bud-money { min-width: 0; }
.bud-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bud-nums span { display: flex; flex-direction: column; min-width: 0; }
.bud-nums small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bud-nums b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bud-bar { height: 5px; border-radius: 5px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bud-bar i { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.bud-act { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
@media (max-width: 1100px) { .bud { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } .bud-act { grid-column: 1 / -1; justify-content: flex-start; } }
@media (max-width: 640px) {
  .bud { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .bud-act .btn { flex: 1; justify-content: center; }
}

/* Cuentas de la empresa: lista de tarjetas por caducar dentro del aviso */
.card-warn { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.card-warn li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-warn li .btn { margin-left: auto; }

/* Venta a crédito (pago parcial) */
.pos-pay { margin: 10px 0 4px; display: grid; gap: 8px; }
.pos-pay-k { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pos-pay .seg button { display: inline-flex; align-items: center; gap: 6px; }
.pos-pay .seg button svg { width: 15px; height: 15px; }
.pos-pay .pos-client { margin: 2px 0 0; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); }
.pos-pay .pos-client[hidden] { display: none; }
.pos-credit-hint { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.pos-credit-hint svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.pos-totals .owe { border-top: 1px dashed var(--line); padding-top: 6px; }
.pos-totals .owe span { color: var(--ink); font-weight: 600; }
.pos-totals .owe b { font-size: 18px; }
.inv-grand.owe { background: #FBEAE6; }
.inv-grand.owe span { color: #C0392B !important; }
@media (max-width: 560px) { .pos-pay .seg { display: grid; grid-template-columns: 1fr; } .pos-pay .pos-client { grid-template-columns: 1fr; } }

/* Deudas: ventas a plazos y progreso de pagos */
.debt-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.debt-bar .tabs { border-bottom: 0; }
.debt-bar .seg.period button { display: inline-flex; align-items: center; gap: 5px; }
.debt-bar .seg.period svg { width: 14px; height: 14px; }
.debts-t .nowrap { white-space: nowrap; }
.debts-t .badge svg { width: 12px; height: 12px; vertical-align: -1px; }
.debt-items { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-prog { height: 4px; border-radius: 4px; background: var(--line); margin-top: 4px; overflow: hidden; min-width: 50px; }
.debt-prog i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
@media (max-width: 760px) { .debt-bar { border-bottom: 0; } .debt-bar .seg.period { width: 100%; } .debt-bar .seg.period button { flex: 1; justify-content: center; } }

/* Reference · Mes ordres : modifier / annuler */
.ref-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ref-mine td:last-child { white-space: nowrap; }
@media (max-width: 760px) { .ref-mine td:last-child { white-space: normal; } .ref-acts { justify-content: flex-start; } }
