:root {
  color-scheme: dark;
  --bg: #0b1a30;          /* azul marino */
  --surface: #11243f;
  --side: #081427;
  --field: #0a172b;
  --ink: #ffffff;
  --ink-2: #c6d1e1;
  --muted: #8797b0;
  --line: #233a5c;
  --line-2: #1a2f4e;
  --hover: #152b4a;

  --brand: #6cb2ff;       /* stock del sistema */
  --brand-btn: #2f7de1;
  --brand-soft: rgba(108,178,255,.14);
  --real: #f2b650;        /* conteo real */
  --real-soft: rgba(242,182,80,.14);

  --red: #ff6f62;         /* faltante */
  --red-soft: rgba(255,111,98,.16);
  --green: #3fd68e;       /* sobrante */
  --green-soft: rgba(63,214,142,.15);
  --gray: #8797b0;        /* coincide */
  --gray-soft: rgba(135,151,176,.15);
  --warn: #ffc95c;
  --warn-soft: rgba(255,201,92,.14);

  --r: 10px;
  --sidebar: 276px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
a { color: var(--brand); }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num, .mono { font-family: var(--num); font-variant-numeric: tabular-nums; }

.mark { width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--bg); display: grid; place-items: center; flex: none; }
.mark .i { width: 20px; height: 20px; stroke-width: 2; }

/* ---------- LOGIN ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--line); padding: 32px 26px; border-radius: 14px; width: 100%; max-width: 340px; text-align: center; }
.login-card .mark { margin: 0 auto 14px; width: 48px; height: 48px; border-radius: 12px; }
.login-card .mark .i { width: 26px; height: 26px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.login-card h1 { letter-spacing: .08em; }
.login-label { display: block; text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.login-card input { width: 100%; font-size: 20px; text-align: center; letter-spacing: 2px; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: var(--field); }
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-error { color: var(--red); min-height: 20px; margin-bottom: 8px; font-size: 14px; }

/* ---------- LAYOUT ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar); z-index: 40;
  background: var(--side); border-right: 1px solid var(--line); padding: 18px 12px; overflow-y: auto;
  transform: translateX(-100%); transition: transform .2s ease; padding-top: max(18px, env(safe-area-inset-top));
}
.sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.5); }
.brand { display: flex; gap: 11px; align-items: center; padding: 2px 8px 20px; }
.brand strong { display: block; font-size: 19px; line-height: 1.1; letter-spacing: .06em; font-weight: 700; }
.brand span { font-size: 13px; color: var(--muted); }
.nav-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 16px 12px 6px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; margin-bottom: 1px; position: relative; }
#nav a:hover { background: var(--line-2); color: var(--ink); }
#nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
#nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; line-height: 19px; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
.backdrop.show { opacity: 1; pointer-events: auto; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: rgba(11,26,48,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar-title { flex: 1; font-weight: 600; font-size: 17px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); width: 40px; height: 40px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn:active { background: var(--line-2); }
.datebar { display: flex; align-items: center; gap: 6px; }
.date-pill { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 0 14px; height: 40px; display: flex; align-items: center; font-weight: 600; cursor: pointer; white-space: nowrap; min-width: 128px; justify-content: center; }
.date-pill input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.date-pill .today { color: var(--brand); }

.view { padding: 18px 14px 120px; max-width: 920px; margin: 0 auto; }

@media (max-width: 559px) {
  .datebar { width: 100%; }
  .date-pill { flex: 1; }
}
@media (min-width: 960px) {
  .sidebar { transform: none; }
  .main-wrap { margin-left: var(--sidebar); }
  .menu-btn, .backdrop { display: none; }
  .topbar { padding: 12px 28px; }
  .view { padding: 28px 28px 120px; }
}

/* ---------- BASE ---------- */
.page-head { margin: 0 0 16px; }
.kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-head.sistema .kicker { color: var(--brand); }
.page-head.real .kicker { color: var(--real); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.panel-pad { padding: 16px; }
.panel h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

.btn { border: 1px solid transparent; border-radius: 9px; padding: 11px 18px; font-weight: 600; cursor: pointer; background: var(--surface); border-color: var(--line); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 15px; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-btn); border-color: var(--brand-btn); color: #fff; }
.btn-real { background: var(--real); border-color: var(--real); color: #1f1405; }
.btn-danger { color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); padding-left: 6px; padding-right: 6px; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--field); font-size: 16px; }
.field textarea { min-height: 70px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 600px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.note { font-size: 14px; color: var(--ink-2); background: var(--line-2); border-radius: 9px; padding: 10px 12px; margin-bottom: 16px; }
.note.blue { background: var(--brand-soft); color: #d4e7ff; }
.note.real { background: var(--real-soft); color: #ffe7bd; }
.note .btn { margin-left: 4px; }

.code { display: inline-block; font-family: var(--num); font-weight: 600; font-size: 12.5px; letter-spacing: .03em; color: var(--ink-2); background: var(--line-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; line-height: 19px; white-space: nowrap; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--gray-soft); color: var(--ink-2); white-space: nowrap; }
.tag .i { width: 14px; height: 14px; stroke-width: 2.4; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.tag.real { background: var(--real-soft); color: var(--real); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
/* compat con módulo de consignaciones */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--gray-soft); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.bad { background: var(--red-soft); color: var(--red); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.blue, .chip.info { background: var(--brand-soft); color: var(--brand); }

/* ---------- CARGA DE STOCK ---------- */
.line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line-2); position: relative; }
.line:first-child { border-top: 0; }
.line::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.sistema .line.is-filled::before { background: var(--brand); }
.real .line.is-filled::before { background: var(--real); }
.line-info { flex: 1; min-width: 0; }
.line-top { display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.cat { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.lname { font-weight: 600; font-size: 15.5px; line-height: 1.2; }
.lsum { font-size: 13px; color: var(--muted); margin-top: 2px; }
.lsum b { color: var(--ink); font-family: var(--num); font-size: 14px; }
.line-inputs { display: flex; gap: 8px; align-items: flex-end; }
.inp { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.inp small { font-size: 11px; color: var(--muted); font-weight: 500; }
.inp input { width: 64px; height: 46px; text-align: center; font-family: var(--num); font-size: 22px; font-weight: 600; border: 1.5px solid var(--line); border-radius: 8px; background: var(--field); padding: 0 4px; }
.inp input:focus { outline: none; background: var(--bg); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.real .inp input:focus { border-color: var(--real); box-shadow: 0 0 0 3px var(--real-soft); }
.inp input::placeholder { color: #3d5478; }
.paren { display: flex; align-items: center; gap: 1px; font-family: var(--num); font-size: 26px; color: var(--muted); font-weight: 500; }
.paren input { width: 52px; }
@media (max-width: 380px) {
  .inp input { width: 56px; }
  .paren input { width: 44px; }
}


.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(8,20,39,.96); border-top: 1px solid var(--line); padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 14px; align-items: center; backdrop-filter: blur(8px); }
.savebar .prog { flex: 1; min-width: 0; }
.savebar .prog-txt { font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.savebar .prog-txt b { font-family: var(--num); font-size: 15px; color: var(--ink); }
.bar { height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.real .bar > div { background: var(--real); }
.savebar .btn { padding: 12px 26px; }
@media (min-width: 960px) { .savebar { left: var(--sidebar); padding-left: 28px; padding-right: 28px; } }

/* ---------- DIFERENCIAS ---------- */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.summary > div { padding: 14px; border-left: 1px solid var(--line-2); }
.summary > div:first-child { border-left: 0; }
.summary .k { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.summary .k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.summary .falta .k::before { background: var(--red); }
.summary .sobra .k::before { background: var(--green); }
.summary .v { font-family: var(--num); font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.summary .falta .v { color: var(--red); }
.summary .sobra .v { color: var(--green); }
.summary .ok .v { color: var(--gray); }
.summary .s { font-size: 12.5px; color: var(--muted); }

.seg { display: inline-flex; background: var(--line-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; margin-bottom: 12px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--hover); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.3); }

.drow { padding: 13px 14px; border-top: 1px solid var(--line-2); position: relative; }
.drow:first-child { border-top: 0; }
.drow::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line); }
.drow.falta::before { background: var(--red); }
.drow.sobra::before { background: var(--green); }
.drow-main { display: flex; align-items: center; gap: 12px; }
.dnums { display: flex; gap: 4px; align-items: stretch; }
.dnums > div { text-align: center; min-width: 58px; padding: 2px 4px; }
.dnums small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.dnums b { display: block; font-family: var(--num); font-size: 21px; font-weight: 600; line-height: 1.15; }
.dnums .n { font-size: 11.5px; color: var(--muted); font-family: var(--num); }
.dnums .s b { color: var(--brand); }
.dnums .r b { color: var(--real); }
.dres { border-radius: 8px; min-width: 76px !important; background: var(--gray-soft); }
.dres b { color: var(--gray); }
.falta .dres { background: var(--red-soft); } .falta .dres b, .falta .dres small { color: var(--red); }
.sobra .dres { background: var(--green-soft); } .sobra .dres b, .sobra .dres small { color: var(--green); }
.dnote { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.dnote input[type=text] { flex: 1; min-width: 200px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--field); font-size: 15px; }
.dnote input[type=text]:focus { outline: none; background: var(--bg); border-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; user-select: none; color: var(--ink-2); }
.check input { width: 20px; height: 20px; accent-color: var(--green); margin: 0; }
.drow.resolved .dnote input[type=text] { color: var(--ink-2); }
.dexpl { font-size: 13.5px; margin-top: 8px; color: #ffe7bd; background: var(--real-soft); border-radius: 8px; padding: 7px 10px; }
@media (max-width: 559px) {
  .drow-main { flex-wrap: wrap; }
  .drow-main .line-info { flex-basis: 100%; }
  .dnums { width: 100%; }
  .dnums > div { flex: 1; }
}

/* ---------- INICIO ---------- */
.steps .step { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-top: 1px solid var(--line-2); cursor: pointer; }
.steps .step:first-child { border-top: 0; }
.steps .step:hover { background: var(--hover); }
.step-n { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-family: var(--num); font-weight: 700; color: var(--muted); flex: none; }
.step.done .step-n { background: var(--green); border-color: var(--green); color: #06281a; }
.step.alert .step-n { background: var(--red); border-color: var(--red); color: #fff; }
.step-t { font-weight: 600; }
.step-d { font-size: 14px; color: var(--muted); }
.step > .i { color: var(--muted); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px 16px 16px; }
.wday { text-align: center; cursor: pointer; }
.wday .wd { font-size: 11.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.wday .wb { margin-top: 5px; height: 38px; border-radius: 8px; display: grid; place-items: center; font-family: var(--num); font-weight: 600; font-size: 16px; background: transparent; color: var(--muted); border: 1.5px dashed var(--line); }
.wday.ok .wb { background: var(--hover); color: var(--ink); border: 1.5px solid var(--gray); }
.wday.falta .wb, .wday.sobra .wb, .wday.half .wb { border-style: solid; border-color: transparent; }
.wday.sel .wb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.wday.falta .wb { background: var(--red); color: #fff; }
.wday.sobra .wb { background: var(--green); color: #06281a; }
.wday.half .wb { background: repeating-linear-gradient(-45deg, var(--line-2), var(--line-2) 4px, var(--surface) 4px, var(--surface) 8px); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 0 16px 14px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; border: 1px dashed var(--muted); }
.legend .lf::before { background: var(--red); border: 0; } .legend .ls::before { background: var(--green); border: 0; } .legend .lo::before { background: var(--hover); border: 1px solid var(--gray); }

/* ---------- HISTORIAL ---------- */
.hrow { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line-2); cursor: pointer; flex-wrap: wrap; }
.hrow:first-child { border-top: 0; }
.hrow:hover { background: var(--hover); }
.hdate { min-width: 110px; }
.hdate b { display: block; font-family: var(--num); font-size: 17px; }
.hdate span { font-size: 13px; color: var(--muted); text-transform: capitalize; }
.hres { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.hdetail { width: 100%; font-size: 13px; color: var(--muted); }
.hdetail .f { color: var(--red); } .hdetail .s { color: var(--green); }

/* ---------- PRODUCTOS ---------- */
.prow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line-2); align-items: center; }
.prow:first-child { border-top: 0; }
.prow .pf { display: flex; flex-direction: column; gap: 3px; }
.prow .pf.wide { grid-column: 1 / -1; }
.prow label.cap { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.prow input:not([type=checkbox]), .prow select { padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 8px; width: 100%; background: var(--field); font-size: 15px; }
.prow .acts { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.prow.off { opacity: .55; }
@media (min-width: 760px) {
  .prow { grid-template-columns: 90px 2fr 1.2fr 80px 90px; }
  .prow .pf.wide { grid-column: auto; }
}

/* ---------- MODAL / TOAST / ESTADOS ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: var(--surface); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 18px 16px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 14px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(16px); background: #fff; color: var(--bg); padding: 11px 18px; border-radius: 9px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .2s; z-index: 80; max-width: 90vw; text-align: center; display: flex; gap: 8px; align-items: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); color: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.empty p { margin: 0 0 16px; }
.loading { padding: 50px; text-align: center; color: var(--muted); }

/* ---------- CONSIGNACIONES (módulo futuro) ---------- */
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.ccard-head { display: flex; justify-content: space-between; gap: 10px; }
.cname { font-weight: 700; font-size: 17px; }
.cmeta { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 14px; margin: 10px 0; font-size: 14px; }
.cmeta div span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.citems, .cactions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; background: var(--line-2); padding: 3px; border-radius: 9px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.tabs button.active { background: var(--hover); color: var(--ink); }

/* ---------- MENÚ POR SECCIONES ---------- */
.sidebar { display: flex; flex-direction: column; }
#nav { flex: 1; }
#nav a.nav-top { margin-bottom: 8px; }
.nav-group { margin-bottom: 4px; }
.nav-group summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--ink); user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { background: var(--hover); }
.nav-group summary .badge { margin-left: auto; }
.nav-group summary .nlbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group summary .badge { margin-left: 0; }
.nav-group summary .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.nav-group[open] summary .chev { transform: rotate(90deg); }
.nav-group.has-active > summary { color: var(--brand); }
.nav-group a { padding: 8px 12px 8px 44px !important; font-size: 15px; color: var(--ink-2) !important; }
.nav-group a.active { color: var(--brand) !important; }
.nav-group a.active::before { left: -12px; }
.logout { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; color: var(--muted); padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 500; margin-top: 16px; border-top: 1px solid var(--line); border-radius: 0; }
.logout:hover { color: var(--ink); }

/* ---------- PIEZAS COMUNES ---------- */
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 22px 2px 10px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); cursor: default; }
.mini-row:first-child { border-top: 0; }
.mini-row[data-go] { cursor: pointer; }
.mini-row[data-go]:hover { background: var(--hover); }
.mini-row .icon-btn { width: 36px; height: 36px; }
.mini-row .icon-btn .i { width: 18px; height: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip-btn .i { width: 16px; height: 16px; }
.chip-btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.btn-ok { background: var(--green); border-color: var(--green); color: #06281a; }
.btn .i { width: 18px; height: 18px; }
.btn-wa { background: #1fa855; border-color: #1fa855; }
.field select { appearance: auto; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th, .tbl td { padding: 10px 14px; border-top: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.tbl thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tbl .n { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ---------- CONSIGNACIONES ---------- */
.ccard { border-left: 3px solid var(--line); }
.ccard.vencida { border-left-color: var(--red); }
.ccard.pronto { border-left-color: var(--warn); }
.ccard-head { align-items: flex-start; }
.cactions { margin-bottom: 0; }
.item-row { background: var(--field); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 10px; }
.item-row .line-inputs { justify-content: flex-start; }

/* ---------- ROTURAS Y RECAMBIOS ---------- */
.k-pinchado { --k: #ff8a65; } .k-gusto { --k: #c39bff; } .k-recambio { --k: #6cb2ff; } .k-roto { --k: #ffc95c; } .k-otro { --k: #8797b0; }
.tag[class*="k-"] { color: var(--k); background: color-mix(in srgb, var(--k) 15%, transparent); }
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kind { text-align: left; border: 1.5px solid var(--line); background: var(--field); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.kind b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.kind b::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--k); }
.kind small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kind.on { border-color: var(--k); background: color-mix(in srgb, var(--k) 12%, var(--field)); }
.kind-sum { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 4px; }
.kind-sum > div { padding: 12px; border-left: 1px solid var(--line-2); }
.kind-sum > div:first-child { border-left: 0; }
.kind-sum small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.kind-sum small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.kind-sum b { font-size: 26px; display: block; margin-top: 2px; }
@media (max-width: 559px) { .kind-sum { grid-template-columns: repeat(3, 1fr); } .kind-sum > div:nth-child(4) { border-left: 0; } .kind-sum > div:nth-child(n+4) { border-top: 1px solid var(--line-2); } }

/* ---------- ALTAS ---------- */
.reparto-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 600px) { .reparto-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .reparto-grid { grid-template-columns: repeat(4, 1fr); } }
.reparto-cell { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.reparto-cell span { color: var(--ink-2); font-size: 15px; }
.reparto-cell b { color: var(--ink); font-family: var(--num); font-size: 20px; }
.reparto-cell input { width: 72px; height: 46px; text-align: center; font-family: var(--num); font-size: 22px; font-weight: 600; border: 1.5px solid var(--line); border-radius: 8px; background: var(--field); }
.reparto-cell input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.reparto-cell input::placeholder { color: #3d5478; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; max-width: 520px; margin: 22px auto 8px; }
.pod { text-align: center; }
.pod-name { font-weight: 700; font-size: 15px; }
.pod-val { color: var(--ink-2); font-size: 20px; font-weight: 600; margin: 2px 0 8px; }
.pod-val small { font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 500; }
.pod-block { background: var(--medal); border-radius: 10px 10px 4px 4px; display: grid; place-items: center; color: var(--bg); }
.pod-block span { font-size: 30px; font-weight: 700; }
.p1 .pod-block { height: 130px; } .p2 .pod-block { height: 96px; } .p3 .pod-block { height: 70px; }
.bars { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.bar-row { display: grid; grid-template-columns: 34px 92px 1fr 40px; align-items: center; gap: 10px; padding: 5px 0; }
.bar-row:hover { background: var(--hover); border-radius: 6px; }
.bar-pos { color: var(--muted); font-size: 15px; text-align: right; }
.bar-lbl { font-size: 14.5px; color: var(--ink-2); white-space: nowrap; }
.bar-track { height: 16px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: #3f78c4; border-radius: 4px; min-width: 0; }
.bar-fill.top { background: var(--brand); }
.bar-val { text-align: right; font-weight: 700; font-size: 17px; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.hrow.sel { background: var(--brand-soft); }

.hdate span.nocap { text-transform: none; }
