:root{font-family:"Inter",system-ui,sans-serif;color:#182234;background:#f4f6fa;font-synthesis:none;--muted:#56647a;--line:#e3e8f0;--blue:#244ed8;--nav:#101c32}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #7696ff;outline-offset:2px}svg{width:20px;height:20px;vertical-align:middle;flex:none}.shell{min-height:100vh;display:grid;grid-template-columns:233px minmax(0,1fr)}.sidebar{position:sticky;top:0;height:100vh;background:var(--nav);color:#e5eaf5;padding:25px 15px 16px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:11px;padding:0 8px;font-weight:750;font-size:21px;letter-spacing:-.5px;color:white}.brand small,.sidebar-bottom small{display:block;color:#a4b3ca;font-size:12px;font-weight:500;letter-spacing:.1px;margin-top:3px}.brand small{font-size:10px;letter-spacing:1.25px}.brand-mark{width:39px;height:39px;border-radius:11px;display:grid;place-items:center;background:#4169ee}.nav-label{color:#9aabca;font-size:11px;letter-spacing:1.3px;margin:45px 11px 12px;font-weight:700}nav{display:grid;gap:5px}nav button{background:transparent;border:0;color:#bcc9df;text-align:left;display:flex;align-items:center;gap:11px;width:100%;padding:12px;border-radius:8px;font-size:14px;font-weight:580}nav button:hover,nav button[aria-current=page]{background:#283d6d;color:#fff}nav button[aria-current=page] svg{color:#a8bcff}.sidebar-bottom{margin-top:auto}.location,.profile{display:flex;align-items:center;gap:10px;padding:13px 8px;font-size:14px}.location{color:#c5d1e7}.profile{border-top:1px solid #30405a;font-weight:650}.profile b{display:grid;place-items:center;width:35px;height:35px;background:#2e426e;color:#e0e8ff;border-radius:50%;font-size:12px}.top{height:65px;border-bottom:1px solid var(--line);background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 31px;font-size:14px;color:#35415a}.top-parent,.slash{color:var(--muted)}.slash{margin:0 7px}.demo,.pill{display:inline-flex;align-items:center;gap:7px;border-radius:6px;padding:5px 9px;font-size:13px;font-weight:650;background:#edf2ff;color:#2946a2}.demo i{background:#4169ee;width:7px;height:7px;border-radius:50%}main{max-width:1500px;margin:auto;padding:28px 31px 36px}.heading{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:22px}.date{display:flex;gap:7px;align-items:center;color:var(--muted);font-size:14px;margin:0 0 9px}.date svg{width:15px;height:15px}h1,h2,h3,p{margin:0}h1{font-size:clamp(28px,3vw,36px);line-height:1.15;letter-spacing:-1.15px}h2{font-size:18px;letter-spacing:-.35px}h3{font-size:15px}.subtitle,.muted{color:var(--muted)}.subtitle{margin-top:7px;font-size:15px}.btn{padding:9px 13px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:#fff;color:#24334f;border:1px solid #dce3ef;border-radius:7px;font-size:14px;font-weight:650;white-space:nowrap}.btn:hover{background:#f0f4ff}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.primary:hover{background:#1a3db6}.btn:disabled{opacity:.5;cursor:default}.btn svg{width:16px;height:16px}.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:17px}.panel,.card{background:#fff;border:1px solid var(--line);border-radius:11px;box-shadow:0 2px 3px #17294a04}.card{padding:15px 16px}.card-head{display:flex;justify-content:space-between;align-items:center;gap:7px;color:var(--muted);font-size:14px;font-weight:590}.badge-icon{width:35px;height:35px;border-radius:8px;display:grid;place-items:center;background:#eaf0ff;color:#2a51d6}.badge-icon.amber,.pill.amber{background:#fff1da;color:#8a5109}.badge-icon.green,.pill.green{background:#e1f6eb;color:#116849}.badge-icon.purple,.pill.purple{background:#f0eaff;color:#6542b5}.value{font-size:clamp(20px,2.45vw,30px);font-weight:750;letter-spacing:-1px;margin:7px 0 5px}.card .muted,.panel .muted{font-size:14px}.split{display:grid;grid-template-columns:minmax(0,1.58fr) minmax(0,1fr);gap:16px;margin-bottom:17px}.panel-top{padding:17px 18px 13px;display:flex;align-items:start;justify-content:space-between;gap:10px}.panel-top p{margin-top:5px}.flow{padding:2px 18px 16px}.flow-row{display:grid;grid-template-columns:122px 1fr 32px;gap:8px;align-items:center;margin:14px 0;font-size:14px}.flow-row b{text-align:right}.track{height:9px;border-radius:8px;background:#edf1f8;overflow:hidden}.track span{display:block;height:100%;border-radius:8px;background:var(--bar)}.chart{padding:6px 18px 15px}.chart canvas,.map canvas{display:block;width:100%}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap;font-size:14px}th{background:#f7f9fc;color:#526176;font-size:12px;font-weight:700;letter-spacing:.25px}td,th{padding:11px 15px;border-bottom:1px solid #ebeff5}tr:last-child td{border-bottom:0}td:first-child,th:first-child{padding-left:18px}td b{color:#2546a1}.text-btn{border:0;background:none;padding:5px;color:#244bc9;font-weight:650;font-size:14px}.controls{display:flex;flex-wrap:wrap;gap:9px;padding:0 18px 14px}input,select{padding:9px 11px;border:1px solid #dbe2ef;background:#fff;border-radius:7px;color:#182234;min-width:0}#search{width:min(100%,300px)}.pager{padding:12px 18px;display:flex;gap:9px;align-items:center;justify-content:end}.pager span{margin-right:auto}.map{padding:0 15px 15px}.route-list{padding:0 18px 16px;display:grid;gap:8px}.route-option{display:flex;align-items:center;gap:10px;padding:10px;text-align:left}.route-option span:last-child{margin-left:auto}.route-dot{height:10px;width:10px;border-radius:50%;flex:none}.notice{margin-bottom:16px;padding:13px 16px;background:#eaf0ff;border-radius:7px;color:#314985;font-size:14px}.empty{padding:22px;color:var(--muted)}dialog{border:1px solid var(--line);border-radius:13px;width:min(740px,calc(100% - 24px));padding:0;max-height:88vh;color:inherit}dialog::backdrop{background:#0c172988}.modal-body{padding:0 18px 18px}.modal-body table{white-space:normal}.modal-body input{width:104px}.modal-actions{display:flex;justify-content:end;padding-top:15px}.modal-body>p{margin-bottom:12px}#toast{position:fixed;bottom:18px;right:18px;background:var(--nav);color:#fff;border-radius:8px;padding:11px 15px;z-index:3;max-width:calc(100% - 36px)}#toast:empty{display:none}
@media(max-width:1050px){.shell{grid-template-columns:192px minmax(0,1fr)}main,.top{padding-left:20px;padding-right:20px}.card{padding:12px}.flow-row{grid-template-columns:100px 1fr 27px}}
@media(max-width:780px){.shell{display:block}.sidebar{position:static;height:auto;padding:10px 12px}.brand{font-size:17px}.brand-mark{width:32px;height:32px}.brand small,.nav-label,.sidebar-bottom{display:none}nav{display:flex;overflow:auto;margin-top:8px}nav button{white-space:nowrap;width:auto;padding:8px}.top{height:48px}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.split{grid-template-columns:1fr}main{padding-top:20px}.heading{align-items:start;flex-wrap:wrap}}

.tax-options {
  display: grid;
  gap: 9px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
}
.tax-options legend { padding: 0 5px; font-weight: 650; }
.tax-options input[type=checkbox] { width: auto; vertical-align: middle; }
.tax-options input:disabled { background: #f7f9fc; }
.tax-totals { max-width: 330px; margin: 16px 0 0 auto; font-size: 14px; }
.tax-totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.tax-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.tax-totals > div:last-child { border-top: 1px solid var(--line); margin-top: 5px; font-weight: 700; }
.modal-body > .modal-message { color: #8a5109; margin: 12px 0 0; }
.modal-message:empty { display: none; }

[hidden] { display: none !important; }

:root {
  color: #17283d;
  background: #f2f5f9;
  --nav: #14243b;
  --blue: #2657ca;
  --line: #dce4ee;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1fr);
  background: #f9fbfe;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: clamp(28px, 6vw, 88px);
  background: radial-gradient(ellipse at bottom left, #2a4d83, transparent 65%), var(--nav);
  color: #fff;
}
.login-brand .brand { padding: 0; }
.login-brand-copy { margin-bottom: 9vh; }
.login-brand-copy strong {
  display: block;
  max-width: 9ch;
  font-size: clamp(37px, 6vw, 85px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}
.login-brand-copy p { margin-top: 20px; color: #d4e1f7; font-size: 17px; }

.login-content {
  display: grid;
  place-items: center;
  padding: clamp(22px, 6vw, 80px);
}
.login-form {
  width: min(100%, 385px);
  display: grid;
  align-content: start;
  gap: 9px;
}
.login-form h1 { margin-bottom: 19px; }
.login-form label { font-size: 14px; font-weight: 700; }
.login-form input { padding: 12px; margin-bottom: 8px; }
.login-form button { min-height: 48px; }
.login-error { color: #a1262a; font-size: 14px; }
.login-error:empty { display: none; }

.sidebar nav { margin-top: 38px; }
.top { gap: 16px; }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-name { display: grid; text-align: right; min-width: 0; }
.account-name strong { overflow: hidden; text-overflow: ellipsis; }
.account-name small { color: var(--muted); font-size: 12px; }
.account .btn { min-height: 36px; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.route-heading-actions { flex: 0 0 auto; }
@media (max-width: 780px) { .route-heading-actions { flex: 0 1 auto; } }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { min-width:0; padding:16px 18px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 2px 4px #17294a05; }
.metric small { display:block; color:var(--muted); margin-bottom:8px; font-size:13px; font-weight:650; line-height:1.25; }
.metric strong { display:block; color:#142d50; font-size:clamp(21px,2vw,29px); line-height:1.1; letter-spacing:-.7px; overflow-wrap:anywhere; }
.closure-metrics .metric:first-child{border-left:4px solid #315ee8}.closure-metrics .metric:nth-child(2){border-left:4px solid #117b67}.closure-metrics .metric:nth-child(3){border-left:4px solid #8551bd}.closure-metrics .metric:nth-child(4){border-left:4px solid #bd7611}
.closure-status{display:flex;gap:14px;align-items:center;flex-wrap:wrap;padding:16px 20px;margin:16px 0;border-radius:12px;border:1px solid #d6dde8;background:#f1f3f6;color:#566579}.closure-status strong{font-size:1.05rem}.closure-status span{padding:5px 10px;border-radius:8px;background:#fff}.closure-status.is-ready{background:#e7f7ef;border-color:#a4d9ba;color:#126337}.btn.success{background:#16834a;color:#fff;border-color:#16834a}.btn.success:hover{background:#126a3d}
.closure-vans{display:grid;gap:12px}.closure-vans .panel-top{align-items:center;padding:18px}.closure-status strong{margin-right:auto}.btn:disabled:hover{background:#fff;color:#24334f}
.card { padding: 17px; }
.card .value { font-size: clamp(21px, 2.2vw, 34px); overflow-wrap: anywhere; }
.weighing-progress { margin-bottom: 17px; padding-bottom: 17px; }
.weighing-progress .panel-top { align-items: baseline; }
.weighing-progress strong { font-size: 14px; color: var(--muted); }
.weighing-progress progress { width: calc(100% - 36px); height: 12px; margin: 0 18px; accent-color: var(--blue); }
.order-client { white-space: normal; max-width: 290px; }
.order-action .text-btn { display: inline-flex; align-items: center; padding: 8px 10px; border-radius: 6px; background: #edf3ff; }

.order-dialog-head h2 { font-size: 23px; margin-top: 5px; }
.route-assignment { margin-top: 8px; color: #244ed8; font-size: 14px; font-weight: 750; }
.order-reference { font-size: 12px; font-weight: 700; color: var(--blue); }
.dialog-summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 18px 12px; }
.weight-list { list-style: none; margin: 0; padding: 0; }
.weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.weight-row label { display: block; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.weight-row small { display: block; margin-top: 4px; color: var(--muted); }
.weight-input { display: flex; align-items: center; gap: 6px; }
.weight-input input { width: 100px; min-height: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.weight-input span { font-size: 13px; color: var(--muted); }
.weight-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  background: #fff;
  border-top: 1px solid var(--line);
}
.weight-actions .modal-message { margin: 0 auto 0 0; font-size: 14px; color: #8a5109; }

@media (max-width: 780px) {
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-brand { min-height: auto; padding: 20px; }
  .login-brand-copy { display: none; }
  .login-content { place-items: start center; padding-top: clamp(34px, 12vh, 80px); }
  input, select { font-size: 16px; }
  .sidebar { position: sticky; top: 0; z-index: 2; }
  .sidebar nav { margin-top: 8px; }
  .sidebar nav button { flex: 1 0 auto; min-height: 44px; justify-content: center; }
  .sidebar nav svg { width: 16px; height: 16px; }
  .top { min-height: 52px; }
  .heading-actions { justify-content: flex-start; }
  .order-table, .order-table tbody { display: block; }
  .order-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .order-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "ref status" "client client" "area area" "total action";
    align-items: center;
    gap: 5px 8px;
    padding: 12px 15px;
    border-top: 1px solid var(--line);
  }
  .order-table td { padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .order-table .order-ref { grid-area: ref; font-size: 12px; }
  .order-client { grid-area: client; max-width: none; font-weight: 750; }
  .order-area { grid-area: area; color: var(--muted); }
  .order-status { grid-area: status; justify-self: end; }
  .order-status .pill { font-size: 11px; }
  .order-total { grid-area: total; }
  .order-action { grid-area: action; justify-self: end; }
  .order-action .text-btn { min-height: 44px; }
  .weight-actions .btn { min-height: 48px; width: 100%; }
}

@media (max-width: 430px) {
  main, .top { padding-left: 14px; padding-right: 14px; }
  .sidebar nav svg { display: none; }
  .sidebar nav button { font-size: 13px; padding: 7px 6px; }
  .cards { gap: 9px; }
  .card { padding: 12px; }
  .card-head { font-size: 13px; }
  .card .muted { font-size: 12px; }
  .badge-icon { width: 27px; height: 27px; }
  .badge-icon svg { width: 16px; height: 16px; }
  .account-name { max-width: 145px; }
  .weight-input input { width: 84px; }
  .pager .btn { min-height: 44px; padding-inline: 8px; }
}

.confirmed-amounts { margin-bottom: 17px; }
.confirmed-amounts dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0 18px 16px;
}
.confirmed-amounts dt { color: var(--muted); font-size: 13px; }
.confirmed-amounts dd {
  margin: 4px 0 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .confirmed-amounts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.delivery-summary { margin-bottom: 16px; }
.delivery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stops-list { margin: 0; padding: 0 18px 14px 42px; }
.stops-list li { padding: 9px 0; border-top: 1px solid var(--line); }
.stops-list li::marker { color: var(--blue); font-weight: 700; }
.stops-list li span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.back-to-delivery { margin-bottom: 12px; }
@media (max-width: 550px) {
  .delivery-grid { grid-template-columns: 1fr; gap: 10px; }
}

.activity-summary { margin-bottom: 17px; }
.activity-table { font-variant-numeric: tabular-nums; }
.activity-table td, .activity-table thead th:not(:first-child) { text-align: right; }
.activity-table th[scope=row] { background: none; color: #173f56; font-size: 14px; }
.activity-table tbody tr:last-child th[scope=row] { border-bottom: 0; }
.activity-table td:last-child { font-weight: 700; }
.activity-cell-label { display: none; }
@media (max-width: 780px) {
  .activity-table, .activity-table tbody { display: block; }
  .activity-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .activity-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
  }
  .activity-table tbody th[scope=row] { grid-column: span 2; }
  .activity-table tbody th[scope=row], .activity-table tbody td { padding: 0; border: 0; text-align: left; white-space: normal; }
  .activity-cell-label { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
}

.catalog-tools { padding-top: 14px; }
.catalog-summary { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:14px 18px; border-top:1px solid var(--line); background:#fff; }
.catalog-scope { padding:6px 11px; border-radius:8px; background:#eaf0ff; color:#254a9b; font-size:13px; font-weight:700; }
.catalog-total { color:var(--muted); font-size:14px; }
.catalog-total strong { color:#172d4c; font-size:16px; }
.catalog-select { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
.catalog-select input { width: min(300px, 64vw); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label { display: grid; gap: 5px; min-width: 0; font-size: 14px; font-weight: 650; }
.form-grid input { width: 100%; }
.catalog-form > p { margin: 12px 0 0; font-size: 14px; }
@media (max-width: 540px) { .form-grid { grid-template-columns: 1fr; } }

.documents-panel { margin-bottom: 16px; }
.document-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 220px; }
.document-actions .btn { min-height: 34px; white-space: normal; text-align: center; }
.manual-line { border-top: 1px solid var(--line); padding: 10px 0; margin-top: 8px; }
.manual-line .btn { align-self: end; justify-self: start; }

textarea {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid #dbe2ef;
  background: #fff;
  border-radius: 7px;
  color: #182234;
  min-width: 0;
  resize: vertical;
  width: 100%;
}
textarea:focus-visible { outline: 3px solid #7696ff; outline-offset: 2px; }
.form-wide { grid-column: 1 / -1; }

.fiscal-panel, .rece-history { margin-bottom: 16px; }
.fiscal-panel .controls { align-items: end; }
.fiscal-panel .catalog-select input { width: auto; }
.fiscal-summary, .fiscal-report { padding: 0 18px 16px; }
.fiscal-summary p, .fiscal-report p, .rece-history p { margin: 5px 0; color: var(--muted); }
.fiscal-report { border-top: 1px solid var(--line); padding-top: 14px; }
.fiscal-report details, .fiscal-report .btn { margin-top: 8px; }
.fiscal-report small { display: block; color: var(--muted); }
.fiscal-message { min-width: 13em; white-space: normal; }
.fiscal-panel summary, .rece-history summary { cursor: pointer; font-weight: 650; }
.rece-history { padding: 12px 18px; }
.fiscal-history { margin: 0 18px 14px; width: max-content; max-width: calc(100% - 36px); }

.fiscal-header { align-items: center; flex-wrap: wrap; }
.fiscal-header .catalog-select { width: auto; }
.fiscal-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0 18px 16px;
}
.fiscal-step {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: start;
}
.fiscal-step-title, .fiscal-counts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fiscal-step-title span { background: #edf2ff; color: #244bc9; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; }
.fiscal-step p, .fiscal-tools p { color: var(--muted); font-size: 14px; }
.fiscal-step .fiscal-production, .fiscal-alert { color: #853f06; }
.fiscal-alert { margin: 0 18px 12px; background: #fff1da; padding: 10px; border-radius: 7px; }
.fiscal-step .fiscal-report { width: 100%; border: 0; padding: 0; }
.fiscal-counts { margin-top: 8px; }
.fiscal-step .fiscal-history { margin: 0; max-width: 100%; }
.fiscal-print-option { font-size: 14px; }
.fiscal-tools { border-top: 1px solid var(--line); padding: 12px 18px; font-size: 14px; }
.fiscal-tools .heading-actions, .fiscal-tools p { margin-top: 8px; }
.invoice-tools { position: relative; }
.invoice-tools-menu { position: absolute; z-index: 2; right: 0; display: grid; gap: 6px; padding: 8px; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#invoices-today { scroll-margin-top: 16px; }
@media (max-width: 900px) {
  .fiscal-steps { grid-template-columns: minmax(0, 1fr); }
}
.fiscal-step:has(.fiscal-report details[open]) { grid-column: 1 / -1; }

/* Sistema visual de operación: contraste claro, espacios y controles táctiles. */
:root {
  --nav: #102a3a;
  --blue: #205b69;
  --muted: #526575;
  --line: #d8e2e5;
  --surface: #ffffff;
  --canvas: #f3f6f5;
  --focus: #ad641a;
  color: #172f3b;
  background: var(--canvas);
}
body { background: var(--canvas); line-height: 1.45; }
.skip-link { position: fixed; z-index: 20; left: 12px; top: 8px; padding: 10px 16px; border-radius: 8px; background: #fff; color: #143d4b; font-weight: 700; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
main:focus { outline: none; }
.sidebar { background: linear-gradient(165deg, #163a4b, #102a3a 70%); box-shadow: 6px 0 24px #1735470b; }
.brand { letter-spacing: -.04em; }
.brand-mark { background: #d7a84f; color: #102a3a; border-radius: 12px; }
.sidebar nav button { border: 1px solid transparent; border-radius: 10px; color: #cfdee1; transition: background .15s ease, color .15s ease; }
.sidebar nav button:hover { background: #ffffff12; color: #fff; }
.sidebar nav button[aria-current=page] { background: #ffffff1c; border-color: #ffffff26; color: #fff; box-shadow: inset 3px 0 #e1b657; }
.sidebar nav button[aria-current=page] svg { color: #f1cd7f; }
.top { background: #ffffffeb; border-bottom-color: var(--line); }
main { padding-top: 34px; }
.heading { gap: 24px; margin-bottom: 26px; }
h1 { color: #102e3e; font-weight: 760; }
h2, h3 { color: #183a49; }
.date { font-weight: 650; letter-spacing: .01em; }
.subtitle { line-height: 1.5; max-width: 68ch; }
.panel, .card, .metric { background: var(--surface); border-color: var(--line); border-radius: 14px; box-shadow: 0 4px 16px #12384709; }
.card { border-top: 3px solid #b9d5d1; }
.card-head { font-weight: 650; }
.card .value, .metric strong { color: #173d4b; font-variant-numeric: tabular-nums; }
.badge-icon { background: #e4f1ef; color: #215e68; border-radius: 10px; }
.panel-top { gap: 16px; padding-top: 20px; padding-bottom: 16px; }
.panel-top h2 { line-height: 1.25; }
.btn { min-height: 44px; border-radius: 9px; border-color: #cbdadb; color: #204553; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn:hover:not(:disabled) { background: #edf5f3; border-color: #abcac7; }
.btn.primary { background: #205b69; border-color: #205b69; color: #fff; }
.btn.primary:hover:not(:disabled) { background: #174652; border-color: #174652; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
input, select, textarea { border-color: #c8d8db; border-radius: 8px; color: #172f3b; }
input:not([type=checkbox]):not([type=radio]), select { min-height: 44px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline-color: var(--focus); }
th { background: #f1f6f5; color: #49616d; }
td, th { border-bottom-color: #e5edec; }
tbody tr:hover { background: #f8fbfa; }
.text-btn { color: #205b69; }
.pill { border-radius: 8px; }
.notice { background: #e5f1ef; color: #244e55; border: 1px solid #cde2df; border-radius: 10px; }
dialog { border-radius: 16px; box-shadow: 0 24px 70px #102a3a45; }
dialog::backdrop { background: #0c2433a3; }
.login-brand { background: radial-gradient(ellipse at bottom left, #2f6973, transparent 65%), #102a3a; }
.login-form { padding: clamp(24px, 4vw, 40px); width: min(100%, 440px); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 45px #163b4a0d; }
.login-content { background: radial-gradient(circle at 90% 10%, #e2efeb, transparent 40%), #f4f7f5; }
.catalog-scope, .order-action .text-btn, .fiscal-step-title span { background: #e5f1ef; color: #205b69; }
.route-assignment, .order-reference { color: #205b69; }
.fiscal-step { background: #fbfdfc; border-radius: 12px; }
@media (max-width: 780px) {
  .sidebar { box-shadow: 0 5px 18px #102a3a20; }
  .sidebar nav { scrollbar-width: thin; scrollbar-color: #76969b transparent; }
  .heading { gap: 14px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { min-height: 44px; white-space: normal; }
  .panel-top { flex-wrap: wrap; }
  .login-form { padding: 24px; }
}
@media (max-width: 430px) {
  .heading-actions .btn { flex: 1 1 auto; }
  .account-name { max-width: 115px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.daily-next { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:14px; padding:18px 20px; margin-bottom:18px; border-left:4px solid #d5a346; }
.daily-next p { color:var(--muted); margin-top:5px; }
@media(max-width:540px) { .daily-next .btn { width:100%; } }

/* El mismo logo que se usa en los comprobantes, sobre fondo claro. */
.brand-logo { display:block; flex:0 0 auto; width:76px; height:48px; object-fit:contain; background:#fff; border-radius:7px; padding:3px; }
.brand > span { min-width:0; line-height:1.12; }
@media (max-width:780px) { .brand-logo { width:62px; height:39px; } }

/* Acciones compactas por sección y fecha en el encabezado general. */
.header-date { display:flex; align-items:center; gap:8px; min-width:0; color:var(--muted); font-weight:650; }
.header-date svg { width:17px; height:17px; }
.header-date time { white-space:nowrap; }
.section-actions-more { position:relative; }
.section-actions-more > summary { list-style:none; cursor:pointer; }
.section-actions-more > summary::-webkit-details-marker { display:none; }
.section-actions-menu { position:absolute; right:0; z-index:4; min-width:220px; max-width:calc(100vw - 28px); display:grid; gap:6px; margin-top:6px; padding:8px; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 28px #102a3a25; }
.section-actions-menu .btn { width:100%; justify-content:flex-start; white-space:normal; text-align:left; }
@media(max-width:540px) {
  .header-date { font-size:12px; }
  .header-date svg { width:15px; height:15px; }
  .section-actions { flex-wrap:nowrap; }
  .section-actions > .btn { flex:1 1 auto; }
  .section-actions-more { flex:0 0 auto; }
}

/* Densidad cómoda para consultar más información sin perder áreas táctiles. */
main { padding-top:24px; }
.heading { margin-bottom:18px; gap:16px; }
h1 { font-size:clamp(25px,2.4vw,31px); letter-spacing:-.8px; }
h2 { font-size:16px; }
h3 { font-size:14px; }
.subtitle { font-size:14px; margin-top:5px; }
.card { padding:13px 15px; }
.card .value { font-size:clamp(20px,2vw,28px); margin:5px 0 3px; }
.card-head, .card .muted, .panel .muted { font-size:13px; }
.metric { padding:13px 15px; }
.metric strong { font-size:clamp(20px,1.9vw,26px); }
.panel-top { padding:14px 16px 11px; }
td, th { padding-top:9px; padding-bottom:9px; }
.daily-next { padding:13px 16px; margin-bottom:14px; }
.cards, .metric-grid { gap:12px; margin-bottom:14px; }
@media(max-width:780px) { main { padding-top:16px; } .card { padding:12px; } }

/* Menú lateral plegable en las pantallas con navegación vertical. */
.sidebar-toggle { display:flex; align-items:center; gap:9px; width:100%; min-height:40px; margin-top:18px; padding:6px 12px; color:#d6e5e7; background:transparent; border:1px solid #ffffff30; border-radius:9px; text-align:left; font-size:13px; }
.sidebar-toggle:hover { background:#ffffff18; color:#fff; }
.sidebar-toggle > [aria-hidden] { font-size:23px; line-height:1; }
@media (min-width:781px) {
  .shell.sidebar-collapsed { grid-template-columns:72px minmax(0,1fr); }
  .sidebar-collapsed .sidebar { padding-left:10px; padding-right:10px; }
  .sidebar-collapsed .brand { padding:0; justify-content:center; }
  .sidebar-collapsed .brand-logo { width:48px; height:40px; }
  .sidebar-collapsed .brand > span, .sidebar-collapsed .nav-text, .sidebar-collapsed .sidebar-toggle-label { display:none; }
  .sidebar-collapsed .sidebar-toggle { justify-content:center; padding:6px; }
  .sidebar-collapsed nav button { justify-content:center; padding:12px; }
}
@media (max-width:780px) { .sidebar-toggle { display:none; } }

/* Navegación completa en ventanas bajas y control de menú al pie. */
@media (min-width:781px) {
  .sidebar { min-height:0; overflow:hidden; }
  .sidebar nav { flex:1 1 auto; min-height:0; overflow-y:auto; align-content:start; margin-top:20px; scrollbar-width:thin; scrollbar-color:#78979d transparent; }
  .sidebar nav button { min-height:38px; padding:8px 10px; }
  .sidebar-bottom { flex:0 0 auto; margin-top:8px; }
  .sidebar-toggle { width:auto; min-height:32px; margin:0; padding:4px 8px; font-size:12px; }
  .sidebar-toggle > [aria-hidden] { font-size:19px; }
  .sidebar-collapsed nav button { padding:8px; }
  .sidebar-collapsed .sidebar-toggle { min-width:40px; margin:auto; }
}

/* Los padrones ajustan su contenido al ancho disponible. */
.catalog-table { table-layout:fixed; white-space:normal; }
.catalog-table th, .catalog-table td { padding:10px 8px; overflow-wrap:anywhere; vertical-align:top; }
.catalog-table th:first-child, .catalog-table td:first-child { padding-left:14px; }
.customer-table th:nth-child(1), .customer-table th:nth-child(2), .customer-table th:nth-child(3) { width:7%; }
.customer-table th:nth-child(4) { width:21%; }
.customer-table th:nth-child(5) { width:21%; }
.customer-table th:nth-child(6) { width:14%; }
.customer-table th:nth-child(7) { width:10%; }
.customer-table th:nth-child(8) { width:13%; }
.article-table th:nth-child(1), .article-table th:nth-child(3) { width:9%; }
.article-table th:nth-child(2) { width:27%; }
.article-table th:nth-child(4), .article-table th:nth-child(5), .article-table th:nth-child(6), .article-table th:nth-child(7) { width:13.75%; }
.catalog-table .text-btn { text-align:left; overflow-wrap:anywhere; }
@media(max-width:900px) {
  .catalog-table, .catalog-table tbody { display:block; }
  .catalog-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .catalog-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; padding:14px 16px; border-top:1px solid var(--line); }
  .catalog-table td, .catalog-table td:first-child { padding:0; border:0; min-width:0; }
  .catalog-table td::before { content:attr(data-label); display:block; margin-bottom:2px; color:var(--muted); font-size:12px; font-weight:650; }
  .catalog-table .text-btn { min-height:40px; padding:4px 0; }
}
.daily-steps { margin-bottom:16px; }
.daily-step { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 16px; border-top:1px solid var(--line); }
.daily-step p { color:var(--muted); font-size:13px; margin-top:3px; }
.metrics-range { margin:12px 0; color:var(--muted); font-size:13px; }
.activity-summary { margin-top:16px; }
.metric-chart-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.metric-chart { min-width:0; }
.metric-line-chart { display:block; width:100%; height:auto; padding:0 8px 8px; overflow:visible; }
.chart-grid-line { stroke:#d9e5e4; stroke-width:1; }
.chart-line { fill:none; stroke:#205bca; stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.chart-point { fill:#205bca; stroke:#fff; stroke-width:1; }
.chart-axis { fill:#526575; font-size:10px; }
.chart-value { fill:#163e61; font-size:9px; font-weight:650; }
@media(max-width:780px) { .metric-chart-grid { grid-template-columns:1fr; } }

.closure-returns { margin:18px 0; }
.closure-returns > h3 { margin-bottom:4px; }
.return-settlement { margin-top:12px; padding:14px; border:1px solid #e3ba6b; border-left:5px solid #d49324; border-radius:12px; background:#fffaf0; }
.return-settlement p { margin:5px 0 10px; color:var(--muted); }
.return-settlement-line { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:8px 0; border-top:1px solid #ead9ba; }
.return-settlement-line span { min-width:0; }
.return-settlement-line small { display:block; color:var(--muted); }
.return-settlement-line label { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.return-settlement-line input { width:100px; }
.return-credit { display:flex; flex-direction:column; justify-content:center; }
.return-credit small { color:var(--muted); }
@media(max-width:700px) {
  .return-settlement-line { align-items:flex-start; flex-direction:column; }
  .return-settlement-line label, .return-settlement-line input { width:100%; }
}
.late-orders { border-left:5px solid #d49324; }
.late-order-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 18px; border-top:1px solid var(--line); }
.late-order-row span { display:block; margin-top:3px; color:var(--muted); }
@media(max-width:650px) { .late-order-row { align-items:stretch; flex-direction:column; } }
.van-targets { display:grid; gap:10px; margin:14px 0; }
.van-target-row { display:grid; grid-template-columns:minmax(160px,1fr) minmax(180px,1fr); align-items:end; gap:16px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; }
.van-target-row > label:first-child { align-self:center; }
@media(max-width:600px) { .van-target-row { grid-template-columns:1fr; } }
