/* Instyle Retail Control — UI base (mobile-first, sin frameworks) */

:root {
    --navy: #0b1626;
    --navy-2: #111f33;
    --navy-3: #17263d;
    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --green: #16a34a;
    --green-soft: #dcfce7;
    --orange: #f59e0b;
    --orange-soft: #fef3c7;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --bg: #eef2f7;
    --card: #ffffff;
    --line: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --radius: 14px;
    --sidebar-w: 252px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 6px 24px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
h1, h2, h3 { margin: 0; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--navy);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .22s ease;
    overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(2, 6, 23, .55);
    z-index: 30;
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

.main { min-height: 100vh; display: flex; flex-direction: column; }

@media (min-width: 960px) {
    .sidebar { transform: none; }
    .sidebar-backdrop { display: none; }
    .main { margin-left: var(--sidebar-w); }
    #sidebarToggle { display: none; }
}

/* ---------- Sidebar ---------- */
.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px 18px;
}
.brand-mark {
    width: 40px; height: 40px; border-radius: 11px;
    background: var(--navy-3);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-mark.big { width: 48px; height: 48px; background: var(--navy); }
.brand-text { color: #fff; font-weight: 800; letter-spacing: .12em; font-size: 15px; line-height: 1.1; }
.brand-text small { font-weight: 500; font-size: 8.5px; letter-spacing: .38em; color: #94a3b8; }

.nav { flex: 1; padding: 4px 12px 16px; }
.nav-label {
    font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: #64748b; font-weight: 700;
    padding: 18px 10px 7px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px;
    border-radius: 9px;
    color: #b9c5d6;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 2px;
}
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.active { background: var(--navy-3); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { display: flex; opacity: .85; }
.nav-badge {
    margin-left: auto;
    background: var(--red); color: #fff;
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
    min-width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 6px;
}
.sidebar-foot { padding: 14px 20px; border-top: 1px solid var(--navy-2); }
.version { font-size: 11.5px; color: #64748b; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 12px 18px;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13.5px; }
.user-meta small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 560px) { .user-meta { display: none; } }

.icon-btn {
    background: none; border: 1px solid var(--line);
    border-radius: 9px;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* ---------- Contenido ---------- */
.content { padding: 18px; display: flex; flex-direction: column; gap: 16px; max-width: 1280px; width: 100%; }
@media (min-width: 960px) { .content { padding: 24px 28px; } }

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h2 { font-size: 16px; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 3fr 2fr; align-items: start; } }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi { display: flex; gap: 14px; align-items: center; }
.kpi-icon {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-icon.orange { background: var(--orange-soft); color: var(--orange); }
.kpi-icon.navy { background: #e2e8f0; color: var(--navy); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.kpi-foot { font-size: 12px; color: var(--muted); }
.text-red { color: var(--red); font-weight: 700; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
th {
    text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700;
    padding: 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
th.num { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

.badge {
    display: inline-block;
    font-size: 11.5px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    white-space: nowrap;
}
.badge.blue { background: var(--blue-soft); color: #1d4ed8; }
.badge.green { background: var(--green-soft); color: #15803d; }
.badge.orange { background: var(--orange-soft); color: #b45309; }
.badge.red { background: var(--red-soft); color: #b91c1c; }
.badge.gray { background: #f1f5f9; color: var(--muted); }

small.muted { color: var(--muted); font-size: 11px; }

/* ---------- Marketing / Redes ---------- */
.acc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.acc-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none;
}
.acc-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.acc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.acc-periods { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-period { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid var(--line); }
.acc-period.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.spark-wrap { width: 100%; height: 140px; }
.spark { width: 100%; height: 140px; display: block; }
.spark-empty, .spark-legend { color: var(--muted); font-size: 12.5px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }

.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kb-col { flex: 0 0 250px; display: flex; flex-direction: column; }
.kb-head { padding: 9px 13px; border-radius: 10px 10px 0 0; color: #fff; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.kb-count { background: rgba(255,255,255,.28); border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.kb-body { flex: 1; background: #f1f5f9; border-radius: 0 0 10px 10px; padding: 8px; min-height: 90px; display: flex; flex-direction: column; gap: 8px; }
.kb-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0; }
/* Overlay de espera del OCR (lectura de la hoja) */
.ocr-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(11, 22, 38, .82); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.ocr-box { background: #fff; border-radius: 16px; padding: 28px 26px; max-width: 340px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.ocr-box strong { font-size: 17px; }
.ocr-msg { color: var(--muted); font-size: 13.5px; min-height: 36px; }
.ocr-spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #dbeafe; border-top-color: var(--blue, #2563eb); animation: ocrspin .9s linear infinite; }
@keyframes ocrspin { to { transform: rotate(360deg); } }

/* Recepción en Finanzas: validación sobre por sobre */
.sobre-card { border-left: 4px solid var(--orange, #f59e0b); }
.sobre-card.sobre-ok { border-left-color: #16a34a; }

/* Recolección: chips de fecha del corte (evita el formato gringo del date nativo) */
.date-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.date-chip { cursor: pointer; }
.date-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.date-chip span { display: block; text-align: center; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 12.5px; line-height: 1.25; background: #fff; color: var(--muted); }
.date-chip input:checked + span { border-color: var(--blue, #2563eb); background: #eff6ff; color: var(--blue, #2563eb); font-weight: 600; }
.other-date-input { margin-bottom: 10px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; width: 100%; }

/* Recolección: pregunta "¿otro corte?" tras cada foto */
.next-cut-prompt { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; padding: 14px; background: #f0fdf4; border: 1px solid #86efac; border-radius: 12px; }
.next-cut-prompt strong { font-size: 14px; }

/* Recolección: captura de corte por foto (OCR bloqueado) */
.photo-cut { margin-bottom: 14px; }
.photo-cut-drop { display: flex; align-items: center; gap: 14px; padding: 16px; border: 2px dashed var(--blue, #2563eb); border-radius: 12px; background: #eff6ff; cursor: pointer; transition: background .15s; }
.photo-cut-drop:hover { background: #dbeafe; }
.photo-cut-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-cut-icon { font-size: 30px; }
.photo-cut-drop.busy { opacity: .65; pointer-events: none; border-style: solid; }
.photo-cut-drop small { color: var(--muted); }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .chart-row { grid-template-columns: 1fr; } }
.field-hint { color: var(--muted); font-size: 11.5px; margin-top: 3px; display: block; }
.kb-card { background: #fff; border-radius: 8px; padding: 11px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-left: 3px solid transparent; }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card[draggable="true"]:active { cursor: grabbing; }
.kb-card.dragging { opacity: .45; }
.kb-body.drag-over { background: #dbeafe; outline: 2px dashed #60a5fa; outline-offset: -2px; }
.kb-card.prio-alta { border-left-color: var(--red); }
.kb-card.prio-media { border-left-color: var(--orange); }
.kb-card.prio-baja { border-left-color: #6ee7b7; }
.kb-acc { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.kb-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.kb-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.idea-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 10px; background: #f1f5f9; color: var(--muted); }
.kb-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kb-move { flex: 1; min-width: 0; }
.kb-move select { width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--muted); }
.kb-del { flex: 0 0 auto; }
.kb-del-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 5px 8px; font-size: 13px; line-height: 1; cursor: pointer; color: var(--muted); }
.kb-del-btn:hover { background: #fef2f2; border-color: var(--red); }
.idea-new { margin-top: 6px; }
.idea-new summary { cursor: pointer; list-style: none; }
.idea-new summary::-webkit-details-marker { display: none; }

/* ---------- Checklist / Visitas ---------- */
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress-bar span { display: block; height: 100%; background: var(--blue); border-radius: 999px; transition: width .3s; }
.checklist { display: flex; flex-direction: column; gap: 12px; }
.chk-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.chk-item.chk-done { border-color: #bbf7d0; background: #f6fef9; }
.chk-item.chk-fail { border-color: #fecaca; background: #fef6f6; }
.chk-q { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }
.chk-q > span:first-child { flex: 1; min-width: 200px; }
.chk-options { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chk-opt { position: relative; }
.chk-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk-opt span {
    display: inline-block; padding: 6px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
    border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); user-select: none;
}
.chk-opt input:checked + span { color: #fff; }
.chk-opt-complies input:checked + span { background: var(--green); border-color: var(--green); }
.chk-opt-partial input:checked + span { background: var(--orange); border-color: var(--orange); }
.chk-opt-fails input:checked + span { background: var(--red); border-color: var(--red); }
.chk-opt-na input:checked + span { background: var(--muted); border-color: var(--muted); }
.chk-extra { display: flex; gap: 8px; flex-wrap: wrap; }
.chk-extra input[type=text] { flex: 1; min-width: 180px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; }
.chk-extra input[type=file] { font-size: 12.5px; max-width: 200px; }
.chk-answer { font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; position: sticky; bottom: 12px; z-index: 5; }

/* ---------- Panel de ventas (dashboard) ---------- */
.sales-panel { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sales-block { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.sales-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.sales-total { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; }
.sales-breakdown { font-size: 13px; color: #334155; }
.sales-cmp { font-size: 12.5px; margin-top: 6px; }

/* ---------- KPIs semanales ---------- */
.kpi-week-good { color: var(--green); font-weight: 700; }
.kpi-week-bad { color: var(--red); font-weight: 700; }
.traffic-input { width: 90px; text-align: right; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 7px; }
.muted-cell { color: var(--muted); }
.delta-up { color: var(--green); font-weight: 700; white-space: nowrap; }
.delta-down { color: var(--red); font-weight: 700; white-space: nowrap; }

/* ---------- Tabs de canal ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tab {
    padding: 8px 14px; font-size: 13.5px; font-weight: 600;
    color: var(--muted); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-count {
    background: #f1f5f9; color: var(--muted);
    border-radius: 999px; font-size: 11px; font-weight: 700;
    padding: 1px 8px;
}
.tab.active .tab-count { background: var(--blue-soft); color: #1d4ed8; }

/* ---------- Formularios ---------- */
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .span-2 { grid-column: span 2; }
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: 12.5px; font-weight: 600; color: #334155; }
.field input, .field select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 15px;
    background: #fff;
    width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.check { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; }
.check-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 6px; }
.check-grid .check { margin: 0; }
.form-section { font-size: 14px; margin-top: 20px; color: #334155; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.inline-form .field { flex: 1; min-width: 150px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 14px; font-weight: 600;
    text-decoration: none;
    border: 0; cursor: pointer;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: #334155; }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; margin-top: 18px; }

/* ---------- Estados / misceláneos ---------- */
.flash {
    margin: 14px 18px 0;
    padding: 11px 15px;
    border-radius: 10px;
    font-size: 14px;
}
@media (min-width: 960px) { .flash { margin: 16px 28px 0; max-width: 1224px; } }
.flash-ok { background: var(--green-soft); color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: var(--red-soft); color: #b91c1c; border: 1px solid #fecaca; }
.auth-card .flash, .auth-card .flash-error { margin: 0 0 14px; }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 34px 16px;
    font-size: 14px;
    line-height: 1.6;
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 10px;
}
.hint {
    margin-top: 14px;
    background: #f0f6ff;
    border: 1px solid #dbeafe;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.55;
    padding: 11px 14px;
    border-radius: 10px;
}
.link { color: var(--blue); font-weight: 600; text-decoration: none; font-size: 13.5px; }
.link:hover { text-decoration: underline; }

.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 2px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.stat-list li:last-child { border-bottom: 0; }
.stat-list span { color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    display: flex; gap: 14px;
    padding: 8px 2px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13.5px;
    align-items: baseline;
}
.timeline li:last-child { border-bottom: 0; }
.timeline .time { color: var(--muted); font-size: 12px; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; }
.timeline .what { min-width: 0; }

/* ---------- Módulo placeholder ---------- */
.module-card h2 { font-size: 20px; margin: 12px 0 6px; }
.module-head { display: flex; gap: 8px; flex-wrap: wrap; }
.module-desc { color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
.module-card h3 { font-size: 14px; color: #334155; margin-bottom: 8px; }
.feature-list { margin: 0; padding: 0 0 0 2px; list-style: none; }
.feature-list li {
    padding: 7px 0 7px 26px;
    position: relative;
    font-size: 14px;
    border-bottom: 1px solid #f8fafc;
}
.feature-list li::before {
    content: "✓";
    position: absolute; left: 2px;
    color: var(--green); font-weight: 800;
}

/* ---------- Cajas editables ---------- */
.reg-list { display: flex; flex-direction: column; gap: 10px; }
.reg-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.reg-edit { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.reg-edit input {
    padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px;
}
.reg-edit input[name="name"] { width: 120px; }
.reg-edit input[name="authorized_fund"] { width: 100px; text-align: right; }
.reg-actions { display: flex; gap: 6px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }

/* ---------- Desglose del esperado (fondo) ---------- */
.expected-box {
    background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 14px; font-size: 14px;
}
.expected-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.expected-row.neg strong { color: var(--red); }
.expected-row.pos strong { color: var(--green); }
.expected-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; }
.expected-row.total strong { font-size: 17px; color: var(--blue); }
.expected-detail { margin-top: 8px; font-size: 13px; }
.expected-detail summary { cursor: pointer; color: var(--muted); }
.expected-detail ul { margin: 8px 0 0; padding-left: 18px; color: #334155; }
.expected-detail li { padding: 2px 0; }
.expected-actions { margin-top: 8px; font-size: 13px; }

/* ---------- Fondos / denominaciones ---------- */
.fund-refs { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.fund-refs > div { display: flex; flex-direction: column; gap: 2px; }
.denom-table input.denom-qty, .denom-table input.denom-cent {
    width: 90px; text-align: right; padding: 7px 9px;
    border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px;
}
.denom-table td { padding: 6px 10px; }
.denom-total {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-top: 14px; padding: 14px 16px; background: var(--navy); color: #fff; border-radius: 10px;
    font-weight: 600;
}
.denom-total strong { font-size: 20px; margin-left: 8px; }
.denom-mxn {
    display: flex; justify-content: flex-end; gap: 8px; align-items: baseline;
    margin-top: 8px; font-size: 13.5px; color: var(--muted);
}
.denom-mxn strong { font-size: 16px; color: var(--text); }
.denom-diffval.ok { color: #86efac; }
.denom-diffval.neg { color: #fca5a5; }
.denom-diffval.pos { color: #fcd34d; }

/* ---------- Recolecciones ---------- */
.collection-totals { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.collection-totals > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; }
.ct-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.ct-value { font-size: 16px; font-weight: 700; }
.ct-value.big { font-size: 22px; color: var(--blue); }

.avail-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.avail-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.avail-row > div:first-child { flex: 1; display: flex; flex-direction: column; }
.avail-amount { font-weight: 700; }

.dep-cut {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.dep-cut:has(.dep-check:checked) { border-color: var(--blue); background: var(--blue-soft); }
.dep-cut input { width: 18px; height: 18px; flex-shrink: 0; }
.dep-cut-info { flex: 1; display: flex; flex-direction: column; }
.dep-cut-amount { font-weight: 700; }
.dep-sum { text-align: right; margin-top: 12px; font-size: 15px; }
.dep-sum strong { font-size: 18px; color: var(--blue); }

.custody-now { display: flex; align-items: center; gap: 14px; padding: 16px 0 20px; }
.custody-badge {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--blue-soft); color: var(--blue);
    display: flex; align-items: center; justify-content: center;
}

.sign-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.sign-box.signed { border-color: #bbf7d0; background: #f0fdf4; }
.sign-box.disabled { opacity: .6; }
.sign-box h3 { font-size: 14px; margin-bottom: 8px; }
.sign-legend { font-style: italic; color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.signature-pad {
    width: 100%; height: 170px; touch-action: none;
    border: 2px dashed #cbd5e1; border-radius: 10px; background: #fff;
    display: block; margin: 4px 0;
}
.sign-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.sign-done { display: flex; align-items: center; gap: 14px; }
.sign-img { width: 150px; height: 70px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sign-empty { width: 150px; height: 70px; display: flex; align-items: center; justify-content: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }

.reception-summary { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 4px; }
.reception-summary > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.reception-summary .span-2 { grid-column: span 2; }

/* ---------- Comprobante ---------- */
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--navy); padding-bottom: 14px; margin-bottom: 16px; }
.receipt-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 8px; }
.receipt-grid > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.receipt-total {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--navy); color: #fff; border-radius: 10px;
    padding: 14px 18px; font-weight: 700; letter-spacing: .04em; margin: 16px 0;
}
.receipt-total span { font-size: 22px; }
.receipt-signs { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin: 8px 0; }
.receipt-sign { text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.receipt-sign .sign-img, .receipt-sign .sign-empty { width: 100%; height: 90px; margin-bottom: 8px; }
.receipt-sign-name { font-weight: 700; }
.receipt-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media print {
    .sidebar, .topbar, .sidebar-backdrop, .no-print { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
    body { background: #fff; }
}

/* ---------- Login ---------- */
.auth-body {
    background: linear-gradient(160deg, var(--navy) 0%, #10233c 60%, #132b49 100%);
    min-height: 100vh; margin: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card {
    background: var(--card);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-mark { color: #fff; }
.auth-brand-name { font-weight: 800; letter-spacing: .1em; font-size: 15px; }
.auth-brand-sub { font-size: 12px; color: var(--muted); }
.auth-card h1 { font-size: 20px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 18px; line-height: 1.5; }
.auth-card .field { margin-bottom: 12px; }
.auth-foot { text-align: center; color: #64748b; font-size: 12px; margin-top: 18px; letter-spacing: .04em; }

/* ---------- Cortes / captura de foto ---------- */
.muted-note { color: var(--muted); font-size: 12px; display: block; margin-top: 6px; }
.photo-capture { margin-top: 16px; }
.photo-drop {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center;
    padding: 28px 18px;
    border: 2px dashed #cbd5e1; border-radius: 14px;
    background: #f8fafc; cursor: pointer;
}
.photo-drop:hover { border-color: var(--blue); background: #f0f6ff; }
.photo-drop.has-file { border-color: var(--green); background: var(--green-soft); }
.photo-drop strong { font-size: 15px; }
.photo-drop small { color: var(--muted); font-size: 12.5px; }
.photo-ico { color: var(--blue); }
.photo-preview { display: block; max-width: 100%; margin-top: 14px; border-radius: 12px; border: 1px solid var(--line); }
.cut-photo { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); }

.denom-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 0; }
.denom-table th, .denom-table td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; }
.denom-table thead th { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.denom-table tfoot th { font-size: 14px; border-top: 2px solid var(--line); border-bottom: 0; padding-top: 10px; }
.denom-qty, .denom-cent { width: 90px; text-align: right; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; }
.denom-sub { color: var(--muted); font-variant-numeric: tabular-nums; }

.efectivo-box {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 16px;
    padding: 14px 16px; border-radius: 12px;
    background: var(--navy); color: #fff;
}
.efectivo-box span { font-size: 13px; color: #cbd5e1; }
.efectivo-box strong { font-size: 22px; font-weight: 800; }
