@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f9fbfb;
  --text: #18262a;
  --muted: #68777a;
  --label: #405155;
  --line: #dfe7e7;
  --accent: #087e78;
  --accent-dark: #056560;
  --accent-soft: #e5f4f1;
  --danger: #b42318;
  --danger-soft: #fcebea;
  --shadow: 0 14px 34px rgba(26, 48, 51, 0.08);
  --radius: 10px;
}

body.dark {
  --bg: #152024;
  --surface: #1c2a2e;
  --surface-soft: #223338;
  --text: #eef6f4;
  --muted: #aabcb9;
  --label: #d1dfdc;
  --line: #31464a;
  --accent: #39b7aa;
  --accent-dark: #2aa99d;
  --accent-soft: #1c3d3b;
  --danger-soft: #4c2a2a;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Atkinson Hyperlegible", Aptos, Arial, sans-serif; font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(8, 126, 120, 0.28); outline-offset: 2px; }
i { width: 18px; height: 18px; stroke-width: 1.8; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 22px 14px 18px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0 10px 25px; color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: 0; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: #fff; background: var(--accent); }
.brand-mark i { width: 18px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; text-decoration: none; font-weight: 400; }
.nav-item:hover { color: var(--text); background: var(--surface-soft); }
.nav-item.is-active { color: var(--accent-dark); background: var(--accent-soft); }
.nav-button { font: inherit; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 17px; }
.storage-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.storage-note i { flex: 0 0 auto; width: 15px; height: 15px; color: var(--accent); }

.main-content { width: min(1440px, 100%); min-width: 0; padding: 36px clamp(22px, 4vw, 64px) 46px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 30px; }
.eyebrow { margin: 0 0 5px; color: var(--accent-dark); font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: 0; font-weight: 400; }
h2 { margin-bottom: 3px; font-size: 17px; line-height: 1.25; letter-spacing: 0; font-weight: 400; }
h3 { margin-bottom: 2px; font-size: 14px; }
.today, .section-heading p, .form-section-title p { margin-bottom: 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 9px; align-items: center; }
.system-alert { display: flex; align-items: center; gap: 11px; margin: -10px 0 24px; padding: 12px 14px; border: 1px solid #efc7c2; border-radius: var(--radius); color: #8f2118; background: var(--danger-soft); }
.system-alert > i { flex: 0 0 auto; }.system-alert p { flex: 1; margin: 0; }.system-alert .secondary-button { min-height: 34px; color: #8f2118; border-color: #dfaaa3; background: transparent; }
body.dark .system-alert { color: #ffcac2; border-color: #70413d; }.dark .system-alert .secondary-button { color: #ffcac2; border-color: #70413d; }
.primary-button, .secondary-button, .text-button, .icon-button { border: 0; border-radius: 8px; transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease; }
.primary-button, .secondary-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; font-weight: 700; white-space: nowrap; }
.primary-button { color: #fff; background: var(--accent); box-shadow: 0 4px 12px rgba(8, 126, 120, 0.2); }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.secondary-button:hover { background: var(--surface-soft); }
.primary-button:active, .secondary-button:active, .icon-button:active { transform: translateY(1px); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.icon-button:hover { color: var(--text); background: var(--surface-soft); }
.text-button { padding: 7px 0; color: var(--accent-dark); background: transparent; font-weight: 400; }
.text-button:hover { color: var(--text); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.metric { min-height: 106px; display: flex; align-items: center; gap: 13px; padding: 18px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; }
.metric-icon i { width: 19px; height: 19px; }
.metric-icon.mint { color: #087e78; background: #e5f4f1; }.metric-icon.amber { color: #a56700; background: #fff4dc; }.metric-icon.blue { color: #1565a5; background: #e8f3fb; }.metric-icon.rose { color: #ab3958; background: #fcecf1; }
body.dark .metric-icon.mint { background: #1c3d3b; }.dark .metric-icon.amber { background: #443b25; }.dark .metric-icon.blue { background: #243b4b; }.dark .metric-icon.rose { background: #462e37; }
.metric span { display: block; color: var(--muted); font-size: 12px; }.metric strong { display: block; margin-top: 2px; font-size: 22px; letter-spacing: 0; }

.workspace, .status-panel, .client-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.workspace { overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 18px; }
.section-heading.compact { padding: 21px 22px 13px; align-items: flex-start; }.section-heading.compact p { font-size: 12px; }
.filter-bar { display: flex; gap: 10px; padding: 0 24px 18px; border-bottom: 1px solid var(--line); }
.search-field { min-width: 250px; flex: 1 1 360px; position: relative; }.search-field i { position: absolute; left: 12px; top: 11px; width: 17px; color: var(--muted); }.search-field input { padding-left: 38px; }
.select-field { flex: 0 1 190px; }
input, select, textarea { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--text); background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease; }
textarea { min-height: auto; padding-top: 9px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8c9b9c; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8,126,120,.12); }
.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }.table-wrap::-webkit-scrollbar { height: 8px; }.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
table { width: 100%; min-width: 880px; border-collapse: collapse; text-align: left; }th { height: 42px; padding: 0 24px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }td { padding: 16px 24px; border-top: 1px solid var(--line); vertical-align: middle; }tr:hover td { background: var(--surface-soft); }
.shipment-code { display: block; color: var(--accent-dark); font-size: 12px; font-weight: 750; }.shipment-date, .table-subline { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }.person-name { display: block; font-weight: 700; }.destination { max-width: 175px; }.amount { font-weight: 750; white-space: nowrap; }.payment-note { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }.row-actions { display: flex; justify-content: flex-end; gap: 3px; }.table-action { width: 31px; height: 31px; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }.table-action:hover { color: var(--accent-dark); background: var(--accent-soft); }.table-action.danger:hover { color: var(--danger); background: var(--danger-soft); }.table-action i { width: 16px; height: 16px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }.badge.registrado { color: #51606e; background: #edf0f3; }.badge.almacen { color: #9b6200; background: #fff3d8; }.badge.ruta { color: #1764a2; background: #e6f2fb; }.badge.entregado { color: #08705f; background: #e2f5ef; }.badge.cancelado { color: #b42318; background: #fcebea; }
body.dark .badge.registrado { background:#344248; color:#d3dddd; }.dark .badge.almacen { background:#4a3d23; }.dark .badge.ruta { background:#243e52; }.dark .badge.entregado { background:#1c413b; }.dark .badge.cancelado { background:#4a2b2b; }

.empty-state { min-height: 310px; display: grid; align-content: center; justify-items: center; padding: 30px; text-align: center; }.empty-state h3 { margin: 13px 0 5px; font-size: 17px; }.empty-state p { max-width: 385px; margin-bottom: 18px; color: var(--muted); }.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }.empty-icon i { width: 24px; height: 24px; }
.compact-empty { min-height: 230px; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 22px; margin-top: 22px; }.status-list { padding: 0 22px 21px; }.status-row { display: grid; grid-template-columns: 102px 1fr 28px; gap: 10px; align-items: center; padding: 10px 0; font-size: 13px; }.status-row:not(:last-child) { border-bottom: 1px solid var(--line); }.status-track { height: 6px; border-radius: 999px; overflow: hidden; background: var(--line); }.status-fill { height: 100%; border-radius: inherit; background: var(--accent); }.status-row strong { text-align: right; font-size: 13px; }.client-list { padding: 0 22px 13px; }.client-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }.client-row:not(:last-child) { border-bottom: 1px solid var(--line); }.avatar { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--accent-dark); background: var(--accent-soft); font-size: 11px; font-weight: 800; }.client-row strong { display: block; font-size: 13px; }.client-row span { display: block; color: var(--muted); font-size: 12px; }

dialog { padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }dialog::backdrop { background: rgba(19, 36, 39, .52); }.shipment-dialog { width: min(920px, calc(100% - 28px)); max-height: min(850px, calc(100dvh - 28px)); }.shipment-dialog form { display: flex; flex-direction: column; max-height: inherit; }.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 24px; }.dialog-header { border-bottom: 1px solid var(--line); }.dialog-header h2 { margin-bottom: 0; font-size: 20px; }.dialog-header .eyebrow { margin-bottom: 2px; }.form-body { overflow-y: auto; padding: 0 24px; }.form-section { padding: 22px 0; }.form-section:not(:last-child) { border-bottom: 1px solid var(--line); }.form-section-title { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 15px; }.form-section-title > span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--accent-dark); background: var(--accent-soft); font-size: 11px; font-weight: 700; }.form-section-title h3 { font-size: 14px; }.form-section-title p { font-size: 12px; }.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }.form-grid label, .notes-field { display: grid; gap: 6px; color: var(--label); font-size: 13px; font-weight: 400; }.notes-field { margin-top: 14px; }.split-form { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }.dialog-footer { border-top: 1px solid var(--line); }.dialog-footer .secondary-button { margin-left: auto; }.form-message { margin: 0 0 18px; padding: 10px 12px; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-weight: 700; }
.details-dialog { width: min(580px, calc(100% - 28px)); max-height: calc(100dvh - 28px); }.details-content { overflow-y: auto; max-height: calc(100dvh - 28px); }.details-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 22px 24px 19px; border-bottom: 1px solid var(--line); }.details-header h2 { margin: 3px 0 0; font-size: 19px; }.details-meta { padding: 18px 24px 7px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.details-block { padding: 14px 24px; }.details-block h3 { margin-bottom: 10px; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }.details-grid span { display: block; color: var(--muted); font-size: 11px; }.details-grid strong { display: block; margin-top: 2px; font-size: 13px; }.details-notes { margin: 0; padding: 10px 12px; color: var(--text); background: var(--surface-soft); border-radius: 8px; white-space: pre-wrap; }.details-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 19px 24px; border-top: 1px solid var(--line); }.details-actions .danger-action { color: var(--danger); border-color: #efc7c2; }
.toast { position: fixed; z-index: 10; right: 22px; bottom: 22px; max-width: min(390px, calc(100% - 44px)); padding: 12px 14px; border-radius: 8px; color: #fff; background: #1f3033; box-shadow: var(--shadow); font-weight: 650; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }.toast.is-visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; left: -10000px; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1020px) { .metrics { grid-template-columns: repeat(2, 1fr); }.metric:nth-child(2) { border-right: 0; }.metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.lower-grid { grid-template-columns: 1fr; } .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .app-shell { display: block; }.sidebar { position: sticky; z-index: 3; top: 0; height: 63px; padding: 10px 15px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }.brand { padding: 0; font-size: 17px; }.brand-mark { width: 29px; height: 29px; }.nav-list { display: flex; margin-left: auto; gap: 2px; }.nav-item { width: 38px; min-height: 38px; justify-content: center; padding: 0; }.nav-item span, .sidebar-bottom { display: none; }.main-content { padding: 26px 16px 36px; }.topbar { margin-bottom: 23px; }.topbar-actions .primary-button { width: 40px; padding: 0; font-size: 0; }.topbar-actions .primary-button i { width: 19px; height: 19px; }.metrics { margin-bottom: 22px; }.metric { min-height: 88px; padding: 14px; }.metric-icon { width: 33px; height: 33px; }.metric strong { font-size: 18px; }.metric span { font-size: 11px; }.section-heading { padding: 18px 16px 14px; }.filter-bar { display: grid; grid-template-columns: 1fr 1fr; padding: 0 16px 15px; }.search-field { min-width: 0; grid-column: 1 / -1; }.select-field { min-width: 0; }.form-body { padding: 0 17px; }.dialog-header, .dialog-footer { padding: 16px 17px; }.form-grid, .form-grid.three, .form-grid.four, .split-form { grid-template-columns: 1fr; gap: 12px; }.split-form { gap: 22px; }.details-meta, .details-grid { grid-template-columns: 1fr; }.details-header, .details-block, .details-actions { padding-left: 17px; padding-right: 17px; } }
@media (max-width: 440px) { .nav-list { gap: 0; }.nav-item { width: 34px; }.nav-item i { width: 17px; }.topbar { gap: 12px; }.topbar-actions { gap: 6px; }.metrics { grid-template-columns: 1fr; }.metric { border-right: 0; border-bottom: 1px solid var(--line); }.metric:last-child { border-bottom: 0; }.filter-bar { grid-template-columns: 1fr; }.select-field { min-width: 100%; }.section-heading > .text-button { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
