:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e6e9f0;
  --text: #1b2333;
  --muted: #6b7486;
  --primary: #3b5bdb;
  --primary-soft: #edf1ff;
  --side: #121a2b;
  --side-text: #a9b3c7;

  --ok: #0c8fb8;      --ok-soft: #e3f5fb;    --ok-row: #f2fafd;
  --warn: #c88a04;    --warn-soft: #fff4d6;  --warn-row: #fffbef;
  --none: #8a93a6;    --none-soft: #eef0f4;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Layout ---------- */
.layout { min-height: 100vh; }
.topbar { background: var(--side); color: var(--side-text); position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 14px rgba(16,24,40,.12); }
.topbar-inner { max-width: 1600px; margin: 0 auto; padding: 0 32px; height: var(--topbar-h); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 15.5px; white-space: nowrap; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #4c6ef5, #15aabf); color: #fff;
}
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; margin: 0; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  color: var(--side-text); font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(76,110,245,.22); color: #fff; }
.nav svg.i { width: 17px; height: 17px; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #fff; }
.topbar-user .uname { font-weight: 500; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #2a3550; color: #fff;
  display: grid; place-items: center; font-weight: 600; text-transform: uppercase; font-size: 13px;
}

.content { min-width: 0; padding: 26px 32px 90px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: var(--primary); color: #fff; transition: background .15s, box-shadow .15s;
}
.btn:hover { background: #3049c4; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn.ghost:hover { background: #f8f9fc; }
.btn.link { background: none; color: var(--muted); padding: 8px 10px; }
.btn.link:hover { color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 13px; }

input[type=text], input[type=password], input[type=search], input[type=date], input[type=email], input[type=number], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,.15); }
select { padding-right: 28px; }
textarea { resize: vertical; width: 100%; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; display: block; color: inherit; position: relative; transition: transform .15s, box-shadow .15s, border-color .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,.12); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.kpi-num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 2px; }
.kpi-sub { color: var(--muted); font-size: 12.5px; }
.kpi .mini { height: 5px; border-radius: 3px; background: var(--none-soft); margin-top: 10px; overflow: hidden; }
.kpi .mini span { display: block; height: 100%; border-radius: 3px; }
.t-total .kpi-icon { background: var(--primary-soft); color: var(--primary); }
.t-completo .kpi-icon { background: var(--ok-soft); color: var(--ok); }   .t-completo .mini span { background: var(--ok); }
.t-falta .kpi-icon { background: var(--warn-soft); color: var(--warn); }   .t-falta .mini span { background: var(--warn); }
.t-pendiente .kpi-icon { background: var(--none-soft); color: var(--none); } .t-pendiente .mini span { background: var(--none); }

.progress-card { padding: 16px 20px; margin-bottom: 16px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.progress-head b { font-size: 15px; }
.progress-head .big { font-size: 20px; font-weight: 700; }
.bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--none-soft); }
.bar span { display: block; height: 100%; }
.bar .completo { background: linear-gradient(90deg, #0c8fb8, #22b8cf); }
.bar .falta { background: #eda100; }
.legend { display: flex; gap: 18px; margin-top: 10px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1 1 280px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.search input { width: 100%; padding-left: 36px; }
.toolbar .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; padding: 11px 12px; background: #fafbfd; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #eff1f5; vertical-align: middle; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover { background: #f7f9ff; }
table.data tr.completo td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
table.data tr.falta td:first-child { box-shadow: inset 3px 0 0 #eda100; }
table.data tr.falta { background: var(--warn-row); }
table.data tr.completo { background: var(--ok-row); }
table.data tr.selected { background: #eaf0ff !important; }
.w-check { width: 42px; }
.op { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.op:hover { color: var(--primary); }
.mono { font-variant-numeric: tabular-nums; white-space: nowrap; color: #46506a; }
.prov { max-width: 340px; }
.obs { max-width: 300px; color: var(--muted); font-size: 13px; }
.caja-tag { display: inline-block; white-space: nowrap; background: #f0f2f7; border-radius: 6px; padding: 2px 8px; font-weight: 600; font-size: 12.5px; color: #46506a; }
.empty { text-align: center; padding: 48px 12px !important; color: var(--muted); }

input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.completo { background: var(--ok-soft); color: var(--ok); }
.badge.falta { background: var(--warn-soft); color: #a26f00; }
.badge.pendiente { background: var(--none-soft); color: #687186; }
.chip { display: inline-block; padding: 2px 9px; margin: 2px 4px 2px 0; border-radius: 6px; font-size: 12px; font-weight: 600; background: #fff; border: 1px solid #f1dc9c; color: #8a5f00; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: var(--muted); font-size: 13px; }
.pager .pages { display: flex; gap: 6px; }

/* ---------- Bulk bar ---------- */
.bulk {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px;
  background: var(--side); color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  transition: transform .25s cubic-bezier(.2,.8,.2,1); flex-wrap: wrap; max-width: calc(100vw - 40px);
}
.bulk.show { transform: translate(-50%, 0); }
.bulk .n { font-weight: 700; margin-right: 6px; }
.bulk select, .bulk input { background: #1f2a40; border-color: #2e3a55; color: #fff; }
.bulk input::placeholder { color: #8892a8; }
.bulk .sep { width: 1px; height: 24px; background: #2e3a55; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field label.lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; }
.field.full { grid-column: 1 / -1; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: #d6336c; font-size: 12.5px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.segmented label {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; cursor: pointer; font-weight: 600; transition: all .15s; background: #fff;
}
.segmented input { display: none; }
.segmented .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; }
.segmented label.pendiente { color: #687186; }
.segmented label.falta { color: #a26f00; }
.segmented label.completo { color: var(--ok); }
.segmented label:has(input:checked) { border-color: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }
.segmented label.pendiente:has(input:checked) { background: var(--none-soft); }
.segmented label.falta:has(input:checked) { background: var(--warn-soft); }
.segmented label.completo:has(input:checked) { background: var(--ok-soft); }
.segmented label:has(input:checked) .dot { background: currentColor; }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles label {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: #fff; font-weight: 600; font-size: 13px; color: #46506a; transition: all .15s;
}
.toggles input { display: none; }
.toggles label:hover { border-color: #c9cfdb; }
.toggles label:has(input:checked) { background: var(--warn-soft); border-color: #eda100; color: #8a5f00; }
.toggles label:has(input:checked)::before { content: "✓"; font-weight: 700; }

.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.edit-layout .card + .card { margin-top: 20px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.meta { list-style: none; margin: 0; padding: 0; }
.meta li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f6; font-size: 13px; }
.meta li:last-child { border: 0; }
.meta span { color: var(--muted); }

/* ---------- Faltantes ---------- */
.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid #f0f2f6; }
.list-item:last-child { border: 0; }
.list-item .name { flex: 1; font-weight: 600; }
.list-item.off .name { color: var(--muted); text-decoration: line-through; }
.pill-count { background: var(--warn-soft); color: #8a5f00; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12.5px; }
.pill-count.zero { background: var(--none-soft); color: var(--muted); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-left: 4px solid #2f9e44;
  padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 280px; animation: toast-in .3s ease;
}
.toast.warning { border-left-color: #eda100; }
.toast.error { border-left-color: #e03131; }
.toast.hide { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, #dfe7ff 0, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #d3f3fa 0, transparent 60%), var(--bg);
}
.login-card { width: 100%; max-width: 380px; padding: 34px 32px; }
.login-card .brand { color: var(--text); padding: 0 0 20px; }
.login-card .brand small { color: var(--muted); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p.sub { color: var(--muted); margin: 0 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.alert { background: #fff0f3; color: #c2255c; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edit-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { padding: 0 14px; gap: 12px; }
  .brand span:last-child, .nav a > span:not(.nav-badge), .topbar-user .uname { display: none; }
  .content { padding: 18px 14px 90px; }
  .form-grid, .segmented { grid-template-columns: 1fr; }
}

/* ---------- Planilla editable ---------- */
.hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px;
  background: #f7f9ff; border-bottom: 1px solid var(--border); color: #46506a; font-size: 13px;
}
.hint svg { color: var(--primary); width: 16px; height: 16px; }
.hint .keys { margin-left: auto; color: var(--muted); }
kbd {
  display: inline-block; font: 600 11px/1 "Segoe UI", system-ui, sans-serif; padding: 3px 6px; margin: 0 1px;
  border: 1px solid #d5dae4; border-bottom-width: 2px; border-radius: 5px; background: #fff; color: #46506a;
}

.planilla td.cell { cursor: text; outline: none; border-radius: 0; min-width: 40px; transition: background .12s, box-shadow .12s; }
.planilla td.cell:focus { box-shadow: inset 0 0 0 1.5px var(--primary); border-radius: 6px; background: #fff; color: var(--text); }
.planilla td.cell.c-caja { font-weight: 600; color: #46506a; white-space: nowrap; }
.planilla td.cell.saving { opacity: .55; }
.flash-ok { animation: flash-ok 1.1s ease; }
.flash-err { animation: flash-err 1.4s ease; }
@keyframes flash-ok { 0%, 30% { background: #d3f9d8; box-shadow: inset 0 0 0 2px #40c057; } }
@keyframes flash-err { 0%, 40% { background: #ffe3e3; box-shadow: inset 0 0 0 2px #fa5252; } }

.estado-sel {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; cursor: pointer;
  padding: 4px 26px 4px 12px; font-size: 12px; font-weight: 600;
  background: var(--none-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23687186' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #687186;
}
.estado-sel.completo { background-color: var(--ok-soft); color: var(--ok); }
.estado-sel.falta { background-color: var(--warn-soft); color: #a26f00; }
.estado-sel:focus { box-shadow: 0 0 0 3px rgba(59,91,219,.2); }
.estado-sel { background-image: none; padding-right: 24px; width: 112px; }
tr:hover .estado-sel, .estado-sel:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23687186' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

.cell-falt { cursor: pointer; outline: none; min-width: 90px; }
.cell-falt:focus { box-shadow: inset 0 0 0 1.5px var(--primary); border-radius: 6px; }
.add-hint { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #b5bccb; border: 1px dashed #cfd5e0; font-weight: 600; opacity: 0; transition: opacity .12s; }
tr:hover .add-hint, .cell-falt:focus .add-hint { opacity: 1; }

.add-row td { background: #f8f9fc; border-bottom: 1px solid var(--border); padding: 10px 6px; }
.add-row input, .add-row select { width: 100%; padding: 6px 9px; font-size: 13px; background: #fff; }
.add-row.saving { opacity: .6; pointer-events: none; }
.add-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--primary); color: #fff; }
.add-icon svg { width: 14px; height: 14px; }
.add-close { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.add-close:hover { background: #eceff5; color: var(--text); }
.add-close svg { width: 15px; height: 15px; }

.falt-pop {
  position: absolute; z-index: 40; width: 240px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px;
}
.falt-pop-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px 8px; }
.falt-pop-list label { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-weight: 500; }
.falt-pop-list label:hover { background: #f4f6fb; }
.falt-pop-list label:has(input:checked) { background: var(--warn-soft); color: #8a5f00; }
.falt-pop input:not([type]) , #falt-pop-nuevo { width: 100%; margin-top: 8px; font-size: 13px; }

/* ---------- Pegar desde Excel ---------- */
.col-guide { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.col-guide b { font-weight: 600; margin-right: 4px; }
.col-guide span { background: #e9ebef; color: #2b3345; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.col-guide i { font-style: normal; color: #b5bccb; }
.paste-area { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; tab-size: 4; white-space: pre; min-height: 220px; }
.radio-line { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.radio-line input { accent-color: var(--primary); width: auto; margin: 0; }
.badge.error { background: #ffe3e3; color: #c92a2a; }
table.data tr.err-row { background: #fff5f5; }
table.data tr.err-row td:first-child { box-shadow: inset 3px 0 0 #fa5252; }

/* ---------- Análisis ---------- */
:root { --c-completo: #0c8fb8; --c-falta: #eda100; --c-pendiente: #e3e7ee; --c-azul: #3b5bdb; --c-gris: #b5bccb; }

.stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat-label { color: var(--muted); font-weight: 600; font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 650; letter-spacing: -.02em; margin: 8px 0 2px; }
.stat-hero { font-size: 52px; font-weight: 650; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0 4px; }
.stat-sub { color: var(--muted); font-size: 12.5px; }
.meter { height: 8px; border-radius: 4px; background: #d9f0f7; margin-top: 12px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--c-completo); border-radius: 4px; }

.charts-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.col-side { display: flex; flex-direction: column; gap: 20px; }
.chart-card { padding: 18px 20px 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.chart-head h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.chart-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; max-width: 560px; }
.chart-legend { margin: 0 0 10px; }
.chart-legend .sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw.completo { background: var(--c-completo); } .sw.falta { background: var(--c-falta); } .sw.pendiente { background: var(--c-pendiente); }
.chart-empty { color: var(--muted); padding: 20px 0; text-align: center; }

/* barras de avance (100% apiladas) */
.av-chart { display: flex; flex-direction: column; }
.av-row {
  display: grid; grid-template-columns: 118px minmax(0, 1fr) 96px; align-items: center; gap: 12px;
  padding: 5px 6px; margin: 0 -6px; border-radius: 8px; color: var(--text); outline: none;
}
.av-row:hover, .av-row:focus-visible { background: #f5f7fb; }
.av-row:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.av-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-bar { display: flex; gap: 2px; height: 18px; }
.av-bar .seg { flex-basis: 0; min-width: 2px; height: 100%; transition: filter .12s; }
.av-bar .seg:last-child { border-radius: 0 4px 4px 0; }
.av-bar .seg.completo { background: var(--c-completo); }
.av-bar .seg.falta { background: var(--c-falta); }
.av-bar .seg.pendiente { background: var(--c-pendiente); }
.av-row:hover .seg:hover { filter: brightness(1.12) saturate(1.1); }
.av-val { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.av-val b { font-weight: 700; margin-right: 5px; }
.av-val span { color: var(--muted); font-size: 12px; }

/* barras simples */
.hb-chart { display: flex; flex-direction: column; }
.hb-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 5px 6px; margin: 0 -6px; border-radius: 8px; color: var(--text); outline: none;
}
.hb-row:hover, .hb-row:focus-visible { background: #f5f7fb; }
.hb-row:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.hb-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hb-area { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.hb-bar { display: block; height: 16px; min-width: 2px; border-radius: 0 4px 4px 0; flex: none; max-width: calc(100% - 56px); }
.hb-bar.falta { background: var(--c-falta); }
.hb-bar.azul { background: var(--c-azul); }
.hb-bar.gris { background: var(--c-gris); }
.hb-row:hover .hb-bar { filter: brightness(1.1); }
.hb-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tbl-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.tbl-wrap th.num, .tbl-wrap td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* tooltip */
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 180px; max-width: 300px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 10px 12px; font-size: 12.5px;
}
.tip-title { font-weight: 700; margin-bottom: 6px; }
.tip-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--muted); }
.tip-row b { color: var(--text); font-size: 13.5px; min-width: 34px; font-variant-numeric: tabular-nums; }
.tip-row.on { color: var(--text); }
.tip-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tip-key.completo { background: var(--c-completo); } .tip-key.falta { background: var(--c-falta); }
.tip-key.pendiente { background: #c3c9d4; } .tip-key.azul { background: var(--c-azul); } .tip-key.gris { background: var(--c-gris); }
.tip-foot { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; color: var(--muted); }

@media (max-width: 1100px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}
.hb-bar.cero { display: none; }

/* ---------- Secciones de análisis ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 30px 0 14px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.periodos { display: inline-flex; background: #e9ecf2; border-radius: 9px; padding: 3px; gap: 2px; }
.periodo { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.periodo:hover { color: var(--text); }
.periodo.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.stats.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* columnas por día */
.col-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding-top: 6px; }
.col-axis { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; transform: translateY(-7px); }
.col-plot { position: relative; min-width: 0; }
.col-grid { position: absolute; inset: 0 0 auto 0; height: 200px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.col-grid i { display: block; height: 1px; background: #edf0f5; }
.col-grid i:last-child { background: #d5dae4; }
.col-bars { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 2px; }
.col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; border-radius: 4px; cursor: default; }
.col:hover, .col:focus-visible { background: #f2f4f9; }
.col:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.col-bar { width: 100%; max-width: 24px; background: var(--c-completo); border-radius: 4px 4px 0 0; min-height: 2px; }
.col-bar.cero { display: none; }
.col.finde .col-bar { opacity: .45; }
.col-x { display: flex; gap: 2px; margin-top: 6px; }
.col-x span { flex: 1 1 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; text-align: left; min-width: 0; }
.hb-extra { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.hb-bar.completo { background: var(--c-completo); }

/* ---------- Historial ---------- */
.muted { color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; background: #e3e8f4; color: #3b4a6b; }
.diff { font-size: 13px; }
.diff .old { color: var(--muted); text-decoration: line-through; text-decoration-color: #c3c9d4; }
.diff .new { font-weight: 600; }
.arrow { color: #b5bccb; margin: 0 7px; }

.timeline { list-style: none; margin: 0 0 8px; padding: 0 0 0 14px; border-left: 2px solid #e6e9f0; }
.timeline li { position: relative; padding: 0 0 14px 4px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.tl-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tl-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tl-body { font-size: 13px; margin-top: 2px; word-break: break-word; }
.tl-body .old { color: var(--muted); text-decoration: line-through; text-decoration-color: #c3c9d4; }
.tl-body .new { font-weight: 600; }
.tl-who { color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 1100px) { .stats.stats-4 { grid-template-columns: 1fr 1fr; } }

/* Filtros de fecha: etiqueta y campo en una misma caja, como los demás filtros */
.date-f {
  display: inline-flex; align-items: center; gap: 2px; padding-left: 11px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 600; transition: border-color .15s, box-shadow .15s;
}
.date-f:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,.15); }
.date-f input[type=date] {
  border: 0; box-shadow: none; background: transparent; padding: 8px 10px 8px 6px;
  color: var(--text); font-weight: 400; cursor: pointer; min-width: 132px;
}
.date-f input[type=date]:focus { box-shadow: none; }
.date-f input[type=date]:not(:valid), .date-f input[type=date][value=""] { color: var(--muted); }
.date-f input[type=date]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.date-f input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ---------- ABM de faltantes ---------- */
.list-head { display: grid; grid-template-columns: 1fr auto 120px; gap: 14px; padding: 10px 20px 10px 66px; border-bottom: 1px solid var(--border); background: #fafbfd; border-radius: var(--radius) var(--radius) 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.falt-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); flex: none; }
.list-item.off .falt-icon { background: var(--none-soft); color: var(--none); }
.falt-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.falt-main .name { cursor: text; }
.tag-off { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--none-soft); padding: 2px 8px; border-radius: 999px; }
.rename-form { display: flex; align-items: center; gap: 6px; flex: 1; }
.rename-form input { flex: 1; max-width: 320px; padding: 6px 10px; }
.row-actions { display: flex; align-items: center; gap: 2px; width: 120px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: #eef1f6; color: var(--text); }
.icon-btn.danger:hover { background: #fff0f0; color: #e03131; }
.icon-btn svg { width: 17px; height: 17px; }
.btn.danger { background: #e03131; }
.btn.danger:hover { background: #c92a2a; }
.warn-box { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: #fff8e6; border: 1px solid #fbe3a1; color: #6b4e00; font-size: 13.5px; line-height: 1.5; }
.warn-box svg { color: var(--warn); margin-top: 2px; }
.ejemplos { list-style: none; padding: 0; margin: 16px 0; columns: 2; font-size: 13px; }
.ejemplos li { padding: 3px 0; break-inside: avoid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Registro y usuarios ---------- */
.login-card.wide { max-width: 520px; }
.login-card .form-grid { margin-bottom: 18px; gap: 14px 16px; }
.login-card .form-grid .field { margin-bottom: 0; }
.login-alt { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0; }
.login-alt a { font-weight: 600; }
.opt { color: var(--muted); font-weight: 400; }
.done-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: #e6f7ec; color: #2f9e44; }
.done-icon svg { width: 26px; height: 26px; }

.nav-badge { background: #f03e3e; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: -2px; }
.count-pill { display: inline-block; vertical-align: 2px; background: var(--warn-soft); color: #8a5f00; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 9px; margin-left: 6px; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-main .muted { font-size: 12.5px; }
.avatar.pend { background: var(--warn-soft); color: #8a5f00; }
.tag-admin { font-size: 11.5px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.row-actions.wide { width: auto; gap: 8px; }

/* ---------- Importar ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -6px 0 20px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.tab svg { width: 16px; height: 16px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 2px dashed #cfd6e4; border-radius: 12px; padding: 38px 20px; cursor: pointer; background: #fafbfd;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.sobre { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.lleno { border-style: solid; border-color: #8ce99a; background: #f4fcf5; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: var(--shadow); margin-bottom: 6px; }
.dropzone .muted { font-size: 12.5px; }
.pasos { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: #3b4458; }
.pasos li { margin-bottom: 6px; }

.avisos { margin: 0 0 20px; background: #fffcf2; border-color: #f6e3a6; }
.avisos ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }
.chip-color { display: inline-flex; align-items: center; gap: 5px; margin: 2px 6px 2px 0; font-weight: 600; font-size: 12.5px; }
.chip-color i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid #0002; }
.confirmar { margin-bottom: 8px; }
.opcion { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.opcion:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opcion input { margin-top: 3px; accent-color: var(--primary); }
.opcion > span { display: flex; flex-direction: column; gap: 2px; }
.opcion .muted { font-size: 12.5px; }
.opcion.sub { margin-left: 26px; }
.resumen-cambios { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rc { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
td.arrow { color: #b5bccb; width: 20px; }
.btn:disabled { opacity: .55; cursor: default; }
.sub-lista { margin: 4px 0 2px; padding-left: 18px; font-size: 13px; } .muted.small { font-size: 11.5px; font-weight: 400; }

/* ---------- Cajas ---------- */
:root { --esp-pocos: #e3f4e6; --esp-pocos-t: #1e7b34; --esp-mitad: #ffe9a6; --esp-mitad-t: #7a5300; --esp-llena: #f6b7b5; --esp-llena-t: #9b1c1c; }
.stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.esp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.esp-dot.pocos { background: #6cc27f; } .esp-dot.mitad { background: #d99f00; } .esp-dot.llena { background: #e03131; }
.input-num { width: 90px; }
.cajas-tabla td { vertical-align: middle; }
.cajas-tabla tr.fila-llena { background: #fff6f6; }
.cajas-tabla tr.fila-llena td:first-child { box-shadow: inset 3px 0 0 #e03131; }
.caja-num { display: inline-grid; place-items: center; min-width: 36px; height: 32px; padding: 0 8px; border-radius: 8px; background: #eef0f4; color: var(--text); font-weight: 700; font-size: 15px; }
.caja-num:hover { background: #e2e6ee; }
.sub-actual { font-weight: 700; font-size: 15px; color: var(--text); margin-right: 8px; font-variant-numeric: tabular-nums; }
.sub-actual:hover { color: var(--primary); }
.espacio-sel { display: inline-flex; gap: 4px; margin: 0; }
.esp { border: 1px solid var(--border); background: #fff; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.esp:hover { border-color: #c3c9d4; color: var(--text); }
.esp.pocos.on { background: var(--esp-pocos); color: var(--esp-pocos-t); border-color: transparent; }
.esp.mitad.on { background: var(--esp-mitad); color: var(--esp-mitad-t); border-color: transparent; }
.esp.llena.on { background: var(--esp-llena); color: var(--esp-llena-t); border-color: transparent; }
.avance-link { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 220px; }
.av-bar.mini { flex: 1; height: 10px; min-width: 100px; }
.av-bar.mini .seg:last-child { border-radius: 0 3px 3px 0; }
.av-txt { font-size: 12.5px; white-space: nowrap; color: var(--muted); }
.av-txt b { color: var(--text); }
.acciones-caja { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.acciones-caja form { margin: 0; }
@media (max-width: 1100px) { .stats.stats-3 { grid-template-columns: 1fr; } }
.esp.mini { padding: 2px 8px; font-size: 11.5px; cursor: default; }
.caja-cell { display: flex; align-items: center; gap: 10px; }
.caja-obs { font-size: 12px; color: var(--muted); max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.espacio-sel label.esp { display: inline-flex; align-items: center; }
.espacio-sel label.esp input { display: none; }
.btn.link.danger-link { color: #c92a2a; padding-left: 0; }
.btn.link.danger-link:hover { color: #a51d1d; }

/* ---------- Encabezado de tabla fijo al bajar ---------- */
/* La barra superior ya está fija: el encabezado de la tabla queda justo debajo. */
:root { --topbar-h: 58px; }
.table-wrap.encabezado-fijo { overflow: visible; }
.table-wrap.encabezado-fijo table.data th {
  position: sticky; top: var(--topbar-h); z-index: 5;
  box-shadow: inset 0 -1px 0 var(--border);
}
.card > .table-wrap.encabezado-fijo:first-child table.data thead th:first-child { border-top-left-radius: var(--radius); }
.card > .table-wrap.encabezado-fijo:first-child table.data thead th:last-child { border-top-right-radius: var(--radius); }
/* Barra superior compacta: en pantallas medianas, solo íconos (el nombre aparece al pasar el mouse) */
@media (max-width: 1180px) {
  .topbar-inner { gap: 16px; }
  .nav a > span:not(.nav-badge), .topbar-user .uname { display: none; }
  .nav a { padding: 8px 10px; }
}

/* ---------- Desplegable de caja ---------- */
.planilla td.c-caja { cursor: pointer; font-weight: 600; color: #46506a; white-space: nowrap; outline: none; min-width: 70px; }
.planilla td.c-caja:focus-visible { box-shadow: inset 0 0 0 1.5px var(--primary); border-radius: 6px; }
.planilla tr:hover td.c-caja:not(:has(select))::after {
  content: ""; display: inline-block; width: 8px; height: 5px; margin-left: 6px; vertical-align: middle; opacity: .6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23687186' stroke-width='1.4' fill='none'/%3E%3C/svg%3E") no-repeat center;
}
.planilla td.c-caja.saving { opacity: .55; }
.caja-sel { padding: 4px 6px; font-size: 13px; max-width: 150px; }
.sel-caja { max-width: 190px; }
.add-row select.sel-caja { min-width: 90px; }

/* ---------- Avance por mes (listado) ---------- */
.mes-card { margin-bottom: 16px; }
.mes-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 30px; }
.mes-plot { position: relative; min-width: 0; }
.mes-cols { position: relative; height: 200px; display: flex; gap: 4px; }
.mes-col { position: relative; flex: 1 1 0; height: 100%; color: var(--text); outline: none; border-radius: 6px; }
.mes-col:hover, .mes-col:focus-visible { background: #f9fafc; box-shadow: inset 0 0 0 1px #e6e9f0; }
.mes-col:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.mes-stack {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(40px, 70%); height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.mes-stack .seg { display: block; width: 100%; min-height: 2px; flex: none; }
.mes-stack .seg:first-child { border-radius: 4px 4px 0 0; }
.mes-stack .seg.completo { background: var(--c-completo); }
.mes-stack .seg.falta { background: var(--c-falta); }
.mes-stack .seg.pendiente { background: #d9dee7; }
.mes-col:hover .seg { filter: brightness(1.06); }
.mes-faltan { position: absolute; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.mes-faltan b { color: var(--text); font-size: 12.5px; }
.mes-x { display: flex; gap: 4px; margin-top: 6px; }
.mes-x span { flex: 1 1 0; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.sugerencias { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }

/* Ejes: cada número centrado exactamente sobre su línea (arriba, mitad, base) */
.col-axis { position: relative; display: block; min-width: 36px; transform: none; }
.col-axis span { position: absolute; right: 0; transform: translateY(-50%); line-height: 1; }
.col-axis span:nth-child(1) { top: 0; }
.col-axis span:nth-child(2) { top: 50%; }
.col-axis span:nth-child(3) { top: 100%; }
.mes-card .sw.pendiente { background: #d9dee7; }

/* ---------- Selector de cajas ---------- */
.cp-oculto { display: none !important; }
.cp-trigger {
  display: inline-flex; align-items: center; gap: 7px; min-width: 120px; max-width: 220px;
  padding: 7px 30px 7px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer;
  font: inherit; color: var(--text); text-align: left; position: relative; white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23687186' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.cp-trigger span { overflow: hidden; text-overflow: ellipsis; }
.cp-trigger:hover { border-color: #c9cfdb; }
.cp-trigger:focus-visible, .cp-trigger[aria-expanded="true"] { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,.15); }
.cp-trigger.vacio span { color: var(--muted); }
.field .cp-trigger { width: 100%; max-width: none; }
.add-row .cp-trigger { min-width: 96px; padding: 6px 28px 6px 9px; font-size: 13px; }
.bulk .cp-trigger { background-color: #1f2a40; border-color: #2e3a55; color: #fff; }
.bulk .cp-trigger.vacio span { color: #a9b3c7; }

.cp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: #c3c9d4; }
.cp-dot.pocos { background: #6cc27f; } .cp-dot.mitad { background: #d99f00; } .cp-dot.llena { background: #e03131; }

.cp-pop {
  position: absolute; z-index: 70; width: 400px; max-width: calc(100vw - 16px);
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: min(460px, calc(100vh - 24px));
}
.cp-buscar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cp-buscar svg { width: 16px; height: 16px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.cp-buscar input { border: 0; box-shadow: none !important; padding: 4px 0; width: 100%; font-size: 14px; }
.cp-cuerpo { overflow-y: auto; padding: 6px 12px 12px; }
.cp-seccion { padding-top: 8px; }
.cp-titulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 7px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cp-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 7px; padding: 5px 9px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: background .1s, border-color .1s;
}
.cp-chip:hover, .cp-chip:focus-visible { background: var(--primary-soft); border-color: #b8c6f5; outline: none; }
.cp-chip.sel { background: var(--primary); border-color: var(--primary); color: #fff; }
.cp-chip.sel .cp-dot { box-shadow: 0 0 0 2px #fff; }
.cp-chip.cp-llena:not(.sel) { color: #8a2a2a; background: #fff6f6; border-color: #f3cdcd; }
.cp-chip.cp-actual:not(.sel) { border-color: #9fb2ef; }
.cp-chip.cp-toda { font-weight: 500; color: var(--muted); }
.cp-chip.cp-quitar { color: #c92a2a; }
.cp-chip.cp-usar { border-style: dashed; color: var(--primary); }
.cp-fijas { padding-top: 6px; }
.cp-fila { display: grid; grid-template-columns: 112px 1fr; gap: 8px; align-items: start; padding: 5px 0; border-top: 1px solid #f1f3f7; }
.cp-fila:first-of-type { border-top: 0; }
.cp-fila .cp-chip { min-width: 34px; justify-content: center; padding: 4px 7px; }
.cp-etq { font-size: 12.5px; font-weight: 700; color: #3b4458; padding-top: 5px; display: flex; flex-direction: column; gap: 2px; }
.cp-esp { font-size: 11px; font-weight: 600; }
.cp-esp.pocos { color: #1e7b34; } .cp-esp.mitad { color: #8a5f00; } .cp-esp.llena { color: #c92a2a; }
.cp-nueva { padding-top: 10px; }
.cp-vacio { color: var(--muted); font-size: 13px; padding: 14px 2px 4px; }
.planilla td.c-caja.abierta { box-shadow: inset 0 0 0 1.5px var(--primary); border-radius: 6px; background: #fff; }
.cp-titulo { display: flex; align-items: center; gap: 10px; }
.cp-ref { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.cp-ref .cp-dot { width: 7px; height: 7px; margin-left: 6px; }
.cp-chip.cp-mas { border-style: dashed; color: var(--primary); background: #fafbff; font-weight: 600; }
.cp-chip.cp-mas:hover { background: var(--primary-soft); }
.cp-agregar { border-top: 1px solid #f1f3f7; margin-top: 8px; padding-top: 10px; }
.cp-pop.cp-cargando { opacity: .6; pointer-events: none; }
