/* Anotta · estilos. Verde de marca para la interfaz; azul y naranja quedan para los datos. */
:root {
  color-scheme: light;
  --bg: #e4f0eb;
  --surface: #fcfcfb;
  --surface-2: #eef6f2;
  --ink: #10201b;
  --ink-2: #425851;
  --ink-3: #5d736b;
  --line: #cfdfd7;
  --line-2: #e3eee8;
  --btn: #08795a;
  --btn-ink: #ffffff;
  --brand: #08795a;
  --brand-2: #14c79a;
  --brand-ink: #04231b;
  --soft: #d3f0e4;
  --deep: #0a2f27;
  --deep-2: #0e4a3c;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #6250d6;
  --mark-neutral: #8a9099;
  --mark-baja: #c3c7cd;
  --ok: #0a6b0a;
  --warn-bg: #fff1d6;
  --warn-ink: #7a4b00;
  --bad: #b3261e;
  --bad-bg: #fde8e6;
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(10, 47, 39, .07), 0 6px 20px rgba(10, 47, 39, .07);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0a1210; --surface: #1a1a19; --surface-2: #232826; --ink: #eef3f0; --ink-2: #bccac3; --ink-3: #8fa39a;
    --line: #2d3a35; --line-2: #25302c; --btn: #19c295; --btn-ink: #04231b; --brand: #19c295; --brand-2: #19c295; --soft: #12392f;
    --deep: #07201a; --deep-2: #0b3329;
    --s1: #3987e5; --s2: #d95926; --s3: #9085e9; --mark-neutral: #8d9199; --mark-baja: #4a4c50;
    --ok: #4cc24c; --warn-bg: #3a2c0d; --warn-ink: #f3c56b; --bad: #ff8b83; --bad-bg: #3d1f1d; --focus: #6da7ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1210; --surface: #1a1a19; --surface-2: #232826; --ink: #eef3f0; --ink-2: #bccac3; --ink-3: #8fa39a;
  --line: #2d3a35; --line-2: #25302c; --btn: #19c295; --btn-ink: #04231b; --brand: #19c295; --brand-2: #19c295; --soft: #12392f;
  --deep: #07201a; --deep-2: #0b3329;
  --s1: #3987e5; --s2: #d95926; --s3: #9085e9; --mark-neutral: #8d9199; --mark-baja: #4a4c50;
  --ok: #4cc24c; --warn-bg: #3a2c0d; --warn-ink: #f3c56b; --bad: #ff8b83; --bad-bg: #3d1f1d; --focus: #6da7ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 16px; background: linear-gradient(175deg, var(--deep), var(--deep-2)); color: #e6f4ee; }
.marca { font-size: 22px; font-weight: 700; letter-spacing: -.03em; padding: 0 10px; display: flex; align-items: center; gap: 8px; color: #fff; }
.marca svg.logo { width: 22px; height: 22px; }
.emp { display: grid; gap: 4px; padding: 0 4px; }
.emp label { font-size: 12px; color: rgba(230,244,238,.65); padding-left: 6px; }
.side select, .side .emp .yo { background-color: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); color: #fff; }
.side select option { color: #10201b; background: #fff; }
.side .emp .yo { border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 9px 11px; }
.side .emp .yo b { color: #fff; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: rgba(230,244,238,.8); text-decoration: none; font-weight: 500; }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a[aria-current="page"] { background: var(--brand-2); color: var(--brand-ink); font-weight: 650; }
.side-pie { margin-top: auto; display: grid; gap: 6px; padding: 0 4px; }
.yo { padding: 8px 10px; font-size: 13px; color: rgba(230,244,238,.75); overflow-wrap: anywhere; }
.yo b { display: block; color: #fff; font-weight: 600; }
.side .btn.plano { color: #e6f4ee; }
.side .btn.plano:hover { background: rgba(255,255,255,.12); }
.main { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1240px; width: 100%; }
.cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.cab h1 { font-size: 28px; letter-spacing: -.025em; font-weight: 700; }
.cab .sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 15px; border-radius: 10px; cursor: pointer; font-weight: 550; min-height: 40px; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--soft); }
.btn.pri { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); box-shadow: 0 2px 8px color-mix(in srgb, var(--btn) 35%, transparent); }
.btn.pri:hover { filter: brightness(1.08); background: var(--btn); }
.btn.peligro { color: var(--bad); }
.btn.chico { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn.plano { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 17px; height: 17px; }
.campo { display: grid; gap: 5px; }
.campo > span, .campo > label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.campo small { color: var(--ink-3); font-size: 12px; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 40px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236c727a' stroke-width='2'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 14px; color: var(--ink-2); min-height: 34px; }
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); font-weight: 600; }
.chip:hover { background: var(--soft); }
.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fila-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card { border-top: 3px solid color-mix(in srgb, var(--brand-2) 55%, var(--line)); }
.card > h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.card .nota { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.card-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rejilla { display: grid; gap: 16px; }
.r-hero { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.r-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card.hero { padding: 0; overflow: hidden; }
.hero-banner { padding: 20px 22px 22px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #1fd3a5 0%, transparent 55%), linear-gradient(135deg, #0a4a3b, #0b7c5f); }
.hero-banner .hero-etq, .hero-banner .delta { color: rgba(255,255,255,.88); }
.hero-banner .delta b { color: #fff; }
.hero-banner .hero-num.neg { color: #ffd3cf; }
.hero-cuerpo { padding: 14px 20px 18px; }
.hero-num { font-size: clamp(44px, 6.5vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -.035em; margin: 10px 0 6px; font-variant-numeric: proportional-nums; }
.hero-num.neg { color: var(--bad); }
.hero-etq { color: var(--ink-2); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: var(--surface); }
.tile { position: relative; }
.tile .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 8px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.tile .ic svg { width: 18px; height: 18px; }
.tile .e { font-size: 13px; color: var(--ink-2); }
.tile .v { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; }
.tile .d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.vacio { background: transparent; }
.leyenda { list-style: none; display: flex; gap: 16px; padding: 0; margin: 0; font-size: 13px; color: var(--ink-2); }
.leyenda li { display: flex; align-items: center; gap: 6px; }
.vista-alt { background: none; border: 0; color: var(--ink-2); font-size: 13px; cursor: pointer; padding: 4px 8px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
.vista-alt:hover { color: var(--ink); }

/* ---------- gráficos ---------- */
.chart { display: block; max-width: 100%; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .conector { stroke: var(--ink-3); stroke-width: 1; opacity: .5; }
.chart .tick { fill: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chart .val.fuerte, .chart .cat.fuerte { fill: var(--ink); font-weight: 650; }
.chart .cat { fill: var(--ink-2); font-size: 12.5px; }
.chart .mk-baja { fill: var(--mark-baja); }
.chart .mk.on { filter: brightness(1.12); }
.chart .hit { cursor: default; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 13px; max-width: 250px; }
.tip-t { font-weight: 650; margin-bottom: 5px; }
.tip-r { display: grid; grid-template-columns: 10px 1fr auto; gap: 7px; align-items: baseline; color: var(--ink-2); line-height: 1.5; }
.tip-r b { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; grid-column: 3; }
.tip-r span { grid-column: 2; }
.tip-r span:only-of-type { grid-column: 2 / 4; }

/* ---------- tablas ---------- */
.tabla-w { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 550; color: var(--ink-3); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th.d, td.d { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.anulada td { color: var(--ink-3); }
tr.anulada td .tachar { text-decoration: line-through; }
tbody tr.clic { cursor: pointer; }
tbody tr.clic:hover td { background: var(--surface-2); }
.sub-fila td { background: var(--surface-2); padding: 12px 14px; }
.etq { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.etq.aviso { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.etq.mal { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.etq svg { width: 13px; height: 13px; }
.vacio-c { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.vacio-c b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.lista li:last-child { border-bottom: 0; }
.barra-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.barra-tools .campo { min-width: 150px; }
.barra-tools input[type="search"] { min-width: 220px; }

/* ---------- inventario ---------- */
.prod { border-top: 1px solid var(--line-2); }
.prod:first-child { border-top: 0; }
.prod-cab { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; text-align: left; padding: 13px 4px; cursor: pointer; }
.prod-cab:hover { background: var(--surface-2); }
.prod-cab .n { flex: 1; min-width: 0; }
.prod-cab .n b { font-weight: 600; }
.prod-cab .n span { color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.prod-cab > svg { width: 16px; height: 16px; transition: transform .15s; color: var(--ink-3); }
.prod-cab[aria-expanded="true"] > svg { transform: rotate(90deg); }
.vars { padding: 0 4px 14px 4px; }
.talla-g { display: flex; flex-wrap: wrap; gap: 8px; }
.talla { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; min-width: 64px; text-align: center; background: var(--surface); cursor: default; }
.talla .t { font-weight: 650; }
.talla .c { font-size: 11.5px; color: var(--ink-3); }
.talla .s { font-size: 14px; font-variant-numeric: tabular-nums; }
.talla.bajo { border-color: var(--warn-ink); background: var(--warn-bg); }
.talla.cero { border-style: dashed; color: var(--ink-3); }
button.talla { cursor: pointer; }
button.talla:hover { border-color: var(--ink); }

/* ---------- ventana ---------- */
.velo { position: fixed; inset: 0; z-index: 70; background: rgba(10, 12, 14, .5); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; width: min(640px, 100%); max-height: min(92vh, 900px); overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,.35); border: 1px solid var(--line); }
.modal-cab { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-cab h2 { font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.modal-cuerpo { padding: 8px 22px 18px; display: grid; gap: 14px; }
.modal-pie { padding: 12px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.modal-pie .total { margin-right: auto; align-self: center; font-size: 14px; color: var(--ink-2); }
.modal-pie .total b { color: var(--ink); font-size: 17px; }
.items { display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 1fr 74px 120px 32px; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.item .nom { font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.item .nom small { display: block; color: var(--ink-3); font-weight: 400; }
.item input { min-height: 36px; padding: 6px 9px; }
.item.reventa { grid-template-columns: 1fr 1fr; }
.resultados { border: 1px solid var(--line); border-radius: 12px; max-height: 220px; overflow: auto; }
.resultados button { display: flex; width: 100%; justify-content: space-between; gap: 12px; text-align: left; background: none; border: 0; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.resultados button:last-child { border-bottom: 0; }
.resultados button:hover, .resultados button:focus-visible { background: var(--surface-2); }
.resultados .st { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.ayuda { color: var(--ink-3); font-size: 13px; }

/* ---------- aviso ---------- */
.toasts { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); }
.toast { background: var(--btn); color: var(--btn-ink); border-radius: 12px; padding: 11px 15px; box-shadow: 0 8px 28px rgba(0,0,0,.3); font-weight: 500; display: flex; gap: 10px; align-items: center; }
.toast.mal { background: var(--bad); color: #fff; }
.toast svg { width: 18px; height: 18px; flex: none; }

/* ---------- entrada ---------- */
.entrada { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.entrada-lado { padding: clamp(28px, 6vw, 72px); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; background: radial-gradient(90% 70% at 100% 0%, #1fd3a5 0%, transparent 60%), radial-gradient(70% 60% at 0% 100%, #2a78d6 0%, transparent 62%), linear-gradient(160deg, #0a3d32, #0b6a53); }
.entrada-lado .marca { font-size: 30px; padding: 0; }
.entrada-lado .marca svg.logo { width: 32px; height: 32px; }
.entrada-lado h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; max-width: 14em; }
.entrada-lado ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; color: rgba(255,255,255,.92); }
.entrada-lado li { display: flex; gap: 10px; align-items: flex-start; }
.entrada-lado li svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: #7ff0cf; }
.entrada-lado a { color: #fff; opacity: .85; font-size: 14px; }
.entrada-form { display: grid; place-items: center; padding: 28px 18px; }
.entrada-c { width: min(380px, 100%); display: grid; gap: 20px; }
.entrada-c h1 { font-size: 26px; letter-spacing: -.02em; }
.entrada-c .lema { color: var(--ink-2); margin-top: 4px; }
.entrada-c form { display: grid; gap: 14px; }
.cargando { display: grid; place-items: center; min-height: 40vh; color: var(--ink-3); }
.giro { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation-duration: 3s; } .prod-cab svg { transition: none; } }

/* ---------- móvil ---------- */
.barra-mov { display: none; }
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 8px 12px; }
  .entrada { grid-template-columns: 1fr; }
  .entrada-lado { padding: 26px 22px; gap: 22px; }
  .entrada-lado ul { display: none; }
  .side .nav, .side .side-pie .yo { display: none; }
  .side .marca { padding: 0; font-size: 20px; }
  .side .emp { flex: 1; min-width: 150px; padding: 0; }
  .side .emp label { display: none; }
  .side .emp .yo { padding: 8px 11px; }
  .side-pie { margin: 0; grid-auto-flow: column; padding: 0; }
  .main { padding: 18px 14px 96px; }
  .cab h1 { font-size: 22px; }
  .r-hero, .r-2 { grid-template-columns: 1fr; }
  .barra-mov { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .barra-mov a { display: grid; justify-items: center; gap: 2px; padding: 5px 2px; font-size: 11.5px; color: var(--ink-3); text-decoration: none; border-radius: 10px; }
  .barra-mov a svg { width: 22px; height: 22px; }
  .barra-mov a[aria-current="page"] { color: var(--brand); font-weight: 650; background: var(--soft); }
  .barra-mov a[aria-current="page"] svg { stroke-width: 2.4; }
  .toasts { bottom: 84px; }
  .item { grid-template-columns: 1fr 64px 100px 32px; }
  .fila-3 { grid-template-columns: 1fr 1fr; }
  .tabla-resp thead { display: none; }
  .tabla-resp tr { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 2px 10px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); }
  .tabla-resp td { border: 0; padding: 0; text-align: left; min-width: 0; }
  .tabla-resp td:first-child { min-width: 42px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .cab > *, .acciones { min-width: 0; max-width: 100%; }
  .app { overflow-x: hidden; }
  .chip { flex: none; }
  .acciones { width: 100%; }
  .acciones > .chips { width: 100%; }
  .tabla-resp td.d { text-align: right; }
  .tabla-resp td[data-oc="m"] { display: none; }
  .tabla-resp .sub-fila { display: block; }
  .tabla-resp .sub-fila td { padding: 12px; }
}
@media (max-width: 480px) {
  .fila-2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .modal { border-radius: 18px 18px 0 0; align-self: end; max-height: 94vh; }
  .velo { padding: 0; align-items: end; }
}
@media print { .side, .barra-mov, .acciones, .toasts { display: none !important; } .app { display: block; } body { background: #fff; } }
.main:focus { outline: none; }
.sep-t { margin: 22px 0 10px; font-size: 13px; color: var(--ink-3); }
.delta { font-size: 13px; color: var(--ink-2); }
.delta b { font-weight: 600; color: var(--ink); }
.chart .sm { font-size: 11px; }

/* ===== Color de marca: verde azulado (el color de la interfaz; los datos conservan azul y naranja) ===== */
:root {
  --bg: #dff0ec; --surface-2: #edf6f4; --line: #cfe0dc; --line-2: #e4eeec;
  --brand: #0f766e; --brand-2: #14a597; --brand-deep: #0a4f4a; --brand-soft: #d3efe9; --on-brand: #ffffff;
  --btn: #0f766e; --btn-ink: #ffffff; --focus: #0f766e;
  --t1: #e3eefc; --t1i: #1e5aa8; --t2: #fde6dc; --t2i: #b8481f; --t3: #d8f3e6; --t3i: #0d6b43; --t4: #ebe5fb; --t4i: #5340b8;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #0a1513; --surface-2: #1f2a28; --line: #2f3d3a; --line-2: #26322f;
    --brand: #2dc7b2; --brand-2: #1f9e8f; --brand-deep: #06231f; --brand-soft: #123631; --on-brand: #04201c;
    --btn: #2dc7b2; --btn-ink: #04201c; --focus: #5eead4;
    --t1: #16283f; --t1i: #8fbaf5; --t2: #3a2217; --t2i: #f0a07f; --t3: #123226; --t3i: #6fd9a3; --t4: #25203f; --t4i: #b4a9f2;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1513; --surface-2: #1f2a28; --line: #2f3d3a; --line-2: #26322f;
  --brand: #2dc7b2; --brand-2: #1f9e8f; --brand-deep: #06231f; --brand-soft: #123631; --on-brand: #04201c;
  --btn: #2dc7b2; --btn-ink: #04201c; --focus: #5eead4;
  --t1: #16283f; --t1i: #8fbaf5; --t2: #3a2217; --t2i: #f0a07f; --t3: #123226; --t3i: #6fd9a3; --t4: #25203f; --t4i: #b4a9f2;
}
body { background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%), var(--bg); background-attachment: fixed; }

/* barra lateral */
.side { background: linear-gradient(180deg, var(--brand-deep), #0d625b 120%); border-right: 0; color: #e8f6f3; }
:root[data-theme="dark"] .side { background: linear-gradient(180deg, #06231f, #0a3a35); }
.side .marca { color: #fff; }
.side .marca svg.logo { color: #5eead4; }
.side .marca svg.logo path { stroke: var(--brand-deep); }
.side .emp label { color: rgba(232, 246, 243, .65); }
.side select { background-color: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.side select option { color: #15171a; }
.side select:hover { border-color: rgba(255, 255, 255, .5); }
.side .nav a { color: rgba(232, 246, 243, .8); }
.side .nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side .nav a[aria-current="page"] { background: #fff; color: var(--brand-deep); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.side .yo { color: rgba(232, 246, 243, .75); }
.side .yo b { color: #fff; }
.side .btn.plano { color: #e8f6f3; }
.side .btn.plano:hover { background: rgba(255, 255, 255, .12); }
.side :focus-visible { outline-color: #5eead4; }

/* botones y selectores */
.btn.pri { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: var(--on-brand); box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.pri:hover { background: linear-gradient(135deg, var(--brand), var(--brand-2)); opacity: 1; filter: brightness(1.08); }
.btn:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip:hover { border-color: var(--brand); color: var(--ink); }
.vista-alt:hover, a.vista-alt { color: var(--brand); }
.toast { background: var(--brand-deep); color: #fff; }
:root[data-theme="dark"] .toast { background: var(--brand); color: var(--on-brand); }
.card { border-color: var(--line); }
.card > h2 { letter-spacing: -.015em; }
.cab h1 { color: var(--ink); }
.cab h1::after { content: ""; display: block; width: 36px; height: 4px; border-radius: 4px; margin-top: 6px; background: linear-gradient(90deg, var(--brand), var(--s2)); }
.etq.aviso { background: var(--warn-bg); }

/* tarjeta principal del resumen */
.hero-banda { margin: -18px -20px 0; padding: 20px 22px 22px; border-radius: 16px 16px 0 0; color: #fff; background: radial-gradient(500px 220px at 90% 0%, rgba(94, 234, 212, .35), transparent 70%), linear-gradient(135deg, var(--brand-deep), var(--brand) 85%); }
:root[data-theme="dark"] .hero-banda { background: radial-gradient(500px 220px at 90% 0%, rgba(94, 234, 212, .25), transparent 70%), linear-gradient(135deg, #06231f, #0f6a60 85%); }
.hero-banda .hero-etq, .hero-banda .delta { color: rgba(255, 255, 255, .86); }
.hero-banda .delta b { color: #fff; }
.hero-banda .hero-num { color: #fff; margin-top: 8px; }
.hero-banda .hero-num.neg { color: #ffd2cd; }
.hero-banda .dot { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); background: #fff !important; }
.tile { border: 0; position: relative; padding: 14px 15px 14px 15px; }
.tile .ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 8px; background: rgba(255, 255, 255, .6); }
.tile .ic svg { width: 17px; height: 17px; }
.tile .e { color: inherit; opacity: .85; }
.tile .d { color: inherit; opacity: .7; }
.tile.c1 { background: var(--t1); color: var(--t1i); } .tile.c2 { background: var(--t3); color: var(--t3i); }
.tile.c3 { background: var(--t2); color: var(--t2i); } .tile.c4 { background: var(--t4); color: var(--t4i); }
:root[data-theme="dark"] .tile .ic { background: rgba(255, 255, 255, .1); }
.tile .v { color: var(--ink); }

/* inventario y listas */
.talla { border-color: var(--line); }
button.talla:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.prod-cab:hover { background: var(--brand-soft); border-radius: 10px; }
tbody tr.clic:hover td { background: var(--brand-soft); }
.nav a svg, .barra-mov a svg { stroke-width: 2; }
.barra-mov a[aria-current="page"] { color: var(--brand); }

/* entrada */
.entrada { background: radial-gradient(900px 500px at 15% 0%, color-mix(in srgb, var(--brand-2) 40%, transparent), transparent 65%), radial-gradient(700px 500px at 100% 100%, color-mix(in srgb, var(--s2) 22%, transparent), transparent 60%), var(--bg); }
.entrada-c { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 26px; box-shadow: 0 20px 60px rgba(8, 60, 55, .18); }
.entrada .marca svg.logo { color: var(--brand); }
.entrada .marca svg.logo path { stroke: #fff; }
.giro { border-top-color: var(--brand); }
@media (max-width: 880px) { .side { background: linear-gradient(135deg, var(--brand-deep), #0d625b); } .main { padding-top: 18px; } }

.marca svg.palabra { width: auto; height: 24px; }
.entrada-lado .marca svg.palabra { height: 40px; }
@media (max-width: 880px) {
  .prod-cab .n span { display: block; margin-left: 0; }
  .prod-cab .n { min-width: 0; }
}

/* ---------- historial ---------- */
.h-personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.h-persona { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; color: var(--ink); min-width: 0; box-shadow: var(--shadow); }
.h-persona:hover { border-color: var(--brand); }
.h-persona[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent); }
.h-persona-t { display: grid; gap: 2px; min-width: 0; }
.h-persona-t b { font-weight: 650; font-size: 16px; }
.h-desglose { font-size: 14px; color: var(--ink-2); }
.h-av { flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; letter-spacing: .02em; }
.h-dia { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.h-dia:first-child { margin-top: 0; }
.h-dia h3 { margin: 0; font-size: 15px; font-weight: 650; }
.h-lista { list-style: none; margin: 0; padding: 0; }
.h-fila { border-top: 1px solid var(--line-2); }
.h-fila:first-child { border-top: 0; }
.h-cab { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 12px 6px; cursor: pointer; border-radius: 10px; }
.h-cab:hover { background: var(--brand-soft); }
.h-linea { overflow-wrap: anywhere; }
.h-linea b { font-weight: 650; }
.h-sub { color: var(--ink-2); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.h-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.h-der { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-monto { font-weight: 650; }
.h-monto.tachado { text-decoration: line-through; color: var(--ink-3); font-weight: 500; }
.h-fila.anul .h-linea { color: var(--ink-2); }
.h-det { margin: 0 6px 12px 54px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }
.h-kv { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; }
.h-kv dt { color: var(--ink-3); font-size: 13px; }
.h-kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.h-mas { text-align: center; margin-top: 14px; }
@media (max-width: 720px) {
  .h-personas { grid-template-columns: 1fr; }
  .h-cab { grid-template-columns: 34px minmax(0, 1fr); }
  .h-der { grid-column: 2; display: flex; gap: 10px; align-items: baseline; text-align: left; }
  .h-det { margin-left: 6px; }
  .barra-tools > .chips { width: 100%; }
}

.rejilla > * { min-width: 0; }

/* ---------- negocios (administrador general) ---------- */
.neg-panel { display: grid; gap: 4px; }
.neg-fila { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.neg-fila .campo { margin: 0; }
@media (max-width: 720px) { .neg-fila input { max-width: none !important; width: 100%; } }
@media (max-width: 720px) {
  .barra-mov { grid-auto-columns: minmax(66px, 1fr); overflow-x: auto; scrollbar-width: none; }
  .barra-mov a { font-size: 11px; }
}
.acceso-datos { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: 14px; user-select: all; }

.etq.pago { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: var(--ok); border-color: transparent; font-weight: 600; }
.etq.mal { font-weight: 600; }

/* Plan del negocio: Plus en dorado suave, Básico en plateado suave */
:root { --plan-plus-bg: #f4e8c1; --plan-plus-ink: #6f5309; --plan-bas-bg: #e5e8eb; --plan-bas-ink: #47535d; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --plan-plus-bg: #3a3118; --plan-plus-ink: #e6c867; --plan-bas-bg: #2f3438; --plan-bas-ink: #c4ccd3; } }
:root[data-theme="dark"] { --plan-plus-bg: #3a3118; --plan-plus-ink: #e6c867; --plan-bas-bg: #2f3438; --plan-bas-ink: #c4ccd3; }
.etq.plan-plus { background: var(--plan-plus-bg); color: var(--plan-plus-ink); border-color: transparent; font-weight: 600; }
.etq.plan-basico { background: var(--plan-bas-bg); color: var(--plan-bas-ink); border-color: transparent; font-weight: 600; }
