/* Forecast Navidad 2026: complementa presupuesto.css con barras de avance y filtros. */
.secondary-button,.download-button{border:1px solid var(--line);border-radius:9px;padding:9px 13px;color:var(--ink);background:var(--surface2);font:inherit;font-size:13px;font-weight:750;cursor:pointer}
.download-button{border-color:#3d58d8;background:#3d58d8;color:#fff}
.download-button:disabled{opacity:.45;cursor:not-allowed}
.sources{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;min-width:min(760px,100%)}
.source{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:rgba(15,27,45,.85)}
.source span,.source strong,.source small{display:block}
.source span{color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.09em;font-weight:850}
.source strong{margin:5px 0 3px;color:var(--cyan);font-size:15px}
.source small{color:#b7c6da;font-size:11px;line-height:1.35}
.source.missing strong{color:var(--orange)}
.kpi-grid{margin-bottom:14px}
.kpi strong{color:var(--ink)}
.kpi .kpi-bar{height:6px;margin-top:9px;border-radius:9px;background:#1c2d45;overflow:hidden}
.kpi .kpi-bar i{display:block;height:100%;background:var(--cyan)}
.alerts{display:grid;gap:8px;margin-bottom:16px}
.alerts:empty{display:none}
.alert{padding:11px 14px;border:1px solid rgba(244,165,50,.45);border-radius:11px;background:rgba(244,165,50,.08);color:#ffd59a;font-size:12.5px;line-height:1.45}
.alert.info{border-color:rgba(32,214,199,.35);background:rgba(32,214,199,.06);color:#bff3ee}
.tab-count{display:inline-block;min-width:22px;margin-left:6px;padding:2px 7px;border-radius:999px;background:rgba(255,83,98,.16);color:#ff9aa3;font-size:11px}
.fc-table{font-size:12.5px}
.fc-table td{color:#e4ecf7}
.fc-table td.text{text-align:left;white-space:normal;min-width:230px;max-width:420px}
.fc-table td.code{text-align:left;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;color:#cfe0f5}
.fc-table tbody tr.clickable{cursor:pointer}
.fc-table tbody tr.clickable:hover td:first-child{color:var(--cyan)}
.fc-table .zero{color:#5f7593}
.fc-table .warn{color:var(--orange);font-weight:850}
.fc-table .bad{color:var(--red);font-weight:850}
.progress{display:flex;width:170px;height:12px;border-radius:7px;overflow:hidden;background:#1c2d45}
.progress i{display:block;height:100%}
.seg-sellin{background:#20d6c7}.seg-reserva{background:#5678ff}.seg-libre{background:#2b3f5c}.seg-exceso{background:#ff5362}
.legend i.seg-sellin,.legend i.seg-reserva,.legend i.seg-libre,.legend i.seg-exceso{display:inline-block;width:13px;height:13px;border-radius:3px;margin-left:8px}
.progress-label{display:block;margin-top:4px;color:var(--muted);font-size:10.5px;text-align:left}
.pill{display:inline-block;padding:4px 9px;border-radius:999px;font-size:11px;font-weight:850;white-space:nowrap}
.pill.bad{background:rgba(255,83,98,.14);color:#ff9aa3}
.pill.warn{background:rgba(244,165,50,.14);color:#ffcf8a}
.pill.ok{background:rgba(39,217,155,.12);color:#7bf0c6}
.pill.info{background:rgba(86,120,255,.15);color:#b3c1ff}
.toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:14px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.toolbar label{display:grid;gap:6px;color:var(--muted);font-size:11px;text-transform:uppercase;font-weight:850;letter-spacing:.05em}
.toolbar label.grow{flex:1;min-width:220px}
.toolbar select,.toolbar input{min-width:210px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface2);color:var(--ink);font:inherit;font-size:13px;text-transform:none;letter-spacing:0}
.toolbar-summary{display:flex;gap:18px;flex-wrap:wrap;margin-left:auto}
.toolbar-summary div{min-width:110px}
.toolbar-summary span{display:block;color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}
.toolbar-summary strong{display:block;margin-top:3px;font-size:17px;color:var(--ink)}
.more{padding:14px;text-align:center;color:var(--muted);font-size:12px}
.more button{margin-left:8px;border:1px solid var(--line);border-radius:8px;padding:6px 10px;background:var(--surface2);color:var(--ink);cursor:pointer}
@media(max-width:1180px){.sources{grid-template-columns:repeat(2,minmax(150px,1fr));min-width:0}.hero{display:block}.sources{margin-top:18px}}
@media(max-width:760px){.secondary-button,.download-button{font-size:12px;padding:8px 10px}.sources{grid-template-columns:1fr 1fr}.toolbar select,.toolbar input{min-width:0;width:100%}.toolbar label{width:100%}.toolbar-summary{margin-left:0}}
.hero h1{font-size:clamp(30px,3.4vw,44px)}
.hero{align-items:center}
.source small{overflow-wrap:anywhere}

/* ---- Tema claro (Rodrigo 19-10): fondo blanco, mismos colores de barras y etiquetas, letra más grande ---- */
:root{color-scheme:light;--bg:#ffffff;--surface:#ffffff;--surface2:#f3f6fb;--line:#d6e0ec;--ink:#0f2033;--muted:#4a5f7c;--cyan:#0a8f86;--cyan2:#0ca49a;--blue:#3d58d8;--orange:#c27406;--red:#d32f42;--green:#11845a;--shadow:0 6px 20px rgba(15,42,68,.07)}
body{background:#ffffff;color:var(--ink);font-size:15px}
.topbar{background:rgba(255,255,255,.96);border-bottom:1px solid var(--line)}
.brand,.back{color:var(--ink)}
.brand small{color:var(--muted)}
.back,.secondary-button{background:#ffffff;color:var(--ink);border-color:var(--line)}
.upload-button{color:#ffffff}
.eyebrow{color:var(--cyan);font-size:12px}
.hero h1{color:var(--ink)}
.hero>div>p:last-child{color:var(--muted);font-size:16px}
.source{background:#ffffff;border-color:var(--line);box-shadow:var(--shadow)}
.source span{color:var(--muted);font-size:11.5px}
.source strong{font-size:18px}
.source small{color:#3d4f68;font-size:13px}
.status{background:#ffffff;color:var(--muted);font-size:15px}
.kpi{background:#ffffff;border-color:var(--line);box-shadow:var(--shadow);min-height:132px}
.kpi span{color:var(--muted);font-size:12.5px}
.kpi strong{color:var(--ink);font-size:clamp(26px,2.3vw,34px)}
.kpi small{color:#3d4f68;font-size:13.5px}
.kpi .kpi-bar,.progress{background:#e2e9f2}
.seg-libre,.legend i.seg-libre{background:#c3cfdf}
.alert{background:#fff7e8;border-color:#f0c77c;color:#7a4b00;font-size:14px}
.alert.info{background:#e9f8f6;border-color:#9fdcd5;color:#0b5f59}
.tabs button{color:var(--muted);font-size:15px}
.tabs button.active{color:var(--cyan);border-color:var(--cyan)}
.tab-count{background:#fde7ea;color:#c62839;font-size:12px}
.block{background:#ffffff;border-color:var(--line);box-shadow:var(--shadow)}
.block h2{font-size:20px;color:var(--ink)}
.legend{color:var(--muted);font-size:13px}
.fc-table{font-size:14.5px}
.fc-table th,.fc-table td{padding:13px 15px;border-bottom:1px solid #e3eaf3}
.fc-table thead th{background:#f1f5fa;color:#3d4f68;font-size:11.5px}
.fc-table td{color:#16263b}
.fc-table td.code{color:#174a8b;font-size:14px}
.fc-table td b{color:var(--ink)}
.fc-table tbody tr:hover{background:#f5f9ff}
.fc-table tbody tr.clickable:hover td:first-child{color:var(--cyan)}
.fc-table tfoot td{background:#eef7f6;color:var(--ink)}
.fc-table .zero{color:#a3b1c4}
.fc-table .warn{color:var(--orange)}
.fc-table .bad{color:var(--red)}
.progress{width:190px;height:14px}
.progress-label{color:var(--muted);font-size:12px}
.pill{font-size:12px}
.pill.bad{background:#fde7ea;color:#b4232f}
.pill.warn{background:#fff1d9;color:#9a5a00}
.pill.ok{background:#e3f6ee;color:#0d6e49}
.pill.info{background:#e8edff;color:#2f47b5}
.toolbar{background:#ffffff;border-color:var(--line);box-shadow:var(--shadow)}
.toolbar label{color:var(--muted);font-size:12px}
.toolbar select,.toolbar input{background:#ffffff;color:var(--ink);border-color:#c9d5e4;font-size:14.5px}
.toolbar-summary span{color:var(--muted);font-size:11.5px}
.toolbar-summary strong{font-size:19px;color:var(--ink)}
.toolbar .download-button{align-self:end}
.more{color:var(--muted);font-size:13px}
.more button{background:#ffffff;color:var(--ink);border-color:var(--line)}
footer{color:var(--muted);font-size:12.5px}
dialog{background:#ffffff;color:var(--ink);border-color:var(--line);box-shadow:0 30px 80px rgba(15,42,68,.25)}
dialog::backdrop{background:rgba(15,32,51,.45)}
dialog p:not(.eyebrow){color:var(--muted)}
.file-field input{background:#f3f6fb;border-color:#c9d5e4;color:var(--ink)}
.dialog-actions button.secondary{color:var(--ink)!important}
.positive{color:var(--green)!important}.negative{color:var(--red)!important}.attention{color:var(--orange)!important}

/* Página ancha, filas en una sola línea y números más negros (Rodrigo 19-10) */
main{width:calc(100% - 28px);max-width:2600px}
.fc-table{min-width:100%}
.fc-table th,.fc-table td{padding:11px 12px;white-space:nowrap}
.fc-table td.text{white-space:nowrap;min-width:0;max-width:340px;overflow:hidden;text-overflow:ellipsis}
.fc-table td{color:#05101d;font-weight:600}
.fc-table td.code{color:#0d3d7a;font-weight:700}
.fc-table td.text{font-weight:500;color:#0f2033}
.fc-table thead th{color:#1d2f47;font-weight:800}
.fc-table tfoot td{color:#000;font-weight:900}
.fc-table .zero{color:#9aa8bb;font-weight:500}
.progress-label{white-space:nowrap}
.kpi strong,.toolbar-summary strong,.source strong{font-weight:900}
.kpi strong,.toolbar-summary strong{color:#05101d}
.kpi small,.source small{color:#22344d}
.fc-table thead th{white-space:normal;line-height:1.25;vertical-align:bottom;min-width:64px;font-size:11px}
.fc-table th,.fc-table td{padding:10px 10px}
.fc-table td{font-size:14px}
.fc-table td.text{max-width:290px}
.fc-table .pill{font-size:11.5px;padding:3px 8px}
.fc-table .inline-date{color:#4a5f7c;font-size:11px;font-weight:600}
.fc-table td.action-cell{text-align:left}
/* La página no se desplaza hacia el costado; las tablas anchas tienen su propio desplazamiento. */
html,body{overflow-x:hidden}
main{margin-left:auto;margin-right:auto}

/* Saldos negativos en rojo aunque estén en negrita; números negros (Rodrigo 19-10) */
.fc-table td{color:#000}
.fc-table td b{color:inherit}
.fc-table td.bad,.fc-table td.bad b,.fc-table .bad{color:#d0021b!important;font-weight:800}
.fc-table td.good-num b{color:#0b6b45}
.fc-table .zero{color:#7d8ca1}
.fc-table td.text{color:#000}
.tab-count.ok-count{background:#e3f6ee;color:#0d6e49}

/* Filtro de marca general (Rodrigo 19-10) */
.brand-bar{display:flex;flex-wrap:wrap;align-items:end;gap:16px;margin:4px 0 14px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#f7fafd}
.brand-bar label{display:grid;gap:6px;color:var(--muted);font-size:12px;text-transform:uppercase;font-weight:850;letter-spacing:.05em}
.brand-bar select{min-width:320px;padding:10px 12px;border:1px solid #c9d5e4;border-radius:9px;background:#fff;color:var(--ink);font:inherit;font-size:15px;font-weight:700;text-transform:none;letter-spacing:0}
.brand-bar .hint{color:var(--muted);font-size:12.5px;padding-bottom:10px}
/* Números un poco más grandes, negros y marcados (Rodrigo 19-10) */
.fc-table td{font-size:15.5px;font-weight:700;color:#000;letter-spacing:-.005em}
.fc-table td.text{font-size:14.5px;font-weight:500}
.fc-table td.code{font-size:14.5px;font-weight:800}
.fc-table td b{font-weight:900}
.fc-table .zero{font-weight:600;color:#6f7f95}
.fc-table tfoot td{font-size:15.5px;font-weight:900}
.fc-table .warn{color:#b86a00;font-weight:900}
.fc-table .bad,.fc-table td.bad b{font-weight:900}
.toolbar-summary strong{font-size:21px}

/* Detalle del código por cliente (Rodrigo 20-10) */
.fc-table td.code{cursor:pointer;text-decoration:underline;text-decoration-color:#9fb6d6;text-underline-offset:3px}
.fc-table td.code:hover{color:#0a8f86}
.code-dialog{width:min(1280px,calc(100% - 28px))}
.code-dialog form{padding:24px 26px}
.code-dialog h2{font-size:22px;color:var(--ink);padding-right:30px}
.code-info{margin:2px 0 12px;color:var(--muted)!important;font-size:13px}
.code-cards{display:grid;grid-template-columns:repeat(7,minmax(110px,1fr));gap:8px;margin-bottom:14px}
.code-cards div{padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#f7fafd}
.code-cards span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:800}
.code-cards strong{display:block;margin-top:4px;font-size:18px;color:#000}
@media(max-width:900px){.code-cards{grid-template-columns:repeat(2,1fr)}}

/* Edición del forecast en pantalla (Rodrigo 22-10) */
.fc-input{width:96px;padding:6px 8px;border:1.5px solid #9fb6d6;border-radius:8px;background:#fffdf0;color:#000;font:inherit;font-size:15px;font-weight:800;text-align:right}
.fc-input:focus{outline:2px solid #0a8f86;border-color:#0a8f86}
.code-edit{display:flex;flex-wrap:wrap;align-items:end;gap:14px;margin-top:14px;padding:14px;border:1px dashed #c9d5e4;border-radius:12px;background:#fbfcfe}
.code-edit label{display:grid;gap:6px;color:var(--muted);font-size:12px;text-transform:uppercase;font-weight:850}
.code-edit select,.code-edit input{min-width:180px;padding:9px 11px;border:1px solid #c9d5e4;border-radius:9px;background:#fff;color:var(--ink);font:inherit;font-size:14px;text-transform:none}
.code-edit .hint{flex:1;min-width:220px;color:var(--muted);font-size:12.5px;padding-bottom:8px}
.code-edit-actions{display:flex;gap:10px}
.code-edit .dialog-status{width:100%;margin:0;font-size:13px;font-weight:700}

/* Forecast por cliente editable (Rodrigo 22-10) */
.detail-edit{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:-6px 0 4px;padding:12px 14px;border:1px dashed #9fb6d6;border-radius:12px;background:#fffdf0}
.detail-edit strong{color:var(--ink);font-size:14px}
.detail-edit .hint{color:var(--muted);font-size:12.5px}
.detail-edit input{padding:8px 10px;border:1px solid #c9d5e4;border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:14px;width:150px}
.detail-edit .spacer{flex:1}
.detail-edit .dialog-status{width:100%;margin:0;font-size:13px;font-weight:700}
.fc-input.changed{background:#fff3c4;border-color:#c27406}

/* Historial de cambios plegado: se abre al pinchar (Rodrigo 26-10) */
.adjust-fold{padding:0}
.adjust-fold>summary{display:flex;align-items:center;gap:12px;padding:12px 18px;cursor:pointer;list-style:none;font-weight:850;color:var(--ink)}
.adjust-fold>summary::-webkit-details-marker{display:none}
.adjust-fold>summary .hint{padding:0;font-weight:600}
.adjust-fold .adjust-open{margin-left:auto;color:#0f64d5;font-size:13px;font-weight:850}
.adjust-fold[open] .adjust-open{font-size:0}
.adjust-fold[open] .adjust-open::after{content:"Ocultar ▴";font-size:13px}
.adjust-fold>p.hint{margin:0;padding:0 18px 10px}
.adjust-fold .table-wrap{margin:0 0 6px}

/* Foto del producto en el detalle del código (Rodrigo 02-11) */
.code-head{display:flex;align-items:center;gap:16px}
.code-photo{flex:none;width:88px;height:88px;display:grid;place-items:center;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}
.code-photo img{max-width:84px;max-height:84px;object-fit:contain}
.code-photo{cursor:zoom-in}.code-photo:hover{border-color:#8db4e3;box-shadow:0 4px 14px #17304f1f}
.photo-dialog{max-width:min(940px,94vw);max-height:94vh;padding:16px;border:0;border-radius:16px;background:#fff;cursor:zoom-out;text-align:center}
.photo-dialog::backdrop{background:#0b1b2ecc}
.photo-dialog img{display:block;max-width:100%;max-height:80vh;margin:0 auto;object-fit:contain}
.photo-dialog p{margin:10px 0 0;color:#173352;font-weight:700;font-size:14px}
