:root {
    --color-bg: #f3f4f6;
    --color-surface: #ffffff;
    --color-surface-hover: #f9fafb;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-text: #111827;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-primary: #dc2626;
    --color-primary-hover: #b91c1c;
    --color-primary-light: #fef2f2;
    --color-primary-muted: rgba(220, 38, 38, 0.12);
    --color-success: #10b981;
    --color-success-bg: #ecfdf5;
    --color-success-text: #059669;
    --color-danger: #ef4444;
    --color-danger-bg: #fef2f2;
    --color-danger-text: #dc2626;
    --color-warning: #f59e0b;
    --color-warning-bg: #fffbeb;
    --color-icon-blue: #dc2626;
    --color-icon-green: #10b981;
    --color-icon-purple: #8b5cf6;
    --color-icon-orange: #f97316;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --sidebar-width: 248px;
    --topbar-height: 64px;
    --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-hover); }

code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    padding: 0.15em 0.45em;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

/* ── Shell ── */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.brand-logo-lg {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    border-radius: var(--radius);
}

.brand-logo-xl {
    width: 72px;
    height: 72px;
    font-size: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35);
}

.sidebar-brand strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.sidebar-brand small {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding: 16px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.nav-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.sidebar-cta {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--color-border-light);
}

.sidebar-cta .btn { width: 100%; }

.app-body {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-box {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-box svg,
.search-form svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-box input,
.search-form input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input::placeholder,
.search-form input::placeholder { color: var(--color-text-muted); }

.search-box input:focus,
.search-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-muted);
    background: var(--color-surface);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition);
}

.icon-btn:hover { background: var(--color-bg); color: var(--color-text); }
.icon-btn svg { width: 20px; height: 20px; }

.logout-form {
    display: inline-flex;
    margin: 0;
}

.logout-form button {
    border: none;
    background: transparent;
    cursor: pointer;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.topbar-user:hover {
    background: var(--color-bg);
}

.topbar-user .user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #fff;
}

.topbar-user-info strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}

.topbar-user-info small {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* ── Main ── */
.main {
    flex: 1;
    padding: 28px 32px 40px;
}

.page-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.breadcrumbs {
    flex: 1 1 100%;
    margin-bottom: 4px;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
}

.breadcrumbs li + li::before {
    content: '/';
    color: var(--color-text-muted);
}

.breadcrumbs a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--color-primary);
}

.breadcrumbs span[aria-current="page"] {
    color: var(--color-text);
    font-weight: 600;
}

.page-header h1 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-text);
    line-height: 1.2;
}

.page-header p {
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.page-actions-desktop-only {
    display: inline-flex;
}

.page-actions-overflow {
    position: relative;
    display: none;
}

.page-actions-overflow summary {
    list-style: none;
    cursor: pointer;
}

.page-actions-overflow summary::-webkit-details-marker {
    display: none;
}

.page-actions-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-actions-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.page-actions-menu a:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

/* ── KPI cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

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

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg { width: 20px; height: 20px; }

.stat-icon-blue,
.stat-icon-primary { background: var(--color-primary-light); color: var(--color-primary); }
.stat-icon-neutral { background: var(--color-bg); color: var(--color-text-secondary); border: 1px solid var(--color-border-light); }
.stat-icon-green { background: #ecfdf5; color: var(--color-icon-green); }
.stat-icon-purple { background: #f5f3ff; color: var(--color-icon-purple); }
.stat-icon-orange { background: #fff7ed; color: var(--color-icon-orange); }

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

.stat-trend-up { background: var(--color-success-bg); color: var(--color-success-text); }
.stat-trend-neutral { background: var(--color-bg); color: var(--color-text-muted); }

.stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-value-sm {
    font-size: 1.25rem;
}

body.mobile-more-open {
    overflow: hidden;
}

/* ── Content grid ── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    margin-bottom: 24px;
}

.content-grid-full { grid-template-columns: 1fr; }

/* ── Cards ── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--color-border-light);
    gap: 12px;
}

.card-header h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 20px 22px; }
.card-body-flush { padding: 0; }

.list-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-surface-hover);
}

.list-pagination-info {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.list-pagination-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-pagination-current {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ── Progress list ── */
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.progress-item-header span:first-child {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
}

.progress-item-header span:last-child {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.progress-bar {
    height: 6px;
    background: var(--color-bg);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #f87171);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    table-layout: auto;
}

.data-table th {
    text-align: left;
    padding: 11px 16px;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-surface-hover);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-secondary);
    vertical-align: top;
}

.data-table td strong { color: var(--color-text); font-weight: 600; }

.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--color-surface-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-meta {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.cell-meta code {
    font-size: 0.75rem;
}

.cell-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cell-stack-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
}

.cell-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-company-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.35;
    max-width: 100%;
}

.vehicles-list-table {
    table-layout: fixed;
    width: 100%;
}

.vehicles-list-table th:nth-child(1),
.vehicles-list-table td.cell-primary {
    width: 22%;
}

.vehicles-list-table th:nth-child(2),
.vehicles-list-table td.col-company {
    width: 18%;
}

.vehicles-list-table th:nth-child(3) {
    width: 88px;
}

.vehicles-list-table th:nth-child(4) {
    width: 14%;
}

.vehicles-list-table th:nth-child(5) {
    width: 24%;
}

.vehicles-list-table th:nth-child(6),
.vehicles-list-table td.cell-actions {
    width: 168px;
    min-width: 168px;
}

.vehicles-list-table td.col-mileage {
    white-space: nowrap;
}

.data-table:has(.col-company) {
    table-layout: fixed;
    width: 100%;
}

.data-table:has(.col-company) th:nth-child(2),
.data-table:has(.col-company) td.col-company {
    width: 22%;
    max-width: 0;
}

.cell-meta.col-hide-md,
.cell-meta.col-hide-lg {
    display: none;
}

@media (max-width: 900px) {
    .cell-meta.col-hide-md,
    .cell-meta.col-hide-lg {
        display: block;
    }

    .data-table td.cell-actions {
        white-space: normal;
    }

    .vehicle-row-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        max-width: 100%;
    }
}

.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.validity-renew-pending { margin-top: 8px; }
.validity-renewal-queue { margin-bottom: 24px; }

.vehicle-row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.vehicle-row-actions form {
    display: inline-flex;
    margin: 0;
}

.vehicle-action-tools {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
}

.vehicle-action-tools form {
    display: inline-flex;
    margin: 0;
}

.vehicle-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: 156px;
    margin-left: auto;
}

.table-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: 156px;
    margin-left: auto;
}

.clients-list-table {
    table-layout: fixed;
    width: 100%;
}

.clients-list-table .col-actions {
    width: 168px;
    min-width: 168px;
}

.clients-list-table .table-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 156px;
    max-width: 100%;
    margin-left: auto;
}

.clients-list-table .table-action-form-span {
    grid-column: 1 / -1;
}

.clients-list-table .table-action-grid > .btn,
.clients-list-table .table-action-grid > .table-action-form {
    min-width: 0;
}

.clients-list-table .table-action-grid .btn,
.clients-list-table .table-action-grid .table-action-form button {
    width: 100%;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.vehicle-action-grid > .btn,
.vehicle-action-grid > form.vehicle-action-form,
.table-action-grid > .btn,
.table-action-grid > form.table-action-form {
    min-width: 0;
}

.vehicle-action-grid .btn,
.table-action-grid .btn {
    width: 100%;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.vehicle-action-form,
.table-action-form {
    display: block;
    margin: 0;
}

.vehicle-action-form button,
.table-action-form button {
    width: 100%;
}

.companies-list-table {
    table-layout: fixed;
    width: 100%;
}

.companies-list-table .col-name {
    width: 24%;
}

.companies-list-table .col-country {
    width: 72px;
    white-space: nowrap;
}

.companies-list-table .col-tax {
    width: 118px;
    white-space: nowrap;
}

.companies-list-table .col-address {
    width: 18%;
}

.companies-list-table .col-client {
    width: 12%;
}

.companies-list-table .col-vehicles {
    width: 72px;
    text-align: center;
    white-space: nowrap;
}

.companies-list-table .col-actions {
    width: 168px;
    min-width: 168px;
}

.companies-list-table .col-tax code {
    font-size: 0.75rem;
    word-break: break-all;
}

.data-table td.cell-actions {
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.data-table td.cell-actions .vehicle-row-actions {
    justify-content: flex-end;
}

.data-table td.cell-actions .btn-sm {
    min-height: 32px;
    padding: 6px 12px;
}

.data-table td.cell-actions .btn-danger-outline {
    color: var(--color-danger-text);
    border-color: #fecaca;
    background: var(--color-surface);
}

.data-table td.cell-actions .btn-danger-outline:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: #fca5a5;
}

.clients-list-table td.cell-actions.col-actions {
    width: 168px;
    min-width: 168px;
    white-space: normal;
}

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-width: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--color-text);
    font-family: var(--font);
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input::placeholder { color: var(--color-text-muted); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-muted);
}

.form-group input:disabled {
    background: var(--color-bg);
    color: var(--color-text-muted);
}

.form-hint { font-size: 0.75rem; color: var(--color-text-muted); line-height: 1.5; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 22px;
    border-top: 1px solid var(--color-border-light);
}

.account-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

.account-settings .form-card {
    max-width: none;
}

.form-card-header {
    margin-bottom: 20px;
}

.form-card-header h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.form-card-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.account-profile-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
}

.account-profile-list div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-profile-list dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.account-profile-list dd {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 680px;
    box-shadow: var(--shadow-sm);
}

.form-card-wide {
    max-width: none;
    width: 100%;
}

.form-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px 32px;
}

.form-split-col {
    min-width: 0;
}

@media (min-width: 992px) {
    .form-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .form-split-col > .form-section-title:first-child {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
}

.form-card-wide .form-actions {
    margin-top: 20px;
}

.input-group { display: flex; gap: 10px; min-width: 0; }
.input-group input { flex: 1; min-width: 0; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

.lookup-status { font-size: 0.8125rem; margin-top: 6px; min-height: 1.2em; font-weight: 500; }
.lookup-status.loading { color: var(--color-text-muted); }
.lookup-status.loading::before {
    content: '';
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-right: 6px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.1em;
    animation: lookup-spin 0.8s linear infinite;
}
@keyframes lookup-spin { to { transform: rotate(360deg); } }
.lookup-status.success { color: var(--color-success-text); }
.lookup-status.error { color: var(--color-danger-text); }

.vehicle-import-panel {
    margin-bottom: 20px;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid #c7d7fe;
    background: linear-gradient(135deg, #f5f8ff 0%, #eef4ff 100%);
}

.vehicle-import-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.vehicle-import-panel h2 {
    margin: 0 0 4px;
    font-size: 1.125rem;
}

.vehicle-import-panel p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

.vehicle-import-panel .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.vehicle-import-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.vehicle-import-tab {
    padding: 8px 14px;
    border: 1px solid #c7d7fe;
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.vehicle-import-tab.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.vehicle-import-pane {
    margin-top: 14px;
}

.vehicle-import-pane[hidden] {
    display: none;
}

.vehicle-import-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.vehicle-import-textarea {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.vehicle-import-actions {
    margin-top: 10px;
}

.vehicle-import-actions-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
}

.vehicle-import-manual {
    margin-top: 14px;
}

.form-section-title-compact {
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
}

.form-section-hint {
    margin: -4px 0 14px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.catalog-combobox {
    position: relative;
}

.catalog-suggest {
    position: absolute;
    z-index: 30;
    top: calc(100% - 4px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.catalog-suggest-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.catalog-suggest-item:last-child {
    border-bottom: 0;
}

.catalog-suggest-item:hover,
.catalog-suggest-item:focus {
    background: #f5f8ff;
    outline: none;
}

.vehicle-import-vin-hint {
    margin: 0 0 12px;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

.vehicle-import-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.vehicle-import-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vehicle-import-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.form-group-grow { flex: 1.4; }
.input-mono { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.label-required { color: var(--color-danger-text); font-weight: 600; }

.form-collapsible {
    margin: 16px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface, #fff);
}

.form-collapsible summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    list-style: none;
}

.form-collapsible summary::-webkit-details-marker { display: none; }

.form-collapsible summary::after {
    content: '▾';
    float: right;
    color: var(--color-text-muted);
}

.form-collapsible:not([open]) summary::after { content: '▸'; }

.form-collapsible-body { padding: 0 16px 16px; }

.field-auto-filled {
    animation: field-highlight 1.5s ease;
}

@keyframes field-highlight {
    0% { background-color: #ecfdf3; box-shadow: 0 0 0 2px #86efac; }
    100% { background-color: transparent; box-shadow: none; }
}

.btn-lg { padding: 12px 24px; font-size: 1rem; }

.form-section-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.btn-outline {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.btn-danger:hover { background: var(--color-danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-block { width: 100%; }

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid #fde68a;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-info { background: var(--color-primary-light); color: var(--color-primary-hover); }
.badge-muted { background: var(--color-bg); color: var(--color-text-muted); }

.nav-badge {
    margin-left: auto;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}

.nav-link { position: relative; }

.request-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-fault {
    border-color: #fecaca;
    color: var(--color-danger-text);
}

.btn-fault:hover {
    background: var(--color-danger-bg);
    border-color: #fecaca;
    color: var(--color-danger-text);
}

.request-description,
.request-admin-note {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

.request-description h3,
.request-admin-note h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.request-description p,
.request-admin-note p {
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.7;
}

.request-admin-note {
    background: var(--color-primary-light);
    margin: 20px -22px -20px;
    padding: 20px 22px;
    border-top-color: #fecaca;
    border-radius: 0 0 var(--radius) var(--radius);
}

.request-admin-note h3 { color: var(--color-primary); }

/* ── Urgent & notifications ── */
.badge-urgent {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    animation: urgent-pulse 2s ease-in-out infinite;
}

@keyframes urgent-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15); }
}

.row-urgent { background: #fef2f2 !important; }
.row-urgent:hover { background: #fee2e2 !important; }

.card-urgent {
    border-color: #fecaca;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.08);
}

.urgent-alert { border-color: #fecaca; }
.appointment-alert { font-size: 1rem; }

.appointment-box {
    background: var(--color-primary-light);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.appointment-box-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.appointment-box-date {
    display: block;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.appointment-accept-form {
    margin-top: 12px;
}

.appointment-accept-alert .appointment-accept-form {
    margin-top: 16px;
}

.appointment-box-action .appointment-accept-form {
    margin-top: 16px;
}

.expiry-alerts-card {
    margin-bottom: 24px;
}

.expiry-alerts-header {
    align-items: flex-start;
    gap: 16px;
}

.expiry-alerts-header h2 {
    margin: 0;
    font-size: 1.0625rem;
}

.expiry-alerts-subtitle {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.expiry-alerts-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.expiry-alerts-scroll {
    max-height: min(320px, 45vh);
    overflow-y: auto;
}

.expiry-alerts-table th,
.expiry-alerts-table td {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 0.875rem;
}

.expiry-alerts-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--color-surface);
    box-shadow: 0 1px 0 var(--color-border);
}

.expiry-alerts-row-expired {
    background: rgba(220, 38, 38, 0.03);
}

.expiry-alerts-row-warning {
    background: rgba(245, 158, 11, 0.03);
}

.expiry-kind-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.expiry-kind-inspection {
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
}

.expiry-kind-insurance {
    background: #f5f3ff;
    color: #7c3aed;
}

.expiry-alerts-action {
    text-align: right;
    white-space: nowrap;
}

.expiry-alerts-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
}

.validity-renew-alert {
    margin-bottom: 16px;
}

.validity-renew-content strong {
    display: block;
    margin-bottom: 6px;
}

.validity-renew-content p {
    margin: 0 0 14px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.validity-renew-form {
    margin: 0;
}

.validity-renew-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.validity-renew-fields label {
    display: block;
    width: 100%;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.validity-renew-fields input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
}

.input-readonly {
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.form-hint-warning {
    color: var(--color-warning);
}

.badge-inline {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Workshop calendar ── */
.calendar-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
}

.calendar-toolbar-title {
    text-align: center;
    flex: 1;
}

.calendar-toolbar-title strong {
    display: block;
    font-size: 1.0625rem;
}

.calendar-grid-wrap {
    padding: 12px 16px 18px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    position: relative;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-surface);
    transition: background var(--transition), border-color var(--transition);
}

.calendar-day:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.calendar-day-outside {
    opacity: 0.45;
}

.calendar-day-today {
    border-color: var(--color-primary);
}

.calendar-day-selected {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.calendar-day-has-events .calendar-day-num {
    font-weight: 700;
}

.calendar-day-num {
    font-size: 0.875rem;
}

.calendar-day-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 18px;
}

.calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.calendar-event {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.calendar-event-fault {
    border-left: 3px solid #dc2626;
}

.calendar-event-time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.calendar-event-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.calendar-event-meta,
.calendar-event-desc {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0 0 8px;
}

.calendar-event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.calendar-empty {
    padding: 28px 16px;
}

.calendar-upcoming {
    margin-bottom: 24px;
}

.notification-workshop.notification-unread {
    border-left: 3px solid var(--color-primary);
}

.notification-release.notification-unread {
    border-left: 3px solid var(--color-success);
    background: var(--color-success-bg);
}

.notification-release .badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

/* ── Bug reports ── */
.bug-reports-list {
    display: flex;
    flex-direction: column;
}

.bug-report-item {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.bug-report-item:last-child {
    border-bottom: none;
}

.bug-report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.bug-report-desc {
    margin: 0 0 12px;
    line-height: 1.55;
    color: var(--color-text);
}

.bug-report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.bug-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.bug-report-status-select,
.bug-report-actions input[type="text"] {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
}

.bug-report-actions input[type="text"] {
    flex: 1 1 220px;
}

/* ── News / nowości ── */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item-header {
    align-items: flex-start;
}

.news-item-header h2 {
    margin: 0 0 4px;
    font-size: 1.125rem;
}

.news-item-date {
    margin: 0;
    color: var(--color-text-muted);
}

.news-item-message {
    margin: 0 0 16px;
    line-height: 1.6;
    color: var(--color-text);
}

.news-item-actions {
    display: flex;
    gap: 8px;
}

/* ── Filters & search ── */
.filter-bar {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.filter-bar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.filter-field-grow {
    flex: 1;
    min-width: 180px;
}

.filter-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.filter-field input,
.filter-field select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-page-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-results-list {
    display: flex;
    flex-direction: column;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border-light);
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    background: var(--color-surface-hover);
}

.search-result-item span {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.search-results-card {
    margin-bottom: 16px;
}

/* ── Workshop today ── */
.workshop-today-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workshop-today-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.workshop-stat {
    text-align: center;
    padding: 14px;
    background: var(--color-bg-subtle);
    border-radius: var(--radius-sm);
}

.workshop-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

.workshop-stat-urgent {
    color: #dc2626;
}

.workshop-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.workshop-today-section h3 {
    font-size: 0.875rem;
    margin-bottom: 10px;
    color: var(--color-text-secondary);
}

.workshop-today-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workshop-today-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
}

.workshop-today-item:hover {
    background: var(--color-surface-hover);
}

.workshop-today-item-urgent {
    border-left: 3px solid #dc2626;
}

.workshop-today-time {
    font-weight: 700;
    color: var(--color-primary);
    min-width: 44px;
}

.workshop-today-label {
    font-size: 0.875rem;
}

.workshop-today-card {
    margin-bottom: 20px;
}

.oil-alerts-card {
    margin-bottom: 20px;
}

/* ── Fleet report ── */
.report-month-chart {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
    align-items: end;
    min-height: 180px;
}

.report-month-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 180px;
    justify-content: flex-end;
}

.report-month-fill {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(180deg, #f87171, #dc2626);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
}

.report-month-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.report-month-value {
    font-size: 0.625rem;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.2;
}

.report-year-form select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.report-mail-hint {
    margin-top: 16px;
}

/* ── Client todo panel ── */
.client-todo-card {
    margin-bottom: 20px;
}

.client-todo-list {
    display: flex;
    flex-direction: column;
}

.client-todo-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border-light);
}

.client-todo-item:last-child {
    border-bottom: none;
}

.client-todo-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.client-todo-top strong {
    font-size: 0.9375rem;
}

.client-todo-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.client-todo-item .btn {
    flex-shrink: 0;
    align-self: center;
}

.client-todo-item-appointment {
    border-left: 3px solid var(--color-primary);
}

.client-todo-item-expiry.client-todo-item .client-todo-main,
.client-todo-item-oil .client-todo-main {
    min-width: 0;
}

.mileage-quick-btn,
.mileage-stat-btn {
    margin-top: 6px;
}

.stat-card .mileage-stat-btn {
    margin-top: 10px;
}

.calendar-event-pending {
    border-left: 3px solid #f59e0b;
}

/* ── Request tracking ── */
.request-tracking-card {
    margin-bottom: 20px;
}

.request-tracking {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.request-tracking-step {
    position: relative;
    flex: 1;
    min-width: 88px;
    text-align: center;
}

.request-tracking-marker {
    width: 32px;
    height: 32px;
    margin: 0 auto 8px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.request-tracking-marker svg {
    width: 16px;
    height: 16px;
}

.request-tracking-step.is-done .request-tracking-marker {
    border-color: var(--color-success);
    background: #ecfdf5;
    color: var(--color-success-text);
}

.request-tracking-step.is-current .request-tracking-marker {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.request-tracking-label {
    font-size: 0.6875rem;
    line-height: 1.3;
    color: var(--color-text-muted);
}

.request-tracking-step.is-current .request-tracking-label {
    color: var(--color-text);
    font-weight: 600;
}

.request-tracking-line {
    display: none;
}

.request-tracking-compact {
    margin-top: 10px;
    justify-content: flex-start;
    gap: 4px;
}

.request-tracking-compact .request-tracking-step {
    min-width: 0;
    flex: 0 0 auto;
}

.request-tracking-compact .request-tracking-marker {
    width: 22px;
    height: 22px;
    font-size: 0.625rem;
    margin-bottom: 0;
}

.request-tracking-compact .request-tracking-label {
    display: none;
}

.appointment-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.counter-propose-details {
    margin-top: 14px;
}

.counter-propose-details summary {
    cursor: pointer;
    list-style: none;
}

.counter-propose-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── Fleet health & costs ── */
.content-grid-dashboard {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 20px;
}

.dashboard-vehicles-table {
    table-layout: fixed;
    width: 100%;
}

.dashboard-vehicles-table th:nth-child(1),
.dashboard-vehicles-table td.cell-primary {
    width: 50%;
}

.dashboard-vehicles-table th:nth-child(2),
.dashboard-vehicles-table td.dashboard-col-mileage {
    width: 110px;
    white-space: nowrap;
    text-align: right;
}

.dashboard-vehicles-table th:nth-child(3) {
    width: 200px;
}

.dashboard-vehicles-table .cell-meta-company {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.dashboard-vehicles-table .cell-stack-row {
    font-size: 0.8125rem;
}

.fleet-health-body {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.fleet-health-score {
    text-align: center;
    min-width: 120px;
}

.fleet-health-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.fleet-health-caption {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.fleet-health-good .fleet-health-value { color: #16a34a; }
.fleet-health-fair .fleet-health-value { color: #d97706; }
.fleet-health-poor .fleet-health-value { color: #dc2626; }
.fleet-health-neutral .fleet-health-value { color: var(--color-text-muted); }

.fleet-health-breakdown {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.fleet-health-stat {
    text-align: center;
}

.fleet-health-stat strong {
    display: block;
    font-size: 1.25rem;
}

.fleet-health-stat span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.fleet-health-stat-warn strong {
    color: #d97706;
}

.fleet-cost-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.fleet-cost-stat {
    text-align: center;
    padding: 12px;
    background: var(--color-bg-subtle);
    border-radius: var(--radius-sm);
}

.fleet-cost-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
}

.fleet-cost-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.fleet-cost-top h3 {
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.fleet-cost-top-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fleet-cost-top-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.875rem;
}

.fleet-cost-top-list li:last-child {
    border-bottom: none;
}

.vehicle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.form-section-title {
    margin: 24px 0 12px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
}

.form-section-title h3 {
    font-size: 0.9375rem;
    margin: 0;
}

.notification-expiry.notification-unread {
    border-left: 3px solid #f59e0b;
}

.nav-badge-urgent {
    background: #dc2626;
    animation: urgent-pulse 2s ease-in-out infinite;
}

.icon-btn-notify {
    position: relative;
    text-decoration: none;
    color: var(--color-text-secondary);
}

.notify-wrap {
    position: relative;
}

.notify-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(380px, calc(100vw - 32px));
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    z-index: 200;
    overflow: hidden;
}

.notify-dropdown[hidden] {
    display: none;
}

.notify-dropdown-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}

.notify-dropdown-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.notify-dropdown-mark-all {
    margin: 0;
}

.notify-dropdown-mark-all button {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 4px 8px;
    min-height: 0;
}

.notify-dropdown-header strong {
    font-size: 0.9375rem;
}

.notify-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}

.notify-dropdown-empty {
    padding: 28px 16px;
    text-align: center;
}

.notify-dropdown-empty p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.notify-dropdown-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
}

.notify-dropdown-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.notify-dropdown-main:hover {
    opacity: 0.85;
}

.notify-dropdown-read-form {
    margin: 0;
}

.notify-dropdown-read-btn {
    align-self: flex-start;
    font-size: 0.75rem;
    padding: 4px 10px;
    min-height: 0;
}

.notify-dropdown-item:last-child {
    border-bottom: none;
}

.notify-dropdown-item-unread {
    background: rgba(37, 99, 235, 0.04);
    border-left: 3px solid var(--color-primary);
    padding-left: 13px;
}

.notify-dropdown-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.notify-dropdown-message {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.notify-dropdown-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.notify-dropdown-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
}

.notify-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc2626;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.notification-unread {
    border-left: 4px solid var(--color-primary);
    background: #f8fbff;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.notification-content p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 6px;
}

.notification-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Service option chips ── */
.option-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option-chip {
    cursor: pointer;
    display: inline-flex;
}

.option-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-chip span {
    display: inline-block;
    padding: 10px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    transition: all var(--transition);
    user-select: none;
}

.option-chip input:checked + span {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.option-chip:hover span {
    border-color: var(--color-primary);
}

.service-options-display {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

.service-options-display h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.option-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.option-tag-sm {
    padding: 3px 8px;
    font-size: 0.6875rem;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px;
}

.empty-state-message,
.empty-state p {
    color: var(--color-text-muted);
    margin: 0 0 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 36ch;
    margin-left: auto;
    margin-right: auto;
}

/* ── Toasts ── */
.toast-stack {
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 16px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    line-height: 1.5;
    animation: toast-in 0.25s ease;
}

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error { border-left: 4px solid var(--color-danger); }
.toast-warning { border-left: 4px solid var(--color-warning); }
.toast-info { border-left: 4px solid var(--color-primary); }

.toast.is-leaving {
    animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(12px); }
}

/* ── Info cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.info-card {
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}

.info-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 0.8125rem; color: var(--color-text-secondary); }

.vehicle-link { color: inherit; text-decoration: none; }
.vehicle-link:hover strong { color: var(--color-primary); }

.section { margin-bottom: 28px; }

/* ── Vehicle detail ── */
.detail-list { display: flex; flex-direction: column; gap: 0; }

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.detail-row:last-child { border-bottom: none; }

.detail-row dt {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-row dd {
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 500;
    text-align: right;
}

.service-form { display: flex; flex-direction: column; gap: 16px; }

.service-cost-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
    font-size: 0.875rem;
}

.service-cost-total strong {
    font-size: 1.125rem;
    color: var(--color-text);
}

.card-highlight {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.receive-vehicle-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
}

.receive-vehicle-note {
    margin-bottom: 16px;
}

.history-table {
    table-layout: fixed;
    width: 100%;
}

.history-table-wrap {
    overflow-x: visible;
}

.history-table th:first-child,
.history-table td.cell-primary {
    width: 38%;
}

.history-table .col-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    width: 12%;
}

.history-table .cell-actions {
    width: 96px;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.history-table .col-total {
    font-weight: 600;
}

.history-table tfoot .history-totals td {
    background: var(--color-bg-subtle);
    font-weight: 600;
    border-top: 2px solid var(--color-border);
    vertical-align: middle;
}

.history-table tfoot .history-totals td:first-child {
    color: var(--color-text-secondary);
}

@media (max-width: 1100px) {
    .history-table th:first-child,
    .history-table td.cell-primary {
        width: auto;
    }

    .history-table .col-num {
        width: 100px;
    }
}

.badge-neutral {
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
}

body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.modal-dialog {
    position: relative;
    width: min(100%, 520px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px 24px;
}

.modal-detail-list {
    margin-bottom: 20px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    margin: 0 0 8px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.modal-section p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

.modal-costs {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
    margin-bottom: 12px;
}

.modal-cost-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.875rem;
}

.modal-cost-item strong {
    font-variant-numeric: tabular-nums;
}

.modal-cost-total {
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
    font-weight: 600;
}

.modal-workshop {
    margin: 0;
    color: var(--color-text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-dialog-scanner {
    width: min(100%, 480px);
}

.aztec-scanner-body {
    padding-top: 0;
}

.aztec-scanner-viewport {
    width: 100%;
    min-height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f172a;
}

.aztec-scanner-viewport video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.aztec-scanner-hint {
    margin: 12px 0 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

#aztec-scanner-status {
    margin-top: 8px;
    min-height: 1.25rem;
}

/* ── Service timeline ── */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 20px;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 0 2px var(--color-border);
    background: var(--color-primary);
    z-index: 1;
}

.timeline-item-oil_change .timeline-marker {
    background: var(--color-icon-orange);
    box-shadow: 0 0 0 2px #fed7aa;
}

.timeline-item-repair .timeline-marker {
    background: var(--color-primary);
}

.timeline-content {
    flex: 1;
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.timeline-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.timeline-item-oil_change .timeline-category { color: var(--color-icon-orange); }

.timeline-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
}

.timeline-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.timeline-meta time {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
}

.timeline-meta span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.timeline-desc {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.timeline-workshop {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.timeline-delete {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border-light);
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    background: #f4f4f5;
}

.login-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.login-panel {
    width: min(480px, 42vw);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #f4f4f5;
}

.login-container {
    width: 100%;
    max-width: 380px;
}

.login-brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.login-brand-mark strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-text);
}

.login-brand-mark > div span {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.login-brand-mark .brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0;
    flex-shrink: 0;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
}

.login-brand {
    margin-bottom: 24px;
}

.login-brand h2 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--color-text);
}

.login-brand p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form .form-group {
    gap: 8px;
}

.login-input,
.login-form .login-input {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--color-text);
    font-family: var(--font);
    font-size: 0.875rem;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-input::placeholder {
    color: var(--color-text-muted);
}

.login-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-muted);
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text);
    -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset;
    box-shadow: 0 0 0 1000px var(--color-surface) inset;
    border: 1px solid var(--color-border);
    transition: background-color 9999s ease-out;
}

.login-footer {
    margin-top: 20px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.login-back-link {
    margin-top: 16px;
    text-align: center;
    font-size: 0.8125rem;
}

.login-back-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.login-back-link a:hover {
    text-decoration: underline;
}

.login-split-single {
    justify-content: center;
}

.login-split-single .login-panel {
    width: 100%;
    max-width: 480px;
}

.login-hero {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 48px clamp(40px, 6vw, 80px);
    background:
        radial-gradient(ellipse 60% 50% at 80% 20%, rgba(220, 38, 38, 0.12) 0%, transparent 60%),
        linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
    overflow-y: auto;
}

.login-hero-inner {
    width: 100%;
    max-width: 480px;
}

.login-hero h1 {
    font-size: clamp(1.625rem, 2.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: #fff;
    margin: 0 0 12px;
}

.login-hero-lead {
    font-size: 0.9375rem;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0 0 32px;
}

.login-steps {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    counter-reset: login-step;
}

.login-steps li {
    counter-increment: login-step;
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 3px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.login-steps li:first-child {
    padding-top: 0;
}

.login-steps li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.login-steps li::before {
    content: counter(login-step);
    grid-column: 1;
    grid-row: 1 / -1;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.login-steps strong {
    grid-column: 2;
    grid-row: 1;
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.35;
}

.login-steps span {
    grid-column: 2;
    grid-row: 2;
    display: block;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.45;
}

.login-features {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
}

.login-features svg {
    width: 15px;
    height: 15px;
    color: #64748b;
    flex-shrink: 0;
}

.login-hero-footnote {
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    color: #64748b;
}

@media (min-width: 1200px) {
    .login-hero-inner {
        max-width: 520px;
    }
}

/* ── Mobile shell ── */
.menu-toggle { display: none; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 190;
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 180;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

.mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    text-decoration: none;
}

.mobile-bottom-nav a svg {
    width: 22px;
    height: 22px;
}

.mobile-bottom-nav a.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.mobile-bottom-nav a.mobile-nav-primary {
    color: var(--color-primary);
}

.mobile-bottom-nav .mobile-nav-more,
.mobile-bottom-nav button.mobile-nav-more {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.mobile-bottom-nav .mobile-nav-more svg {
    width: 22px;
    height: 22px;
}

.mobile-bottom-nav .mobile-nav-more.is-open {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.mobile-more-sheet {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.mobile-more-sheet[hidden] {
    display: none !important;
}

.mobile-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.mobile-more-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--color-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.15);
    animation: sheet-up 0.25s ease;
}

@keyframes sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mobile-more-header h2 {
    font-size: 1rem;
    margin: 0;
}

.mobile-more-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-more-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
}

.mobile-more-links a svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
}

.mobile-more-links a:hover,
.mobile-more-links a:active {
    background: var(--color-bg);
}

.mobile-more-links a .nav-badge {
    margin-left: auto;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .col-hide-lg { display: none; }
}

@media (max-width: 900px) {
    .col-hide-md { display: none; }
}

@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    body.app-mobile-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    body.sidebar-open { overflow: hidden; }

    .menu-toggle { display: inline-flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: none;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    }

    .sidebar-overlay.is-visible { display: block; }

    .app-body { margin-left: 0; }
    .main { padding: 16px 12px 24px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .search-box { display: none; }
    .topbar-user-info { display: none; }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 12px;
        gap: 8px;
    }

    .stat-card-top {
        align-items: center;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
    }

    .stat-icon svg {
        width: 16px;
        height: 16px;
    }

    .stat-trend {
        font-size: 0.625rem;
        padding: 2px 6px;
        max-width: 50%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stat-value {
        font-size: 1.375rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
    .login-split {
        flex-direction: column;
    }

    .login-panel {
        width: 100%;
        padding: 28px 20px 24px;
        align-items: stretch;
    }

    .login-container {
        max-width: none;
    }

    .login-brand-mark {
        justify-content: center;
        margin-bottom: 20px;
    }

    .login-brand-mark .brand-logo {
        width: 52px;
        height: 52px;
        font-size: 1.375rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
    }

    .login-brand-mark strong {
        font-size: 1.125rem;
    }

    .login-card {
        padding: 28px 22px;
    }

    .login-brand h2 {
        font-size: 1.25rem;
    }

    .login-hero {
        flex: none;
        width: 100%;
        padding: 32px 20px 40px;
        align-items: stretch;
    }

    .login-hero h1 {
        font-size: 1.375rem;
    }

    .login-hero-lead {
        font-size: 0.875rem;
        margin-bottom: 24px;
    }

    .login-steps li {
        padding: 14px 0;
    }

    .login-features {
        gap: 10px 16px;
    }

    .login-hero-footnote {
        text-align: center;
    }
    .form-row { grid-template-columns: 1fr; }
    .form-card { padding: 20px 16px; }
    .input-group { flex-direction: column; }
    .page-topbar { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-actions-desktop-only { display: none !important; }
    .page-actions-overflow { display: block; }
    .page-actions { width: 100%; flex-wrap: wrap; }
    .page-actions .btn { flex: 1 1 auto; min-width: 0; justify-content: center; }
    .card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }
    .expiry-alerts-header { flex-direction: column; }
    .expiry-alerts-scroll { max-height: none; overflow: visible; }
    .validity-renew-fields { flex-direction: column; align-items: stretch; }
    .validity-renew-fields input[type="date"],
    .validity-renew-fields .btn { width: 100%; }
    .notify-dropdown {
        position: fixed;
        top: calc(var(--topbar-height) + 8px);
        left: 12px;
        right: 12px;
        width: auto;
    }

    .calendar-layout {
        grid-template-columns: 1fr;
    }

    .calendar-event {
        grid-template-columns: 1fr;
    }

    .calendar-event-time {
        font-size: 0.875rem;
    }

    .calendar-day {
        min-height: 44px;
    }

    .calendar-upcoming { display: none; }

    .workshop-today-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .workshop-stat {
        padding: 10px 6px;
    }

    .workshop-stat-value {
        font-size: 1.25rem;
    }

    .workshop-stat-label {
        font-size: 0.6875rem;
        line-height: 1.2;
    }

    .workshop-today-body {
        gap: 12px;
    }

    .workshop-today-card {
        margin-bottom: 14px;
    }

    .workshop-today-card .card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .workshop-today-card .card-body {
        padding: 12px 14px;
    }

    .workshop-today-body .empty-state.calendar-empty {
        padding: 10px 8px;
    }

    .workshop-today-body .empty-state p {
        margin-bottom: 0;
        font-size: 0.8125rem;
    }
    .report-month-chart { grid-template-columns: repeat(6, 1fr); }
    .filter-bar-row { flex-direction: column; align-items: stretch; }
    .filter-field { min-width: 0; width: 100%; }
    .filter-actions .btn { flex: 1; }

    .content-grid-dashboard { grid-template-columns: 1fr; }
    .fleet-cost-stats { grid-template-columns: 1fr; }
    .fleet-health-body { flex-direction: column; align-items: stretch; }

    .account-settings { grid-template-columns: 1fr; }

    .client-todo-item {
        flex-direction: column;
        align-items: stretch;
    }

    .client-todo-item .btn {
        align-self: stretch;
    }

    .mileage-quick-btn {
        display: inline-flex;
        margin-top: 8px;
    }

    .mobile-bottom-nav { display: flex; }

    /* Tables → cards */
    .table-wrap {
        overflow-x: visible;
        padding: 8px;
    }

    .card-body-flush > .table-wrap { padding: 8px; }

    .data-table { border-collapse: separate; border-spacing: 0; }

    .data-table thead { display: none; }

    .data-table tbody tr {
        display: block;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        overflow: visible;
    }

    .data-table tbody tr:last-child { margin-bottom: 0; }
    .data-table tbody tr:hover { background: var(--color-surface); }
    .data-table tbody tr.row-urgent { border-left: 3px solid #dc2626; }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(88px, 36%) 1fr;
        gap: 8px;
        align-items: start;
        padding: 10px 14px;
        border-bottom: 1px solid var(--color-border-light);
        text-align: right;
    }

    .data-table td:last-child { border-bottom: none; }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.6875rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--color-text-muted);
        text-align: left;
        padding-top: 2px;
    }

    .data-table td.cell-primary {
        display: block;
        text-align: left;
        padding: 14px 14px 10px;
        border-bottom: 1px solid var(--color-border);
        background: var(--color-surface-hover);
    }

    .data-table td.cell-primary::before { display: none; }

    .data-table td.actions,
    .data-table td.cell-actions {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        text-align: left;
        padding: 12px 14px;
        border-top: 1px solid var(--color-border-light);
        background: var(--color-bg-subtle);
    }

    .data-table td.actions::before,
    .data-table td.cell-actions::before {
        display: block;
        margin-bottom: 10px;
    }

    .vehicles-list-table td.vehicle-card-actions::before {
        display: none;
    }

    .vehicles-list-table td.vehicle-card-actions {
        padding: 10px 12px 12px;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border-light);
    }

    .vehicles-list-table .vehicle-row-actions.vehicle-action-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        max-width: none;
        width: 100%;
    }

    .vehicles-list-table .vehicle-row-actions.vehicle-action-grid .btn,
    .vehicles-list-table .vehicle-row-actions.vehicle-action-grid .vehicle-action-form,
    .vehicles-list-table .vehicle-row-actions.vehicle-action-grid .vehicle-action-form button {
        width: 100%;
        min-height: 38px;
        padding: 8px 6px;
        font-size: 0.8125rem;
        justify-content: center;
    }

    .companies-list-table .table-action-grid {
        max-width: none;
        width: 100%;
    }

    .companies-list-table .table-action-grid .btn,
    .companies-list-table .table-action-grid .table-action-form,
    .companies-list-table .table-action-grid .table-action-form button {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.8125rem;
    }

    .clients-list-table .table-action-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: none;
    }

    .clients-list-table .table-action-grid .btn,
    .clients-list-table .table-action-grid .table-action-form button {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.8125rem;
    }

    .data-table td.cell-actions:not(.vehicle-card-actions) .vehicle-row-actions .btn,
    .data-table td.cell-actions:not(.vehicle-card-actions) .vehicle-row-actions form,
    .data-table td.cell-actions:not(.vehicle-card-actions) .vehicle-row-actions form button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .btn-sm { min-height: 40px; padding: 10px 14px; }

    .data-table tfoot { display: block; }
    .data-table tfoot tr {
        display: block;
        padding: 12px 14px;
        background: var(--color-bg-subtle);
        border-radius: var(--radius-sm);
    }
    .data-table tfoot td {
        display: block;
        padding: 4px 0;
        border: none;
        text-align: left;
    }
    .data-table tfoot td::before { display: none; }

    .col-hide-lg,
    .col-hide-md { display: none !important; }

    .history-table td.col-num::before { content: attr(data-label); }

    .history-table-wrap { overflow-x: visible; }

    .history-table tfoot tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .history-table tfoot td {
        display: block;
        padding: 0;
        border: none;
        width: auto;
    }

    .history-table tfoot td:empty {
        display: none;
    }

    .history-table tfoot td.col-hide-md,
    .history-table tfoot td.col-hide-lg {
        display: none !important;
    }

    .history-table tfoot td.col-total {
        margin-left: auto;
        font-size: 1rem;
    }

    /* Dashboard — kompaktowa karta pojazdu */
    .dashboard-vehicles-table td.cell-primary {
        background: var(--color-surface);
        padding: 12px 14px 10px;
    }

    .dashboard-vehicles-table td.dashboard-col-mileage,
    .dashboard-vehicles-table td[data-label="Terminy"] {
        display: grid;
        grid-template-columns: 88px 1fr;
        gap: 8px;
        align-items: start;
        padding: 10px 14px;
        text-align: right;
    }

    .dashboard-vehicles-table td.dashboard-col-mileage::before,
    .dashboard-vehicles-table td[data-label="Terminy"]::before {
        text-align: left;
        padding-top: 0;
    }

    .dashboard-vehicles-table td[data-label="Terminy"] .cell-stack {
        flex: 1;
        min-width: 0;
        text-align: right;
    }

    .dashboard-vehicles-table .cell-stack-row {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .dashboard-vehicles-table .cell-meta-company {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    /* Lista zgłoszeń — status bez obciętego timeline */
    .data-table td[data-label="Status"] {
        display: block;
        text-align: left;
    }

    .data-table td[data-label="Status"]::before {
        display: block;
        margin-bottom: 8px;
    }

    .data-table td[data-label="Status"] .request-tracking-compact {
        display: none;
    }

    .data-table td.cell-actions .btn:only-child {
        width: 100%;
        justify-content: center;
    }
}
