:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-strong: #0f172a;
    --text: #111827;
    --muted: #5b6472;
    --border: #d7dde8;
    --accent: #176b5f;
    --accent-dark: #0d4c44;
    --warning: #b45309;
    --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    display: grid;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    grid-template-columns: 248px minmax(0, 1fr);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--accent-dark);
    text-decoration: underline;
}

.site-header {
    background: var(--surface);
    border-right: 1px solid var(--border);
    height: 100dvh;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-shell {
    margin: 0 auto;
    max-width: 1120px;
    width: min(100%, 1120px);
}

.nav-shell {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    padding: 18px 14px;
    width: 100%;
}

.brand {
    color: var(--surface-strong);
    border-bottom: 1px solid var(--border);
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    padding: 0 10px 16px;
}

.nav-actions {
    align-content: start;
    display: grid;
    gap: 14px;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 4px 18px 0;
    scrollbar-gutter: stable;
    white-space: normal;
}

.nav-row {
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
}

.nav-actions a,
.site-header .nav-actions .link-button {
    align-items: center;
    border-radius: 6px;
    color: #334155;
    display: flex;
    font-size: 0.88rem;
    font-weight: 800;
    justify-content: flex-start;
    min-height: 36px;
    padding: 8px 10px;
    width: 100%;
}

.nav-actions a:hover,
.nav-actions a:focus,
.site-header .nav-actions .link-button:hover,
.site-header .nav-actions .link-button:focus {
    background: #eef7f5;
    color: var(--accent-dark);
    text-decoration: none;
}

.site-header .nav-actions .button {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.nav-actions form {
    margin: 0;
    width: 100%;
}

.nav-user {
    border-top: 1px solid var(--border);
    color: #64748b;
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    margin-top: 8px;
    min-width: 0;
    overflow: hidden;
    padding: 12px 10px 2px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-shell {
    min-width: 0;
    padding: 24px 18px 48px;
}

.dashboard-hero,
.auth-panel,
.content-header,
.vehicle-status,
.workflow-panel {
    background: var(--surface-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: #ffffff;
    margin-bottom: 22px;
    padding: 28px;
}

.dashboard-hero h1,
.auth-panel h1,
.content-header h1 {
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: 1.02;
    margin: 0 0 16px;
    max-width: 820px;
}

.dashboard-hero p,
.auth-copy p,
.content-header p,
.vehicle-status p,
.workflow-panel p {
    color: #d9e1ed;
    margin: 0;
    max-width: 720px;
}

.section-label {
    color: #6ee7b7;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.vehicle-status,
.workflow-panel,
.split-header {
    align-items: start;
    display: grid;
    gap: 18px;
}

.vehicle-status h2,
.workflow-panel h2 {
    color: #ffffff;
    font-size: 1.8rem;
    line-height: 1.15;
    margin: 0 0 8px;
}

.metric-card,
.form-card,
.data-panel,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.metric-card {
    min-height: 178px;
    padding: 22px;
}

.metric-card h2 {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 16px;
}

.metric-card p {
    color: var(--muted);
    margin: 0;
}

.metric-value {
    color: var(--surface-strong) !important;
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 14px !important;
}

.auth-panel {
    display: grid;
    gap: 22px;
}

.auth-copy {
    align-self: center;
}

.form-card {
    color: var(--text);
    display: grid;
    gap: 10px;
    padding: 22px;
}

.stacked-form {
    gap: 16px;
    margin: 0 auto;
    max-width: 760px;
}

.ticket-form {
    gap: 0;
    margin: 0 auto;
    max-width: 1040px;
    padding: 0;
}

.ticket-section {
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 18px;
    padding: 22px;
}

.ticket-section:last-of-type {
    border-bottom: 0;
}

.ticket-section-heading h2 {
    color: var(--surface-strong);
    font-size: 1.15rem;
    line-height: 1.2;
    margin: 0 0 4px;
}

.ticket-section-heading p {
    color: var(--muted);
    margin: 0;
}

.ticket-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

.ticket-contact-shell {
    display: grid;
    gap: 16px;
}

.ticket-toggle {
    justify-self: start;
}

.ticket-form .button-secondary {
    border-color: var(--accent);
    color: var(--accent);
}

.ticket-form .button-secondary:hover,
.ticket-form .button-secondary:focus {
    background: #ecfdf5;
    border-color: var(--accent-dark);
    color: var(--accent-dark);
}

.ticket-actions {
    padding: 22px;
}

.form-row {
    display: grid;
    gap: 7px;
}

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 10px;
}

.form-card label {
    font-size: 0.92rem;
    font-weight: 800;
}

.form-card input,
.form-card select,
.form-card textarea,
.filter-panel input,
.filter-panel select {
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

.form-card input[type="checkbox"] {
    min-height: 18px;
    width: 18px;
}

.form-card textarea {
    min-height: 120px;
}

.form-card ul,
.form-card .errorlist {
    color: #b91c1c;
    margin: 0 0 8px;
    padding-left: 18px;
}

.form-note {
    color: var(--muted);
    margin: 8px 0 0;
}

.help-text {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.form-actions,
.row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.data-panel {
    display: grid;
    gap: 0;
    overflow: hidden;
}

.filter-panel {
    align-items: end;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    margin-bottom: 16px;
    padding: 16px;
}

.vehicle-row {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.vehicle-row + .vehicle-row {
    border-top: 1px solid var(--border);
}

.vehicle-main {
    align-items: start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.vehicle-main h2,
.empty-state h2 {
    color: var(--surface-strong);
    font-size: 1.3rem;
    line-height: 1.2;
    margin: 0 0 4px;
}

.vehicle-main p,
.empty-state p {
    color: var(--muted);
    margin: 0;
}

.status-pill {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    color: #065f46;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 5px 9px;
}

.warning-pill {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.button-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-form {
    box-shadow: none;
    margin-bottom: 18px;
}

.form-grid {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-grid label {
    display: grid;
    gap: 6px;
}

.dashboard-filter {
    margin-bottom: 18px;
}

.inline-form-grid {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inline-form-grid label {
    display: grid;
    gap: 6px;
}

.status-card {
    border-left: 5px solid #86efac;
}

.status-card.status-warning {
    border-left-color: #facc15;
}

.status-card.status-critical {
    border-left-color: #ef4444;
}

.header-actions,
.panel-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.split-header-inline {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.tab-nav {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 8px;
}

.tab-nav a {
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    padding: 8px 10px;
    text-decoration: none;
}

.tab-nav a:hover,
.tab-nav a:focus,
.tab-nav a.active {
    background: #e0f2fe;
    color: #075985;
}

.compact-row {
    align-items: center;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    padding: 0.85rem 0;
}

.compact-row p {
    color: var(--muted);
    margin: 0.2rem 0 0;
}

.status-completed {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.status-cancelled {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.status-due_soon {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.status-overdue {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.status-expired {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.status-upcoming {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.status-active {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-open,
.status-assigned,
.status-not_started,
.status-scheduled,
.status-confirmed,
.status-available {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.status-in_progress,
.status-in_service,
.status-occupied,
.status-in_use {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.status-waiting_parts,
.status-waiting,
.status-paused,
.status-reserved,
.status-checked_in,
.status-busy,
.status-training,
.priority-high,
.priority-urgent {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.priority-out_of_service,
.status-no_show,
.status-off,
.status-vacation,
.status-out_of_service {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.status-watchlist,
.status-do_not_use {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.status-suspended {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.status-incomplete {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.status-low {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-moderate {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.status-elevated,
.status-average {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.status-high,
.status-needs_improvement {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.status-expiring {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.status-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.status-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.status-on_target {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-critical {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.vehicle-facts {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    margin: 0;
}

.vehicle-facts div {
    min-width: 0;
}

.vehicle-facts dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.vehicle-facts dd {
    color: var(--text);
    margin: 3px 0 0;
}

.inline-form {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-state {
    padding: 26px;
    text-align: left;
}

.empty-state .button {
    margin-top: 18px;
}

.detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    margin-bottom: 16px;
}

.dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    margin-bottom: 16px;
}

.forecast-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.forecast-card {
    display: grid;
    gap: 12px;
    padding: 22px;
}

.confidence-pill,
.risk-pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    padding: 7px 10px;
    white-space: nowrap;
}

.confidence-high,
.risk-low {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.confidence-medium,
.risk-moderate {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.confidence-low,
.risk-elevated {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.risk-high {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.text-value {
    font-size: 1.5rem;
    line-height: 1.12;
}

.detail-panel {
    padding: 22px;
}

.detail-list {
    display: grid;
    gap: 18px;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.detail-list dd {
    margin: 4px 0 0;
}

.panel-heading {
    color: var(--surface-strong);
    font-size: 1.1rem;
    margin: 0 0 16px;
}

.muted {
    color: var(--muted);
}

.note-card,
.timeline-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.note-card + .note-card,
.timeline-card + .timeline-card {
    margin-top: 12px;
}

.note-card p,
.timeline-card p,
.timeline-card h2,
.timeline-card h3 {
    margin: 0;
}

.timeline-card h2,
.timeline-card h3 {
    color: var(--surface-strong);
    font-size: 1rem;
    line-height: 1.25;
}

.timeline-list {
    display: grid;
    gap: 12px;
}

.timeline-meta {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.timeline-filter {
    box-shadow: none;
    margin: 0 0 16px;
}

.table-scroll {
    overflow-x: auto;
    width: 100%;
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    border-collapse: collapse;
    min-width: 720px;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.compact-table {
    min-width: 880px;
}

.compact-table th,
.compact-table td {
    padding: 8px 10px;
}

.payment-history-panel {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 10px;
    padding-top: 12px;
}

.payment-history-panel h3 {
    color: var(--surface-strong);
    font-size: 1rem;
    margin: 0;
}

.bar-chart {
    display: grid;
    gap: 12px;
}

.bar-list {
    display: grid;
    gap: 14px;
}

.bar-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1.4fr) auto;
}

.bar-label,
.bar-value {
    color: var(--surface-strong);
    font-size: 0.92rem;
    font-weight: 800;
}

.bar-label {
    display: grid;
    gap: 3px;
}

.bar-label span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.stack-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 12px;
}

.stack-row span {
    color: var(--muted);
}

.bar-track {
    background: #e5e7eb;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.bar-fill {
    background: var(--accent);
    display: block;
    height: 100%;
}

.warning-fill {
    background: #ef4444;
}

.score-green {
    border-color: #86efac;
}

.score-yellow {
    border-color: #fde68a;
}

.score-red {
    border-color: #fecaca;
}

.status-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.status-summary {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 12px;
}

.status-summary span {
    color: var(--surface-strong);
    font-size: 1.4rem;
    font-weight: 900;
}

.report-links {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.command-filter {
    align-items: end;
    grid-template-columns: 1fr;
}

.command-search {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    width: 100%;
}

.command-search label {
    grid-column: 1 / -1;
}

.command-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.command-panel {
    gap: 0;
    padding: 0;
}

.command-panel-title {
    border-bottom: 1px solid var(--border);
    padding: 18px;
}

.command-panel-title .panel-heading {
    margin-bottom: 4px;
}

.command-metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: 18px;
}

.priority-card {
    border-left: 5px solid #bfdbfe;
}

.priority-warning {
    border-left-color: #f59e0b;
}

.priority-critical {
    border-left-color: #dc2626;
}

.command-map-shell {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    padding: 18px;
}

.command-map-grid {
    background:
        linear-gradient(90deg, rgba(23, 107, 95, 0.12) 1px, transparent 1px),
        linear-gradient(rgba(23, 107, 95, 0.12) 1px, transparent 1px),
        #f8fafc;
    background-size: 34px 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 220px;
    padding: 18px;
    position: relative;
}

.command-map-grid span {
    align-self: center;
    background: var(--accent);
    border: 3px solid #d1fae5;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    height: 16px;
    justify-self: center;
    width: 16px;
}

.command-map-grid span:nth-child(2n) {
    background: #2563eb;
}

.command-map-grid span:nth-child(3n) {
    background: #b45309;
}

.command-map-list {
    display: grid;
    gap: 8px;
}

.location-map-shell {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    padding: 18px;
}

.location-map-grid {
    background:
        linear-gradient(90deg, rgba(23, 107, 95, 0.12) 1px, transparent 1px),
        linear-gradient(rgba(23, 107, 95, 0.12) 1px, transparent 1px),
        #f8fafc;
    background-size: 34px 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    min-height: 240px;
    padding: 18px;
}

.location-map-grid span {
    align-self: center;
    background: var(--accent);
    border: 3px solid #d1fae5;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    height: 18px;
    justify-self: center;
    width: 18px;
}

.location-map-grid span:nth-child(2n) {
    background: #2563eb;
}

.location-map-grid span:nth-child(3n) {
    background: #b45309;
}

.command-map-list h3,
.command-map-list p {
    margin: 0;
}

.receipt-preview {
    border: 1px solid var(--border);
    border-radius: 8px;
    display: block;
    height: auto;
    margin-top: 12px;
    max-width: min(100%, 420px);
}

.receipt-thumb {
    border: 1px solid var(--border);
    border-radius: 6px;
    display: block;
    height: 72px;
    object-fit: cover;
    width: 96px;
}

.alert-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #7f1d1d;
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
    padding: 16px;
}

.alert-banner div {
    display: grid;
    gap: 4px;
}

.button,
.link-button {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
}

.button {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #ffffff;
}

.button:hover,
.button:focus {
    background: var(--accent-dark);
    color: #ffffff;
    text-decoration: none;
}

.button-secondary {
    background: transparent;
    border-color: #d9e1ed;
    color: #ffffff;
}

.button-secondary:hover,
.button-secondary:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffffff;
}

.button-small {
    min-height: 38px;
    padding: 8px 12px;
}

.button-disabled {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

.button-disabled:hover,
.button-disabled:focus {
    background: #e5e7eb;
    color: #6b7280;
    text-decoration: none;
}

.quick-actions {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 22px;
}

.link-button {
    background: transparent;
    border: 0;
    color: var(--accent);
    padding: 0;
}

.link-button:hover,
.link-button:focus {
    color: var(--accent-dark);
    text-decoration: underline;
}

.messages {
    margin-bottom: 16px;
}

.message {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    color: #065f46;
    margin: 0;
    padding: 12px 14px;
}

@media (min-width: 640px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vehicle-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .forecast-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ticket-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ticket-wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 639px) {
    body {
        display: block;
    }

    .site-header {
        border-bottom: 1px solid var(--border);
        border-right: 0;
        height: auto;
        max-height: 42dvh;
    }

    .nav-shell {
        display: flex;
        gap: 10px;
        height: auto;
        max-height: 42dvh;
        padding: 12px 12px 10px;
    }

    .brand {
        line-height: 1.2;
        padding-bottom: 10px;
    }

    .nav-actions {
        gap: 10px;
        max-height: calc(42dvh - 58px);
        padding-bottom: 8px;
    }

    .nav-row {
        gap: 3px;
    }

    .nav-actions a,
    .site-header .nav-actions .link-button {
        font-size: 0.82rem;
        min-height: 32px;
        padding: 7px 8px;
    }

    .page-shell {
        padding: 18px 12px 40px;
    }

    .compact-row {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .timeline-card {
        border-radius: 8px;
    }

    .bar-row {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .data-table {
        min-width: 680px;
    }
}

@media (min-width: 920px) {
    .nav-shell {
        padding: 18px 14px;
        width: 100%;
    }

    .nav-actions {
        gap: 14px;
    }

    .nav-row {
        display: grid;
        font-size: 0.9rem;
        gap: 4px;
        grid-template-columns: 1fr;
        line-height: 1.2;
        white-space: normal;
    }

    .nav-actions .link-button {
        min-height: 36px;
    }

    .page-shell {
        padding-top: 34px;
    }

    .dashboard-hero {
        padding: 48px;
    }

    .auth-panel {
        grid-template-columns: minmax(0, 1fr) 420px;
        padding: 44px;
    }

    .content-header,
    .vehicle-status,
    .workflow-panel {
        padding: 38px 44px;
    }

    .split-header,
    .vehicle-status,
    .workflow-panel {
        align-items: center;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .vehicle-row {
        grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.4fr) auto;
    }

    .vehicle-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-panel {
        grid-template-columns: 1.5fr 0.7fr 1fr 1fr 1fr auto auto;
    }

    .command-filter {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    }

    .command-search {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .timeline-filter {
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
    }

    .report-links {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .quick-actions {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .ticket-section {
        grid-template-columns: 220px minmax(0, 1fr);
        padding: 26px;
    }

    .ticket-section-heading {
        border-right: 1px solid var(--border);
        padding-right: 20px;
    }

    .ticket-actions {
        padding: 26px;
    }
}
