:root {
    --wrc-navy: #10233a;
    --wrc-blue: #21466e;
    --wrc-sand: #efe4d2;
    --wrc-accent: #bf5b04;
    --wrc-ink: #213246;
    --wrc-muted: #667487;
    --wrc-panel: #ffffff;
    --wrc-line: rgba(19, 38, 63, 0.1);
    --wrc-soft-line: rgba(19, 38, 63, 0.06);
    --wrc-bg: #f5f7fa;
    --wrc-surface: #ffffff;
    --wrc-surface-raised: #f8fafc;
    --wrc-border: rgba(19, 38, 63, 0.1);
    --wrc-border-strong: rgba(19, 38, 63, 0.2);
    --wrc-success: #14532d;
    --wrc-success-bg: #d1fae5;
    --wrc-warning: #92400e;
    --wrc-warning-bg: #fef3c7;
    --wrc-danger: #991b1b;
    --wrc-danger-bg: #fee2e2;
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --text-xs: 0.75rem;
    --text-sm: 0.85rem;
    --text-base: 1rem;
    --text-lg: 1.1rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --bottom-nav-height: 56px;
    --top-header-height: 56px;
    --status-booked-bg: #FFE8A3;
    --status-invoice-bg: #FFF3C4;
    --status-paid-bg: #CDE8BE;
    --status-parking-bg: #E7F0FF;
    --status-repair-bg: #FFD6D6;
    --status-free-bg: #FFFFFF;
    --fleet-day-width: 38px;
    --fleet-row-height: 36px;
    --fleet-vehicle-width: 320px;
}

html,
body {
    min-height: 100%;
}

body {
    color: var(--wrc-ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(239, 228, 210, 0.55), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(245, 247, 250, 0.96)),
        var(--wrc-bg);
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.display-6 {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    letter-spacing: -0.02em;
}

a {
    color: var(--wrc-blue);
}

.app-body {
    min-height: 100vh;
}

.app-navbar {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.14), transparent 35%),
        linear-gradient(135deg, #0f2237, #1e456b 62%, #b45a11 150%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-nav-links {
    gap: 0.15rem;
}

.app-nav-links .nav-link {
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-weight: 600;
}

.app-nav-links .nav-link.active,
.app-nav-links .nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
}

.app-nav-dropdown {
    border: 1px solid rgba(19, 38, 63, 0.1);
    border-radius: 1rem;
    padding: 0.5rem;
    box-shadow: 0 1rem 2rem rgba(17, 34, 58, 0.12);
}

.app-nav-dropdown .dropdown-item {
    border-radius: 0.8rem;
    font-weight: 600;
    padding: 0.6rem 0.8rem;
}

.app-nav-dropdown .dropdown-item.active,
.app-nav-dropdown .dropdown-item:active,
.app-nav-dropdown .dropdown-item:hover {
    background: rgba(33, 70, 110, 0.1);
    color: var(--wrc-blue);
}

.app-user-panel {
    display: grid;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.app-user-meta {
    min-width: 0;
}

.hero-panel {
    color: white;
    border-radius: 1.5rem;
    background:
        linear-gradient(125deg, rgba(11, 28, 46, 0.96), rgba(26, 65, 102, 0.9)),
        radial-gradient(circle at top right, rgba(191, 91, 4, 0.3), transparent 30%);
    box-shadow: 0 1rem 3rem rgba(16, 35, 58, 0.16);
}

.page-header {
    padding: 0.5rem 0 0;
}

.dashboard-card,
.card {
    border-radius: 1.05rem;
    border-color: var(--wrc-line) !important;
    box-shadow: 0 0.7rem 2rem rgba(17, 34, 58, 0.06);
}

.section-card {
    background: var(--wrc-panel);
}

.section-card .card-body {
    padding: 1.5rem;
}

.status-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--wrc-line);
    background: #f8fafc;
    color: var(--wrc-ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.status-pill.status-available {
    background: var(--status-free-bg);
}

.status-pill.status-booked {
    background: var(--status-booked-bg);
}

.status-pill.status-invoice_issued,
.status-pill.status-pending_payment {
    background: var(--status-invoice-bg);
}

.status-pill.status-paid {
    background: var(--status-paid-bg);
}

.status-pill.status-parking {
    background: var(--status-parking-bg);
}

.status-pill.status-repair {
    background: var(--status-repair-bg);
    color: #8c1d1d;
}

/* Booking flow status pills */
.status-pill.status-draft,
.status-pill.status-pending_manager {
    background: #f1f5f9;
    color: #64748b;
}

.status-pill.status-documents_generated,
.status-pill.status-sent_to_broker,
.status-pill.status-broker_uploaded_docs {
    background: #e0f2fe;
    color: #0369a1;
}

.status-pill.status-docs_sent_to_client {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-pill.status-invoice_accepted_by_client {
    background: #ede9fe;
    color: #6d28d9;
}

.status-pill.status-contract_signed_by_client,
.status-pill.status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.status-pill.status-payment_pending,
.status-pill.status-payment_initiated_by_client {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.status-paid,
.status-pill.status-receipt_generated {
    background: var(--status-paid-bg);
    color: #14532d;
}

.status-pill.status-waiting_key_transfer,
.status-pill.status-key_transfer_pending {
    background: #fff7ed;
    color: #c2410c;
}

.status-pill.status-broker_transferred_keys {
    background: #e0f2fe;
    color: #075985;
}

.status-pill.status-client_received_keys {
    background: #d1fae5;
    color: #064e3b;
}

.status-pill.status-rental_active,
.status-pill.status-active {
    background: #bbf7d0;
    color: #14532d;
    font-weight: 800;
}

.status-pill.status-return_pending {
    background: #fed7aa;
    color: #9a3412;
}

.status-pill.status-waiting_client_return_act_signature {
    background: #fef9c3;
    color: #713f12;
}

.status-pill.status-broker_confirmed_return {
    background: #fef9c3;
    color: #713f12;
}

.status-pill.status-client_confirmed_return {
    background: #fce7f3;
    color: #9d174d;
}

.status-pill.status-rental_finished {
    background: #e2e8f0;
    color: #334155;
    font-weight: 800;
}

.status-pill.status-completed {
    background: #e2e8f0;
    color: #334155;
}

.status-pill.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-block {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--wrc-line);
    border-radius: 1rem;
    background: #f8fafc;
}

.empty-state {
    border: 1px dashed rgba(24, 49, 83, 0.16);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(239, 228, 210, 0.2), rgba(255, 255, 255, 0.92));
}

.empty-state-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    background: rgba(24, 49, 83, 0.08);
}

.table > :not(caption) > * > * {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom-color: var(--wrc-soft-line);
}

.table-responsive {
    border-radius: 0.9rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.required-marker {
    color: #b42318;
}

.form-text,
.text-secondary {
    color: var(--wrc-muted) !important;
}

.form-control,
.form-select {
    border-radius: 0.85rem;
    border-color: rgba(19, 38, 63, 0.14);
    padding: 0.72rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(33, 70, 110, 0.4);
    box-shadow: 0 0 0 0.2rem rgba(33, 70, 110, 0.12);
}

.field-error {
    color: #b42318;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.is-invalid-field {
    border-color: rgba(180, 35, 24, 0.45) !important;
    background: #fff7f7;
}

.success-panel {
    border: 1px solid rgba(18, 128, 74, 0.12);
    border-radius: 1rem;
    background: #f4fbf6;
}

.auth-shell {
    min-height: calc(100vh - 12rem);
    display: grid;
    align-items: center;
}

.auth-card {
    max-width: 520px;
    margin: 0 auto;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-title {
    margin-bottom: 0.75rem;
}

.auth-subtitle {
    color: var(--wrc-muted);
    margin-bottom: 1.5rem;
}

.dashboard-stat-card {
    padding: 1.2rem 1.25rem;
}

.dashboard-stat-label {
    color: var(--wrc-muted);
    font-size: 0.9rem;
}

.dashboard-stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
}

.quick-actions-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quick-action-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--wrc-line);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fff, #f7f9fc);
    text-decoration: none;
    color: inherit;
}

.car-card {
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.car-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 1rem 2.5rem rgba(16, 35, 58, 0.12);
}

.car-list-photo,
.car-photo-preview {
    width: 100%;
    object-fit: cover;
}

.car-list-photo {
    aspect-ratio: 16 / 10;
}

.car-photo-preview {
    max-height: 320px;
}

.car-photo-placeholder {
    display: grid;
    place-items: center;
    min-height: 200px;
    background:
        linear-gradient(135deg, rgba(33, 70, 110, 0.08), rgba(191, 91, 4, 0.1)),
        #f5f7fa;
    color: var(--wrc-muted);
    font-weight: 700;
}

.car-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.document-draft-card {
    border: 1px solid var(--wrc-line);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fff, #fafbfc);
    padding: 1rem;
}

.document-draft-card h3 {
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

.fleet-calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fleet-cal-nav {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--wrc-line);
    border-radius: 0.55rem;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 2px rgba(19, 38, 63, 0.06);
}

.fleet-cal-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    border: none;
    background: transparent;
    color: var(--wrc-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.12s, color 0.12s;
    flex: 0 0 auto;
}

.fleet-cal-nav-arrow:hover {
    background: var(--wrc-bg);
    color: var(--wrc-blue);
}

.fleet-cal-nav-label {
    border: none;
    border-left: 1px solid var(--wrc-line);
    border-right: 1px solid var(--wrc-line);
    background: transparent;
    color: var(--wrc-ink);
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0 1.1rem;
    height: 38px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}

.fleet-cal-nav-label:hover {
    background: var(--wrc-bg);
    color: var(--wrc-blue);
}

.fleet-feedback-host {
    min-height: 1px;
}

.fleet-calendar-shell {
    display: flex;
    align-items: stretch;
    gap: 4px;
}

.fleet-expand-btn {
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--wrc-line);
    border-radius: 0.75rem;
    background: white;
    color: var(--wrc-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.13s, color 0.13s, border-color 0.13s;
}

.fleet-expand-btn:hover {
    background: rgba(33, 70, 110, 0.06);
    color: var(--wrc-blue);
    border-color: rgba(33, 70, 110, 0.2);
}

#fleetCalendarApp {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 991.98px) {
    .fleet-expand-btn {
        display: none;
    }
}

.fleet-inline-note {
    margin-bottom: 1rem;
}

.fleet-loading-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: var(--wrc-muted);
    border: 1px dashed var(--wrc-line);
    border-radius: 1rem;
    background: linear-gradient(180deg, #fff, #fafbfc);
}

.fleet-calendar-grid {
    display: block;
}

.fleet-grid-scroll {
    overflow: auto;
    border: 1px solid var(--wrc-line);
    border-radius: 1rem;
    background: white;
}

.fleet-header-row,
.fleet-row {
    display: grid;
    grid-template-columns: var(--fleet-vehicle-width) max-content;
    min-width: calc(var(--fleet-vehicle-width) + (var(--fleet-day-width) * 28));
}

.fleet-header-row {
    position: sticky;
    z-index: 20;
    background: white;
}

.fleet-header-row:first-child {
    top: 0;
}

.fleet-days-row {
    top: 42px;
    z-index: 19;
}

.fleet-sticky-header,
.fleet-vehicle-cell {
    position: sticky;
    left: 0;
    z-index: 18;
    background: white;
    border-right: 1px solid var(--wrc-line);
}

.fleet-corner-cell,
.fleet-corner-subtitle {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--wrc-line);
}

.fleet-corner-subtitle {
    font-size: 0.85rem;
    color: var(--wrc-muted);
}

.fleet-months-grid,
.fleet-days-grid,
.fleet-day-cells-grid {
    display: grid;
    grid-template-columns: repeat(var(--day-count), var(--fleet-day-width));
}

.fleet-month-cell,
.fleet-day-header {
    display: grid;
    place-items: center;
    min-height: 42px;
    border-bottom: 1px solid var(--wrc-line);
    border-right: 1px solid var(--wrc-soft-line);
    background: white;
    font-size: 0.84rem;
}

.fleet-day-header {
    gap: 0.15rem;
    padding: 0.35rem 0.1rem;
}

.fleet-day-header strong {
    font-size: 0.95rem;
}

.fleet-day-header.is-weekend,
.fleet-day-cell.is-weekend {
    background: #fafbfd;
}

.fleet-day-header.is-today,
.fleet-day-cell.is-today {
    box-shadow: inset 0 -2px 0 rgba(33, 70, 110, 0.8);
}

.fleet-row {
    border-bottom: 1px solid var(--wrc-soft-line);
}

.fleet-vehicle-cell {
    display: flex;
    align-items: center;
    min-height: var(--fleet-row-height);
    padding: 0 1rem;
}

.fleet-row:hover .fleet-vehicle-cell,
.fleet-row:hover .fleet-track,
.fleet-row:hover .fleet-xl-track {
    background: #fcfdff;
}

.fleet-vehicle-inline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
}

.fleet-vehicle-title {
    font-weight: 800;
    color: var(--wrc-ink);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fleet-vehicle-title:hover {
    color: var(--wrc-blue);
}

.fleet-vehicle-subtitle,
.fleet-vehicle-caption {
    color: var(--wrc-muted);
    font-size: 0.84rem;
}

.fleet-vehicle-meta-item {
    color: var(--wrc-muted);
    font-size: 0.84rem;
}

.fleet-vehicle-subtitle,
.fleet-vehicle-meta-item,
.fleet-vehicle-cell .status-pill {
    flex: 0 0 auto;
}

.fleet-vehicle-caption {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fleet-track {
    position: relative;
    min-width: calc(var(--fleet-day-count, var(--day-count)) * var(--fleet-day-width));
    background: white;
}

.fleet-day-cells-grid {
    position: relative;
}

.fleet-day-cell {
    width: var(--fleet-day-width);
    height: var(--fleet-row-height);
    border: 0;
    border-right: 1px solid var(--wrc-soft-line);
    border-bottom: 1px solid var(--wrc-soft-line);
    background: white;
}

.fleet-day-cell.is-selecting {
    background: rgba(33, 70, 110, 0.12);
}

.fleet-day-cell.is-hover-column,
.fleet-day-header.is-hover-column {
    background: rgba(33, 70, 110, 0.06);
}

.fleet-bars-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fleet-booking-bar {
    position: absolute;
    top: 5px;
    left: calc((var(--start-index) * var(--fleet-day-width)) + 4px);
    width: calc((var(--span-days) * var(--fleet-day-width)) - 8px);
    min-width: calc(var(--fleet-day-width) - 8px);
    height: calc(var(--fleet-row-height) - 10px);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.55rem;
    border: 1px solid rgba(19, 38, 63, 0.08);
    border-radius: 0.7rem;
    color: var(--wrc-ink);
    font-size: 0.78rem;
    font-weight: 700;
    overflow: hidden;
    pointer-events: auto;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.fleet-booking-bar.is-clickable {
    cursor: pointer;
}

/* Fleet calendar bar colors — per booking status */
.fleet-booking-bar.status-draft,
.fleet-booking-bar.status-pending_manager,
.fleet-booking-bar.status-booked {
    background: #fef9c3;
    color: #713f12;
}

.fleet-booking-bar.status-documents_generated,
.fleet-booking-bar.status-sent_to_broker,
.fleet-booking-bar.status-broker_uploaded_docs,
.fleet-booking-bar.status-invoice_issued {
    background: #e0f2fe;
    color: #0369a1;
}

.fleet-booking-bar.status-docs_sent_to_client {
    background: #dbeafe;
    color: #1d4ed8;
}

.fleet-booking-bar.status-invoice_accepted_by_client,
.fleet-booking-bar.status-contract_signed_by_client,
.fleet-booking-bar.status-confirmed {
    background: #ede9fe;
    color: #6d28d9;
}

.fleet-booking-bar.status-payment_pending,
.fleet-booking-bar.status-payment_initiated_by_client {
    background: #ffedd5;
    color: #c2410c;
}

.fleet-booking-bar.status-paid,
.fleet-booking-bar.status-receipt_generated,
.fleet-booking-bar.status-waiting_key_transfer,
.fleet-booking-bar.status-broker_transferred_keys,
.fleet-booking-bar.status-client_received_keys,
.fleet-booking-bar.status-key_transfer_pending {
    background: var(--status-paid-bg);
    color: #14532d;
}

.fleet-booking-bar.status-rental_active,
.fleet-booking-bar.status-active {
    background: #bbf7d0;
    color: #14532d;
}

.fleet-booking-bar.status-return_pending,
.fleet-booking-bar.status-broker_confirmed_return,
.fleet-booking-bar.status-client_confirmed_return {
    background: #fed7aa;
    color: #9a3412;
}

.fleet-booking-bar.status-rental_finished,
.fleet-booking-bar.status-completed {
    background: #e2e8f0;
    color: #475569;
}

.fleet-booking-bar.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.fleet-booking-bar.status-parking {
    background: var(--status-parking-bg);
    color: #1e3a5f;
}

.fleet-booking-bar.status-repair {
    background: var(--status-repair-bg);
    color: #8c1d1d;
}

.fleet-booking-bar-status {
    color: var(--wrc-muted);
    font-weight: 600;
}

.fleet-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--today-index) * var(--fleet-day-width));
    width: 2px;
    background: rgba(33, 70, 110, 0.45);
    pointer-events: none;
    z-index: 10;
}

/* ============================================================
   Fleet calendar — Excel-like grid cells
   ============================================================ */

.fleet-xl-track {
    position: relative;
    min-width: calc(var(--day-count) * var(--fleet-day-width));
    background: white;
}

.fleet-xl-cells-grid {
    display: grid;
    grid-template-columns: repeat(var(--day-count), var(--fleet-day-width));
    position: relative;
}

.fleet-xl-cell {
    position: relative;
    width: var(--fleet-day-width);
    height: var(--fleet-row-height);
    border: 0;
    border-right: 1px solid var(--wrc-soft-line);
    background: white;
    padding: 0;
    cursor: default;
    overflow: visible;
    z-index: 1;
}

.fleet-xl-cell.is-free {
    cursor: pointer;
}

.fleet-xl-cell.is-free:hover {
    background: rgba(33, 70, 110, 0.05);
}

.fleet-xl-cell.is-free.is-weekend {
    background: #fafbfd;
}

.fleet-xl-cell.is-free.is-hover-column {
    background: rgba(33, 70, 110, 0.06);
}

.fleet-xl-cell.is-today {
    box-shadow: inset 0 -2px 0 rgba(33, 70, 110, 0.8);
}

.fleet-xl-cell.is-selecting {
    background: rgba(33, 70, 110, 0.14) !important;
}

.fleet-xl-cell.is-free.is-pending-start {
    background: rgba(33, 70, 110, 0.28) !important;
    box-shadow: inset 0 0 0 2px rgba(33, 70, 110, 0.6);
}

.fleet-xl-cell.is-free.is-pending-range {
    background: rgba(33, 70, 110, 0.1) !important;
}

.fleet-xl-cell.is-booked.is-pending-range {
    box-shadow: inset 0 0 0 2px #ef4444, inset 0 1px 0 rgba(0, 0, 0, 0.09), inset 0 -1px 0 rgba(0, 0, 0, 0.09);
}

.fleet-xl-cell.is-booked {
    cursor: pointer;
    z-index: 2;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.09), inset 0 -1px 0 rgba(0, 0, 0, 0.09);
}

.fleet-xl-cell.is-booked.is-today {
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.09), inset 0 -2px 0 rgba(33, 70, 110, 0.8);
}

.fleet-xl-cell.is-booking-start,
.fleet-xl-cell.is-booking-only {
    border-left: 2px solid rgba(0, 0, 0, 0.18);
    z-index: 3;
}

.fleet-xl-cell.is-booking-end {
    border-right: 1px solid rgba(0, 0, 0, 0.18);
}

/* Floating label spanning the full booking width */
.xl-cell-label {
    position: absolute;
    top: 0;
    left: 5px;
    height: 100%;
    width: calc(var(--span) * var(--fleet-day-width) - 10px);
    line-height: var(--fleet-row-height);
    font-size: 0.73rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 5;
    color: inherit;
}

/* Status background colors for Excel cells */
.fleet-xl-cell.status-draft,
.fleet-xl-cell.status-pending_manager,
.fleet-xl-cell.status-booked {
    background: #fef9c3;
    color: #713f12;
}

.fleet-xl-cell.status-documents_generated,
.fleet-xl-cell.status-sent_to_broker,
.fleet-xl-cell.status-broker_uploaded_docs,
.fleet-xl-cell.status-invoice_issued {
    background: #e0f2fe;
    color: #0369a1;
}

.fleet-xl-cell.status-docs_sent_to_client {
    background: #dbeafe;
    color: #1d4ed8;
}

.fleet-xl-cell.status-invoice_accepted_by_client,
.fleet-xl-cell.status-contract_signed_by_client,
.fleet-xl-cell.status-confirmed {
    background: #ede9fe;
    color: #6d28d9;
}

.fleet-xl-cell.status-payment_pending,
.fleet-xl-cell.status-payment_initiated_by_client {
    background: #ffedd5;
    color: #c2410c;
}

.fleet-xl-cell.status-paid,
.fleet-xl-cell.status-receipt_generated,
.fleet-xl-cell.status-waiting_key_transfer,
.fleet-xl-cell.status-broker_transferred_keys,
.fleet-xl-cell.status-client_received_keys,
.fleet-xl-cell.status-key_transfer_pending {
    background: var(--status-paid-bg);
    color: #14532d;
}

.fleet-xl-cell.status-rental_active,
.fleet-xl-cell.status-active {
    background: #bbf7d0;
    color: #14532d;
}

.fleet-xl-cell.status-return_pending,
.fleet-xl-cell.status-broker_confirmed_return,
.fleet-xl-cell.status-client_confirmed_return {
    background: #fed7aa;
    color: #9a3412;
}

.fleet-xl-cell.status-rental_finished,
.fleet-xl-cell.status-completed {
    background: #e2e8f0;
    color: #475569;
}

.fleet-xl-cell.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.fleet-xl-cell.status-parking {
    background: var(--status-parking-bg);
    color: #1e3a5f;
}

.fleet-xl-cell.status-repair {
    background: var(--status-repair-bg);
    color: #8c1d1d;
}

/* Status legend */
.fleet-legend {
    font-size: 0.78rem;
    color: var(--wrc-muted);
}

.fleet-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.fleet-legend-dot {
    width: 16px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex: 0 0 auto;
}

.fleet-legend-dot.status-pending_manager { background: #fef9c3; }
.fleet-legend-dot.status-documents_generated { background: #e0f2fe; }
.fleet-legend-dot.status-docs_sent_to_client { background: #dbeafe; }
.fleet-legend-dot.status-payment_initiated_by_client { background: #ffedd5; }
.fleet-legend-dot.status-receipt_generated { background: var(--status-paid-bg); }
.fleet-legend-dot.status-rental_active { background: #bbf7d0; }
.fleet-legend-dot.status-return_pending { background: #fed7aa; }
.fleet-legend-dot.status-rental_finished { background: #e2e8f0; }
.fleet-legend-dot.status-repair { background: var(--status-repair-bg); }
.fleet-legend-dot.status-parking { background: var(--status-parking-bg); }
.fleet-legend-dot.status-cancelled { background: #fee2e2; }

.fleet-booking-detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.fleet-detail-card {
    border: 1px solid var(--wrc-line);
    border-radius: 1rem;
    padding: 1rem;
    background: linear-gradient(180deg, #fff, #fafbfc);
}

.fleet-detail-title {
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.fleet-detail-list {
    display: grid;
    gap: 0.65rem;
}

.fleet-detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
}

.fleet-detail-list span {
    color: var(--wrc-muted);
}

.fleet-document-preview {
    border: 1px solid var(--wrc-line);
    border-radius: 0.9rem;
    padding: 0.9rem;
    background: white;
}

.fleet-document-preview + .fleet-document-preview {
    margin-top: 0.9rem;
}

.fleet-document-preview h3 {
    font-size: 0.98rem;
    margin-bottom: 0.4rem;
}

.fleet-mobile-list {
    display: none;
}

@media (max-width: 991.98px) {
    .hero-panel {
        border-radius: 1rem;
    }

    .app-user-panel {
        margin-top: 1rem;
    }

    .fleet-mobile-list {
        display: block;
    }

    .fleet-calendar-grid {
        display: none;
    }

    :root {
        --fleet-vehicle-width: 220px;
        --fleet-day-width: 36px;
    }
}

@media (min-width: 992px) {
    .app-user-panel {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .w-lg-auto {
        width: auto !important;
    }
}

/* ============================================================
   Web-app layer: mobile topbar, bottom nav, app-shell, cards
   ============================================================ */

.app-mobile-topbar {
    display: none;
}

.app-bottom-nav {
    display: none;
}

@media (max-width: 991.98px) {
    body.app-body {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .app-navbar {
        display: none !important;
    }

    .app-mobile-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1030;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.6rem 0.9rem;
        padding-top: calc(0.6rem + env(safe-area-inset-top, 0px));
        height: calc(var(--top-header-height) + env(safe-area-inset-top, 0px));
        background:
            radial-gradient(circle at top left, rgba(255, 255, 255, 0.14), transparent 35%),
            linear-gradient(135deg, #0f2237, #1e456b 62%, #b45a11 150%);
        color: #fff;
        box-shadow: 0 1px 3px rgba(16, 35, 58, 0.18);
    }

    .app-mobile-topbar .app-topbar-brand {
        color: #fff;
        text-decoration: none;
        font-family: "Space Grotesk", "Manrope", sans-serif;
        font-weight: 700;
        font-size: 1.05rem;
        letter-spacing: -0.01em;
    }

    .app-mobile-topbar .app-topbar-meta {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        font-size: 0.78rem;
        color: rgba(255, 255, 255, 0.85);
    }

    .app-mobile-topbar .app-topbar-more {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 1.1rem;
    }

    main.container {
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }

    .app-bottom-nav {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: #ffffff;
        border-top: 1px solid var(--wrc-border);
        box-shadow: 0 -4px 14px rgba(16, 35, 58, 0.08);
    }

    .app-bottom-nav .app-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 4px 2px;
        color: var(--wrc-muted);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 600;
        position: relative;
        min-height: 44px;
        min-width: 0;
        background: transparent;
        border: 0;
    }

    .app-bottom-nav .app-bottom-nav-item span {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-bottom-nav .app-bottom-nav-item i {
        font-size: 1.25rem;
        line-height: 1;
    }

    .app-bottom-nav .app-bottom-nav-item.is-active,
    .app-bottom-nav .app-bottom-nav-item:active {
        color: var(--wrc-blue);
    }

    .app-bottom-nav .app-bottom-nav-item.is-active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 22%;
        right: 22%;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--wrc-accent);
    }

    .app-bottom-nav .app-bottom-nav-item .app-bottom-nav-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 22px);
        background: var(--wrc-accent);
        color: #fff;
        font-size: 0.65rem;
        line-height: 1;
        padding: 2px 5px;
        border-radius: 999px;
        font-weight: 700;
        min-width: 16px;
        text-align: center;
    }

    .rental-day-bubbles {
        display: flex;
        gap: 3px;
        align-items: center;
        justify-content: center;
    }

    .rental-day-bubble {
        width: 19px;
        height: 19px;
        border-radius: 50%;
        background: #e4e8ee;
        color: #8a95a3;
        font-size: 0.62rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .app-bottom-nav-item.is-active .rental-day-bubble,
    .app-bottom-nav-item:active .rental-day-bubble {
        background: #22a96e;
        color: #fff;
    }

    .app-bottom-nav-item.is-active .rental-bubble-active,
    .app-bottom-nav-item:active .rental-bubble-active {
        background: #22a96e;
        color: #fff;
    }
    .app-bottom-nav-item.is-active .rental-bubble-parking,
    .app-bottom-nav-item:active .rental-bubble-parking {
        background: #f0c030;
        color: #5a4000;
    }
    .app-bottom-nav-item.is-active .rental-bubble-repair,
    .app-bottom-nav-item:active .rental-bubble-repair {
        background: #9aa0a8;
        color: #fff;
    }
}

/* "Ещё" offcanvas — slides up from bottom on mobile */
@media (max-width: 991.98px) {
    .app-more-offcanvas.offcanvas-bottom {
        height: auto;
        max-height: 80vh;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

.rental-legend { font-size: .8rem; }
.rental-legend-item { display: flex; align-items: center; gap: .35rem; }
.rental-legend-bubble {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: .68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.rental-legend-label { color: #6c757d; white-space: nowrap; }

.app-more-offcanvas .offcanvas-header {
    padding: 1rem 1.2rem 0.5rem;
}

.app-more-offcanvas .offcanvas-body {
    padding: 0.5rem 1rem 1.2rem;
}

.app-more-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.app-more-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 0.9rem;
    border-radius: 0.9rem;
    border: 1px solid var(--wrc-border);
    background: var(--wrc-surface-raised);
    color: var(--wrc-ink);
    text-decoration: none;
    font-weight: 600;
    min-height: 56px;
    text-align: left;
}

.app-more-item i {
    flex: 0 0 24px;
    font-size: 1.25rem;
    color: var(--wrc-blue);
}

.app-more-item.is-danger {
    color: var(--wrc-danger);
}

.app-more-item.is-danger i {
    color: var(--wrc-danger);
}

.app-more-item .app-more-arrow {
    margin-left: auto;
    color: var(--wrc-muted);
}

.app-more-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--wrc-muted);
    font-weight: 700;
    margin: 0.4rem 0 0.5rem;
}

.app-more-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--wrc-border);
    margin-bottom: 0.6rem;
}

.app-more-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--wrc-blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

/* ============================================================
   Mobile cards — generic + per-page
   ============================================================ */

.app-card {
    border: 1px solid var(--wrc-border);
    border-radius: 1rem;
    background: var(--wrc-surface);
    padding: 0.9rem 1rem;
}

.app-card-raised {
    background: var(--wrc-surface);
    box-shadow: 0 6px 16px rgba(16, 35, 58, 0.06);
}

.app-mobile-cards {
    display: none;
}

@media (max-width: 767.98px) {
    .app-desktop-table {
        display: none !important;
    }

    .app-mobile-cards {
        display: grid;
        gap: 0.7rem;
    }
}

.app-mobile-card {
    border: 1px solid var(--wrc-border);
    border-radius: 1rem;
    background: var(--wrc-surface);
    padding: 0.9rem 1rem;
    box-shadow: 0 4px 12px rgba(16, 35, 58, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.app-mobile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.app-mobile-card-head > * {
    min-width: 0;
}

.app-mobile-card-title {
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.app-mobile-card-subtitle {
    color: var(--wrc-muted);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Status-pill inside card head: keep it compact, allow wrap on narrow screens */
.app-mobile-card-head .status-pill {
    flex: 0 1 auto;
    max-width: 50%;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
}

@media (max-width: 575.98px) {
    .app-mobile-card-head .status-pill {
        font-size: 0.72rem;
        padding: 0.28rem 0.55rem;
        max-width: 48%;
    }
}

.app-mobile-card-rows {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.app-mobile-card-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
}

.app-mobile-card-row span {
    color: var(--wrc-muted);
}

.app-mobile-card-row strong {
    color: var(--wrc-ink);
    text-align: right;
    word-break: break-word;
}

.app-mobile-card-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

/* All direct flex children share the row; w-100 inside is neutralised */
.app-mobile-card-cta > * {
    flex: 1 1 auto;
    min-width: 0;
}

.app-mobile-card-cta > .app-cta-secondary,
.app-mobile-card-cta > .dropdown.app-cta-secondary {
    flex: 0 0 auto;
}

.booking-amount-label {
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-left: auto;
}

.app-mobile-card-cta > form,
.app-mobile-card-cta > .flex-grow-1 {
    flex: 1 1 auto;
    min-width: 0;
}

/* Inside the CTA row, w-100 on inner buttons should still mean "fill the parent slot",
   not 100% of the row — neutralise on the wrapper to avoid wrap. */
.app-mobile-card-cta > .w-100,
.app-mobile-card-cta > a.w-100 {
    width: auto !important;
}

.app-mobile-card-cta .btn {
    min-height: 44px;
}

.app-mobile-card-note {
    border-top: 1px dashed var(--wrc-border);
    padding-top: 0.55rem;
    font-size: 0.85rem;
    color: var(--wrc-muted);
}

.app-mobile-card-note.is-warning {
    color: var(--wrc-warning);
}

.app-mobile-card-note.is-success {
    color: var(--wrc-success);
}

/* Mobile actions menu button (3-dot) */
.app-card-actions-menu .dropdown-toggle::after {
    display: none;
}

.app-card-actions-menu .dropdown-menu {
    border-radius: 0.8rem;
    border: 1px solid var(--wrc-border);
    box-shadow: 0 14px 28px rgba(16, 35, 58, 0.12);
}

.app-card-actions-menu .dropdown-item {
    padding: 0.6rem 0.85rem;
    font-weight: 600;
    border-radius: 0.55rem;
}

/* Status dot — compact inline indicator */
.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--wrc-muted);
    margin-right: 0.35rem;
    vertical-align: middle;
}

.status-dot.is-success { background: #16a34a; }
.status-dot.is-warning { background: #d97706; }
.status-dot.is-danger { background: #dc2626; }
.status-dot.is-info { background: #2563eb; }

/* Quick action icons */
.quick-action-tile {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-action-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(16, 35, 58, 0.08);
    text-decoration: none;
}

.quick-action-tile i {
    font-size: 1.4rem;
    color: var(--wrc-blue);
    flex: 0 0 auto;
}

.quick-action-tile .quick-action-body {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.quick-action-tile .quick-action-label {
    font-weight: 700;
    line-height: 1.2;
}

.quick-action-tile .quick-action-hint {
    color: var(--wrc-muted);
    font-size: 0.78rem;
}

/* Hero compact for mobile */
@media (max-width: 767.98px) {
    .hero-panel {
        padding: 1.1rem 1rem !important;
        border-radius: 1rem;
    }

    .hero-panel h1 {
        font-size: 1.45rem;
    }

    .hero-panel .lead {
        font-size: 0.95rem;
    }
}

/* iOS form zoom prevention + bigger touch targets */
@media (max-width: 767.98px) {
    .form-control,
    .form-select,
    textarea.form-control,
    input.form-control {
        font-size: 16px;
        min-height: 44px;
    }

    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
    }

    .table-responsive {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
}

/* Prevent horizontal scroll bleeding */
@media (max-width: 991.98px) {
    body {
        overflow-x: hidden;
    }
}

/* Filters accordion on mobile (calendar) */
@media (max-width: 767.98px) {
    .app-mobile-filters-toggle {
        display: flex;
    }
}

.app-mobile-filters-toggle {
    display: none;
}

/* Modal: fullscreen on small screens */
@media (max-width: 575.98px) {
    .modal-dialog.modal-mobile-fullscreen {
        max-width: 100%;
        margin: 0;
        height: 100%;
    }

    .modal-dialog.modal-mobile-fullscreen .modal-content {
        height: 100%;
        border-radius: 0;
    }
}

/* Car-card actions: equal-width buttons on mobile */
@media (max-width: 575.98px) {
    .car-card-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-height: 44px;
    }
}

/* Empty state icon — use Bootstrap Icon glyph */
.empty-state .empty-state-icon::before {
    content: "\F1B0"; /* bi-inbox */
    font-family: "bootstrap-icons" !important;
    color: var(--wrc-muted);
    font-size: 1.4rem;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}


/* Tasks mobile card */
.task-card {
    border: 1px solid var(--wrc-border);
    border-radius: 1rem;
    background: var(--wrc-surface);
    padding: 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 4px 12px rgba(16, 35, 58, 0.05);
}

.task-card .task-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: flex-start;
}

.task-card .task-card-type {
    font-size: 0.75rem;
    color: var(--wrc-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.task-card .task-card-title {
    font-weight: 700;
    line-height: 1.25;
}

.task-card .task-card-meta {
    display: grid;
    gap: 0.3rem;
    font-size: 0.86rem;
}

.task-card .task-card-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.task-card .task-card-meta-row span {
    color: var(--wrc-muted);
    white-space: nowrap;
}

.task-card .task-card-meta-row strong {
    text-align: right;
}

.task-card .task-card-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.task-card .task-card-actions .btn {
    flex: 1 1 calc(50% - 0.2rem);
    min-height: 44px;
}

.task-card-amount-warn {
    border: 1px solid #f59e0b;
    background: #fef3c7;
    color: #92400e;
    border-radius: 0.6rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
}

/* Step progress indicator (booking wizard + task cards) */
.qb-step-dot {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid #dee2e6; background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; color: #6c757d;
    flex-shrink: 0; transition: all .2s;
}
.qb-step-dot.active { border-color: #0d6efd; background: #0d6efd; color: #fff; }
.qb-step-dot.done   { border-color: #198754; background: #198754; color: #fff; }
.qb-step-line { flex: 1; height: 2px; background: #dee2e6; transition: background .2s; }
.qb-step-line.done  { background: #198754; }
.qb-step-dot-sm { width: 22px; height: 22px; font-size: .68rem; }

/* Key-flow strip (broker chain: M→B→C or C→B→M) */
.kf-strip {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 3px 0 0;
}
.kf-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.kf-circle {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #f0f2f5;
    color: #6c757d;
    font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #dee2e6;
}
.kf-lbl {
    font-size: 9px; color: #adb5bd;
    max-width: 46px; text-align: center; line-height: 1.15;
    white-space: nowrap;
}
.kf-seg {
    flex: 1;
    height: 2px;
    background: #dee2e6;
    margin-top: 9px;
}
.kf-circle.kf-has-key {
    background: #fd7e14;
    border-color: #fd7e14;
    color: #fff;
    font-size: 10px;
}

/* Generic mobile cards alias for other pages */
.client-mobile-card,
.user-mobile-card,
.transfer-mobile-card,
.kassa-balance-banner {
    border-radius: 1.25rem;
    padding: 1.1rem 1.25rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1.5px solid transparent;
}

.kassa-balance-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 35, 58, 0.12);
}

.kassa-balance-positive {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.kassa-balance-negative {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    border-color: #fca5a5;
}

.kassa-balance-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.kassa-balance-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
    color: #16a34a;
}

.kassa-balance-negative .kassa-balance-icon {
    color: #dc2626;
}

.kassa-balance-body {
    flex: 1;
    min-width: 0;
}

.kassa-balance-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #15803d;
    margin-bottom: 0.1rem;
}

.kassa-balance-negative .kassa-balance-label {
    color: #b91c1c;
}

.kassa-balance-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: #14532d;
    line-height: 1.15;
}

.kassa-balance-negative .kassa-balance-value {
    color: #7f1d1d;
}

.kassa-balance-arrow {
    font-size: 1rem;
    color: #16a34a;
    flex-shrink: 0;
    opacity: 0.6;
}

.kassa-balance-negative .kassa-balance-arrow {
    color: #dc2626;
}

.money-kassa-total {
    text-align: center;
    padding: 1.25rem 1rem;
    background: var(--wrc-surface);
    border: 1px solid var(--wrc-border);
    border-radius: 1rem;
    box-shadow: 0 4px 10px rgba(16, 35, 58, 0.04);
}

.money-kassa-total-label {
    font-size: var(--text-sm);
    color: var(--bs-secondary);
    margin-bottom: 0.25rem;
}

.money-kassa-total-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.1;
}

.money-date-sep {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--bs-body-color);
    text-align: center;
    padding: 0.75rem 0 0.25rem;
}

.money-mobile-row,
.expense-mobile-card {
    border: 1px solid var(--wrc-border);
    border-radius: 1rem;
    background: var(--wrc-surface);
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 10px rgba(16, 35, 58, 0.04);
}

.money-mobile-row,
.expense-mobile-card {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
}

.money-mobile-row > *,
.expense-mobile-card > * {
    min-width: 0;
}

/* Money summary rows */
.money-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--wrc-border);
    gap: 1rem;
}

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

.money-summary-result {
    font-size: 1.05rem;
}

/* Money KPI cards */
.money-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.15rem;
}

.money-kpi-label {
    font-size: 0.85rem;
    color: var(--wrc-muted);
    font-weight: 600;
}

.money-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.money-kpi.is-income .money-kpi-value { color: var(--wrc-success); }
.money-kpi.is-expense .money-kpi-value { color: var(--wrc-danger); }

/* "Pull down" feel on bottom-nav offcanvas trigger */
.app-more-handle {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: var(--wrc-border-strong);
    margin: 0.4rem auto 0.6rem;
}

/* Hide-on-mobile / show-on-mobile helpers */
@media (max-width: 767.98px) {
    .hide-on-mobile { display: none !important; }
}

@media (min-width: 768px) {
    .show-on-mobile { display: none !important; }
}

/* Active state highlight on links/buttons large enough to tap */
@media (max-width: 991.98px) {
    .nav-link, .btn { -webkit-tap-highlight-color: rgba(33, 70, 110, 0.15); }
}

/* Booking date track */
.booking-date-track {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.booking-date-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--wrc-text);
}
.booking-date-bar {
    flex: 1;
    height: 4px;
    background: var(--wrc-border);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.booking-date-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: #16a34a;
    border-radius: 2px;
    transition: width 0.3s ease;
}


/* ============================================================
   Client portal — minimalist cabinet
   ============================================================ */
.cp-shell {
    max-width: 760px;
    margin: 0 auto;
}

.cp-profile-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cp-avatar {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    background: linear-gradient(135deg, var(--wrc-blue), var(--wrc-accent));
}

.cp-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--wrc-muted);
    margin-bottom: 0.7rem;
}

.cp-doc-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--wrc-success);
}

/* Booking card */
.cp-booking {
    border: 1px solid var(--wrc-border);
    border-radius: 1.1rem;
    background: var(--wrc-surface);
    box-shadow: 0 6px 16px rgba(16, 35, 58, 0.05);
    overflow: hidden;
}

.cp-booking + .cp-booking {
    margin-top: 1rem;
}

.cp-booking-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.15rem 1.25rem 0.5rem;
}

.cp-booking-car {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}

.cp-booking-plate {
    color: var(--wrc-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.cp-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0 1.25rem;
    padding: 0.5rem 1.25rem 1rem;
}

.cp-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.4rem 0;
}

.cp-meta-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--wrc-muted);
    font-weight: 600;
}

.cp-meta-value {
    font-weight: 600;
}

/* Adaptive action zone */
.cp-action {
    margin: 0 1.25rem 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 0.9rem;
    background: var(--wrc-surface-raised);
    border: 1px solid var(--wrc-soft-line);
}

.cp-action--accent {
    background: #eff5ff;
    border-color: #cfe0fb;
}

.cp-action--warn {
    background: #fff8ec;
    border-color: #fbe3bd;
}

.cp-action--success {
    background: #f0fbf4;
    border-color: #c2eccf;
}

.cp-action-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cp-action-text {
    color: var(--wrc-muted);
    font-size: 0.88rem;
    margin-bottom: 0.85rem;
}

.cp-action-text:last-child {
    margin-bottom: 0;
}

.cp-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cp-action-btns .btn {
    flex: 1 1 auto;
}

/* Document checklist rows */
.cp-doc-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--wrc-soft-line);
}

.cp-doc-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.cp-doc-ico {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--wrc-line);
    color: var(--wrc-muted);
    font-size: 1rem;
}

.cp-doc-row.is-done .cp-doc-ico {
    background: var(--status-paid-bg);
    border-color: transparent;
    color: #14532d;
}

.cp-doc-info {
    flex: 1 1 auto;
    min-width: 0;
}

.cp-doc-name {
    font-weight: 600;
    line-height: 1.2;
}

.cp-doc-status {
    font-size: 0.8rem;
    color: var(--wrc-muted);
}

.cp-doc-status.is-done {
    color: var(--wrc-success);
}

.cp-doc-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

/* Next-step hint footer */
.cp-hint {
    padding: 0.95rem 1.1rem;
    margin: 0 1.25rem 1.25rem;
    border-radius: 0.9rem;
    border: 1px dashed var(--wrc-border);
    color: var(--wrc-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.cp-hint .cp-hint-step {
    color: var(--wrc-accent);
    font-weight: 700;
}

.cp-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

@media (max-width: 575.98px) {
    .cp-doc-row {
        flex-wrap: wrap;
    }
    .cp-doc-actions {
        width: 100%;
    }
    .cp-doc-actions .btn {
        flex: 1 1 auto;
    }
}

/* ── Location choice buttons (handover form) ─────────────────────── */
.location-choice-btn {
    display: flex;
    align-items: center;
    padding: .55rem .75rem;
    border: 1.5px solid var(--wrc-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    color: var(--wrc-text);
    background: var(--wrc-surface);
    transition: border-color .15s, background .15s;
    margin: 0;
    user-select: none;
}
.location-choice-btn.active {
    border-color: var(--wrc-primary, #21466e);
    background: color-mix(in srgb, var(--wrc-primary, #21466e) 8%, transparent);
    font-weight: 600;
}
