/* ===== Self-hosted fonts ===== */
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url("../fonts/nunito-300-nQjjZd5.woff2") format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/nunito-400-nQjjZd5.woff2") format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/nunito-600-nQjjZd5.woff2") format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/nunito-700-nQjjZd5.woff2") format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/nunito-800-nQjjZd5.woff2") format('woff2');
}
@font-face {
    font-family: 'Bebas Neue';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/bebas-neue-400-c3igBv2.woff2") format('woff2');
}

/* ===== CDS App - CSS Variables & Theme ===== */
:root {
    /* Brand palette */
    --cds-navy: #1B2A4A;
    --cds-navy-light: #2A3D66;
    --cds-navy-deep: #2a3164;
    --cds-teal: #1B2A4A;
    --cds-teal-dark: #152035;
    --cds-teal-chat: #2A3D66;
    --cds-white: #FFFFFF;
    --cds-gray-light: #F5F5F5;
    --cds-gray: #E0E0E0;
    --cds-gray-text: #888888;
    --cds-red: #E74C3C;
    --cds-green: #2ECC71;
    --cds-green-toggle: #2dcf63;
    --cds-orange: #F39C12;

    /* CONNECT DRIVER SOLUTIONS — teal CTA / active states (see figma_ui_parity plan + cds_platform accents) */
    --cds-brand-accent: #00A89E;
    --cds-brand-accent-dark: #008579;
    --cds-platform-navy: #20254F;

    /* Semantic tokens */
    --cds-text-dark: #1B2A4A;
    --cds-text-light: #FFFFFF;
    --cds-body-bg: #20254F;
    --cds-surface: #eceef3;
    --cds-surface-alt: #eef0f5;
    --cds-border-accent: #586595;
    --cds-border-card: #8fdde3;
    --cds-border-input: #3e4778;
    --cds-nav-bg: #eef1f7;
    --cds-nav-active-fill: #dfe5ef;
    --cds-nav-border: #20254F;

    /* Gradients */
    --cds-gradient-teal: linear-gradient(135deg, #1B2A4A 0%, #2A3D66 100%);
    --cds-gradient-teal-tab: linear-gradient(135deg, #1B2A4A 0%, #253562 100%);
    --cds-gradient-teal-active: linear-gradient(135deg, #2A3D66 0%, #3a5080 100%);
    --cds-gradient-stat: linear-gradient(135deg, #1B2A4A 0%, #2A3D66 100%);

    /* Effects */
    --cds-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --cds-shadow-hover: 0 6px 20px rgba(0,0,0,0.13);
    --cds-shadow-nav: 0 -2px 10px rgba(16, 20, 48, 0.14);
    --cds-shadow-sidebar: 0 -12px 36px rgba(0, 0, 0, 0.26);
    --cds-radius: 12px;
    --cds-radius-lg: 20px;

    /* Layout */
    --cds-bottom-nav-height: 88px;
    --cds-header-height: 56px;
    --cds-sidebar-width: 260px;

    /* Typography */
    --cds-display-font: 'Bebas Neue', 'Nunito', sans-serif;
    --cds-body-font: 'Nunito', 'Segoe UI', sans-serif;

    /* Spacing scale (design-system parity when Figma MCP vars unavailable) */
    --cds-space-1: 4px;
    --cds-space-2: 8px;
    --cds-space-3: 12px;
    --cds-space-4: 16px;
    --cds-space-5: 20px;
    --cds-space-6: 24px;

    /* Shell / surfaces */
    --cds-eu-blue: #003399;
    --cds-header-glass-bg: rgba(27, 42, 74, 0.42);
    --cds-header-glass-border: rgba(255, 255, 255, 0.12);
    --cds-header-blur: 14px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Mobile tap feedback */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

/* App shell — same cds_platform eye hero + navy veil as login (all routes) */
body {
    font-family: var(--cds-body-font);
    background-color: var(--cds-platform-navy);
    background-image:
        linear-gradient(105deg, rgba(32, 37, 79, 0.94) 0%, rgba(32, 37, 79, 0.9) 50%, rgba(26, 36, 68, 0.82) 100%),
        url('/img/background-eye-c.jpg');
    background-size: cover;
    background-position: left center, center bottom;
    background-repeat: no-repeat;
    color: var(--cds-text-light);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Login-only layout (background inherits global eye shell on body) */
body.login-screen .app-container {
    padding-bottom: 0;
}

body.login-screen .app-main {
    padding: 0 16px;
    padding-top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Layout ===== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: calc(var(--cds-bottom-nav-height) + 16px);
}

.app-main {
    padding: 0 16px;
    padding-top: var(--cds-header-height);
}

/* ===== Header ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--cds-header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    z-index: 100;
    background: var(--cds-header-glass-bg);
    backdrop-filter: blur(var(--cds-header-blur));
    -webkit-backdrop-filter: blur(var(--cds-header-blur));
    border-bottom: 1px solid var(--cds-header-glass-border);
    box-shadow: 0 6px 24px rgba(15, 18, 42, 0.18);
}

.app-header .header-logo {
    height: 28px;
    width: auto;
    display: block;
}

.app-header .header-profile {
    position: absolute;
    right: var(--cds-space-4);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cds-white);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cds-platform-navy);
    cursor: pointer;
    text-decoration: none;
}

.app-header .header-profile svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.app-header .header-profile:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 2px;
}

.app-header .header-menu {
    position: absolute;
    left: var(--cds-space-4);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: var(--cds-navy-light);
    color: var(--cds-text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-header .header-menu svg {
    width: 18px;
    height: 18px;
}

.app-header .header-back {
    position: absolute;
    left: 58px;
    font-size: 14px;
    color: var(--cds-text-light);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.app-header .header-back svg {
    width: 20px;
    height: 20px;
}

/* ===== Page Title ===== */
.page-title {
    font-family: var(--cds-display-font);
    font-size: 20px;
    line-height: 1;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.8px;
    margin: 10px 0 18px;
    color: var(--cds-text-light);
    text-shadow: 0 3px 22px rgba(0, 0, 0, 0.35);
}

/* ===== Greeting ===== */
.greeting {
    font-family: var(--cds-display-font);
    font-size: 56px;
    font-weight: 400;
    line-height: 0.92;
    margin: 16px 0 24px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
}

.dashboard-page {
    padding-bottom: 16px;
}

.password-checklist {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    font-size: 0.9rem;
}

.password-checklist li {
    margin-bottom: 4px;
}

/* ===== Cards ===== */
.card-cds {
    background: var(--cds-white);
    border-radius: 18px;
    padding: 20px;
    color: var(--cds-text-dark);
    box-shadow: var(--cds-shadow);
    margin-bottom: 16px;
    border: 1px solid rgba(32, 37, 79, 0.14);
}

.card-cds:active,
.maintenance-card:active {
    transform: scale(0.97);
    opacity: 0.85;
    transition: transform 80ms ease-out, opacity 80ms ease-out;
}

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

.card-cds-title {
    font-size: 14px;
    font-weight: 400;
    font-family: var(--cds-display-font);
    color: var(--cds-platform-navy);
    letter-spacing: 0.3px;
}

.card-cds-arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1.5px solid var(--cds-platform-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cds-platform-navy);
    cursor: pointer;
}

/* ===== Score Circle ===== */
.score-circle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle .track {
    fill: none;
    stroke: var(--cds-gray);
    stroke-width: 8;
}

.score-circle .fill {
    fill: none;
    stroke: var(--cds-brand-accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.score-circle .score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 800;
    color: var(--cds-platform-navy);
}

.score-circle .score-value span {
    font-size: 13px;
    font-weight: 400;
    color: var(--cds-gray-text);
}

/* ===== Bottom Navigation (reference: light bar, navy stroke icons; active = navy frame + slightly darker fill, no teal) ===== */
.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 460px;
    min-height: 76px;
    background: var(--cds-nav-bg);
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    padding: 8px 6px;
    box-shadow: 0 4px 22px rgba(32, 37, 79, 0.14);
    z-index: 100;
    border-radius: 16px;
    border: 1px solid var(--cds-nav-border);
}

.bottom-nav-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: clamp(9px, 2.65vw, 11px);
    line-height: 1.15;
    text-align: center;
    color: var(--cds-platform-navy);
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    background: transparent;
    overflow-wrap: break-word;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: var(--cds-platform-navy);
}

.bottom-nav-item.active {
    background: var(--cds-nav-active-fill);
    color: var(--cds-platform-navy);
    font-weight: 700;
    border-color: var(--cds-platform-navy);
    box-shadow: none;
}

.bottom-nav-item.active svg {
    stroke: var(--cds-platform-navy);
}

/* ===== Toggle Switch ===== */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #6f7b8f; /* toggle off state */
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    transition: background-color 0.25s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    top: 2px;
    background: var(--cds-white);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(11, 19, 41, 0.35);
    transition: transform 0.25s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--cds-brand-accent);
    border-color: rgba(255, 255, 255, 0.6);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
    box-shadow: 0 1px 6px rgba(9, 84, 33, 0.35);
}

/* ===== Private Mode Bar (below dashboard cards, above bottom nav) ===== */
.private-mode-bar {
    position: relative;
    width: 100%;
    margin-top: 8px;
    background: linear-gradient(145deg, var(--cds-brand-accent-dark) 0%, var(--cds-brand-accent) 100%);
    color: var(--cds-white);
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.private-mode-bar-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.private-mode-bar-main .private-mode-label {
    text-align: left;
}

.private-mode-bar.disabled {
    background: var(--cds-red);
}

/* ===== Buttons ===== */
.btn-cds {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--cds-radius);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-cds:hover {
    opacity: 0.9;
}

.btn-cds:active {
    transform: scale(0.98);
    transition: transform 60ms ease-out;
}

.btn-cds-primary {
    background: linear-gradient(145deg, var(--cds-brand-accent-dark) 0%, var(--cds-brand-accent) 100%);
    color: var(--cds-white);
    box-shadow: 0 6px 18px rgba(0, 168, 158, 0.28);
}

.btn-cds-dark {
    background: var(--cds-navy);
    color: var(--cds-white);
}

.btn-cds-outline {
    background: var(--cds-gray-light);
    color: var(--cds-navy);
    border: 2px solid var(--cds-border-accent);
}

.btn-cds-outline-danger {
    background: transparent;
    color: var(--cds-red);
    border: 2px solid var(--cds-red);
}

.btn-cds-outline-danger:hover {
    background: rgba(231, 76, 60, 0.08);
}

/* ===== Form Inputs ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--cds-text-dark);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--cds-border-input);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: var(--cds-white);
    color: var(--cds-text-dark);
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--cds-brand-accent);
}

.form-input::placeholder {
    color: var(--cds-gray-text);
}

/* ===== Tabs — Driving only (translucent navy track + pill active) ===== */
.tabs:not(.vehicle-page-tabs) {
    display: flex;
    align-items: stretch;
    gap: 4px;
    background: rgba(32, 37, 79, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 16px;
}

.tabs:not(.vehicle-page-tabs) .tab {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-size: 13px;
    font-family: var(--cds-display-font);
    letter-spacing: 0.28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.82);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: 1.5px solid transparent;
    background: transparent;
}

.tabs:not(.vehicle-page-tabs) .tab.active {
    background: var(--cds-nav-active-fill);
    color: var(--cds-platform-navy);
    border-color: var(--cds-platform-navy);
    box-shadow: none;
}

/* ===== Tabs — Vehicle / Maintenance (Figma: inactive=white + teal ring + navy text; active=solid teal + white) ===== */
.tabs.vehicle-page-tabs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 16px;
}

.tabs.vehicle-page-tabs .tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
    font-family: var(--cds-display-font);
    letter-spacing: 0.28px;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--cds-white);
    color: var(--cds-platform-navy);
    border: 1.5px solid var(--cds-brand-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.tabs.vehicle-page-tabs .tab.active {
    background: linear-gradient(145deg, var(--cds-brand-accent-dark) 0%, var(--cds-brand-accent) 100%);
    color: var(--cds-white);
    border-color: rgba(0, 133, 121, 0.55);
    box-shadow: 0 4px 16px rgba(0, 168, 158, 0.28);
}

a.tab {
    text-decoration: none;
    display: block;
}

/* ===== Sub-tabs — maintenance À venir / Passé (teal bar; active=white pill + navy text) ===== */
.sub-tabs {
    display: flex;
    align-items: stretch;
    gap: 4px;
    background: linear-gradient(145deg, var(--cds-brand-accent-dark) 0%, var(--cds-brand-accent) 100%);
    border: 1px solid rgba(0, 133, 121, 0.45);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 16px;
    box-shadow: 0 4px 18px rgba(0, 168, 158, 0.22);
}

.sub-tab {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-size: 13px;
    font-family: var(--cds-display-font);
    font-weight: 700;
    letter-spacing: 0.25px;
    color: var(--cds-white);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: 1.5px solid transparent;
    background: transparent;
}

a.sub-tab {
    text-decoration: none;
    display: block;
}

.sub-tab.active {
    background: var(--cds-white);
    color: var(--cds-platform-navy);
    border-color: transparent;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* ===== Stat Cards ===== */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--cds-white);
    border-radius: 18px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--cds-shadow);
    border: 1px solid rgba(32, 37, 79, 0.14);
}

.stat-value {
    background: linear-gradient(145deg, var(--cds-brand-accent-dark) 0%, var(--cds-brand-accent) 100%);
    color: var(--cds-white);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.stat-value small {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--cds-text-dark);
}

/* ===== Period Navigator (arrows + month) ===== */
.period-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--cds-text-light);
}

.period-nav-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--cds-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--cds-text-light);
    background: transparent;
}

.period-nav-label {
    font-size: 16px;
    font-weight: 700;
}

/* ===== Maintenance Card ===== */
.maintenance-card {
    background: var(--cds-white);
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: var(--cds-shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    color: var(--cds-text-dark);
    cursor: pointer;
    border: 1px solid var(--cds-border-card);
}

.maintenance-card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

/* Ghost arrow — teal outline, navy chevron (CONNECT maintenance card reference) */
.maintenance-card-arrow {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid var(--cds-border-card);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cds-platform-navy);
}

.maintenance-card-arrow svg {
    width: 15px;
    height: 15px;
}

.maintenance-card-arrow svg polyline {
    stroke-width: 1.75;
}

.maintenance-card:hover .maintenance-card-arrow {
    border-color: var(--cds-brand-accent-dark);
    color: var(--cds-platform-navy);
}

.maintenance-card-type {
    display: block;
    font-size: 17px;
    font-family: var(--cds-display-font);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 0.2px;
    color: var(--cds-platform-navy);
}

.maintenance-card-date {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cds-gray-text);
    margin-bottom: 4px;
}

.maintenance-card-info .place {
    font-size: 14px;
    color: var(--cds-gray-text);
    line-height: 1.35;
    margin: 0;
}

/* ===== Chat / Messagerie (CONNECT reference: teal incoming, bordered outgoing, teal contact card) ===== */
.chat-contact {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--cds-white);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 8px;
    border: 1px solid rgba(32, 37, 79, 0.14);
}

.messaging-layout .chat-contact {
    border: 1px solid var(--cds-border-card);
    padding: 16px 18px;
}

.chat-peer-card {
    margin-bottom: 14px;
    border: 1px solid var(--cds-border-card);
    padding: 16px 18px;
    box-shadow: 0 2px 14px rgba(32, 37, 79, 0.06);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--cds-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--cds-gray-text);
    flex-shrink: 0;
}

.chat-contact-info h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--cds-platform-navy);
    font-family: var(--cds-display-font);
    letter-spacing: 0.02em;
    margin: 0;
}

.chat-contact-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-demo-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 168, 158, 0.15);
    color: var(--cds-brand-accent-dark);
    border: 1px solid var(--cds-border-card);
}

.messaging-demo-hint {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: rgba(255, 255, 255, 0.82);
    margin: -6px 8px 12px;
    line-height: 1.35;
}

.chat-peer-card .chat-contact-info h4,
.messaging-layout .chat-contact-info h4 {
    font-weight: 700;
}

.chat-contact-info p {
    font-size: 13px;
    font-family: inherit;
    color: var(--cds-gray-text);
    margin: 4px 0 0;
}

.chat-thread-body {
    background: var(--cds-white);
    border-radius: 14px;
    padding: 4px 4px 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 14px rgba(32, 37, 79, 0.07);
    flex: 1 1 auto;
    min-height: 200px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px 16px;
    min-height: min(360px, calc(100vh - 280px));
    max-height: calc(100vh - 275px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.45;
}

/* Incoming (parc / company): solid teal, white text */
.chat-bubble.other {
    align-self: flex-start;
    background: var(--cds-brand-accent);
    color: var(--cds-white);
    border: none;
    box-shadow: none;
}

/* Outgoing (driver): light fill + teal border, navy text */
.chat-bubble.self {
    align-self: flex-end;
    background: var(--cds-gray-light);
    color: var(--cds-platform-navy);
    border: 1px solid var(--cds-border-card);
    box-shadow: none;
}

.chat-bubble-meta {
    font-size: 11px;
    font-weight: 500;
    color: var(--cds-gray-text);
    margin-top: 2px;
}

.chat-bubble-meta.other {
    text-align: left;
}

.chat-bubble-meta.self {
    text-align: right;
}

.chat-sender {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
    color: var(--cds-platform-navy);
    margin-bottom: 2px;
}

.chat-input-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--cds-gray-light);
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 -4px 20px rgba(32, 37, 79, 0.1);
    border-top: 1px solid rgba(32, 37, 79, 0.1);
    z-index: 100;
}

.chat-input-bar .photo-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    color: var(--cds-platform-navy);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.photo-btn-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
}

.photo-btn-plus {
    position: absolute;
    right: -6px;
    bottom: -4px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    color: var(--cds-platform-navy);
}

.chat-input-bar input {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid rgba(32, 37, 79, 0.28);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: var(--cds-white);
    color: var(--cds-platform-navy);
}

.chat-input-bar input::placeholder {
    color: var(--cds-gray-text);
}

.chat-input-bar input:focus {
    border-color: var(--cds-brand-accent);
}

.chat-send-btn {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--cds-brand-accent-dark) 0%, var(--cds-brand-accent) 100%);
    color: var(--cds-white);
    box-shadow: 0 6px 16px rgba(0, 168, 158, 0.35);
}

.chat-send-btn:hover {
    opacity: 0.94;
    filter: brightness(1.04);
}

.chat-send-btn:active {
    transform: scale(0.94);
}

/* ===== Bottom Sheet ===== */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.bottom-sheet-overlay.open {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    background: var(--cds-white);
    border-top-left-radius: var(--cds-radius-lg);
    border-top-right-radius: var(--cds-radius-lg);
    z-index: 210;
    transition: transform 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
    color: var(--cds-text-dark);
}

.bottom-sheet.open {
    transform: translateX(-50%) translateY(0);
}

.bottom-sheet-handle {
    width: 48px;
    height: 5px;
    background: var(--cds-gray);
    border-radius: 3px;
    margin: 12px auto;
}

.bottom-sheet-content {
    padding: 8px 24px 32px;
}

.bottom-sheet-title {
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--cds-navy);
}

/* ===== Period cards (private mode list) ===== */
.private-mode-page {
    padding-bottom: 12px;
}

.private-mode-add-btn {
    margin-top: 8px;
}

.private-mode-add-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.card-cds.period-item {
    padding: 16px 18px;
    margin-bottom: 0;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.card-cds.period-item:hover {
    transform: translateY(-1px);
}

.card-cds.period-item.is-enabled {
    border-color: var(--cds-platform-navy);
    box-shadow: 0 2px 14px rgba(32, 37, 79, 0.1);
}

.period-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.period-item-main {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    display: block;
}

.period-item-main:focus-visible {
    outline: 2px solid var(--cds-brand-accent);
    outline-offset: 4px;
    border-radius: 8px;
}

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

.period-edit-btn {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1.5px solid var(--cds-platform-navy);
    align-items: center;
    justify-content: center;
    color: var(--cds-platform-navy);
    background: rgba(255, 255, 255, 0.96);
    transition: transform 0.12s ease, border-color 0.2s;
}

.period-edit-btn:active {
    transform: scale(0.96);
}

.period-item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--cds-text-dark);
}

.period-item-time {
    font-size: 13px;
    color: var(--cds-gray-text);
    margin-top: 4px;
}

.period-days {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.period-day {
    font-size: 11px;
    font-weight: 700;
    color: var(--cds-gray-text);
}

.period-day.active {
    color: var(--cds-brand-accent);
}

.private-mode-days-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.private-mode-days-picker.is-hidden {
    display: none;
}

.private-mode-day-chip {
    min-width: 40px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1.5px solid rgba(32, 37, 79, 0.2);
    background: var(--cds-white);
    font-weight: 700;
    font-size: 12px;
    color: var(--cds-platform-navy);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.private-mode-day-chip.is-on {
    border-color: var(--cds-platform-navy);
    background: var(--cds-nav-active-fill);
}

.private-mode-form-card {
    margin-bottom: 8px;
}

.private-mode-delete-form {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(32, 37, 79, 0.12);
}

.form-input-datetime {
    min-height: 48px;
}

/* Répéter — Figma: sélection = fond bleu marine, autre = contour blanc / léger */
.private-mode-repeat-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.private-mode-repeat-chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 10px;
    border-radius: 14px;
    border: 1.5px solid var(--cds-platform-navy);
    background: var(--cds-white);
    color: var(--cds-platform-navy);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.private-mode-repeat-chip.is-selected {
    background: var(--cds-platform-navy);
    color: var(--cds-white);
    border-color: var(--cds-platform-navy);
}

.private-mode-add-btn.btn-cds-outline {
    color: var(--cds-platform-navy);
    border-color: var(--cds-platform-navy);
    background: rgba(255, 255, 255, 0.95);
}

.private-mode-add-btn.btn-cds-outline:hover {
    background: var(--cds-nav-active-fill);
}

/* ===== Vehicle Info ===== */
.vehicle-section {
    background: var(--cds-white);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
    color: var(--cds-text-dark);
    box-shadow: var(--cds-shadow);
    border: 1px solid rgba(32, 37, 79, 0.14);
}

.vehicle-section-title {
    font-size: 17px;
    font-family: var(--cds-display-font);
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cds-platform-navy);
}

.vehicle-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 17px;
}

.vehicle-detail-row .label {
    color: var(--cds-gray-text);
}

.vehicle-detail-row .value {
    font-weight: 600;
}

.vehicle-plate {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cds-white);
    border: 2px solid var(--cds-navy);
    border-radius: 6px;
    padding: 4px 12px;
    margin-top: 12px;
}

.vehicle-plate .country {
    background: var(--cds-navy);
    color: var(--cds-white);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
}

.vehicle-plate .number {
    font-size: 16px;
    font-weight: 800;
    color: var(--cds-navy);
    letter-spacing: 1px;
}

/* ===== Document Row ===== */
.document-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--cds-gray-light);
    font-size: 14px;
    color: var(--cds-text-dark);
}

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

.document-row .doc-icon {
    color: var(--cds-brand-accent);
    cursor: pointer;
}

.invoice-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

/* ===== Map ===== */
.map-container {
    position: fixed;
    top: var(--cds-header-height);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(100vh - var(--cds-header-height) - var(--cds-bottom-nav-height));
    z-index: 1;
}

.map-address-bar {
    position: fixed;
    bottom: calc(var(--cds-bottom-nav-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    background: linear-gradient(145deg, var(--cds-brand-accent-dark) 0%, var(--cds-brand-accent) 100%);
    color: var(--cds-white);
    border-radius: 14px;
    padding: 12px 20px;
    text-align: center;
    z-index: 50;
    box-shadow: 0 8px 16px rgba(9, 14, 42, 0.2);
}

.map-address-bar .map-date {
    font-size: 13px;
    font-weight: 700;
}

.map-address-bar .map-address {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

/* ===== Login Page ===== */
.login-page {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: transparent;
    padding: 24px 0;
    position: relative;
    overflow: visible;
}

.login-page .login-bg {
    display: none;
}

.login-logo {
    margin-bottom: 28px;
    z-index: 2;
    width: 100%;
    max-width: 300px;
}

.login-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.login-card {
    background: var(--cds-white);
    border-radius: var(--cds-radius-lg);
    padding: 32px 26px;
    width: 100%;
    max-width: 400px;
    z-index: 2;
    border: none;
    box-shadow: 0 16px 48px rgba(12, 18, 42, 0.35);
}

.login-card-title {
    font-family: var(--cds-display-font);
    text-align: center;
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cds-platform-navy);
    margin-bottom: 24px;
}

/* Login CTA — cds_platform / mockup: navy fill, white condensed uppercase (not teal primary) */
.btn-cds-login-submit {
    width: 100%;
    margin-top: 4px;
    font-family: var(--cds-display-font);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 1.35rem;
    line-height: 1.2;
    padding: 22px 20px;
    border-radius: 15px;
    border: none;
    background: var(--cds-platform-navy);
    color: var(--cds-white);
    box-shadow: 0 12px 32px rgba(32, 37, 79, 0.42);
}

.btn-cds-login-submit:hover {
    opacity: 0.94;
    filter: brightness(1.06);
}

.btn-cds-login-submit:active {
    transform: scale(0.985);
    transition: transform 80ms ease-out;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--cds-gray-text);
    margin-bottom: 20px;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.login-forgot {
    text-align: center;
    margin-top: 16px;
}

.login-forgot-hint {
    font-size: 14px;
    color: var(--cds-gray-text);
    margin-bottom: 20px;
    line-height: 1.45;
    text-align: center;
}

.reset-success-card .reset-success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.reset-success-card .login-card-title {
    margin-bottom: 12px;
}

a.btn-cds-login-submit {
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.login-forgot a {
    color: var(--cds-brand-accent);
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ===== Profile ===== */
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--cds-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: var(--cds-gray-text);
}

.profile-name {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--cds-navy);
    margin-bottom: 20px;
}

.profile-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--cds-gray-light);
}

.profile-detail .label {
    color: var(--cds-gray-text);
}

.profile-detail .value {
    font-weight: 600;
    color: var(--cds-text-dark);
}

/* ===== Flash Messages ===== */
.flash-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    z-index: 300;
}

.flash-message {
    padding: 12px 16px;
    border-radius: var(--cds-radius);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    animation: flash-in 0.3s ease;
}

.flash-message.success {
    background: var(--cds-green);
    color: var(--cds-white);
}

.flash-message.error {
    background: var(--cds-red);
    color: var(--cds-white);
}

/* ===== Sidebar ===== */
.app-sidebar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(102%);
    width: min(100%, 480px);
    max-height: 82vh;
    background: var(--cds-surface-alt);
    color: var(--cds-text-dark);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    box-shadow: var(--cds-shadow-sidebar);
    padding: 28px 18px 22px;
    z-index: 230;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.28s ease;
}

.app-sidebar.open {
    transform: translateX(-50%) translateY(0);
}

.app-sidebar::before {
    content: "";
    width: 110px;
    height: 6px;
    border-radius: 999px;
    background: var(--cds-navy-deep);
    align-self: center;
    margin-bottom: 16px;
}

.sidebar-logo-link {
    display: block;
    margin-bottom: 18px;
    text-align: center;
}

.sidebar-logo {
    height: 30px;
    width: auto;
    display: block;
    margin: 0 auto;
    /* White wordmark → platform navy for light sidebar (source: login-logo.png) */
    filter: brightness(0) saturate(100%) invert(12%) sepia(57%) saturate(1709%) hue-rotate(194deg) brightness(97%) contrast(91%);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav-item {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--cds-platform-navy);
    font-weight: 700;
    font-size: 15px;
    border: 1.5px solid rgba(32, 37, 79, 0.18);
    background: rgba(255, 255, 255, 0.82);
}

.sidebar-nav-item.active {
    background: var(--cds-nav-active-fill);
    color: var(--cds-platform-navy);
    border-color: var(--cds-platform-navy);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 220;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Filters ===== */
.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid rgba(32, 37, 79, 0.18);
    border-radius: 14px;
    margin-bottom: 0;
    color: var(--cds-text-dark);
    background: var(--cds-white);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    user-select: none;
    transition: border-color 0.2s;
}

.filters-bar.filters-active {
    border-color: var(--cds-platform-navy);
    color: var(--cds-platform-navy);
}

.filters-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-active-badge {
    background: var(--cds-navy);
    color: var(--cds-white);
    font-size: 10px;
    font-weight: 800;
    border-radius: 9px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filters-panel {
    background: var(--cds-white);
    border: 1px solid rgba(32, 37, 79, 0.18);
    border-top: none;
    border-radius: 0 0 var(--cds-radius) var(--cds-radius);
    padding: 14px 16px 16px;
    margin-bottom: 16px;
    display: none;
    gap: 12px;
    flex-direction: column;
}

.filters-panel.open {
    display: flex;
}

.filters-panel .form-group {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--cds-gray-text);
    margin-bottom: 5px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--cds-border-input);
    border-radius: 8px;
    font-size: 14px;
    background: var(--cds-surface);
    color: var(--cds-text-dark);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--cds-navy);
    box-shadow: 0 0 0 2px rgba(27, 42, 74, 0.1);
}

.filters-footer {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.filter-reset-btn {
    flex: 1;
    padding: 9px;
    border: 1.5px solid var(--cds-gray);
    border-radius: 8px;
    background: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--cds-text-dark);
    cursor: pointer;
}

.filter-reset-btn:hover {
    border-color: var(--cds-navy);
    color: var(--cds-navy);
}

.maintenance-card--hidden {
    display: none !important;
}

.filters-empty-state {
    display: none;
    text-align: center;
    padding: 24px 0;
    color: var(--cds-gray-text);
}

.dashboard-grid,
.vehicle-grid,
.maintenance-grid,
.maintenance-detail-grid,
.driving-stats-grid,
.period-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.maintenance-grid--list {
    margin-top: 16px;
}

.dashboard-grid .card-cds p {
    font-size: 16px;
    font-family: inherit;
}

.vehicle-tabs-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.messaging-layout {
    display: block;
}

.messaging-placeholder {
    display: none;
}

.chat-view {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 88px;
}

.localize-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.private-mode-form {
    max-width: 760px;
}

.private-mode-form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* ===== Add Button (bottom) ===== */
.add-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: var(--cds-teal);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-top: 1px solid var(--cds-gray-light);
    margin-top: 8px;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-teal { color: var(--cds-brand-accent); }
.text-navy { color: var(--cds-navy); }
.text-gray { color: var(--cds-gray-text); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.card-block { display: block; }
.text-bold { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.empty-state { padding: 40px 20px; }
.flex-1 { flex: 1; }
.page-title-dark { color: var(--cds-navy); }
.section-heading { font-size: 16px; font-weight: 700; color: var(--cds-platform-navy); margin-bottom: 12px; }
.btn-cds-sm { padding: 10px; font-size: 13px; }
.btn-cds-tab { padding: 10px; font-size: 14px; }
.form-group-inline { margin-bottom: 0; }
.repeat-label { flex: 1; }
.repeat-label input[type="radio"] { display: none; }
.vehicle-thumb { width: 120px; height: 80px; background: var(--cds-gray-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vehicle-hero { display: flex; align-items: center; gap: 16px; }
.vehicle-hero .vehicle-plate { margin-top: 0; }
.signal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 2px; }
.signal-dot.on { background: var(--cds-brand-accent); }
.signal-dot.off { background: var(--cds-gray); }
.detail-meta { padding-left: 0; font-size: 13px; color: var(--cds-gray-text); margin-bottom: 8px; }
.comment-date { text-align: right; font-size: 12px; color: var(--cds-gray-text); }
.card-form { background: var(--cds-white); padding: 20px; border-radius: var(--cds-radius); color: var(--cds-text-dark); }
.days-row { display: flex; gap: 8px; margin-bottom: 20px; }
.flash-message.error { margin-bottom: 16px; }

/* ===== Entrance Animations ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.animate-in > * {
    opacity: 0;
    animation: fadeUp 0.4s ease forwards;
}
.animate-in > *:nth-child(1) { animation-delay: 0.04s; }
.animate-in > *:nth-child(2) { animation-delay: 0.1s; }
.animate-in > *:nth-child(3) { animation-delay: 0.16s; }
.animate-in > *:nth-child(4) { animation-delay: 0.22s; }
.animate-in > *:nth-child(5) { animation-delay: 0.28s; }
.animate-in > *:nth-child(6) { animation-delay: 0.34s; }

.greeting {
    animation: fadeIn 0.5s ease 0.06s both;
}

.score-circle .fill {
    animation: scoreReveal 0.8s ease 0.35s both;
}
@keyframes scoreReveal {
    from { stroke-dashoffset: 282.74; }
}

/* ===== Hover & Active States ===== */
.card-cds {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card-cds:hover {
    transform: translateY(-2px);
    box-shadow: var(--cds-shadow-hover);
}
.card-cds:active {
    transform: scale(0.97);
}

.maintenance-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.maintenance-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cds-shadow-hover);
}

.chat-contact {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.chat-contact:hover {
    transform: translateY(-1px);
    box-shadow: var(--cds-shadow-hover);
}

.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cds-shadow-hover);
}

.bottom-nav-item {
    transition: color 0.2s ease, transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.bottom-nav-item:active {
    transform: scale(0.92);
}

.sidebar-nav-item {
    transition: background 0.2s, color 0.2s, transform 0.15s;
}
.sidebar-nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.9);
}
.sidebar-nav-item:active {
    transform: scale(0.97);
}

.btn-cds {
    transition: opacity 0.2s, transform 0.12s ease;
}

.private-mode-bar {
    transition: background 0.25s ease, transform 0.15s ease;
}
.private-mode-bar:hover {
    transform: translateY(-1px);
}
.private-mode-bar:active {
    transform: scale(0.98);
}

/* ===== Focus Styles (Accessibility) ===== */
:focus-visible {
    outline: 2px solid var(--cds-teal);
    outline-offset: 2px;
}

.btn-cds:focus-visible {
    outline-offset: 3px;
}

.form-input:focus-visible {
    outline: none;
    border-color: var(--cds-teal);
    box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.2);
}

.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.3);
}

.bottom-nav-item:focus-visible,
.sidebar-nav-item:focus-visible {
    outline: 2px solid var(--cds-platform-navy);
    outline-offset: -2px;
}

/* ===== Desktop / Tablet ===== */
@media (min-width: 992px) {
    .app-container {
        max-width: 480px;
        margin: 0 auto;
    }

    .app-main {
        max-width: none;
    }

    .app-header {
        left: 50%;
        transform: translateX(-50%);
        max-width: 480px;
        width: 100%;
    }

    .private-mode-bar {
        position: static;
        width: 100%;
        max-width: none;
        transform: none;
        margin-top: 8px;
    }

    .private-mode-bar:hover {
        transform: translateY(-1px);
    }

    .private-mode-bar:active {
        transform: scale(0.99);
    }

    .chat-input-bar {
        position: sticky;
        left: auto;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: none;
        border-radius: var(--cds-radius);
    }

    .map-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        max-width: none;
        height: calc(100vh - 180px);
        border-radius: var(--cds-radius);
        overflow: hidden;
    }

    .map-address-bar {
        position: static;
        width: 100%;
        max-width: none;
        transform: none;
        margin-top: 12px;
    }

    .dashboard-grid,
    .vehicle-grid,
    .maintenance-grid,
    .maintenance-detail-grid,
    .driving-stats-grid,
    .period-grid {
        grid-template-columns: 1fr;
    }

    .messaging-layout {
        display: block;
    }

    .messaging-placeholder {
        display: none;
    }
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: calc(var(--cds-header-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 460px;
    padding: 0 12px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--cds-white);
    border-radius: var(--cds-radius);
    padding: 14px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
    animation: toastSlideIn 0.35s ease-out;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
    border-left: 4px solid var(--cds-teal);
}

.toast.toast-removing {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
}

.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon.chat_message { background: rgba(27, 42, 74, 0.15); color: var(--cds-teal); }
.toast-icon.maintenance_reminder { background: rgba(243, 156, 18, 0.15); color: var(--cds-orange); }
.toast-icon.period_alert { background: rgba(27, 42, 74, 0.12); color: var(--cds-navy); }
.toast-icon.vehicle_status { background: rgba(46, 204, 113, 0.15); color: var(--cds-green); }

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

.toast-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--cds-navy);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: var(--cds-gray-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--cds-gray-text);
    font-size: 18px;
    line-height: 1;
}

.toast-close:hover { color: var(--cds-navy); }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Notification badge on bottom nav */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(16px);
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--cds-red);
    color: var(--cds-white);
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

.notification-badge:empty,
.notification-badge[data-count="0"] {
    display: none;
}

/* Private mode — teal circle + eye-slash (shared: header + dashboard bar) */
.cds-private-mode-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cds-brand-accent);
    border: 2px solid rgba(255, 255, 255, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cds-white);
    box-shadow: 0 2px 10px rgba(0, 168, 158, 0.35);
    flex-shrink: 0;
}

.cds-private-mode-eye-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Private mode — header anchor wraps shared circle */
.header-private-mode-badge {
    position: absolute;
    left: var(--cds-space-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.app-header:has(.header-private-mode-badge:not(.hidden)) .header-menu {
    left: calc(var(--cds-space-4) + 36px + var(--cds-space-2));
}

.app-header:has(.header-private-mode-badge:not(.hidden)) .header-back {
    left: calc(var(--cds-space-4) + 36px + var(--cds-space-2) + 36px + var(--cds-space-2));
}

/* Notification bell in header */
.header-bell {
    position: absolute;
    right: calc(var(--cds-space-4) + 36px + var(--cds-space-2));
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: var(--cds-navy-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cds-text-light);
}

.header-bell .notification-badge {
    top: -4px;
    right: -6px;
    transform: none;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
}

/* ===== Programmer un entretien (maintenance schedule form) ===== */
.maintenance-schedule-heading {
    font-family: var(--cds-body-font);
    font-size: 1.35rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.82);
    text-align: left;
    text-transform: none;
    letter-spacing: 0.02em;
    margin: 8px 0 16px;
}

.maintenance-schedule-form {
    background: var(--cds-white);
    border: 1.5px solid var(--cds-navy);
    border-radius: var(--cds-radius);
    padding: 20px 18px 22px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.12);
    margin-bottom: 24px;
}

.maintenance-schedule-form .form-group {
    margin-bottom: 18px;
}

.maintenance-schedule-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.maintenance-schedule-input,
.maintenance-schedule-select {
    background: #f9fafb !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    color: #111827 !important;
    padding: 13px 14px !important;
    font-size: 15px !important;
}

.maintenance-schedule-input:focus,
.maintenance-schedule-select:focus {
    border-color: var(--cds-navy) !important;
    box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.12);
}

.maintenance-schedule-textarea {
    min-height: 88px;
    resize: vertical;
}

.maintenance-schedule-btn-full {
    width: 100%;
    display: block;
    padding: 14px 16px;
    font-weight: 800;
    font-size: 15px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.maintenance-schedule-submit {
    margin-bottom: 0;
    margin-top: 8px;
}

.maintenance-schedule-btn-muted {
    font-weight: 700;
    margin-bottom: 0;
}

.maintenance-new-place-panel {
    padding-top: 4px;
    margin-bottom: 18px;
    animation: maintenancePanelIn 0.28s ease-out;
}

.maintenance-new-place-panel--hidden {
    display: none !important;
}

@keyframes maintenancePanelIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.maintenance-file-drop {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px dashed #9ca3af;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.maintenance-file-drop:hover {
    border-color: var(--cds-navy);
    background: #f3f4f6;
}

.maintenance-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.maintenance-file-text {
    font-size: 14px;
    color: #6b7280;
}

.mt-24 > a.btn-cds {
    display: block;
    text-align: center;
}

/* ===== View Transitions ===== */
@view-transition {
    navigation: auto;
}

@keyframes cds-slide-in-right {
    from { transform: translateX(24px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes cds-slide-out-right {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(24px); opacity: 0; }
}
@keyframes cds-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes cds-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

::view-transition-old(root) {
    animation: 220ms ease-out both cds-fade-out;
}
::view-transition-new(root) {
    animation: 220ms ease-out both cds-slide-in-right;
}

html.is-back-transition::view-transition-old(root) {
    animation: 220ms ease-out both cds-slide-out-right;
}
html.is-back-transition::view-transition-new(root) {
    animation: 220ms ease-out both cds-fade-in;
}

/* ===== Turbo progress bar ===== */
.turbo-progress-bar {
    background-color: var(--cds-brand-accent);
    height: 2px;
}
