:root{--teal:#237f83;--navy:#263746;--gold:#e7ad42;--bg:#f3f5f6;--line:#dce2e5}*{box-sizing:border-box}body{margin:0;background:var(--bg);font:14px system-ui,-apple-system,sans-serif;color:#24313b}header{height:76px;background:#fff;border-top:4px solid var(--teal);display:flex;align-items:center;justify-content:space-between;padding:8px 28px;box-shadow:0 1px 5px #0001}.brand{display:flex;align-items:center;gap:14px}.brand img{height:54px;max-width:150px;object-fit:contain}.brand strong{display:block;color:#176f78;font-size:19px}.brand small,td small{display:block;color:#6c7b84;margin-top:3px}nav{display:flex;gap:14px;align-items:center}nav form{display:inline}.layout{display:grid;grid-template-columns:210px 1fr;min-height:calc(100vh - 116px)}aside{padding:24px 14px;background:var(--navy)}aside a{display:block;color:#dce5eb;text-decoration:none;padding:12px 14px;border-radius:8px;margin-bottom:6px}aside a.active,aside a:hover{background:#ffffff1d;color:#fff}main{padding:28px;overflow:auto}h1{margin-top:0}section,details{background:#fff;border:1px solid var(--line);border-radius:12px;margin:16px 0;padding:18px;box-shadow:0 2px 7px #00000009}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.cards>div{background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px}.cards b{display:block;font-size:28px;margin-top:8px;color:var(--teal)}table{border-collapse:collapse;width:100%;min-width:760px}th,td{border-bottom:1px solid #edf0f2;padding:11px 10px;text-align:left;vertical-align:top}th{background:#f7f8f9;color:#55636c;position:sticky;top:0}.num{text-align:right;font-weight:700}progress{accent-color:var(--teal)}label{display:grid;gap:6px;font-weight:600}input,select,button{font:inherit;border:1px solid #cfd7db;border-radius:7px;padding:10px;background:#fff}button{background:var(--navy);color:#fff;border:0;cursor:pointer}.link{padding:4px 8px;background:none;color:var(--teal)}.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:18px}.form-grid .wide{grid-column:span 2}.search{width:320px;margin-bottom:12px}.alert{padding:12px 16px;border-radius:8px}.green{background:#e5f5ed;color:#176a45}.red{background:#fee9e7;color:#a12a21}.inline{padding:0;margin:0;border:0;box-shadow:none}.popover{display:grid;gap:8px;min-width:180px;margin-top:8px}footer{height:40px;background:#fff;border-top:1px solid var(--line);padding:11px 28px;color:#71808a;text-align:right}.login{display:grid;place-items:center;min-height:100vh}.login-card{width:min(420px,92vw);background:#fff;padding:34px;border-radius:16px;box-shadow:0 12px 45px #1f354028;display:grid;gap:16px}.login-card img{height:90px;max-width:100%;margin:auto}.login-card h1,.login-card p{text-align:center;margin:0}.role-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.role-grid>div{background:#fff;border:1px solid var(--line);border-top:4px solid var(--teal);border-radius:10px;padding:14px}.role-grid small{display:block;margin-top:8px;color:#65737c}.badge{display:inline-block;padding:4px 8px;border-radius:999px;font-size:12px;white-space:nowrap}.badge.on{background:#e4f4ed;color:#176a45}.badge.off{background:#edf0f2;color:#68757d}.badge.warn{background:#fff1d6;color:#8a5a00}.user-edit,.stack-form{display:grid;gap:10px;margin-top:12px}.user-edit{min-width:320px}.check{display:flex;grid-template-columns:auto 1fr;align-items:center}.check input{width:auto}.password-panel{max-width:560px;margin:50px auto;background:#fff;border:1px solid var(--line);border-radius:14px;padding:30px}.hint{color:#65737c}.admin-split{display:grid;grid-template-columns:minmax(300px,1fr) minmax(300px,1fr);gap:20px;min-width:720px;padding-top:12px}.order-lines{grid-column:1/-1;background:#f7f9fa;border-radius:8px;padding:14px}.order-lines>div{display:flex;justify-content:space-between;gap:20px;padding:7px;border-bottom:1px solid var(--line)}
@media(max-width:1000px){.role-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:800px){header{height:auto;align-items:flex-start;gap:10px;padding:10px}.brand strong{font-size:15px}nav span{display:none}.layout{display:block}aside{display:flex;overflow:auto;padding:8px}aside a{white-space:nowrap;margin:0}main{padding:14px}.cards,.form-grid,.role-grid,.admin-split{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}footer{height:auto}.brand img{height:42px}.admin-split{min-width:0}}
.page-head,.section-title,.report-title{display:flex;align-items:center;justify-content:space-between;gap:18px}.page-head p,.section-title p,.report-title p{margin:4px 0;color:#687680}.button{display:inline-block;text-decoration:none;background:var(--navy);color:#fff;padding:10px 14px;border-radius:8px}.button.secondary{background:#e8edef;color:#31424e}.admin-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.admin-cards a{display:grid;gap:7px;text-decoration:none;color:inherit;background:#fff;border:1px solid var(--line);border-radius:12px;padding:24px;box-shadow:0 2px 8px #0000000b}.admin-cards a:hover{border-color:var(--teal);transform:translateY(-1px)}.admin-cards small{color:#687680}.admin-icon{font-size:28px}.difficulty{display:inline-block;border-radius:999px;padding:4px 8px;font-size:12px;font-weight:700}.difficulty.normal{background:#e4f4ed;color:#176a45}.difficulty.media{background:#fff1d6;color:#8a5a00}.difficulty.alta{background:#fee9e7;color:#a12a21}.alerts-section{border-left:5px solid #d93025}.alert-count{display:grid;place-items:center;min-width:38px;height:38px;border-radius:50%;background:#fee9e7;color:#a12a21;font-weight:800}.shortage{color:#b3261e;font-weight:800}.empty-state{padding:24px;background:#f6fbf9;border-radius:8px;color:#176a45}.report-filters{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.report-filters .button{background:#e8edef;color:#31424e}.report-filters .button.active{background:var(--teal);color:#fff}.report-sheet{max-width:1050px}.report-title{justify-content:flex-start;border-bottom:1px solid var(--line);padding-bottom:14px}.report-title img{width:110px;height:65px;object-fit:contain}.report-cards{margin:18px 0}.chart{border:1px solid var(--line);border-radius:10px;padding:10px;margin:18px 0}.chart svg{width:100%;height:auto}.axis{stroke:#aeb8be;stroke-width:1}.line{fill:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.line.current{stroke:#237f83}.line.previous{stroke:#9aa6ad;stroke-dasharray:8 6}.line.exits{stroke:#d86a3a}.legend{display:flex;gap:20px;justify-content:center}.legend i{display:inline-block;width:20px;height:4px;margin-right:6px;vertical-align:middle}.legend i.current{background:#237f83}.legend i.previous{background:#9aa6ad}.legend i.exits{background:#d86a3a}.report-footer{margin-top:20px;padding:10px 0;text-align:center;border:0}.document-upload{border-left:4px solid var(--gold);padding-left:15px}textarea{font:inherit;border:1px solid #cfd7db;border-radius:7px;padding:10px;resize:vertical}
@media(max-width:900px){.admin-cards{grid-template-columns:1fr}.page-head,.section-title{align-items:flex-start}.report-cards{grid-template-columns:1fr}}
.line.older{stroke:#d9b04c;stroke-dasharray:3 7}.legend i.older{background:#d9b04c}@media print{header,aside,body>footer,.no-print,.page-head button{display:none!important}.layout{display:block}.layout main{padding:0}.report-sheet{border:0;box-shadow:none;margin:0;max-width:none}.report-sheet table{min-width:0;font-size:10px}.report-sheet th,.report-sheet td{padding:5px}.report-sheet footer{display:block!important}.alert{display:none}body{background:#fff}@page{size:letter;margin:12mm}}
header{height:94px}.brand{gap:16px}.brand img{height:74px;width:118px;max-width:118px}.layout{min-height:calc(100vh - 134px)}.login-card img{height:115px}.forgot-link{text-align:center;color:var(--teal)}.traffic{display:inline-block;width:13px;height:13px;border-radius:50%;margin-right:8px;box-shadow:0 0 0 3px #0000000b}.traffic.green{background:#2f9e63}.traffic.yellow{background:#e5a928}.traffic.red{background:#d44237}.site-hero{display:grid;grid-template-columns:150px 1fr 260px;align-items:center;gap:22px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:20px;margin-bottom:18px}.client-logo{width:140px;height:86px;object-fit:contain;background:#fff}.client-logo-placeholder{width:140px;height:86px;border:2px dashed #cbd3d7;border-radius:10px;display:grid;place-items:center;text-align:center;color:#849097}.client-logo-mini{width:55px;height:30px;object-fit:contain;vertical-align:middle;margin-right:8px}.site-progress{display:grid;gap:7px}.site-progress b{font-size:30px;color:var(--teal)}.inline-form{display:inline;margin-left:8px}.inline-form button,.secondary-button{padding:7px 10px}.resend-form{margin-top:8px}.secondary-button{background:#e8edef;color:#31424e}.logo-upload{border-left:4px solid var(--teal);padding-left:15px}@media(max-width:800px){header{height:auto}.brand img{height:58px;width:92px}.site-hero{grid-template-columns:1fr}.client-logo,.client-logo-placeholder{width:120px;height:70px}}
header{height:94px}.brand{gap:16px}.brand img{height:74px;width:118px;max-width:118px}.layout{min-height:calc(100vh - 134px)}.login-card img{height:115px}.forgot-link{text-align:center;color:var(--teal)}.traffic{display:inline-block;width:13px;height:13px;border-radius:50%;margin-right:8px;box-shadow:0 0 0 3px #0000000b}.traffic.green{background:#2f9e63}.traffic.yellow{background:#e5a928}.traffic.red{background:#d44237}.site-hero{display:grid;grid-template-columns:150px 1fr 260px;align-items:center;gap:22px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:20px;margin-bottom:18px}.client-logo{width:140px;height:86px;object-fit:contain;background:#fff}.client-logo-placeholder{width:140px;height:86px;border:2px dashed #cbd3d7;border-radius:10px;display:grid;place-items:center;text-align:center;color:#849097}.client-logo-mini{width:55px;height:30px;object-fit:contain;vertical-align:middle;margin-right:8px}.site-progress{display:grid;gap:7px}.site-progress b{font-size:30px;color:var(--teal)}.inline-form{display:inline;margin-left:8px}.inline-form button,.secondary-button{padding:7px 10px}.resend-form{margin-top:8px}.secondary-button{background:#e8edef;color:#31424e}.logo-upload{border-left:4px solid var(--teal);padding-left:15px}.sidebar-status{margin-top:34px;padding:14px 10px;border-top:1px solid #ffffff25;color:#dce5eb}.sidebar-status>b{display:block;margin-bottom:10px;color:#fff}.sidebar-status>a{display:flex;align-items:center;gap:7px;padding:7px 0;margin:0;font-size:12px}.sidebar-status>a:hover{background:transparent;text-decoration:underline}.sidebar-status small{display:block;margin-top:14px;color:#aebbc4;line-height:1.5}.status-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto}.red-dot{background:#ef5b50}.yellow-dot{background:#f0bc45}.blue-dot{background:#64b7c1}@media(max-width:800px){header{height:auto}.brand img{height:58px;width:92px}.site-hero{grid-template-columns:1fr}.client-logo,.client-logo-placeholder{width:120px;height:70px}.sidebar-status{display:none}}

/* Panel lateral claro: reduce el peso visual del espacio libre. */
aside{background:#edf3f4;border-right:1px solid #d8e1e3}
aside>a{color:#314750;font-weight:600}
aside>a.active,aside>a:hover{background:#237f83;color:#fff}
.sidebar-status{margin:28px 4px 0;padding:14px;background:#fff;border:1px solid #d8e1e3;border-radius:10px;color:#40545c;box-shadow:0 2px 8px #2637460b}
.sidebar-status>b{color:#263746}
.sidebar-status>a{color:#40545c;font-weight:500}
.sidebar-status small{color:#788990}
.sidebar-legend{display:grid;gap:8px;border-top:1px solid #e2e8ea;margin-top:10px;padding-top:11px;font-size:11px}
.sidebar-legend span{display:flex;align-items:center;gap:8px}



.sidebar-legend .difficulty{font-style:normal;font-size:9px;padding:3px 6px;min-width:44px;text-align:center}
.movement-grid{display:grid;gap:16px;margin:18px 0}.movement-grid details{margin:0}.form-grid .wide{grid-column:1/-1}.extra-consumption{background:#fff8e1}.extra-consumption td:first-child{border-left:4px solid var(--gold)}

/* Encabezado corporativo y reloj */
header{height:112px;background:linear-gradient(120deg,#173442 0%,#237f83 68%,#2f9191 100%);border-top:0;border-bottom:5px solid var(--gold);color:#fff;padding:10px 28px}
.brand{gap:18px}.brand img{height:90px;width:150px;max-width:150px;object-fit:contain;background:#fff;border-radius:12px;padding:6px;box-shadow:0 5px 18px #102a3440}.brand strong{color:#fff;font-size:21px}.brand small{color:#d7eeee}
header nav a,header nav span,header .link{color:#fff}.live-clock{display:grid;text-align:center;line-height:1.15;background:#ffffff18;border:1px solid #ffffff32;border-radius:10px;padding:8px 12px;min-width:170px}.live-clock b{font-size:18px;color:#fff}.live-clock small{color:#f9dfaa;text-transform:capitalize;margin-top:3px}.layout{min-height:calc(100vh - 152px)}

/* Próximas entregas */
.sidebar-upcoming{border-top:1px solid #e2e8ea;margin-top:12px;padding-top:12px}.sidebar-upcoming>b{display:block;margin-bottom:7px;color:#263746}.sidebar-upcoming>a{display:flex!important;align-items:center!important;gap:8px!important;padding:7px 0!important;margin:0!important}.sidebar-upcoming a>span:last-child{min-width:0}.sidebar-upcoming a strong{display:block;color:#263746}.sidebar-upcoming a small{margin:1px 0 0;color:#788990;font-size:10px;white-space:nowrap}.upcoming-order{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--gold);color:#263746;font-size:11px;font-weight:800;flex:0 0 auto}
.site-status-counts{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}.site-status-counts span{background:#edf3f4;border-radius:999px;padding:8px 12px}.site-status-counts b{color:var(--teal);font-size:17px}.upcoming-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.upcoming-card{display:grid;gap:5px;text-decoration:none;color:#31424e;border:1px solid var(--line);border-left:5px solid var(--teal);border-radius:10px;padding:14px;background:#fff}.upcoming-card.next{border-left-color:var(--gold);background:#fffaf0}.upcoming-card small{color:#687680}.upcoming-card strong{font-size:19px;color:var(--navy)}.upcoming-card em{font-style:normal;color:#687680}

/* Producción agrupada */
.production-site>summary{display:flex;gap:14px;align-items:center;flex-wrap:wrap;cursor:pointer}.production-site>summary strong{font-size:18px;color:var(--teal)}.production-site>summary span{font-size:12px}.production-site-table{overflow:auto;margin-top:14px}.client-logo-manager{border-left:5px solid var(--gold)}

@media(max-width:800px){header{height:auto}.brand img{height:68px;width:108px}.live-clock{min-width:130px;padding:6px}.upcoming-grid{grid-template-columns:1fr}.layout{min-height:calc(100vh - 120px)}}

/* v1.7.0: lectura centrada, anexos y faltantes por Site */
table th{text-align:center}
table td.num,.num{text-align:center!important;font-variant-numeric:tabular-nums}
.cards b{text-align:center}
.site-admin-tools{display:grid;grid-template-columns:repeat(2,minmax(320px,1fr));gap:14px}
.site-admin-tools details{margin:0}.site-admin-tools .annex-manager{grid-column:1/-1;border-left:5px solid var(--gold)}
.po-manager{border-left:5px solid #5caeb8}
.shortage-site{margin:18px 0;border:1px solid var(--line);border-radius:10px;overflow:hidden;break-inside:avoid}
.shortage-site-head{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#edf3f4;padding:12px 16px}
.shortage-site-head h3{margin:0;color:var(--teal)}.shortage-site-head span{color:#687680}.shortage-site-head>b{color:#b3261e}
.shortage-site table{min-width:680px}.shortage-site th,.shortage-site td{text-align:center}.shortage-site td:nth-child(1),.shortage-site td:nth-child(2){text-align:left}
@media(max-width:800px){.site-admin-tools{grid-template-columns:1fr}.site-admin-tools .annex-manager{grid-column:auto}}

/* v1.7.1: avance visual de producción */
.production-summary-progress{display:flex!important;align-items:center;gap:8px;min-width:190px}.production-summary-progress .progress-track{width:125px}
.progress-cell{min-width:150px}.progress-value{text-align:center;font-weight:800;margin-bottom:5px;font-variant-numeric:tabular-nums}
.progress-track{display:flex;height:12px;background:#e7ecee;border-radius:999px;overflow:hidden;box-shadow:inset 0 1px 2px #26374620}
.progress-track i{display:block;height:100%;transition:width .25s ease}.progress-track .done{background:linear-gradient(90deg,#16765b,#43a477)}.progress-track .working{background:linear-gradient(90deg,#e6a82e,#f2c968)}
.production-state{display:inline-block;min-width:86px;padding:5px 9px;border-radius:999px;text-align:center;font-size:11px;font-weight:800;text-transform:uppercase}.production-state.done{background:#dff3e9;color:#176a45}.production-state.working{background:#fff0cc;color:#805700}.production-state.pending{background:#edf0f2;color:#68757d}
.production-row-working{background:#fffaf0}.production-row-done{background:#f4fbf7}.production-row-pending{background:#fff}

/* v1.7.2: encabezados y valores alineados en el mismo eje visual */
.orders-centered th,.orders-centered td{text-align:center!important;vertical-align:middle}
.orders-centered td small{margin-top:4px}
.orders-centered .client-logo-mini{display:block;margin:0 auto 5px}
.production-site-table th,.production-site-table td{text-align:center!important;vertical-align:middle}
.production-site-table td:first-child{text-align:center!important}
.annex-order-form{border-left:5px solid var(--gold);padding-left:15px}.reverse-line-form{display:flex;gap:6px;align-items:center;margin-left:auto}.reverse-line-form input{min-width:210px;padding:7px}.reverse-line-form button{background:#a83228;padding:7px 10px}.order-lines>div{align-items:center;flex-wrap:wrap}

/* v1.7.2: centrado uniforme de todas las filas y columnas del portal */
table th,table td{text-align:center!important;vertical-align:middle!important}
table td small{margin-left:auto;margin-right:auto}
.arrival-cards{grid-template-columns:repeat(4,1fr)}.arrival-create{border-left:5px solid #5caeb8}.arrival-status-form{display:flex;gap:6px;justify-content:center;margin-top:8px}.arrival-status-form select,.arrival-status-form button{padding:7px}.arrival-status-form button{background:var(--teal)}
@media(max-width:900px){.arrival-cards{grid-template-columns:repeat(2,1fr)}}

/* v1.7.3: informes legibles y reservas físicas por Site */
.report-sheet{max-width:1250px;margin-left:auto;margin-right:auto}
.report-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.historical-movement{background:#f1f4f5;color:#62727b}
.historical-movement td:first-child{border-left:4px solid #aab9bf}
.reservation-manager{border-left:5px solid var(--gold)}
.shortage-report{max-width:1450px}
