:root {
  --app-ink: #17283e;
  --app-muted: #526276;
  --app-line: #dce2e9;
  --app-canvas: #f4f6f9;
  --app-blue: #2b6597;
}

:root, body { background: var(--app-canvas); color: var(--app-ink); }
.app-header .top { gap: 16px; }
.app-header .brand { white-space: nowrap; }
.app-logout { margin: 0; }
.app-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.app-nav a, .module-nav a { padding: 8px 10px; text-decoration: none; border-radius: 6px; color: var(--app-ink); font-size: .9rem; font-weight: 650; }
.app-nav a:hover, .module-nav a:hover { background: #eaf0f6; }
.app-nav a[aria-current], .module-nav a[aria-current] { color: #174e7b; background: #e4eef7; }
.panel { border: 1px solid var(--app-line); border-radius: 12px; }
.app-header button, .button-link, .dashboard-editor button { border-radius: 7px; }
.button-link { display: inline-flex; align-items: center; min-height: 43px; padding: 8px 14px; border: 1px solid var(--app-line); text-decoration: none; font-size: .9rem; font-weight: 700; }
.button-link.primary { border-color: #111f37; }
.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 32px 0 18px; }
.dashboard-date { margin: 0 0 4px; color: var(--app-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.dashboard-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; padding-bottom: 36px; }
.dashboard-widget { display: flex; align-items: flex-start; flex-direction: column; min-width: 0; }
.widget-carburant { grid-column: span 2; }
.widget-link { display: inline-block; margin-top: auto; padding-top: 12px; }
.dashboard-widget h2 { margin-bottom: 15px; }
.dashboard-widget > p { margin: 4px 0; }
.dashboard-kpis { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-kpis strong, .dashboard-widget .dashboard-value { display: block; font-size: clamp(1.7rem, 3.2vw, 2.45rem); line-height: 1.15; font-weight: 760; letter-spacing: -.035em; }
.dashboard-kpis strong small, .dashboard-value small { font-size: .9rem; font-weight: 650; letter-spacing: 0; }
.dashboard-kpis span, .dashboard-meta { color: var(--app-muted); font-size: .83rem; }
.dashboard-meta:empty { display: none; }
.fuel-chart { clear: both; width: 100%; margin: 19px 0 8px; }
.fuel-chart figcaption { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; font-size: .83rem; font-weight: 650; }
.fuel-chart figcaption span { font-weight: 500; color: var(--app-muted); }
.fuel-chart figcaption i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: #366e9c; }
.fuel-chart figcaption i + i { margin-left: 7px; background: #84a8be; }
.fuel-chart ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.fuel-chart li { min-width: 0; text-align: center; color: var(--app-muted); font-size: .75rem; }
.fuel-chart li small, .fuel-chart li span { display: block; }
.fuel-chart li small { font-variant-numeric: tabular-nums; }
.fuel-chart-track { height: 83px; display: grid; align-items: end; justify-items: center; border-bottom: 1px solid var(--app-line); margin-bottom: 4px; }
.fuel-chart-bar { display: flex; gap: 4px; align-items: end; }
.fuel-chart meter { display: block; width: 10px; height: 78px; writing-mode: vertical-lr; direction: rtl; appearance: none; }
.fuel-chart meter::-webkit-meter-bar { background: transparent; border: none; border-radius: 0; }
.fuel-chart .meter-cuve::-webkit-meter-optimum-value { background: #366e9c; border-radius: 3px 3px 0 0; }
.fuel-chart .meter-station::-webkit-meter-optimum-value { background: #84a8be; border-radius: 3px 3px 0 0; }
.fuel-chart .meter-cuve::-moz-meter-bar { background: #366e9c; }
.fuel-chart .meter-station::-moz-meter-bar { background: #84a8be; }
.alert-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.alert-chip { padding: 4px 8px; background: #ecf1f7; border-radius: 5px; font-size: .8rem; font-weight: 650; }
.alert-chip.critical { background: #fbe9e9; color: #8d2932; }
.date-critical { color: #8d2932; }
.dashboard-list { list-style: none; margin: 0; padding: 0; width: 100%; }
.dashboard-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--app-line); padding: 8px 0; font-size: .88rem; }
.dashboard-list a { overflow-wrap: anywhere; }
.dashboard-list time, .dashboard-list strong { flex: none; }
.dashboard-list .dashboard-meta { display: block; }
.dashboard-pairs { width: 100%; display: flex; flex-wrap: wrap; gap: 9px 22px; margin: 9px 0 0; }
.dashboard-pairs dt { color: var(--app-muted); font-size: .8rem; }
.dashboard-pairs dd { margin: 2px 0 0; font-weight: 700; }
.dashboard-editor { margin-bottom: 15px; padding-block: 12px; }
.dashboard-editor ol { list-style: none; max-width: 560px; margin: 10px 0; padding: 0; }
.dashboard-editor li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-top: 1px solid var(--app-line); }
.dashboard-editor label { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.dashboard-editor input[type=checkbox] { width: 18px; min-height: auto; height: 18px; }
.widget-move { display: flex; gap: 5px; }
.widget-move button { min-width: 42px; }
.widget-move button[aria-disabled=true] { color: #566a7b; background: #edf1f5; cursor: default; }

body.tachy-workspace { margin: 0; padding: 0; background: var(--app-canvas); font-family: "Segoe UI", Arial, sans-serif; color: var(--app-ink); }
.tachy-workspace { --cargo-navy: #17283e; --cargo-blue: #366e9c; --cargo-navy-soft: #214f76; --workspace-border: var(--app-line); --cargo-line: var(--app-line); }
.tachy-workspace main.cargo-main { width: min(1120px, calc(100% - 44px)); margin: 0 auto; padding: 30px 0 42px; min-height: 0; background: none !important; }
.tachy-workspace .module-bar { height: auto; margin: 0 0 13px; padding: 0; background: transparent; color: var(--app-ink); }
.tachy-workspace .module-bar h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 750; line-height: 1.12; letter-spacing: -.04em; text-transform: none; }
.module-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 0 0 19px; padding-bottom: 10px; border-bottom: 1px solid var(--app-line); }
.tachy-workspace .module-nav a.active { background: #e4eef7; }
.tachy-workspace .cargo-main .panel, .tachy-workspace .cargo-main .upload-card { border-radius: 12px; border-color: var(--app-line); }
.tachy-workspace .cargo-main h2 { font-size: clamp(1.2rem, 2.8vw, 1.55rem); }
.tachy-workspace .cargo-main .upload-card { flex-wrap: wrap; }
.tachy-workspace .primary-link, .tachy-workspace .upload-button { background: var(--app-ink); }
.tachy-workspace .report-table-wrap, .tachy-workspace .deadline-group, .tachy-workspace .prep-detail { min-width: 0; max-width: 100%; }
.tachy-workspace .report-table-wrap { overflow-x: auto; }
.tachy-workspace .score-explainer, .tachy-workspace .kpis { border-color: var(--app-line); }
.tachy-workspace .app-header .top { font-size: 1rem; }
.tachy-workspace .module-bar + .module-nav { margin-top: 2px; }
.deadline-mobile-label { display: none; }
.tachy-workspace .workspace-filterbar > label { min-width: 0; }
.tachy-workspace .cargo-main input[type=search] { min-width: 0; }

@media (max-width: 1000px) {
  .app-header .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding-block: 9px; }
  .app-nav { grid-row: 2; grid-column: 1 / -1; }
  .app-logout { grid-row: 1; grid-column: 2; }
}
@media (max-width: 770px) {
  .dashboard-head { align-items: start; flex-direction: column; margin-top: 22px; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tachy-workspace main.cargo-main { width: calc(100% - 30px); padding-top: 22px; }
}
@media (max-width: 560px) {
  .app-nav { gap: 2px; }
  .app-nav a, .module-nav a { padding: 7px 8px; font-size: .83rem; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .widget-carburant { grid-column: auto; }
  .dashboard-list li { gap: 5px; }
  .fuel-chart ol { gap: 2px; }
  .fuel-chart li { font-size: .71rem; }
  .tachy-workspace .workspace-filterbar > label { flex: 1 1 130px; }
  .tachy-workspace .deadline-panel .workspace-filterbar > label:first-child { flex-basis: 100%; }
  .tachy-workspace .deadline-table { min-width: 0; white-space: normal; }
  .tachy-workspace .deadline-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tachy-workspace .deadline-table tbody { display: block; }
  .tachy-workspace .deadline-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 9px; padding: 10px 12px; border-bottom: 1px solid var(--app-line); }
  .tachy-workspace .deadline-table tbody tr:last-child { border-bottom: 0; }
  .tachy-workspace .deadline-table tbody td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .tachy-workspace .deadline-table td:first-child, .tachy-workspace .deadline-table td:last-child, .tachy-workspace .deadline-table .empty { grid-column: 1 / -1; }
  .deadline-mobile-label { display: block; color: var(--app-muted); font-weight: 650; }
}
