:root {
  color-scheme: light;
  --shell: #142631;
  --shell-raised: #102330;
  --shell-ink: #edf4f8;
  --shell-muted: #b8cbd5;
  --accent: #e1251b;
  --accent-strong: #b91c15;
  --accent-soft: rgba(225, 37, 27, .12);
  --surface: #ffffff;
  --surface-soft: #f1f6f8;
  --surface-warm: #f8fafb;
  --ink: #19303e;
  --muted: #526977;
  --line: #d4e0e6;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b42318;
  --info: #0f6385;
  --shadow: 0 5px 18px rgba(4, 19, 28, .10);
  --shadow-float: 0 20px 60px rgba(4, 19, 28, .28);
  --radius-sm: 8px;
  --radius: 14px;
  --header-h: 78px;
  --sidebar-w: 228px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: #eaf0f3; color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 12%, rgba(225, 37, 27, .22), transparent 30%),
    radial-gradient(circle at 80% 85%, rgba(15, 99, 133, .22), transparent 34%),
    linear-gradient(135deg, #07131c, #102330 52%, #061019);
}
.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  background: rgba(14, 35, 48, .94);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
  color: #fff;
  backdrop-filter: blur(18px);
}
.login-logo { display: block; width: 210px; max-height: 64px; margin-bottom: 30px; object-fit: contain; object-position: left center; }
.eyebrow { margin: 0 0 6px; color: var(--info); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.login-card .eyebrow { color: #fca5a5; }
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.login-intro { margin: 8px 0 24px; color: #bfd0d9; }
.stack-form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; color: #3b5361; font-size: 11px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd9e0;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(225, 37, 27, .14); }
.login-card label { color: #dce7ec; }
.login-card input { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .09); color: #fff; }
.login-card input:focus { border-color: #f87171; }
.version-copy { display: block; margin-top: 24px; color: #8299a6; text-align: center; }
.form-error { margin: 0; padding: 9px 11px; border: 1px solid #fecaca; border-radius: 8px; background: #fff1f2; color: #be123c; font-size: 12px; font-weight: 700; }

.button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 850;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.button:hover { filter: brightness(.97); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 5px 14px rgba(225, 37, 27, .2); }
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { border-color: #bfd0d9; background: #fff; color: #284453; }
.button-ghost { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07); color: #fff; }
.button-link { min-height: 40px; border: 0; background: transparent; color: var(--info); }
.button-block { width: 100%; }

.app-shell { min-height: 100vh; display: grid; grid-template: var(--header-h) 1fr / var(--sidebar-w) minmax(0, 1fr); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  padding: 9px 18px 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: var(--shell-raised);
  color: var(--shell-ink);
  box-shadow: 0 5px 18px rgba(4, 19, 28, .18);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 118px; max-height: 48px; object-fit: contain; object-position: left center; }
.brand div { display: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; }
.brand small { margin-top: 2px; color: var(--shell-muted); font-size: 10px; }
.topbar-heading { min-width: 0; }
.topbar-heading .eyebrow { color: #fca5a5; }
.topbar-heading h1 { margin: 0; font-size: 21px; line-height: 1.1; letter-spacing: -.02em; }
.topbar-heading > p:last-child { margin: 3px 0 0; color: var(--shell-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.connection-status { display: flex; align-items: center; gap: 6px; color: #c7d7df; font-size: 10px; font-weight: 800; }
.connection-status i { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .12); }
.user-pill { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 10px 5px 6px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(255, 255, 255, .06); color: #fff; text-align: left; }
.user-pill > b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); font-size: 11px; }
.user-pill strong, .user-pill small { display: block; max-width: 145px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill strong { font-size: 11px; }
.user-pill small { color: #b8cbd5; font-size: 9px; margin-top: 2px; }

.sidebar {
  position: sticky;
  top: var(--header-h);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  padding: 14px 10px;
  background: var(--shell);
  color: var(--shell-ink);
  overflow-y: auto;
}
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #d4e1e7; text-align: left; font-size: 11px; font-weight: 750; }
.nav-item:hover { background: rgba(255, 255, 255, .07); }
.nav-item.active { border-color: rgba(255, 255, 255, .13); border-left: 3px solid var(--accent); background: rgba(255, 255, 255, .1); color: #fff; }
.nav-icon { display: grid; place-items: center; width: 22px; height: 22px; color: #b7cbd5; font-size: 17px; }
.sidebar-context { display: grid; gap: 4px; margin: auto 2px 12px; padding: 13px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .045); }
.sidebar-context span { color: #8ba4b1; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.sidebar-context strong { font-size: 16px; }
.sidebar-context small { color: #a9bdc7; font-size: 9px; }
.sidebar-user { display: grid; gap: 9px; padding: 12px 3px 0; border-top: 1px solid rgba(255, 255, 255, .11); }
.sidebar-user span { color: #b8cbd5; font-size: 9px; overflow-wrap: anywhere; }

.workspace { min-width: 0; padding: 18px; overflow: hidden; }
.view { display: none; }
.view.active { display: block; }
.workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.workspace-head h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.workspace-head > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
.kpi-card { position: relative; min-height: 78px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .96); box-shadow: 0 2px 8px rgba(4, 19, 28, .06); overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #8aa0ac; }
.kpi-card.pending::before { background: var(--warning); }
.kpi-card.reviewed::before { background: var(--success); }
.kpi-card.field::before { background: var(--accent); }
.kpi-card.geo::before { background: var(--info); }
.kpi-card strong, .kpi-card span { display: block; }
.kpi-card strong { font-size: 24px; letter-spacing: -.04em; }
.kpi-card span { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 750; }

.filters-card { display: grid; grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(120px, .65fr)) auto; align-items: end; gap: 8px; margin-bottom: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 9px rgba(4, 19, 28, .06); }
.filters-card input, .filters-card select { min-height: 36px; font-size: 11px; }
.table-card { border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .97); box-shadow: var(--shadow); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 45px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f8fbfc; }
.table-toolbar p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; }
.table-toolbar > div { display: flex; align-items: center; gap: 8px; color: #49616e; font-size: 10px; font-weight: 800; }
.pager { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #cbd9e0; border-radius: 8px; background: #fff; color: #294553; font-size: 18px; }
.pager:disabled { opacity: .35; cursor: not-allowed; }
.table-scroll { max-height: calc(100vh - 340px); overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { position: sticky; top: 0; z-index: 2; height: 40px; padding: 8px 10px; border-bottom: 1px solid #bfced6; background: #eaf1f4; color: #294653; font-size: 9px; letter-spacing: .03em; text-transform: uppercase; text-align: left; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #e4ebef; color: #29404e; font-size: 11px; vertical-align: middle; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f4f9fb; }
tbody tr:last-child td { border-bottom: 0; }
.cell-primary { display: grid; gap: 2px; }
.cell-primary strong { color: #102a3b; font-size: 12px; }
.cell-primary small { color: #6a7f8a; font-size: 9px; }
.cell-client { max-width: 260px; }
.cell-client strong, .cell-client small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-client small { margin-top: 2px; color: #70828b; font-size: 9px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 4px 8px; border: 1px solid #d5e1e7; border-radius: 999px; background: #f4f7f9; color: #516873; font-size: 9px; font-weight: 850; white-space: nowrap; }
.status-chip.pending { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.status-chip.reviewed { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.status-chip.field { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.row-action { min-height: 30px; padding: 5px 9px; border: 1px solid #bad7e2; border-radius: 8px; background: #eef7fb; color: #0f6385; font-size: 9px; font-weight: 900; }
.empty-state { display: grid; place-items: center; gap: 5px; min-height: 190px; color: #607783; }
.empty-state strong { color: #294653; }

.map-heading { align-items: center; }
.map-actions { display: flex; gap: 7px; }
.map-workspace { display: grid; grid-template-columns: 245px minmax(0, 1fr); height: calc(100vh - 142px); min-height: 560px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.map-panel { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-right: 1px solid var(--line); background: #f8fbfc; overflow: auto; }
.map-stat { display: flex; align-items: center; justify-content: space-between; min-height: 49px; padding: 10px 11px; border: 1px solid #d7e3e8; border-radius: 10px; background: #fff; }
.map-stat span { color: var(--muted); font-size: 10px; font-weight: 750; }
.map-stat strong { color: #173240; font-size: 18px; }
.map-help { padding: 10px; border-radius: 9px; background: #eaf5f9; color: #365866; font-size: 10px; line-height: 1.45; }
.map-help.drawing { border: 1px solid #fca5a5; background: #fff1f2; color: #991b1b; }
.map-legend { display: grid; gap: 7px; padding: 11px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.map-legend span { display: flex; align-items: center; gap: 8px; color: #536a76; font-size: 10px; font-weight: 750; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .14); }
.dot.reviewed { background: #0f7ba2; box-shadow: 0 0 0 3px rgba(15, 123, 162, .14); }
.dot.field { background: #e1251b; box-shadow: 0 0 0 3px rgba(225, 37, 27, .14); }
.selected-records { display: grid; gap: 6px; }
.selected-card { padding: 8px; border: 1px solid #d9e4e9; border-radius: 8px; background: #fff; }
.selected-card strong, .selected-card small { display: block; }
.selected-card strong { font-size: 10px; }
.selected-card small { margin-top: 2px; color: #6a7f8a; font-size: 8px; }
.client-map { width: 100%; height: 100%; background: #dce7eb; }
.client-map.drawing { cursor: crosshair; }
.cnf-marker { display: grid; place-items: center; width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; background: #f59e0b; box-shadow: 0 2px 8px rgba(4, 19, 28, .42); }
.cnf-marker.reviewed { background: #0f7ba2; }
.cnf-marker.field { width: 20px; height: 20px; background: #e1251b; box-shadow: 0 0 0 4px rgba(225, 37, 27, .22), 0 3px 9px rgba(4, 19, 28, .42); }
.cnf-tooltip { min-width: 210px; }
.cnf-tooltip strong, .cnf-tooltip span { display: block; }
.cnf-tooltip strong { color: #102a3b; font-size: 12px; }
.cnf-tooltip span { margin-top: 3px; color: #536a76; font-size: 10px; }

.loads-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(430px, 1.2fr); gap: 14px; }
.upload-card, .history-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.upload-card { display: grid; align-content: start; gap: 14px; padding: 22px; }
.upload-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 14px; background: #eaf5f9; color: #0f6385; font-size: 13px; font-weight: 950; letter-spacing: .08em; }
.upload-card h3, .history-card h3 { margin: 0; font-size: 17px; }
.upload-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.file-button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; }
.load-preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 12px; border: 1px solid #d4e3e9; border-radius: 10px; background: #f7fafb; }
.load-preview div { padding: 8px; border-radius: 8px; background: #fff; }
.load-preview span, .load-preview strong { display: block; }
.load-preview span { color: #6b7f89; font-size: 9px; }
.load-preview strong { margin-top: 2px; font-size: 13px; }
.progress-box { display: grid; gap: 7px; color: #4f6672; font-size: 10px; font-weight: 750; }
progress { width: 100%; height: 8px; accent-color: var(--accent); }
.history-card { overflow: hidden; }
.section-title { padding: 18px; border-bottom: 1px solid var(--line); background: #f8fbfc; }
.loads-history { max-height: calc(100vh - 235px); overflow: auto; }
.load-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 13px 17px; border-bottom: 1px solid #e1e9ed; }
.load-item:last-child { border-bottom: 0; }
.load-item strong, .load-item span, .load-item small { display: block; }
.load-item strong { font-size: 11px; }
.load-item span { margin-top: 3px; color: #607681; font-size: 9px; }
.load-item small { color: #84939b; font-size: 8px; }
.load-count { align-self: center; padding: 5px 8px; border-radius: 999px; background: #eaf7ef; color: #15803d; font-size: 9px; font-weight: 900; }

.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.account-card { padding: 15px; border: 1px solid var(--line); border-left: 5px solid #0f7ba2; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(4, 19, 28, .07); }
.account-card.suspended { border-left-color: #94a3b8; opacity: .74; }
.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.account-head strong, .account-head span { display: block; }
.account-head strong { font-size: 13px; }
.account-head span { margin-top: 3px; color: #687d87; font-size: 10px; }
.account-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.account-actions .button { min-height: 33px; font-size: 10px; }

dialog { padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(4, 17, 25, .64); backdrop-filter: blur(4px); }
.detail-dialog { width: min(1180px, calc(100vw - 38px)); max-height: calc(100vh - 34px); border-radius: 18px; background: #eef4f6; box-shadow: var(--shadow-float); overflow: hidden; }
.dialog-close-form { position: absolute; top: 12px; right: 12px; z-index: 5; margin: 0; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #ccd9df; border-radius: 9px; background: #fff; color: #3c5360; font-size: 23px; line-height: 1; }
.detail-content { max-height: calc(100vh - 34px); overflow: auto; }
.detail-hero { padding: 21px 58px 18px 22px; background: var(--shell-raised); color: #fff; }
.detail-hero .eyebrow { color: #fca5a5; }
.detail-hero h2 { margin: 0; font-size: 24px; }
.detail-hero p { margin: 4px 0 0; color: #b9cbd5; font-size: 11px; }
.detail-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.detail-badges .status-chip { border-color: rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .09); color: #fff; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 12px; padding: 12px; }
.detail-column { display: grid; align-content: start; gap: 12px; }
.detail-section { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.detail-section > header { padding: 11px 13px; border-bottom: 1px solid #dbe5ea; background: #f7fafb; }
.detail-section > header h3 { margin: 0; font-size: 12px; }
.detail-section-body { padding: 13px; }
.data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.data-field { min-width: 0; padding: 9px; border: 1px solid #e0e8ec; border-radius: 8px; background: #fbfcfd; }
.data-field span, .data-field strong { display: block; }
.data-field span { color: #6d818b; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.data-field strong { margin-top: 4px; color: #203946; font-size: 11px; overflow-wrap: anywhere; }
.calculation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.calculation-card { padding: 10px; border-radius: 9px; background: #eaf4f8; color: #365663; }
.calculation-card strong, .calculation-card span { display: block; }
.calculation-card strong { color: #0f6385; font-size: 16px; }
.calculation-card span { margin-top: 3px; font-size: 8px; font-weight: 750; }
.evaluation-form { display: grid; gap: 11px; }
.rating-buttons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.rating-button { min-height: 44px; border: 1px solid #ccd9df; border-radius: 8px; background: #fff; color: #4e6672; font-weight: 900; }
.rating-button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent); }
.field-decision { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.field-decision label { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 10px; border: 1px solid #d1dee4; border-radius: 8px; background: #fff; }
.field-decision input { width: auto; min-height: auto; }
.timeline { display: grid; gap: 9px; }
.timeline-item { position: relative; padding: 0 0 10px 18px; border-bottom: 1px solid #e4eaed; }
.timeline-item:last-child { padding-bottom: 0; border-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; top: 4px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: #0f7ba2; box-shadow: 0 0 0 3px #dceff5; }
.timeline-item strong, .timeline-item span, .timeline-item small { display: block; }
.timeline-item strong { font-size: 10px; }
.timeline-item span { margin-top: 3px; color: #506773; font-size: 9px; line-height: 1.4; }
.timeline-item small { margin-top: 3px; color: #82929a; font-size: 8px; }
.detail-map { width: 100%; height: 290px; background: #dce7eb; }
.no-data { padding: 9px; color: #778a93; font-size: 10px; text-align: center; }

.account-dialog { width: min(490px, calc(100vw - 30px)); border-radius: 16px; background: #fff; box-shadow: var(--shadow-float); }
.dialog-form { display: grid; gap: 13px; padding: 20px; }
.dialog-form > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dialog-form h2 { margin: 0; font-size: 19px; }
.dialog-form footer { display: flex; justify-content: flex-end; gap: 7px; padding-top: 5px; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; min-height: auto; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 11px 13px; border: 1px solid #cbdbe2; border-left: 4px solid #0f7ba2; border-radius: 10px; background: #fff; box-shadow: 0 10px 34px rgba(4, 19, 28, .2); color: #294653; font-size: 11px; font-weight: 750; animation: toast-in .18s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* Operación integral 0.2 */
.nav-list { overflow-y: auto; scrollbar-width: thin; }
.nav-group { display: block; margin: 12px 10px 5px; color: #77909d; font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.nav-group:first-child { margin-top: 2px; }
.nav-badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 8px; }
.topbar-user { gap: 9px; }
.profile-switch { display: grid; gap: 2px; color: #b9cbd5; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.profile-switch select { width: 156px; min-height: 29px; padding: 3px 25px 3px 8px; border-color: rgba(255,255,255,.18); background: #1c3949; color: #fff; font-size: 10px; }
.head-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.filters-expanded { grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(112px, .75fr)); }
.operations-grid { display: grid; grid-template-columns: minmax(280px, .55fr) minmax(540px, 1.45fr); gap: 14px; }
.compact-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compact-title > div { display: flex; gap: 7px; }
.compact-title input, .compact-title select { min-height: 34px; }
.orders-list { max-height: calc(100vh - 230px); overflow: auto; }
.order-item { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid #e1e9ed; }
.order-item > div:first-child strong, .order-item > div:first-child span, .order-item > div:first-child small { display: block; }
.order-item > div:first-child strong { font-size: 12px; }
.order-item > div:first-child span { margin-top: 3px; color: #506773; font-size: 10px; }
.order-item > div:first-child small { margin-top: 2px; color: #7c8e96; font-size: 9px; }
.order-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.stat-panel { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.stat-panel h3 { margin: 0 0 13px; font-size: 13px; }
.bar-list { display: grid; gap: 10px; }
.bar-row > div { display: flex; justify-content: space-between; gap: 10px; color: #526977; font-size: 10px; }
.bar-row i { display: block; height: 7px; margin-top: 4px; border-radius: 999px; background: #e8eff2; overflow: hidden; }
.bar-row i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0f6385, #22a2c9); }
.terrain-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 12px; }
.terrain-card { padding: 15px; border: 1px solid var(--line); border-top: 4px solid #e1251b; border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.terrain-card-head { display: flex; justify-content: space-between; gap: 8px; color: #687d87; font-size: 9px; font-weight: 850; }
.terrain-card-head b { color: #be123c; }
.terrain-card h3 { margin: 12px 0 2px; font-size: 17px; }
.terrain-card > p { margin: 0; color: #5d727d; font-size: 11px; }
.terrain-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 13px 0; }
.terrain-card dl div { padding: 8px; border-radius: 8px; background: #f3f7f9; }
.terrain-card dt { color: #72858e; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.terrain-card dd { margin: 3px 0 0; color: #203946; font-size: 10px; font-weight: 750; }
.terrain-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.terrain-actions .button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.offline-notice { margin-bottom: 12px; padding: 11px 13px; border: 1px solid #fbbf24; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: 10px; font-weight: 750; }
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.export-card { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.export-card > span { position: absolute; top: -10px; right: 9px; color: #e7eff3; font-size: 62px; font-weight: 950; }
.export-card h3 { position: relative; margin: 0; font-size: 16px; }
.export-card p { position: relative; min-height: 45px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.compact-filters { grid-template-columns: minmax(260px, 1fr) 220px; }
.activity-list { border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.activity-item { display: grid; grid-template-columns: 145px minmax(0, 1fr) auto auto; align-items: center; gap: 13px; padding: 12px 14px; border-bottom: 1px solid #e2eaee; }
.activity-item:last-child { border-bottom: 0; }
.activity-item time { color: #738790; font-size: 9px; }
.activity-item strong, .activity-item div span { display: block; }
.activity-item strong { font-size: 11px; }
.activity-item div span { margin-top: 3px; color: #657a84; font-size: 9px; }
.version-list { display: grid; gap: 10px; max-width: 880px; }
.version-item { display: grid; grid-template-columns: 130px 1fr; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.version-item > div { display: grid; place-content: center; padding: 18px; background: #102f40; color: #fff; text-align: center; }
.version-item b { font-size: 18px; }
.version-item time { margin-top: 5px; color: #bad0da; font-size: 9px; }
.version-item section { padding: 17px; }
.version-item h3 { margin: 0; font-size: 14px; }
.version-item p { margin: 6px 0 0; color: #5a707b; font-size: 10px; line-height: 1.5; }
.profiles-field { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.profiles-field legend { color: #526977; font-size: 10px; font-weight: 800; }
.profiles-field label { display: flex; align-items: center; gap: 6px; min-height: 27px; font-size: 10px; }
.profiles-field input { width: auto; min-height: auto; }
.dialog-note { margin: 0; color: #5f7480; font-size: 10px; line-height: 1.45; }
.evidence-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.evidence-list { display: grid; gap: 7px; margin-top: 12px; }
.evidence-item { display: block; padding: 9px; border: 1px solid #dbe5ea; border-radius: 8px; color: inherit; text-decoration: none; }
.evidence-item:hover { border-color: #8ec5d9; background: #f3fafc; }
.evidence-item strong, .evidence-item span, .evidence-item small { display: block; }
.evidence-item strong { font-size: 10px; }.evidence-item span { margin-top: 2px; color: #526977; font-size: 9px; }.evidence-item small { margin-top: 3px; color: #82929a; font-size: 8px; }
.dot.obtained, .cnf-marker.obtained { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.cnf-marker { width: 11px; height: 11px; border-width: 1px; box-shadow: 0 1px 4px rgba(4,19,28,.4); }
.cnf-marker.field { width: 13px; height: 13px; box-shadow: 0 0 0 2px rgba(225,37,27,.2), 0 2px 5px rgba(4,19,28,.35); }
.leaflet-control-layers-toggle { width: 28px !important; height: 28px !important; background-size: 17px 17px !important; }
.leaflet-control-layers-expanded { padding: 5px 7px !important; font-size: 10px !important; }

@media (max-width: 1180px) {
  :root { --sidebar-w: 202px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-card { grid-template-columns: minmax(240px, 1.4fr) repeat(2, 1fr); }
  .loads-layout { grid-template-columns: 1fr; }
  .history-card .loads-history { max-height: 420px; }
  .detail-grid { grid-template-columns: 1fr; }
  .filters-expanded { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operations-grid { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  :root { --header-h: 68px; }
  .app-shell { grid-template: var(--header-h) auto 1fr / 1fr; }
  .topbar { grid-template-columns: 100px minmax(0, 1fr) auto; padding: 7px 9px; }
  .brand img { width: 94px; }
  .topbar-heading h1 { font-size: 16px; }
  .topbar-heading > p:last-child, .connection-status, .user-pill span { display: none; }
  .user-pill { padding: 5px; }
  .sidebar { position: sticky; top: var(--header-h); z-index: 40; grid-row: 2; min-height: 51px; max-height: none; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; }
  .nav-list { display: flex; min-width: max-content; }
  .nav-item { min-height: 38px; white-space: nowrap; }
  .sidebar-context, .sidebar-user { display: none; }
  .workspace { grid-row: 3; padding: 12px; }
  .workspace-head h2 { font-size: 19px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-card { grid-template-columns: 1fr 1fr; }
  .filters-card .search-field { grid-column: 1 / -1; }
  .table-scroll { max-height: none; }
  .map-workspace { grid-template-columns: 1fr; height: auto; }
  .map-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .client-map { height: 66vh; min-height: 480px; }
  .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-switch { display: block; font-size: 0; }
  .profile-switch select { width: 118px; min-height: 30px; font-size: 9px; }
  .nav-group { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
  .order-item { grid-template-columns: 1fr auto; }
  .order-tags { grid-column: 1 / -1; }
  .activity-item { grid-template-columns: 1fr auto; }
  .activity-item time { grid-column: 1 / -1; }
  .evidence-form { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .login-card { padding: 25px 20px; }
  .topbar { grid-template-columns: 90px minmax(0, 1fr) 44px; gap: 7px; }
  .topbar-heading .eyebrow { display: none; }
  .workspace-head { align-items: stretch; flex-direction: column; }
  .map-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 70px; }
  .filters-card { grid-template-columns: 1fr; }
  .filters-card .search-field { grid-column: auto; }
  .table-scroll { overflow-x: auto; }
  table { min-width: 860px; }
  .loads-layout { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .detail-dialog { width: calc(100vw - 14px); max-height: calc(100vh - 14px); }
  .detail-content { max-height: calc(100vh - 14px); }
  .detail-grid { padding: 7px; }
  .data-grid { grid-template-columns: 1fr; }
  .terrain-cards { grid-template-columns: 1fr; }
  .terrain-card { border-radius: 10px; box-shadow: none; }
  .terrain-actions { grid-template-columns: 1fr; }
  .profiles-field { grid-template-columns: 1fr; }
  .compact-filters { grid-template-columns: 1fr; }
  .version-item { grid-template-columns: 90px 1fr; }
  .head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .profile-switch select { width: 104px; }
}
