:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#162b40;background:#f1f4f8;font-size:16px;--navy:#142a40;--blue:#1664c0;--line:#dae2eb;--muted:#526779}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button,.button{border:1px solid var(--line);border-radius:8px;padding:11px 16px;background:white;color:var(--navy);cursor:pointer;font-weight:600;min-height:44px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px}button:hover,.button:hover{background:#eaf1f9}button:disabled{opacity:.5;cursor:not-allowed}.primary{background:var(--blue);color:white;border-color:var(--blue)}.primary:hover{background:#10519e}.danger{color:#a52232;border-color:#ecc5cd}.quiet{background:transparent;border-color:transparent}.shell{display:grid;grid-template-columns:230px minmax(0,1fr);min-height:100vh}aside{background:var(--navy);color:white;padding:30px 18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;gap:12px;align-items:center;padding:0 10px 34px}.brandmark{width:48px;height:48px;display:grid;place-items:center;background:#ffd343;color:#162b40;font-size:26px;font-weight:900;border-radius:10px}.brand strong{display:block;font-size:17px}.brand small{font-size:13px;color:#b9c8d6}.nav{display:flex;flex-direction:column;gap:7px}.nav a{color:#ced8e4;padding:13px 16px;border-radius:8px;text-decoration:none;font-weight:550;font-size:15px}.nav a:hover,.nav a.active{background:#29445f;color:white}.nav a.active{box-shadow:inset 3px 0 #ffd343}.nav span{display:inline-block;width:29px}.account{margin-top:auto;padding:22px 10px 0;border-top:1px solid #385066;font-size:14px}.account p{margin:4px 0}.account small{color:#bbcddd}.account button{color:white;margin:14px 0 0;padding:8px 0}.workspace{min-width:0}.topbar{background:#fff;border-bottom:1px solid var(--line);padding:20px 34px;display:flex;justify-content:space-between;gap:16px;font-size:14px;color:var(--muted)}main{padding:32px;max-width:1800px;margin:0 auto}.heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}.heading h1{font-size:30px;letter-spacing:-.8px;margin:0 0 7px}.heading p{margin:0;color:var(--muted)}.actions{display:flex;gap:10px;flex-wrap:wrap}.metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin:0 0 24px}.metric{background:white;border:1px solid var(--line);border-radius:12px;padding:21px 18px;min-width:0}.metric span{display:block;font-size:14px;line-height:1.4;color:var(--muted)}.metric strong{display:block;font-size:32px;font-variant-numeric:tabular-nums;margin-top:12px;overflow-wrap:anywhere;letter-spacing:-.8px}.metric.highlight{background:var(--navy);color:white;border-color:var(--navy)}.metric.highlight span{color:#d1deeb}.panel{background:white;border:1px solid var(--line);border-radius:12px;overflow:hidden;margin-bottom:24px}.panel-title{padding:22px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line)}h2{font-size:19px;margin:0}h3{font-size:17px}.muted{color:var(--muted)}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:14px}th{background:#f7f9fc;color:var(--muted);font-size:13px;font-weight:600;padding:15px 16px;white-space:nowrap}td{padding:16px;border-top:1px solid #edf0f4;white-space:nowrap}td.wrap{white-space:normal;min-width:140px;max-width:300px;overflow-wrap:anywhere}td.number,th.number{text-align:right;font-variant-numeric:tabular-nums}td a{color:#1558a0;font-weight:650;text-decoration:none}.badge{font-size:13px;padding:5px 9px;border-radius:5px;display:inline-block;background:#eaf0f6;color:#3e566f}.badge.pending{background:#fff2cf;color:#75540d}.badge.good{background:#e3f4ea;color:#226641}.badge.bad{background:#fce8eb;color:#a1263d}.badge.extra{background:#e6efff;color:#2456a0}.empty{padding:52px 24px;text-align:center}.empty-symbol{width:60px;height:60px;border:2px dashed #a4b7cd;border-radius:12px;display:grid;place-items:center;font-size:30px;color:#477399;margin:0 auto 18px}.empty p{color:var(--muted);margin-bottom:24px}.filters{padding:18px 24px;display:flex;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--line)}.filters label{min-width:130px;flex:1}.filters input,.filters select{width:100%}label{display:block;font-weight:550;font-size:14px;color:#334a5f}input,select,textarea{border:1px solid #b9c8d7;border-radius:7px;padding:11px 12px;background:white;color:#142a40;width:100%;margin-top:7px;min-height:44px}textarea{resize:vertical;min-height:88px}input:focus,select:focus,textarea:focus{outline:2px solid #8bbcec;border-color:#1b65b4}input[readonly]{background:#edf2f7}.auth{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.auth-intro{background:var(--navy);color:white;padding:10vw 7vw;display:flex;flex-direction:column;justify-content:center}.auth-intro .brand{padding:0}.auth-intro h1{font-size:clamp(36px,4.5vw,62px);line-height:1.1;letter-spacing:-2px;margin:60px 0 20px}.auth-intro p{color:#c3d2e1;font-size:18px;line-height:1.7;max-width:410px}.auth-form{display:flex;align-items:center;justify-content:center;padding:36px}.auth-form form{width:100%;max-width:410px}.auth-form h2{font-size:28px}.auth-form label{margin-top:22px}.auth-form button{margin-top:26px;width:100%}.note{font-size:14px;color:var(--muted);line-height:1.6}.error{background:#fff0f1;color:#972338;border:1px solid #efbdc7;border-radius:8px;padding:12px;margin:12px 0;line-height:1.5}.error:empty{display:none}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.full{grid-column:1/-1}dialog{border:0;border-radius:14px;padding:0;width:660px;max-width:calc(100vw - 24px);max-height:90vh;color:var(--navy);box-shadow:0 24px 100px #061a4160}dialog::backdrop{background:#091c36a0}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:20px 24px;border-bottom:1px solid var(--line)}.modal-body{padding:24px}.modal-footer{display:flex;justify-content:flex-end;gap:10px;padding-top:24px}.info{background:#edf4fc;border-left:3px solid #2c77cb;padding:14px 16px;font-size:14px;line-height:1.6;margin-bottom:22px}.summary{display:flex;gap:20px;flex-wrap:wrap;padding:18px 24px;font-size:14px}.summary span{color:var(--muted)}.summary strong{display:block;margin-top:5px;color:var(--navy)}.progress{height:7px;background:#e9eef4;overflow:hidden;display:flex}.progress div{background:#2473c5}#toast:not(:empty){position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#142a40;color:white;padding:15px 24px;border-radius:10px;box-shadow:0 8px 32px #162b4030;z-index:10;max-width:90vw}.loading{padding:30px}.detail-json{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:14px;background:#f5f7fa;padding:14px;border-radius:8px}.small-btn{padding:7px 10px;font-size:14px}.subheading{margin:0 0 22px}.tabs{display:flex;gap:10px;margin-bottom:20px}.cancelled{opacity:.7}.cancelled td.number{text-decoration:line-through}@media(min-width:1500px){main{padding:40px}.metrics{gap:20px}.metric{padding:25px}}@media(max-width:1150px){.shell{grid-template-columns:190px minmax(0,1fr)}main{padding:24px}.metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.heading{align-items:flex-start;flex-direction:column}.brand{padding-left:0;gap:7px}.brand strong{font-size:14px}.topbar{padding:18px 24px}}@media(max-width:720px){.shell{display:block}aside{position:relative;height:auto;padding:16px}.brand{padding:0 0 16px}.nav{flex-direction:row;overflow:auto;gap:4px}.nav a{white-space:nowrap;padding:10px}.nav span{display:none}.account{position:absolute;right:18px;top:12px;margin:0;padding:0;border:0}.account p,.account small{display:none}.account button{margin:0}.topbar{padding:14px 18px}.topbar span:last-child{display:none}main{padding:22px 16px}.heading h1{font-size:26px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{padding:16px}.metric strong{font-size:28px}.metric:last-child{grid-column:1/-1}.auth{grid-template-columns:1fr}.auth-intro{padding:28px}.auth-intro h1{font-size:32px;letter-spacing:-1px;margin:28px 0 8px}.auth-intro p{font-size:16px;margin:0}.auth-form{padding:28px}.form-grid{grid-template-columns:1fr}.filters{padding:16px}.filters label{min-width:calc(50% - 12px)}.panel-title{padding:18px}.modal-body{padding:18px}.modal-head{padding:16px}.actions{width:100%}.actions button{flex:1}.summary{padding:18px}.heading p{line-height:1.5}}

.brandmark{flex-shrink:0}.brand strong{font-size:15px}.account small{display:block}
@media(max-width:720px){.account small{display:none}}
.quantity-unit{display:block;margin-top:6px;font-size:14px;line-height:1.35;color:var(--muted)}.highlight .quantity-unit{color:#d1deeb}[hidden]{display:none!important}.review-content .info{overflow-wrap:anywhere}.audit-summary{min-width:260px!important;max-width:440px!important}.modal-head h2,.heading h1{overflow-wrap:anywhere;min-width:0}.summary strong{overflow-wrap:anywhere}.modal-footer{flex-wrap:wrap}.heading>.actions{flex-shrink:0}.form-content input,.form-content select{min-width:0}.number{white-space:nowrap}
.table-wrap td:not(.number){max-width:280px;white-space:normal;overflow-wrap:anywhere}

/* Comfortable reading: keep words intact and scroll wide tables instead of squeezing columns. */
body{line-height:1.55}
.heading h1,.auth-intro h1,.metric strong{letter-spacing:normal}
.heading h1{font-size:2rem;line-height:1.25}
h2{font-size:1.3rem;line-height:1.4}
h3{font-size:1.125rem;line-height:1.45}
.heading p,.note,.info,.summary,label{font-size:1rem;line-height:1.6}
.heading{gap:24px;margin-bottom:28px;flex-wrap:wrap}
.heading>div:first-child{min-width:0;flex:1 1 280px}
.heading>.actions{flex:0 1 auto}
button,.button,input,select,textarea{font-size:1rem;line-height:1.5;min-height:48px}
input,select,textarea{padding:12px 14px;margin-top:9px}
.form-grid{gap:22px}
.small-btn{font-size:.9375rem;padding:10px 14px;min-height:44px}
.nav a{font-size:1rem;line-height:1.5}
.brand strong{font-size:1rem;line-height:1.4}
.brand small,.account,.account small,.topbar{font-size:.9375rem;line-height:1.5}
.brand{padding-left:0;padding-right:0}
.brandmark{width:46px;height:46px}
.metric{padding:24px 20px}
.metric span,.quantity-unit{font-size:1rem;line-height:1.5}
.metric strong{font-size:2.25rem;line-height:1.2;margin-top:14px;word-break:normal;overflow-wrap:normal}
.metrics{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:18px}
.badge{font-size:.9375rem;line-height:1.5;padding:6px 10px;white-space:nowrap}
.filters{gap:18px;padding:22px 24px}
.filters label{flex:1 1 180px;min-width:180px}
table{font-size:1rem;line-height:1.55}
th{font-size:.9375rem;line-height:1.5;color:#334a5f;padding:18px 20px;min-width:120px}
td{padding:20px;vertical-align:middle;line-height:1.6}
.table-wrap td:not(.number){min-width:140px;max-width:320px;white-space:normal;word-break:normal;overflow-wrap:break-word}
.table-wrap th:first-child,.table-wrap td:first-child{min-width:180px}
.table-wrap td.number{min-width:135px;white-space:nowrap}
.table-wrap td.wrap{min-width:200px}
.table-wrap td .small-btn{margin:4px 4px 4px 0;white-space:nowrap}
.summary{gap:24px 32px;padding:22px 24px}
.summary strong{margin-top:7px;line-height:1.5}
.modal-head{gap:16px}.modal-head h2{line-height:1.45}
@media(max-width:1150px){.heading>div:first-child{flex-basis:auto}.heading>.actions{width:100%}}
@media(max-width:720px){
 .heading h1{font-size:1.8rem}.heading{gap:20px}
 .heading>div:first-child{flex-basis:auto}
 .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
 .metric{padding:20px 16px}.metric strong{font-size:2rem;overflow-wrap:break-word}
 .metric:last-child{grid-column:1/-1}
 .filters{padding:20px 16px}.filters label{flex:1 1 180px;min-width:150px}
 .actions{gap:12px}.actions button,.actions .button{flex:1 1 150px}
 .auth-intro h1{letter-spacing:normal;line-height:1.2}
 .brand strong{font-size:.9375rem}.brand small{font-size:.875rem}
 .account button{font-size:.875rem}
}

/* Notificaciones: lectura cómoda y estado persistente por administrador. */
.nav a{flex-wrap:wrap}
.notification-count{display:inline-flex;align-items:center;justify-content:center;min-width:26px;padding:2px 7px;border-radius:20px;background:#fff;color:#142a40;font-size:14px;line-height:1.4}
.notification-card{padding:28px;border:1px solid var(--line);border-radius:12px;margin:0 0 20px;overflow-wrap:anywhere}
.notification-card.unread{border-left:5px solid #c18400;background:#fffdf6}
.notification-card .panel-title{padding:0;border:0}
.notification-card .summary{padding:12px 0;gap:24px}
.notification-quantity{font-size:26px;font-weight:700;line-height:1.4;margin:12px 0}
.notification-card .actions{margin-top:20px;flex-wrap:wrap}
@media(max-width:600px){.notification-card{padding:20px}.notification-card .summary{grid-template-columns:1fr}}

/* Totales de todos los pallets de la carga, alineados con sus columnas. */
.pallet-totals th,.pallet-totals td{background:#eaf2fb;border-top:2px solid #9ab5d3;color:#142a40;font-weight:700;padding:22px 20px}
.pallet-totals td.number{font-size:1.125rem}
.pallet-totals .total-explanation{border-top:1px solid #cad8e8;font-weight:400;white-space:normal;line-height:1.65;text-align:left}
.total-provisional{display:block;margin-top:8px;font-size:.9375rem;font-weight:500}

.usa-section{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.usa-section h3{font-size:1.2rem;margin:0 0 12px}
.usa-count-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;padding:4px 2px}
.usa-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0;flex-wrap:wrap}
.usa-pagination span{font-size:1rem}
@media(max-width:600px){.usa-count-grid{grid-template-columns:1fr}}

/* Captura por pallet: campos grandes y acciones al alcance en celular. */
.pallet-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:18px;padding:20px}
.pallet-card{border:1px solid var(--line);border-radius:14px;padding:20px;min-width:0;overflow-wrap:anywhere;background:#fff}
.pallet-card-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.pallet-card h3{font-size:1.35rem;margin:0}.pallet-card>p{margin:10px 0}
.pallet-counts{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:20px 0}
.pallet-counts dt{font-size:.9375rem;color:#42556a}.pallet-counts dd{margin:6px 0 0;font-size:1.2rem;font-weight:700}
.pallet-card>button{width:100%;margin-top:12px;min-height:52px}.pallet-note{white-space:pre-wrap}
.capture-panel .panel-title{align-items:start;gap:16px;flex-wrap:wrap}.capture-panel .panel-title .note{margin:8px 0 0}
.count-context{font-size:1.05rem;margin:0 0 22px;overflow-wrap:anywhere}
.count-fields label{font-size:1.15rem;font-weight:700}.count-fields input{font-size:1.75rem;min-height:64px;font-weight:700}
.count-fields .note{margin:8px 0 26px}.count-dialog .modal-head h2{overflow-wrap:anywhere}
.count-dialog .modal-footer{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);padding:16px 0 max(16px,env(safe-area-inset-bottom));margin-top:20px}
.count-dialog .modal-footer button{flex:1 1 auto;min-height:52px}
.count-dialog .modal-footer #cancel-modal{flex:0 0 auto}
@media(max-width:600px){
 .pallet-cards{grid-template-columns:minmax(0,1fr);padding:14px;gap:14px}.pallet-card{padding:18px}
 .capture-panel .filters{display:grid;grid-template-columns:1fr;padding:16px;gap:16px}.capture-panel .filters label{min-width:0}
 .count-dialog{width:100%;max-width:100%;height:100%;height:100dvh;max-height:100%;max-height:100dvh;margin:0;border:0;border-radius:0;padding-top:env(safe-area-inset-top)}
 .count-dialog .modal-head{padding:16px 18px}.count-dialog .modal-head h2{font-size:1.2rem}
 .count-dialog .modal-body{padding:8px 18px 0}.count-dialog .modal-footer{gap:10px}
 .count-dialog .modal-footer #cancel-modal{flex:1 1 100%;min-height:44px}
 .count-dialog .modal-footer button[type=submit]{flex:1 1 130px;padding:12px 8px}
}

.pallet-card>.button{width:100%;margin-top:12px;min-height:52px}
@media(max-width:380px){.account{position:static;padding:0;margin:0 0 0 auto}.shell>aside{display:grid;grid-template-columns:1fr}.account button{min-height:44px}.shell>aside .nav{grid-row:3}.shell>aside .brand{padding-bottom:4px}}
.dispatch-dialog{width:820px}.dispatch-row{border:1px solid var(--line);border-radius:12px;margin-bottom:20px;padding:16px}.dispatch-row .panel-title{padding:0 0 12px;margin-bottom:16px}.dispatch-row h3{margin:0}.dispatch-total{font-weight:700;font-size:1.2rem}.dispatch-review li{margin:0 0 16px;overflow-wrap:anywhere}.dispatch-dialog .modal-footer{position:sticky;bottom:0;background:white;border-top:1px solid var(--line);padding:16px 0 max(16px,env(safe-area-inset-bottom));margin-top:20px}
@media(max-width:600px){.dispatch-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.dispatch-row{padding:14px}.dispatch-row .form-grid{gap:16px}.dispatch-dialog .modal-footer button{flex:1 1 120px;min-height:52px}.dispatch-dialog .modal-head h2{font-size:1.25rem}}
