:root {
  color-scheme: dark;
  --bg: #080f24;
  --panel: #0b1630;
  --panel-2: #11213f;
  --panel-3: #162a4f;
  --line: #294267;
  --text: #f4f6f7;
  --muted: #94a4c3;
  --accent: #386bdc;
  --accent-2: #6797ff;
  --green: #24b47e;
  --yellow: #efa63b;
  --red: #e45454;
  --blue: #6797ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.titlebar {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #080f24;
  border-bottom: 1px solid #0b1630;
  -webkit-app-region: drag;
  user-select: none;
}
.titlebar-brand { display: flex; align-items: center; gap: 9px; padding-left: 14px; color: #c8d2d6; font-size: 13px; font-weight: 600; }
.titlebar-brand svg { width: 25px; fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.window-controls { height: 100%; display: flex; -webkit-app-region: no-drag; }
.window-controls button { width: 48px; height: 100%; border: 0; background: transparent; color: #c5d0d4; font-size: 17px; }
.window-controls button:hover { background: #11213f; }
.window-controls .close:hover { background: #c42b1c; color: white; }

.login-view {
  position: relative;
  height: calc(100vh - 42px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(8,15,36, .3), transparent 36%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0, rgba(255,255,255,.014) 1px, transparent 1px, transparent 5px),
    linear-gradient(135deg, #080f24, #0b1630 58%, #080f24);
}
.login-view::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,15,36,.58), transparent 35%, transparent 65%, rgba(8,15,36,.58)); }
.login-truck { position: absolute; width: 82%; max-width: 1180px; opacity: .09; transform: translateY(90px); }
.login-truck svg { width: 100%; fill: none; stroke: #b6c4de; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.login-card {
  position: relative;
  z-index: 2;
  width: 455px;
  padding: 38px 42px 28px;
  border: 1px solid #294267;
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(17,33,63,.98), rgba(8,15,36,.98));
  box-shadow: var(--shadow);
  text-align: center;
}
.login-accent { position: absolute; top: -1px; left: -1px; right: -1px; height: 4px; border-radius: 6px 6px 0 0; background: var(--accent); }
.truck-mark { height: 82px; margin-bottom: 8px; }
.truck-mark svg { height: 100%; fill: none; stroke: #f1f4f5; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.truck-mark svg path { filter: drop-shadow(0 7px 0 rgba(56,107,220,.9)); }
.login-card h1 { margin: 4px 0 7px; font-size: 33px; font-weight: 400; letter-spacing: .2px; }
.login-subtitle { margin: 0; color: #94a4c3; letter-spacing: 2.1px; font-size: 12px; }
.login-divider { width: 92px; height: 1px; background: #11213f; margin: 24px auto 19px; }
.login-card h2 { margin: 0 0 18px; font-size: 19px; font-weight: 600; }
.input-wrap { height: 52px; margin: 0 0 13px; display: flex; align-items: center; border: 1px solid #294267; border-radius: 4px; background: rgba(255,255,255,.015); transition: .18s; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(56,107,220,.12); }
.field-icon { width: 52px; color: #b6c4de; font-size: 20px; }
.field-svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.input-wrap input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: white; font-size: 15px; }
.input-wrap input::placeholder { color: #8195b8; }
.eye-button { width: 48px; height: 100%; border: 0; background: transparent; color: #94a4c3; }
.eye-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.form-error { min-height: 18px; margin: 0 0 6px; color: #ff8277; font-size: 13px; text-align: left; }
.primary-button { border: 0; border-radius: 5px; background: linear-gradient(90deg, #6797ff, #6797ff); color: white; font-weight: 650; box-shadow: 0 6px 20px rgba(56,107,220,.18); }
.primary-button:hover { filter: brightness(1.08); }
.login-button { width: 100%; height: 49px; font-size: 15px; }
.secure-note { margin: 21px 0 0; color: #94a4c3; font-size: 13px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; }
.secure-note svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { height: calc(100vh - 42px); display: grid; grid-template-columns: 256px 1fr; }
.sidebar { display: flex; flex-direction: column; background: #080f24; border-right: 1px solid #11213f; padding: 23px 15px 17px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 25px; }
.mini-logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: rgba(56,107,220,.12); }
.mini-logo svg { width: 30px; fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 18px; }
.sidebar-brand span { color: var(--muted); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; }
.main-nav { display: grid; gap: 6px; }
.nav-item { height: 48px; display: flex; align-items: center; gap: 13px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #b6c4de; text-align: left; }
.nav-item .nav-icon { width: 23px; height: 23px; display: grid; place-items: center; color: #8195b8; }
.nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: #0b1630; color: white; }
.nav-item.active { background: linear-gradient(90deg, rgba(56,107,220,.2), rgba(56,107,220,.07)); border-color: rgba(56,107,220,.22); color: white; }
.nav-item.active .nav-icon { color: var(--accent-2); }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 15px 10px 2px; border-top: 1px solid #11213f; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 13px; }
.sidebar-footer small { margin-top: 2px; color: #8195b8; font-size: 11px; }
.sidebar-session { min-width: 0; flex: 1; }
.sidebar-session strong, .sidebar-session small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout { width: 31px; height: 31px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; color: #94a4c3; cursor: pointer; }
.sidebar-logout:hover { border-color: #6797ff; color: #6797ff; }
.offline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(36,180,126,.12); }

.workspace { min-width: 0; overflow: hidden; background: #f4f6f7; color: #0b1630; }
.workspace-header { height: 94px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid #dfe5e7; background: white; }
.workspace-header h1 { margin: 0 0 4px; font-size: 25px; }
.workspace-header p { margin: 0; color: #8195b8; font-size: 13px; }
.page-root { height: calc(100% - 94px); padding: 26px 32px 34px; overflow: auto; }
.page-root::-webkit-scrollbar { width: 10px; }
.page-root::-webkit-scrollbar-thumb { border: 3px solid #f4f6f7; border-radius: 10px; background: #b8c4c8; }
.header-button, .secondary-button, .danger-button { min-height: 40px; padding: 0 17px; border-radius: 6px; font-weight: 600; }
.header-button { border: 0; background: var(--accent); color: white; }
.secondary-button { border: 1px solid #cbd5d8; background: white; color: #11213f; }
.danger-button { border: 1px solid #efcaca; background: #fff6f6; color: #bc3434; }
.icon-button { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid #d5dddf; border-radius: 6px; background: white; color: #294267; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.kpi-card { min-height: 125px; display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid #e0e6e8; border-radius: 11px; background: white; box-shadow: 0 5px 18px rgba(8,15,36,.05); }
.kpi-icon { width: 51px; height: 51px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #eef5f6; color: #94a4c3; font-size: 23px; }
.kpi-icon.orange { background: #fff0e9; color: var(--accent); }
.kpi-icon.red { background: #ffeded; color: var(--red); }
.kpi-icon.blue { background: #eaf3fb; color: #b6c4de; }
.kpi-value { display: block; color: #11213f; font-size: 28px; font-weight: 750; white-space: nowrap; }
.kpi-label { display: block; margin-top: 4px; color: #8195b8; font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 18px; }
.panel { border: 1px solid #dee5e7; border-radius: 11px; background: white; box-shadow: 0 5px 18px rgba(8,15,36,.045); overflow: hidden; }
.panel-header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 21px; border-bottom: 1px solid #edf0f1; }
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-link { border: 0; background: transparent; color: #6797ff; font-size: 13px; font-weight: 600; }
.event-list, .activity-list { padding: 5px 20px 11px; }
.event-row, .activity-row { display: grid; align-items: center; min-height: 65px; border-bottom: 1px solid #edf0f1; }
.event-row:last-child, .activity-row:last-child { border-bottom: 0; }
.event-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; }
.event-symbol { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 8px; background: #eff5f6; color: #6f84ac; }
.event-row strong, .event-row small, .activity-row strong, .activity-row small { display: block; }
.event-row strong, .activity-row strong { font-size: 13px; }
.event-row small, .activity-row small { margin-top: 4px; color: #8195b8; font-size: 12px; }
.event-due { text-align: right; font-size: 12px; font-weight: 700; }
.event-due.critical { color: var(--red); }
.event-due.warning { color: #d48317; }
.event-due.good { color: var(--green); }
.activity-row { grid-template-columns: minmax(0, 1fr) 120px 100px; gap: 14px; }
.activity-row .money, .activity-row time { text-align: right; font-size: 12px; }
.activity-row .money { font-weight: 700; }
.empty-state { padding: 45px 20px; color: #94a4c3; text-align: center; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.search-box { width: min(420px, 55%); height: 42px; padding: 0 14px; border: 1px solid #d7dfe2; border-radius: 7px; background: white; color: #11213f; outline: none; }
.search-box:focus { border-color: #6797ff; box-shadow: 0 0 0 3px rgba(56,107,220,.1); }
.filter-select { height: 42px; min-width: 130px; padding: 0 12px; border: 1px solid #d7dfe2; border-radius: 7px; background: white; color: #11213f; }
.data-table-wrap { border: 1px solid #dfe5e7; border-radius: 10px; background: white; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.fleet-table { min-width: 1380px; }
.maintenance-table { min-width: 1420px; }
.maintenance-table th:last-child, .maintenance-table td:last-child,
.maintenance-table th:nth-last-child(2), .maintenance-table td:nth-last-child(2) { position: sticky; z-index: 2; }
.maintenance-table th:last-child, .maintenance-table td:last-child { right: 0; min-width: 55px; }
.maintenance-table th:nth-last-child(2), .maintenance-table td:nth-last-child(2) { right: 55px; min-width: 105px; box-shadow: -8px 0 14px rgba(8,15,36, .18); }
.maintenance-table th:last-child, .maintenance-table th:nth-last-child(2) { background: #0b1630; }
.maintenance-table td:last-child, .maintenance-table td:nth-last-child(2) { background: #0b1630; }
.fleet-table th:last-child, .fleet-table td:last-child { position: sticky; right: 0; box-shadow: -8px 0 14px rgba(8,15,36, .18); }
.fleet-table th:last-child { background: #0b1630; }
.fleet-table td:last-child { background: #0b1630; }
.data-table th { height: 46px; padding: 0 13px; background: #f7f9fa; border-bottom: 1px solid #dfe5e7; color: #6f84ac; font-size: 11px; letter-spacing: .4px; text-align: left; text-transform: uppercase; }
.data-table td { height: 58px; padding: 8px 13px; border-bottom: 1px solid #edf1f2; color: #11213f; font-size: 12.5px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfc; }
.comments-cell { min-width: 230px; line-height: 1.35; }
.invoice-number-cell { min-width: 105px; color: #dbe5e8; font-weight: 650; white-space: nowrap; }
.invoice-button { min-width: 82px; height: 31px; padding: 0 9px; border: 1px dashed #294267; border-radius: 5px; background: #0b1630; color: #94a4c3; font-size: 10px; white-space: nowrap; }
.invoice-button:hover { border-color: #6797ff; color: #6797ff; }
.invoice-button.has-invoice { border-style: solid; border-color: rgba(36,180,126,.28); background: rgba(36,180,126,.09); color: #55d19e; }
.plate { font-weight: 750; color: #11213f; letter-spacing: .4px; }
.muted { color: #94a4c3; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.status-badge.good { background: #eaf8f2; color: #197850; }
.status-badge.good::before { background: var(--green); }
.status-badge.warning { background: #fff5e6; color: #6797ff; }
.status-badge.warning::before { background: var(--yellow); }
.status-badge.critical { background: #ffeded; color: #a93737; }
.status-badge.critical::before { background: var(--red); }
.status-badge.neutral { background: #edf2f3; color: #6f84ac; }
.status-badge.neutral::before { background: #94a4c3; }

.cost-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .6fr); gap: 18px; }
.bar-list { padding: 18px 22px 22px; }
.bar-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 90px; align-items: center; gap: 13px; min-height: 43px; }
.bar-label { font-size: 12px; font-weight: 650; }
.bar-track { height: 12px; border-radius: 99px; background: #edf1f2; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6797ff, #6797ff); }
.bar-value { text-align: right; font-size: 12px; font-weight: 700; }
.year-list { padding: 13px 20px 20px; }
.year-row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid #edf0f1; font-size: 13px; }
.year-row:last-child { border-bottom: 0; }
.year-row strong { font-size: 15px; }

.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.document-card { padding: 19px; border: 1px solid #dee5e7; border-radius: 10px; background: white; }
.document-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.document-card h3 { margin: 0; font-size: 15px; }
.document-list { display: grid; gap: 8px; }
.document-item { min-width: 0; display: flex; gap: 6px; }
.document-row { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid #e3e9eb; border-radius: 6px; background: #f9fbfb; color: #294267; text-align: left; font-size: 12px; }
.document-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-type { flex: 0 0 auto; min-width: 27px; padding: 4px 3px; border-radius: 4px; background: #294267; color: #c7d5da; font-size: 7px; font-weight: 800; text-align: center; }
.document-type.pdf { background: #6797ff; color: white; }
.document-menu { flex: 0 0 36px; border: 1px solid #e3e9eb; border-radius: 6px; background: #f9fbfb; color: #6f84ac; font-weight: 800; letter-spacing: 1px; }
.document-menu:hover { color: #6797ff; }
.small-add { border: 0; background: #fff1ea; color: #6797ff; border-radius: 6px; padding: 7px 9px; font-weight: 700; }

.document-action-summary { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; }
.document-action-summary .document-type { min-width: 40px; padding: 9px 4px; font-size: 9px; }
.document-action-summary strong, .document-action-summary small { display: block; }
.document-action-summary strong { max-width: 360px; overflow: hidden; color: #eef3f5; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.document-action-summary small { margin-top: 3px; color: #94a4c3; font-size: 10px; }
.document-action-list { display: grid; gap: 7px; margin-top: 14px; }
.document-action-list button { display: grid; gap: 2px; padding: 11px 13px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; color: #dce5e8; text-align: left; }
.document-action-list button:hover { border-color: #6f84ac; background: #11213f; }
.document-action-list button strong { font-size: 12px; }
.document-action-list button span { color: #94a4c3; font-size: 10px; }
.document-action-list button.danger { border-color: rgba(228,84,84,.28); color: #ff8d8d; }
.document-action-list button.danger:hover { background: rgba(228,84,84,.1); }
.delete-document-warning { padding: 15px; border: 1px solid rgba(228,84,84,.34); border-radius: 7px; background: rgba(228,84,84,.08); }
.delete-document-warning strong { color: #f3f6f7; }
.delete-document-warning p { margin: 7px 0 0; color: #c7d3e8; font-size: 12px; line-height: 1.45; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { padding: 22px; border: 1px solid #dee5e7; border-radius: 10px; background: white; }
.company-settings { grid-column: 1 / -1; }
.email-reminder-settings { grid-column: 1 / -1; }
.company-actions { display: flex; align-items: end; }
.settings-card h2 { margin: 0 0 7px; font-size: 17px; }
.settings-card p { margin: 0 0 18px; color: #8195b8; font-size: 13px; line-height: 1.55; }
.path-box { padding: 11px 12px; border-radius: 6px; background: #f0f4f5; color: #6f84ac; font-family: Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.backup-settings { grid-column: 1 / -1; }
.backup-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.backup-heading p { margin-bottom: 0; }
.backup-active { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(36,180,126,.25); border-radius: 99px; background: rgba(36,180,126,.08); color: #55d19e; font-size: 10px; font-weight: 700; }
.backup-active i { width: 7px; height: 7px; border-radius: 50%; background: #31c58b; box-shadow: 0 0 0 4px rgba(49,197,139,.1); }
.backup-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 14px; }
.backup-overview > div { padding: 12px; border: 1px solid #294267; border-radius: 7px; background: rgba(255,255,255,.015); }
.backup-overview span, .backup-overview strong { display: block; }
.backup-overview span { color: #94a4c3; font-size: 10px; }
.backup-overview strong { margin-top: 5px; color: #e9f0f2; font-size: 12px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-path { margin-top: 11px; }
.backup-history { margin-top: 18px; }
.backup-history h3 { margin: 0 0 9px; color: #dce5e8; font-size: 12px; }
.backup-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #11213f; }
.backup-row strong, .backup-row small { display: block; }
.backup-row strong { color: #dce5e8; font-size: 11px; }
.backup-row small { margin-top: 3px; color: #94a4c3; font-size: 9px; }
.backup-kind { padding: 5px 6px; border-radius: 99px; background: rgba(56,107,220,.1); color: #6797ff; font-size: 8px; font-weight: 750; text-align: center; text-transform: uppercase; }
.backup-kind.manual { background: rgba(56,107,220,.11); color: #6797ff; }
.backup-kind.safety { background: rgba(239,166,59,.11); color: #efb35b; }
.restore-backup { padding: 7px 9px; border: 1px solid #294267; border-radius: 5px; background: #0b1630; color: #bfcdd1; font-size: 10px; }
.restore-backup:hover { border-color: #6f84ac; color: white; }
.restore-warning { padding: 15px; border: 1px solid rgba(239,166,59,.34); border-radius: 7px; background: rgba(239,166,59,.07); }
.restore-warning strong, .restore-warning span { display: block; }
.restore-warning strong { color: #f2f6f7; }
.restore-warning p { margin: 8px 0; color: #c5d0d3; font-size: 12px; line-height: 1.5; }
.restore-warning span { color: #efb35b; font-size: 10px; }
.settings-hint { margin: 10px 0 0 !important; padding: 11px 12px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; }
.email-settings-form { margin-top: 18px; }
.email-enabled { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid #294267; border-radius: 8px; background: #0b1630; color: #e9f0f2; cursor: pointer; }
.email-enabled input { width: 18px; height: 18px; accent-color: #6797ff; }
.email-enabled span, .email-enabled strong, .email-enabled small { display: block; }
.email-enabled small { margin-top: 3px; color: #94a4c3; font-size: 10px; font-weight: 400; }
.form-field small { color: #8195b8; font-size: 10px; line-height: 1.4; }
.email-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.email-status { display: grid; gap: 4px; margin-top: 16px; padding: 12px 13px; border: 1px solid #294267; border-radius: 8px; background: #0b1630; }
.email-status strong { color: #dfe8ea; font-size: 12px; }
.email-status small { color: #94a4c3; font-size: 10px; }
.email-status.success { border-color: rgba(49,197,139,.28); background: rgba(49,197,139,.06); }
.email-status.error { border-color: rgba(228,84,84,.3); background: rgba(228,84,84,.07); }
.email-preview { display: grid; gap: 8px; }
.email-preview > p { margin: 0 0 7px; color: #dce5e8; }
.email-preview-row { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid #294267; border-left: 3px solid #eeb04f; border-radius: 7px; background: #0b1630; }
.email-preview-row.urgent { border-left-color: #f05e58; }
.email-preview-row strong { color: #edf3f5; font-size: 12px; }
.email-preview-row span { color: #94a4c3; font-size: 10px; }

.modal-root { position: fixed; z-index: 20; inset: 42px 0 0; display: grid; place-items: center; padding: 30px; background: rgba(8,15,36,.68); backdrop-filter: blur(3px); }
.modal { width: min(760px, 92vw); max-height: calc(100vh - 110px); overflow: auto; border: 1px solid #dce3e5; border-radius: 12px; background: white; color: #0b1630; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.modal.small { width: min(510px, 92vw); }
.modal-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 23px; border-bottom: 1px solid #e8edef; }
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 6px; background: #f0f3f4; color: #6f84ac; font-size: 21px; }
.modal-body { padding: 22px 23px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-field { display: grid; gap: 7px; }
.form-field.full, .form-grid > .full { grid-column: 1 / -1; }
.form-field label { color: #6f84ac; font-size: 12px; font-weight: 650; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d4dde0; border-radius: 6px; background: white; color: #0b1630; outline: none; }
.form-field textarea { min-height: 82px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #6797ff; box-shadow: 0 0 0 3px rgba(56,107,220,.1); }
.mileage-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; }
.mileage-refresh-button { min-width: 42px; min-height: 42px; display: grid; place-items: center; border: 1px solid #294267; border-radius: 7px; background: #11213f; color: #37d6a0; font-size: 21px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.mileage-refresh-button:hover:not(:disabled) { border-color: #37d6a0; background: #11213f; }
.mileage-refresh-button:active:not(:disabled) { transform: scale(.96); }
.mileage-refresh-button:disabled { cursor: not-allowed; opacity: .42; }
.mileage-refresh-button.loading span { animation: mileage-spin .8s linear infinite; }
.mileage-source { min-height: 15px; color: #94a4c3; font-size: 10px; line-height: 1.4; }
@keyframes mileage-spin { to { transform: rotate(360deg); } }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 23px; border-top: 1px solid #e8edef; }
.maintenance-delete-button { margin-right: auto; }
.detail-banner { display: flex; align-items: center; gap: 16px; margin-bottom: 19px; padding: 17px; border-radius: 8px; background: #f3f7f8; }
.detail-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 10px; background: #e7edef; color: #294267; font-size: 27px; }
.detail-banner h3, .detail-banner p { margin: 0; }
.detail-banner h3 { font-size: 18px; }
.detail-banner p { margin-top: 4px; color: #8195b8; font-size: 12px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 18px; }
.detail-stat { padding: 13px; border: 1px solid #e1e7e9; border-radius: 7px; }
.detail-stat span, .detail-stat strong { display: block; }
.detail-stat span { color: #8195b8; font-size: 11px; }
.detail-stat strong { margin-top: 5px; font-size: 14px; }
.detail-stat small { display: block; margin-top: 5px; color: #94a4c3; font-size: 11px; }
.deadline-cell { min-width: 104px; display: grid; justify-items: start; gap: 6px; }
.deadline-cell > strong { color: #d9e3e6; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.regulatory-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; margin: 0 0 18px; }
.regulatory-card { display: grid; justify-items: start; gap: 7px; padding: 13px; border: 1px solid #294267; border-radius: 7px; background: rgba(255,255,255,.015); }
.regulatory-card > span:first-child { color: #94a4c3; font-size: 11px; }
.regulatory-card > strong { color: #edf3f5; font-size: 13px; }
.modal-error { min-height: 18px; margin: 10px 0 0; color: #6797ff; font-size: 12px; }
.form-help { margin: 0; color: #94a4c3; font-size: 12px; line-height: 1.45; }
.maintenance-invoice-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; }
.maintenance-invoice-link strong, .maintenance-invoice-link span { display: block; }
.maintenance-invoice-link strong { color: #e5edef; font-size: 12px; }
.maintenance-invoice-link span { margin-top: 3px; color: #94a4c3; font-size: 10px; }
.invoice-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.invoice-summary > div { padding: 11px 12px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; }
.invoice-summary span, .invoice-summary strong { display: block; }
.invoice-summary span { color: #94a4c3; font-size: 9px; text-transform: uppercase; }
.invoice-summary strong { margin-top: 5px; color: #edf3f5; font-size: 12px; }
.invoice-files { margin-top: 16px; }
.invoice-files h3 { margin: 0 0 9px; color: #dce5e8; font-size: 12px; }
.invoice-empty { display: grid; gap: 4px; padding: 23px; border: 1px dashed #294267; border-radius: 7px; color: #94a4c3; text-align: center; }
.invoice-empty strong { color: #bfccd0; font-size: 12px; }
.invoice-empty span { font-size: 10px; }

.toast { position: fixed; z-index: 50; right: 25px; bottom: 24px; max-width: 390px; padding: 13px 17px; border-radius: 7px; background: #0b1630; color: white; box-shadow: 0 12px 35px rgba(0,0,0,.3); font-size: 13px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: .23s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1240px) {
  .app-shell { grid-template-columns: 215px 1fr; }
  .sidebar { padding-inline: 10px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .document-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .cost-layout { grid-template-columns: 1fr; }
}

/* Thème Ribat Transport : continuité visuelle du login dans toute l'application */
.workspace {
  color: #eef3f5;
  background:
    radial-gradient(circle at 78% 8%, rgba(8,15,36, .18), transparent 36%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.009) 0, rgba(255,255,255,.009) 1px, transparent 1px, transparent 5px),
    linear-gradient(145deg, #080f24, #0b1630 57%, #080f24);
}
.workspace-header {
  border-bottom-color: #11213f;
  background: rgba(8,15,36, .93);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}
.workspace-header h1 { color: #f4f7f8; font-weight: 650; }
.workspace-header p { color: #94a4c3; }
.page-root::-webkit-scrollbar-thumb { border-color: #080f24; background: #294267; }

.header-button {
  background: linear-gradient(90deg, #6797ff, #6797ff);
  box-shadow: 0 6px 18px rgba(56,107,220, .16);
}
.header-button:hover, .secondary-button:hover, .icon-button:hover { filter: brightness(1.1); }
.secondary-button {
  border-color: #294267;
  background: #0b1630;
  color: #dce5e8;
}
.danger-button {
  border-color: rgba(228, 84, 84, .38);
  background: rgba(228, 84, 84, .1);
  color: #ff8d8d;
}
.icon-button {
  border-color: #294267;
  background: #0b1630;
  color: #c7d3e8;
}

.kpi-card, .panel, .data-table-wrap, .document-card, .settings-card {
  border-color: #11213f;
  background: linear-gradient(150deg, rgba(17,33,63, .98), rgba(11,22,48, .98));
  box-shadow: 0 11px 30px rgba(0, 0, 0, .19);
}
.kpi-card { position: relative; overflow: hidden; }
.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56,107,220,.45), transparent);
  opacity: .55;
}
.kpi-icon { background: rgba(56, 107, 220, .11); color: #6797ff; }
.kpi-icon.orange { background: rgba(56,107,220, .13); color: #6797ff; }
.kpi-icon.red { background: rgba(228, 84, 84, .12); color: #f06b6b; }
.kpi-icon.blue { background: rgba(56, 107, 220, .11); color: #6797ff; }
.kpi-value { color: #f5f8f9; }
.kpi-label { color: #94a4c3; }

.panel-header { border-bottom-color: #11213f; }
.panel-header h2, .document-card h3, .settings-card h2 { color: #f1f5f6; }
.panel-link { color: #6797ff; }
.event-row, .activity-row { border-bottom-color: #11213f; }
.event-symbol { background: #11213f; color: #b6c4de; }
.event-row strong, .activity-row strong, .activity-row .money, .activity-row time { color: #e5edef; }
.event-row small, .activity-row small, .empty-state { color: #94a4c3; }

.search-box, .filter-select {
  border-color: #294267;
  background: #0b1630;
  color: #edf3f5;
}
.search-box::placeholder { color: #8195b8; }
.search-box:focus, .filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,107,220,.11);
  outline: 0;
}
.data-table th {
  border-bottom-color: #294267;
  background: #0b1630;
  color: #94a4c3;
}
.data-table td { border-bottom-color: #11213f; color: #ccd7da; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.plate { color: #f2f6f7; }
.muted { color: #94a4c3; }
.status-badge.good { background: rgba(36,180,126,.12); color: #55d19e; }
.status-badge.warning { background: rgba(239,166,59,.12); color: #f1b75f; }
.status-badge.critical { background: rgba(228,84,84,.13); color: #f27b7b; }
.status-badge.neutral { background: rgba(143,160,166,.12); color: #b6c4de; }

.bar-label, .bar-value, .year-row { color: #dbe4e7; }
.bar-track { background: #11213f; }
.year-row { border-bottom-color: #11213f; }
.document-row {
  border-color: #294267;
  background: #0b1630;
  color: #c7d3d7;
}
.document-row:hover { border-color: #294267; background: #11213f; }
.document-menu { border-color: #294267; background: #0b1630; color: #94a4c3; }
.document-menu:hover { border-color: #294267; background: #11213f; color: #6797ff; }
.small-add { background: rgba(56,107,220,.13); color: #6797ff; }
.settings-card p { color: #94a4c3; }
.path-box { background: #080f24; color: #b6c4de; border: 1px solid #11213f; }

.modal {
  border-color: #294267;
  background: linear-gradient(155deg, #0b1630, #080f24);
  color: #edf3f5;
}
.modal-header, .modal-actions { border-color: #11213f; }
.modal-header h2 { color: #f4f7f8; }
.modal-close { background: #11213f; color: #b6c4de; }
.modal-close:hover { background: #11213f; color: white; }
.form-field label { color: #b6c4de; }
.form-field input, .form-field select, .form-field textarea {
  border-color: #294267;
  background: #080f24;
  color: #eff4f5;
}
.form-field input::placeholder, .form-field textarea::placeholder { color: #8195b8; }
.detail-banner { background: #0b1630; border: 1px solid #294267; }
.detail-icon { background: #11213f; color: #c7d3e8; }
.detail-banner p, .detail-stat span { color: #94a4c3; }
.detail-stat { border-color: #294267; background: rgba(255,255,255,.015); }
.modal-error { color: #ff8178; }

input[type="date"] { color-scheme: dark; }
select option { background: #0b1630; color: #eef3f5; }

/* Adaptation web / PWA */
.web-mode .window-controls { display: none; }
.web-mode .titlebar { -webkit-app-region: initial; }
.web-mode .titlebar-brand { margin: 0 auto 0 2px; }
.web-mode .sidebar-footer .offline-dot { background: #32d9a0; box-shadow: 0 0 0 4px rgba(50,217,160,.1); }

.web-upload-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8,15,36, .82);
  backdrop-filter: blur(8px);
}

.web-upload-card {
  position: relative;
  width: min(560px, 100%);
  padding: 30px;
  border: 1px solid #294267;
  border-top: 4px solid #6797ff;
  border-radius: 14px;
  background: linear-gradient(145deg, #0b1630, #080f24);
  box-shadow: 0 26px 80px rgba(0,0,0,.62);
  text-align: center;
}

.web-upload-card h2 { margin: 6px 0 6px; color: #f5fafb; }
.web-upload-card > p { margin: 0 0 22px; color: #94a4c3; }
.web-upload-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: #6797ff; color: white; font-weight: 900; font-size: 13px; }
.web-upload-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: #11213f; color: #dfeaec; font-size: 24px; cursor: pointer; }
.web-upload-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.web-upload-option { min-height: 130px; padding: 20px; border: 1px solid #294267; border-radius: 11px; background: #0b1630; color: #eaf2f4; text-align: left; cursor: pointer; transition: .18s ease; }
.web-upload-option:hover { transform: translateY(-2px); border-color: #6797ff; background: #11213f; }
.web-upload-option strong,.web-upload-option span { display: block; }
.web-upload-option strong { margin-bottom: 8px; color: #fff; font-size: 16px; }
.web-upload-option span { color: #b6c4de; line-height: 1.45; }
.web-upload-option.phone { box-shadow: inset 3px 0 #6797ff; }
.web-upload-state { display: grid; justify-items: center; gap: 12px; color: #b6c4de; line-height: 1.45; }
.web-upload-state > strong { color: #f4f8f9; font-size: 17px; }
.web-upload-state > span { max-width: 420px; }
.web-upload-state a { color: #6797ff; }
.web-qr-wrap { padding: 9px; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px #0005; }
.web-qr-wrap img { display: block; width: min(240px, 58vw); height: auto; }
.web-waiting { margin-top: 3px; padding: 10px 14px; border-radius: 9px; background: #0b1630; color: #ffc45e; }
.web-upload-spinner { display: inline-block; width: 15px; height: 15px; margin-right: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: web-spin .7s linear infinite; vertical-align: -2px; }
.web-upload-success { padding: 20px; border-radius: 10px; background: #0c3a30; color: #42dda5; font-size: 17px; font-weight: 800; }
@keyframes web-spin { to { transform: rotate(360deg); } }

.application-download-button { width: fit-content; max-width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; text-align: center; text-decoration: none; }
.application-download-button span { font-size: 19px; line-height: 1; }
.application-download-button:disabled { cursor: not-allowed; opacity: .55; }
.application-download small { display: block; margin-top: 11px; color: #8195b8; font-size: 10px; }
.infrastructure-settings, .account-settings, .audit-settings { grid-column: 1 / -1; }
.settings-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.webfleet-settings { grid-column: 1 / -1; }
.webfleet-overview { margin-bottom: 14px; }
.webfleet-message { margin: 0 0 14px; padding: 11px 13px; border: 1px solid #294267; border-radius: 7px; color: #b6c4de; background: #080f24; font-size: 12px; }
.webfleet-state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: #2fe0aa; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.webfleet-state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.webfleet-state.error { color: #ff6b6b; }
.webfleet-state.waiting { color: #f2ad42; }
.mileage-source { display: inline-block; margin-top: 4px; color: #2fe0aa; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.settings-section-heading p { margin-bottom: 0; }
.online-badge, .audit-count { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: rgba(36, 190, 134, .11); color: #48dfa9; font-size: 10px; font-weight: 750; white-space: nowrap; }
.online-badge i, .hosting-status i { width: 7px; height: 7px; border-radius: 50%; background: #2fd69d; box-shadow: 0 0 0 4px rgba(47,214,157,.09); }
.infra-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.infra-metric { padding: 16px; border: 1px solid #294267; border-radius: 9px; background: #0b1630; }
.infra-metric > span, .infra-metric > strong, .infra-metric > small { display: block; }
.infra-metric > span { color: #94a4c3; font-size: 10px; text-transform: uppercase; letter-spacing: .55px; }
.infra-metric > strong { margin-top: 7px; color: #eef4f5; font-size: 13px; overflow-wrap: anywhere; }
.infra-metric > small { margin-top: 8px; color: #8195b8; font-size: 9px; line-height: 1.5; }
.metric-track { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: #11213f; }
.metric-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6797ff, #6797ff); }
.hosting-status { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: #42dba5; font-size: 10px; }
.account-list, .audit-list { margin-top: 17px; overflow: hidden; border: 1px solid #294267; border-radius: 9px; }
.account-row { display: grid; grid-template-columns: 40px minmax(190px, 1fr) auto auto auto; align-items: center; gap: 13px; padding: 12px 14px; border-bottom: 1px solid #11213f; }
.account-row:last-child, .audit-row:last-child { border-bottom: 0; }
.account-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(56,107,220, .14); color: #6797ff; font-size: 11px; font-weight: 850; }
.account-identity strong, .account-identity small { display: block; }
.account-identity strong { color: #eaf0f2; font-size: 12px; }
.account-identity small { margin-top: 4px; color: #8195b8; font-size: 9px; }
.role-badge, .account-status { display: inline-flex; align-items: center; justify-content: center; min-width: 77px; padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 780; }
.role-badge.developer { background: rgba(56,107,220, .15); color: #6797ff; }
.role-badge.user { background: rgba(56, 107, 220, .14); color: #6797ff; }
.account-status.active { background: rgba(38, 192, 139, .12); color: #43d9a4; }
.account-status.disabled { background: rgba(214, 77, 77, .12); color: #ef7777; }
.account-actions { display: flex; gap: 7px; }
.account-actions .secondary-button, .danger-ghost { min-height: 32px; padding: 6px 10px; font-size: 9px; }
.danger-ghost { border: 1px solid rgba(220, 79, 79, .35); border-radius: 6px; background: rgba(220, 79, 79, .08); color: #ef7a7a; }
.audit-count { background: #11213f; color: #94a4c3; }
.audit-list { max-height: 430px; overflow-y: auto; }
.audit-row { display: grid; grid-template-columns: 98px minmax(0, 1fr); align-items: center; gap: 13px; padding: 11px 14px; border-bottom: 1px solid #11213f; }
.audit-action { padding: 6px 8px; border-radius: 6px; background: #11213f; color: #94a4c3; font-size: 9px; font-weight: 800; text-align: center; }
.audit-action.create { background: rgba(38, 192, 139, .12); color: #43d9a4; }
.audit-action.update, .audit-action.replace { background: rgba(240, 162, 50, .12); color: #f2b65b; }
.audit-action.delete { background: rgba(220, 79, 79, .12); color: #ef7777; }
.audit-row strong, .audit-row small { display: block; }
.audit-row strong { color: #dce7ea; font-size: 11px; }
.audit-row small { margin-top: 4px; color: #8195b8; font-size: 9px; }
.form-help { margin: 0; color: #94a4c3; font-size: 10px; line-height: 1.5; }
.account-toggle { align-content: end; }
.account-toggle label { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid #294267; border-radius: 6px; background: #11213f; color: #c8d4d7; }
.account-toggle input { width: auto; min-height: auto; }

@media (max-width: 680px) {
  .web-upload-layer { padding: 12px; }
  .web-upload-card { padding: 26px 18px 20px; }
  .web-upload-options { grid-template-columns: 1fr; }
  .web-upload-option { min-height: 104px; }
  .infra-grid { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 40px minmax(0, 1fr); }
  .account-row > .role-badge, .account-row > .account-status, .account-row > .account-actions { grid-column: 2; justify-self: start; }
  .settings-section-heading { display: grid; }
}

/* Interface téléphone */
@media (max-width: 900px) {
  html, body { height: 100dvh; min-height: 100dvh; }
  body { overscroll-behavior: none; }

  .titlebar { height: 50px; padding: 0 max(12px, env(safe-area-inset-left)); }
  .titlebar-brand { margin: 0 !important; padding: 0; font-size: 13px; }
  .titlebar-brand svg { width: 27px; }

  .login-view { height: calc(100dvh - 50px); padding: 14px; overflow-y: auto; }
  .login-card { width: min(100%, 430px); padding: 26px 22px 22px; }
  .login-card h1 { font-size: 27px; }
  .truck-mark { height: 66px; }

  .app-shell { position: relative; display: block; height: calc(100dvh - 50px); }
  .sidebar {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 5px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    border-top: 1px solid #294267;
    border-right: 0;
    background: rgba(8,15,36, .98);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .38);
    backdrop-filter: blur(14px);
  }
  .sidebar-brand { display: none; }
  .main-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; width: 100%; }
  .nav-item {
    min-width: 0;
    height: 59px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 9px;
    font-size: 8.5px;
    line-height: 1.05;
    text-align: center;
  }
  .nav-item .nav-icon { width: 22px; height: 22px; }
  .nav-icon svg { width: 20px; height: 20px; }
  .sidebar-footer {
    position: fixed;
    z-index: 80;
    top: 8px;
    right: max(10px, env(safe-area-inset-right));
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar-footer .offline-dot, .sidebar-session { display: none; }
  .sidebar-logout { width: 34px; height: 34px; }

  .workspace { height: 100%; }
  .workspace-header {
    height: 76px;
    gap: 10px;
    padding: 0 14px;
  }
  .workspace-header > div:first-child { min-width: 0; }
  .workspace-header h1 { overflow: hidden; margin-bottom: 3px; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-header p { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  #headerAction { flex: 0 0 auto; }
  #headerAction .header-button { min-height: 38px; max-width: 154px; padding: 0 11px; font-size: 11px; line-height: 1.15; }

  .page-root {
    height: calc(100% - 76px);
    padding: 14px 12px calc(90px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }
  .toolbar { flex-wrap: wrap; align-items: stretch; gap: 10px; margin-bottom: 13px; }
  .toolbar .search-box { order: -1; width: 100%; max-width: none; }
  .toolbar .secondary-button { width: 100%; }
  .toolbar > .muted { align-self: center; font-size: 11px; line-height: 1.4; }
  .filter-select { min-width: 112px; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { min-height: 96px; gap: 10px; padding: 14px; }
  .kpi-icon { width: 40px; height: 40px; font-size: 19px; }
  .kpi-value { font-size: 21px; white-space: normal; }
  .kpi-label { font-size: 10px; line-height: 1.35; }
  .dashboard-grid, .cost-layout, .document-grid, .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-grid { margin-top: 12px; }
  .panel-header { min-height: 55px; gap: 10px; padding: 0 14px; }
  .panel-header h2 { font-size: 14px; }
  .event-list, .activity-list { padding-inline: 13px; }
  .event-row { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; padding: 9px 0; }
  .event-symbol { width: 34px; height: 34px; }
  .event-due { grid-column: 2; text-align: left; }
  .activity-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 10px 0; }
  .activity-row time { grid-column: 1; grid-row: 2; text-align: left; }
  .activity-row .money { grid-column: 2; grid-row: 1; }

  .document-card, .settings-card { padding: 15px; }
  .document-row { min-height: 43px; }
  .document-menu { flex-basis: 42px; }
  .backup-heading, .settings-section-heading { display: grid; gap: 10px; }
  .backup-overview, .detail-stats, .regulatory-grid { grid-template-columns: 1fr; }
  .backup-row { grid-template-columns: 72px minmax(0, 1fr); }
  .backup-row > button { grid-column: 2; justify-self: start; }
  .email-settings-actions > button { width: 100%; }
  .infra-grid { grid-template-columns: 1fr; }
  .account-list, .audit-list { overflow-x: hidden; }

  .data-table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .data-table { display: block; width: 100%; min-width: 0 !important; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 11px; }
  .data-table tbody tr {
    position: relative;
    display: block;
    padding: 12px 48px 12px 13px;
    overflow: hidden;
    border: 1px solid #294267;
    border-radius: 11px;
    background: linear-gradient(150deg, #0b1630, #080f24);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
  }
  .data-table tbody tr:hover { background: linear-gradient(150deg, #0b1630, #0b1630); }
  .data-table td {
    position: static !important;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    width: 100%;
    min-width: 0 !important;
    height: auto;
    min-height: 39px;
    padding: 7px 0;
    border-bottom: 1px solid #11213f;
    background: transparent !important;
    box-shadow: none !important;
    line-height: 1.4;
  }
  .data-table td::before { color: #94a4c3; font-size: 9px; font-weight: 750; letter-spacing: .35px; text-transform: uppercase; }
  .data-table td:nth-last-child(2) { right: auto !important; }
  .data-table td:last-child {
    position: absolute !important;
    top: 11px;
    right: 10px !important;
    display: block;
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
  }
  .data-table td:last-child::before { content: none; }
  .data-table td[colspan] { display: block; padding: 0; border: 0; }
  .data-table td[colspan]::before { content: none; }
  .comments-cell { overflow-wrap: anywhere; }
  .deadline-cell { min-width: 0; }
  .status-badge { white-space: normal; }

  .fleet-table td:nth-child(1)::before { content: "Plaque"; }
  .fleet-table td:nth-child(2)::before { content: "Véhicule"; }
  .fleet-table td:nth-child(3)::before { content: "Kilométrage"; }
  .fleet-table td:nth-child(4)::before { content: "Contrôle"; }
  .fleet-table td:nth-child(5)::before { content: "Tachygraphe"; }
  .fleet-table td:nth-child(6)::before { content: "Limiteur"; }
  .fleet-table td:nth-child(7)::before { content: "Contrôle hayon"; }
  .fleet-table td:nth-child(8)::before { content: "Extincteur"; }
  .fleet-table td:nth-child(9)::before { content: "Vidange"; }
  .fleet-table td:nth-child(10)::before { content: "Statut"; }

  .maintenance-table td:nth-child(1)::before { content: "Date"; }
  .maintenance-table td:nth-child(2)::before { content: "Plaque"; }
  .maintenance-table td:nth-child(3)::before { content: "Prestation"; }
  .maintenance-table td:nth-child(4)::before { content: "Garage"; }
  .maintenance-table td:nth-child(5)::before { content: "Kilométrage"; }
  .maintenance-table td:nth-child(6)::before { content: "Coût HT"; }
  .maintenance-table td:nth-child(7)::before { content: "N° facture"; }
  .maintenance-table td:nth-child(8)::before { content: "Commentaires"; }
  .maintenance-table td:nth-child(9)::before { content: "Factures"; }

  .modal-root { z-index: 100; inset: 50px 0 0; place-items: end center; padding: 0; }
  .modal, .modal.small {
    width: 100%;
    max-height: calc(100dvh - 50px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }
  .modal-header { min-height: 60px; padding: 0 16px; }
  .modal-header h2 { font-size: 17px; }
  .modal-body { padding: 17px 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid .full { grid-column: auto; }
  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-wrap: wrap;
    padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
    background: #080f24;
  }
  .modal-actions button { flex: 1 1 135px; min-height: 43px; }
  .detail-banner { padding: 13px; }
  .maintenance-invoice-link { align-items: stretch; flex-direction: column; }
  .maintenance-invoice-link button { width: 100%; }
  .invoice-summary { grid-template-columns: 1fr; }

  .web-upload-layer { align-items: end; padding: 0; }
  .web-upload-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 25px 16px calc(20px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }
  .web-upload-options { grid-template-columns: 1fr; }
  .web-upload-option { min-height: 96px; padding: 17px; }
  .mobile-upload-options .phone { order: -1; }

  .toast {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 82px; }
  .workspace-header h1 { font-size: 18px; }
  #headerAction .header-button { max-width: 142px; padding-inline: 9px; font-size: 10px; }
  .data-table tbody tr { padding-left: 11px; }
  .data-table td { grid-template-columns: 91px minmax(0, 1fr); gap: 7px; }
  .nav-item { font-size: 7.5px; }
  .nav-item .nav-icon { width: 20px; height: 20px; }
}

/* Expérience flotte 1.4 */
.mobile-bottom-nav { display: none; }
.workspace-header-tools { display: flex; align-items: center; gap: 12px; }
.global-search-button { min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; color: #94a4c3; }
.global-search-button span { color: #6797ff; font-size: 20px; }
.global-search-button kbd { padding: 3px 6px; border: 1px solid #294267; border-radius: 4px; background: #080f24; color: #94a4c3; font-size: 9px; }
.nav-count { min-width: 20px; height: 20px; display: grid; place-items: center; margin-left: auto; padding: 0 5px; border-radius: 10px; background: #df4e4e; color: white; font-size: 10px; font-weight: 800; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-top: 14px; }
.dashboard-shortcuts button { min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 11px 15px; border: 1px solid #11213f; border-radius: 9px; background: linear-gradient(145deg,#0b1630,#080f24); color: #e4ecee; text-align: left; }
.dashboard-shortcuts button > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 8px; background: rgba(56,107,220,.12); color: #6797ff; font-size: 18px; }
.dashboard-shortcuts strong, .dashboard-shortcuts small { display: block; }
.dashboard-shortcuts strong { font-size: 12px; }
.dashboard-shortcuts small { margin-top: 3px; color: #94a4c3; font-size: 9px; }
.sidebar { overflow: hidden; }
.main-nav { overflow-y: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }

.alert-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.alert-kpi { min-height: 92px; display: flex; align-items: center; gap: 13px; padding: 16px 19px; border: 1px solid #294267; border-radius: 10px; background: linear-gradient(145deg, #0b1630, #080f24); color: #dce7e9; text-align: left; }
.alert-kpi strong { font-size: 27px; }
.alert-kpi span { color: #94a4c3; }
.alert-kpi.critical strong { color: #f06e6e; }
.alert-kpi.warning strong { color: #f2b457; }
.alert-kpi.info strong { color: #6797ff; }
.alert-kpi.active { border-color: #6797ff; box-shadow: 0 0 0 2px rgba(56,107,220,.13); }
.alerts-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; }
.alert-list { padding: 6px 17px 14px; }
.alert-row { width: 100%; min-height: 67px; display: grid; grid-template-columns: 12px minmax(0, 1fr) 22px; align-items: center; gap: 12px; padding: 9px 4px; border: 0; border-bottom: 1px solid #11213f; background: transparent; color: #dfe8eb; text-align: left; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: rgba(255,255,255,.025); }
.alert-dot { width: 9px; height: 9px; border-radius: 50%; background: #6797ff; box-shadow: 0 0 0 4px rgba(90,174,217,.1); }
.alert-row.critical .alert-dot { background: #e45454; box-shadow: 0 0 0 4px rgba(228,84,84,.12); }
.alert-row.warning .alert-dot { background: #efa63b; box-shadow: 0 0 0 4px rgba(239,166,59,.12); }
.alert-row strong, .alert-row small { display: block; }
.alert-row strong { font-size: 13px; }
.alert-row small { margin-top: 5px; color: #94a4c3; font-size: 11px; }
.alert-arrow { color: #8195b8; font-size: 22px; }
.alert-side { display: grid; align-content: start; gap: 16px; }
.notification-card, .thresholds-card { padding: 21px; }
.notification-card .feature-icon { font-size: 30px; }
.notification-card h2, .thresholds-card h2 { margin: 12px 0 7px; font-size: 16px; }
.notification-card p { margin: 0 0 17px; color: #94a4c3; font-size: 12px; line-height: 1.55; }
.thresholds-card > div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #11213f; font-size: 12px; }
.thresholds-card > div span { color: #94a4c3; }
.thresholds-card .panel-link { margin-top: 15px; padding: 0; }
.success-empty { display: grid; gap: 5px; color: #55d19e; }
.success-empty span { color: #94a4c3; }

.planning-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.planning-toolbar label { display: grid; gap: 5px; color: #94a4c3; font-size: 11px; }
.planning-toolbar input { height: 40px; padding: 0 12px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; color: #ecf3f5; color-scheme: dark; }
.planning-legend { display: flex; gap: 16px; color: #94a4c3; font-size: 11px; }
.planning-legend span { display: flex; align-items: center; gap: 6px; }
.planning-legend i { width: 9px; height: 9px; border-radius: 50%; background: #6797ff; }
.planning-legend i.urgent { background: #e45454; }
.planning-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 16px; }
.calendar-panel { padding: 16px; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-week span { padding: 9px; color: #94a4c3; font-size: 10px; font-weight: 700; text-align: center; text-transform: uppercase; }
.calendar-day { min-height: 112px; display: flex; flex-direction: column; gap: 5px; padding: 8px; border: 1px solid #11213f; background: #0b1630; color: #dce6e9; text-align: left; }
.calendar-day:hover { border-color: #294267; background: #0b1630; }
.calendar-day.blank { background: rgba(8,15,36,.35); pointer-events: none; }
.calendar-day.today { box-shadow: inset 0 0 0 2px #6797ff; }
.calendar-day > span { font-size: 11px; font-weight: 800; }
.calendar-event { overflow: hidden; padding: 4px 5px; border-left: 3px solid #6797ff; border-radius: 3px; background: rgba(56,107,220,.1); color: #6797ff; font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.urgent { border-color: #e45454; background: rgba(228,84,84,.1); color: #f79a9a; }
.calendar-event.high { border-color: #efa63b; background: rgba(239,166,59,.1); color: #f4c071; }
.plan-list-panel { min-width: 0; }
.plan-list { display: grid; max-height: 630px; overflow-y: auto; }
.plan-card { border-bottom: 1px solid #11213f; }
.plan-open { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 15px 17px 10px; border: 0; background: transparent; color: #e5edef; text-align: left; }
.plan-open strong, .plan-open small { display: block; }
.plan-open strong { margin-top: 7px; font-size: 12px; }
.plan-open small { margin-top: 5px; color: #94a4c3; font-size: 10px; }
.plan-status { display: inline-block; padding: 3px 6px; border-radius: 8px; background: rgba(56,107,220,.12); color: #6797ff; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.plan-status.garage { background: rgba(239,166,59,.12); color: #f3b75e; }
.plan-status.completed { background: rgba(36,180,126,.12); color: #52d19c; }
.plan-actions { display: flex; gap: 6px; padding: 0 17px 14px; }
.plan-actions button { min-height: 29px; padding: 0 8px; border: 1px solid #294267; border-radius: 5px; background: #0b1630; color: #94a4c3; font-size: 8px; }

.quick-hero { min-height: 150px; display: flex; align-items: center; justify-content: space-between; padding: 25px 30px; border: 1px solid #294267; border-radius: 13px; background: radial-gradient(circle at 82% 50%, rgba(56,107,220,.2), transparent 28%), linear-gradient(135deg,#0b1630,#080f24); }
.quick-hero span:first-child { color: #6797ff; font-size: 11px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.quick-hero h2 { margin: 7px 0; font-size: 25px; }
.quick-hero p { margin: 0; color: #94a4c3; font-size: 12px; }
.quick-truck { color: #6797ff; font-size: 70px; opacity: .75; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 14px; }
.quick-card { min-height: 145px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; padding: 20px; border: 1px solid #294267; border-radius: 11px; background: linear-gradient(145deg,#0b1630,#080f24); color: #e7eef0; text-align: left; }
.quick-card:hover { border-color: #294267; transform: translateY(-1px); }
.quick-card > span { font-size: 27px; color: #c7d3e8; }
.quick-card.orange > span { color: #6797ff; }
.quick-card.green > span { color: #4dd19b; }
.quick-card.red > span { color: #ee7070; }
.quick-card.blue > span { color: #6797ff; }
.quick-card strong { font-size: 14px; }
.quick-card small { color: #94a4c3; font-size: 10px; }
.quick-card.wide { grid-column: span 2; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; }
.quick-card.wide > span { grid-row: span 2; }
.quick-card.wide select { grid-column: 2; height: 39px; padding: 0 9px; border: 1px solid #294267; border-radius: 6px; background: #080f24; color: #eef3f5; }
.quick-card.wide button { grid-column: 3; grid-row: 1 / span 3; }

.cost-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 14px; }
.cost-kpis article { min-height: 100px; display: grid; align-content: center; gap: 5px; padding: 17px; border: 1px solid #11213f; border-radius: 10px; background: linear-gradient(145deg,#0b1630,#080f24); }
.cost-kpis span, .cost-kpis small { color: #94a4c3; font-size: 10px; }
.cost-kpis strong { font-size: 19px; }
.cost-layout.enhanced { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); }
.cost-vehicles { grid-column: 1 / -1; }
.monthly-chart { height: 260px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 5px; padding: 18px; }
.month-column { min-width: 0; display: grid; gap: 4px; text-align: center; }
.month-column > div { height: 175px; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #294267; }
.month-column i { width: min(28px, 70%); border-radius: 4px 4px 0 0; background: linear-gradient(#6797ff,#6797ff); }
.month-column strong { font-size: 9px; }
.month-column small { overflow: hidden; color: #8195b8; font-size: 7px; text-overflow: ellipsis; }
.category-list { padding: 10px 19px; }
.category-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 13px 0; border-bottom: 1px solid #11213f; font-size: 11px; }
.category-list span { color: #94a4c3; }

.global-search-modal > input { width: 100%; height: 51px; padding: 0 16px; border: 1px solid #294267; border-radius: 8px; outline: 0; background: #080f24; color: #f0f5f6; font-size: 15px; }
#globalSearchResults { max-height: 55vh; overflow-y: auto; padding-top: 10px; }
#globalSearchResults h3 { margin: 13px 6px 6px; color: #8195b8; font-size: 9px; letter-spacing: .7px; text-transform: uppercase; }
.search-result { width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border: 0; border-radius: 7px; background: transparent; color: #e6eef0; text-align: left; }
.search-result:hover { background: #0b1630; }
.search-result > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 7px; background: #11213f; color: #6797ff; font-size: 9px; font-weight: 800; }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: 12px; }
.search-result small { margin-top: 3px; color: #94a4c3; font-size: 9px; }
.search-hint { padding: 35px 15px; color: #94a4c3; text-align: center; font-size: 11px; }

.detail-banner.enhanced { display: grid; grid-template-columns: auto minmax(0, 1fr) 86px; }
.detail-banner.enhanced small { display: block; margin-top: 7px; color: #6fd1a7; font-size: 9px; }
.vehicle-health { display: inline-block; padding: 3px 7px; border-radius: 9px; background: rgba(36,180,126,.12); color: #55d19e; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.vehicle-health.warning { background: rgba(239,166,59,.12); color: #f1b75f; }
.vehicle-health.critical { background: rgba(228,84,84,.13); color: #f27b7b; }
.vehicle-qr-mini { width: 76px; height: 76px; padding: 4px; border-radius: 7px; background: white; }
.detail-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-stat small { display: block; margin-top: 4px; color: #8195b8; font-size: 8px; }
.vehicle-plans { margin: 14px 0; }
.vehicle-plans h3, .vehicle-timeline h3 { margin: 0 0 9px; color: #dfe8eb; font-size: 12px; }
.vehicle-plan-open { width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; color: #e2eaec; text-align: left; }
.vehicle-plan-open + .vehicle-plan-open { margin-top: 6px; }
.vehicle-plan-open span { color: #94a4c3; font-size: 9px; }
.vehicle-timeline { margin-top: 16px; }
.timeline-row { width: 100%; min-height: 57px; display: grid; grid-template-columns: 85px 13px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 5px; border: 0; border-bottom: 1px solid #11213f; background: transparent; color: #e3ebed; text-align: left; }
.timeline-row time, .timeline-row small { color: #94a4c3; font-size: 9px; }
.timeline-row i { width: 8px; height: 8px; border-radius: 50%; background: #6797ff; }
.timeline-row strong, .timeline-row small { display: block; }
.timeline-row small { margin-top: 4px; }
.timeline-row > span { font-size: 10px; font-weight: 800; }
.vehicle-qr-view { display: grid; justify-items: center; gap: 7px; text-align: center; }
.vehicle-qr-view img { width: min(280px, 82vw); padding: 8px; border-radius: 10px; background: white; }
.vehicle-qr-view strong { font-size: 22px; }
.vehicle-qr-view span, .vehicle-qr-view p { color: #94a4c3; }
.vehicle-qr-view p { max-width: 330px; font-size: 11px; line-height: 1.55; }

.invoice-analysis-actions { display: grid; gap: 7px; margin-top: 12px; }
.analyze-invoice { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; color: #e5edef; text-align: left; }
.analyze-invoice strong, .analyze-invoice small { display: block; }
.analyze-invoice strong { font-size: 10px; }
.analyze-invoice small { margin-top: 3px; color: #94a4c3; font-size: 8px; }
.analysis-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 13px; border: 1px solid #294267; border-radius: 8px; background: #0b1630; }
.analysis-banner > span { font-size: 27px; }
.analysis-banner strong, .analysis-banner small { display: block; }
.analysis-banner small { margin-top: 4px; color: #94a4c3; font-size: 9px; }
.analysis-confidence { padding: 12px; border: 1px solid #294267; border-radius: 7px; background: #0b1630; }
.analysis-confidence span, .analysis-confidence strong, .analysis-confidence small { display: block; }
.analysis-confidence span { color: #94a4c3; font-size: 8px; text-transform: uppercase; }
.analysis-confidence strong { margin-top: 5px; font-size: 11px; }
.analysis-confidence small { margin-top: 5px; color: #94a4c3; font-size: 9px; }

@media (max-width: 1150px) {
  .alerts-layout, .planning-layout { grid-template-columns: 1fr; }
  .alert-side { grid-template-columns: 1fr 1fr; }
  .plan-list { max-height: none; }
  .detail-stats.four, .cost-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .main-nav { display: none; }
  .mobile-bottom-nav { position: fixed; z-index: 70; right: 0; bottom: 0; left: 0; height: calc(68px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 5px max(5px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(5px, env(safe-area-inset-left)); border-top: 1px solid #294267; background: rgba(8,15,36,.98); box-shadow: 0 -10px 30px rgba(0,0,0,.4); }
  .mobile-nav-item { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 8px; background: transparent; color: #94a4c3; font-size: 8px; }
  .mobile-nav-item span { font-size: 19px; }
  .mobile-nav-item.active { background: rgba(56,107,220,.13); color: #6797ff; }
  .mobile-nav-item.mobile-add span { width: 37px; height: 37px; display: grid; place-items: center; margin-top: -20px; border-radius: 50%; background: #6797ff; color: white; box-shadow: 0 6px 18px rgba(56,107,220,.35); }
  .global-search-button { width: 39px; min-height: 39px; padding: 0; justify-content: center; }
  .global-search-button > :not(span) { display: none; }
  .workspace-header-tools { gap: 6px; }
  .alert-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dashboard-shortcuts { grid-template-columns: 1fr; gap: 8px; }
  .alert-kpi { min-height: 72px; padding: 11px; }
  .alert-kpi strong { font-size: 21px; }
  .alerts-layout, .alert-side, .planning-layout, .quick-grid, .cost-layout.enhanced { grid-template-columns: 1fr; }
  .alert-side { display: grid; }
  .calendar-panel { padding: 7px; overflow-x: auto; }
  .calendar-week, .calendar-grid { min-width: 720px; }
  .calendar-day { min-height: 96px; }
  .quick-hero { min-height: 125px; padding: 19px; }
  .quick-hero h2 { font-size: 20px; }
  .quick-truck { font-size: 48px; }
  .quick-card, .quick-card.wide { grid-column: auto; min-height: 112px; display: flex; align-items: stretch; }
  .quick-card.wide select, .quick-card.wide button { grid-column: auto; grid-row: auto; width: 100%; }
  .cost-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-vehicles { grid-column: auto; }
  .monthly-chart { overflow-x: auto; }
  .month-column { min-width: 32px; }
  .detail-banner.enhanced { grid-template-columns: auto minmax(0, 1fr); }
  .vehicle-qr-mini { display: none; }
  .detail-stats.four { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 65px 10px minmax(0, 1fr); }
  .timeline-row > span { grid-column: 3; }
  .modal-actions { gap: 7px; }
}

@media (max-width: 480px) {
  .alert-kpis, .cost-kpis { grid-template-columns: 1fr 1fr; }
  .alert-kpi { display: grid; gap: 1px; }
  .planning-toolbar { align-items: stretch; flex-direction: column; }
  .planning-legend { justify-content: space-between; }
  .quick-hero p { max-width: 230px; }
}

/* Ribat Transport: local upload information uses the midnight palette. */
.local-upload-note { display: grid; align-content: center; gap: 8px; padding: 20px; border: 1px dashed #294267; border-radius: 10px; background: #0b1630; color: #94a4c3; text-align: left; }
.local-upload-note strong { color: #e6eefc; font-size: 15px; }
.local-upload-note span { font-size: 12px; line-height: 1.6; }
.ribat-logo { position: relative; overflow: hidden; flex-shrink: 0; background: white; border-radius: 7px; }
.ribat-logo img { position: absolute; max-width: none; }
.login-logo { width: 240px; height: 80px; margin: 0 auto 20px; box-shadow: 0 8px 25px rgba(0,0,0,.16); }
.login-logo img { width: 270px; height: 135px; left: -15px; top: -35px; }
.sidebar-logo { width: 86px; height: 30px; border-radius: 5px; }
.sidebar-logo img { width: 98px; height: 49px; left: -6px; top: -13px; }

/* Filled controls retain readable white text; lighter blue remains for links. */
.primary-button, .header-button { background: linear-gradient(90deg, #315fc8, #386bdc); }
.document-type.pdf, .web-upload-icon, .mobile-nav-item.mobile-add span { background: #386bdc; }
