/* =============================================
   AVIS VEHICLE INSPECTION SYSTEM - Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --avis-red: #E31837;
    --avis-red-dark: #C01229;
    --avis-red-light: #FDEAED;
    --avis-black: #1A1A1A;
    --avis-dark: #222222;
    --bg-main: #F2F3F5;
    --bg-white: #FFFFFF;
    --sidebar-width: 240px;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --green: #16A34A;
    --green-light: #DCFCE7;
    --orange: #EA580C;
    --orange-light: #FFF7ED;
    --yellow: #CA8A04;
    --yellow-light: #FEFCE8;
    --blue: #2563EB;
    --blue-light: #EFF6FF;
    --cyan: #0891B2;
    --cyan-light: #ECFEFF;
}

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

html { font-size: 14px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===================== LAYOUT ===================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo img {
    height: 40px;
    width: auto;
}

.sidebar-logo .avis-logo-text {
    font-size: 36px;
    font-weight: 900;
    color: var(--avis-red);
    letter-spacing: -1px;
    line-height: 1;
}

.sidebar-logo .avis-logo-text span {
    font-size: 14px;
    color: var(--avis-red);
    vertical-align: super;
    font-weight: 700;
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--avis-red);
    color: #fff;
}

.nav-item.active svg, .nav-item.active i {
    color: #fff;
}

.nav-item svg, .nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.nav-item.active i { color: #fff; }

/* ===================== MAIN CONTENT ===================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding: 32px 36px;
}

/* ===================== PAGE HEADER ===================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-header-left {}

.breadcrumb {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb-sep { color: var(--text-muted); font-size: 11px; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}

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

/* ===================== SCOPE BADGE ===================== */
.scope-badge {
    background: var(--avis-black);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 12px;
    text-align: right;
    line-height: 1.3;
}

.scope-badge .scope-label {
    font-weight: 600;
    font-size: 13px;
    display: block;
}

.scope-badge .scope-sub {
    font-weight: 400;
    opacity: 0.75;
    font-size: 11.5px;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--avis-red);
    color: #fff;
}

.btn-primary:hover {
    background: var(--avis-red-dark);
    color: #fff;
}

.btn-dark {
    background: var(--avis-black);
    color: #fff;
}

.btn-dark:hover {
    background: #333;
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-main);
}

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

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

.btn-sm {
    padding: 6px 13px;
    font-size: 12.5px;
}

.btn-lg {
    padding: 11px 24px;
    font-size: 14.5px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background: var(--avis-red-light);
    border-color: var(--avis-red);
    color: var(--avis-red);
}

/* ===================== STAT CARDS ===================== */
.stats-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 28px;
}

.stats-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
}

.stat-card-label {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-card-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===================== CARDS ===================== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

/* ===================== TABLES ===================== */
.table-wrap {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.data-table thead tr {
    background: #F8F9FA;
    border-bottom: 1px solid var(--border-color);
}

.data-table thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.12s;
}

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

.data-table tbody tr:hover {
    background: #FAFAFA;
}

.data-table tbody td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Plain table (no thead background) */
.table-plain thead th {
    background: transparent;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    padding: 10px 14px;
}

/* ===================== BADGES / STATUS ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--avis-red-light); color: var(--avis-red); }
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-cyan { background: var(--cyan-light); color: var(--cyan); }
.badge-gray { background: #F3F4F6; color: #6B7280; }
.badge-dark { background: #1A1A1A; color: #fff; }

/* Completion rate badges */
.rate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.rate-high { background: var(--green); color: #fff; }
.rate-mid { background: var(--yellow); color: #fff; }
.rate-low { background: var(--orange); color: #fff; }

/* ===================== ACTION LINKS ===================== */
.action-link {
    color: var(--avis-red);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.15s;
}

.action-link:hover { opacity: 0.75; text-decoration: underline; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 20px; }

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

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    outline: none;
}

.form-control:focus {
    border-color: var(--avis-red);
    box-shadow: 0 0 0 3px rgba(227,24,55,0.1);
}

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

.form-control-icon {
    position: relative;
}

.form-control-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.form-control-icon input {
    padding-left: 36px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ===================== SECTION CARD ===================== */
.section-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.section-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.section-card-title i {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===================== FILTERS BAR ===================== */
.filters-bar {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.filter-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ===================== TABLE ACTIONS ===================== */
.table-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}

.table-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===================== AVATAR ===================== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell-info .name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-cell-info .email {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===================== TWO-COL LAYOUT ===================== */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.two-col-grid-60 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

/* ===================== INSPECTION DETAIL ===================== */
.info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.info-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Fuel bar */
.fuel-bar-wrap {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.fuel-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
    transition: width 0.3s;
}

/* ===================== PHOTO GALLERY ===================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.photo-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--bg-main);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
}

/* ===================== DAMAGE MARKER ===================== */
.damage-pin {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--avis-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

.damage-pin.existing {
    background: var(--orange);
}

/* ===================== TABS ===================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    gap: 0;
}

.tab-item {
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    text-decoration: none;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: var(--avis-red);
    border-bottom-color: var(--avis-red);
    font-weight: 600;
}

/* ===================== TOGGLE BUTTONS ===================== */
.toggle-group {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.toggle-btn {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.toggle-btn.active {
    background: var(--bg-main);
    color: var(--text-primary);
    font-weight: 600;
}

/* ===================== RADIO & CHECKBOX ===================== */
.radio-group {
    display: flex;
    gap: 24px;
    align-items: center;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-primary);
}

.radio-option input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--avis-red);
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    display: inline-block;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--avis-red); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===================== ACCESSORIES TABLE ===================== */
.accessories-table {
    width: 100%;
    border-collapse: collapse;
}

.accessories-table tr {
    border-bottom: 1px solid var(--border-light);
}

.accessories-table td {
    padding: 14px 18px;
    font-size: 13.5px;
}

.presence-toggle, .condition-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.toggle-opt {
    padding: 6px 16px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: var(--text-muted);
    transition: all 0.15s;
    border: none;
}

.toggle-opt:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.toggle-opt.selected-present {
    background: var(--avis-black);
    color: #fff;
}

.toggle-opt.selected-missing {
    background: var(--avis-red);
    color: #fff;
}

.toggle-opt.selected-good {
    background: var(--avis-black);
    color: #fff;
}

.toggle-opt.selected-damaged {
    background: var(--avis-red);
    color: #fff;
}

/* ===================== CHART PLACEHOLDER ===================== */
.chart-area {
    height: 160px;
    position: relative;
    overflow: hidden;
}

.chart-gradient {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
}

.chart-legend {
    display: flex;
    gap: 18px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    width: 35px;
}

.chart-inner {
    margin-left: 40px;
    height: 100%;
    position: relative;
}

/* ===================== VEHICLE DAMAGE MAP ===================== */
.damage-map-container {
    position: relative;
    background: #F8F9FA;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    border: 1px solid var(--border-light);
}

.damage-map-car {
    max-width: 440px;
    width: 90%;
}

.damage-map-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30,30,30,0.82);
    color: #fff;
    font-size: 12px;
    padding: 7px 16px;
    border-radius: 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.damage-pin-overlay {
    position: absolute;
    width: 28px;
    height: 28px;
    background: var(--avis-red);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    cursor: pointer;
    transform: translate(-50%, -50%);
}

/* ===================== SIGNATURE PAD ===================== */
.signature-pad {
    border: 2px dashed #CBD5E1;
    border-radius: var(--radius-lg);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAFBFC;
    position: relative;
}

.signature-pad-placeholder {
    font-size: 16px;
    color: #CBD5E1;
    text-align: center;
}

.signature-x-line {
    position: absolute;
    bottom: 60px;
    left: 30px;
    right: 30px;
    height: 1px;
    background: var(--border-color);
    display: flex;
    align-items: flex-end;
}

.signature-x-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-right: 4px;
    position: absolute;
    bottom: -18px;
    left: 0;
}

/* ===================== UPLOAD ZONE ===================== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--avis-red);
    background: var(--avis-red-light);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--text-muted);
}

.upload-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===================== COLOR SWATCHES ===================== */
.color-swatches {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.15s;
}

.color-swatch.active { border-color: var(--text-secondary); }

/* ===================== EMAIL LOG ===================== */
.email-log-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.email-log-time {
    font-size: 12.5px;
    color: var(--text-muted);
    min-width: 130px;
    flex-shrink: 0;
}

.email-log-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.email-log-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===================== DAMAGE DETAILS LIST ===================== */
.damage-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    font-size: 13px;
}

/* ===================== REPORT CARDS ===================== */
.report-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border-light);
}

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

.report-icon {
    width: 46px;
    height: 46px;
    background: var(--avis-red-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: var(--avis-red);
}

.report-info { flex: 1; }

.report-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.report-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

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

/* ===================== VEHICLE PROFILE ===================== */
.vehicle-info-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
}

.vehicle-photo {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: contain;
    background: #F8F9FA;
    border-radius: var(--radius-md);
}

.vehicle-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.spec-item {}
.spec-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.spec-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ===================== TIMELINE ===================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--avis-red);
    background: #fff;
}

.timeline-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
}

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

.timeline-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-card-date {
    font-size: 12px;
    color: var(--text-muted);
}

.timeline-card-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tag {
    display: inline-flex;
    padding: 2px 8px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 4px;
}

/* ===================== AUTH ===================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
}

.auth-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-main);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
}

/* ===================== INSPECTION STEPS ===================== */
.inspection-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.step-progress {
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
}

.step-dot.active { background: var(--avis-red); }
.step-dot.done { background: var(--green); }

/* ===================== DAMAGE MAP TABS ===================== */
.damage-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.damage-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}

.damage-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
    font-weight: 600;
}

/* ===================== ACTIVE RENTALS TABLE ===================== */
.active-rentals-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}

/* ===================== FAB ===================== */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
    background: var(--avis-red);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    z-index: 50;
}

.fab:hover { background: var(--avis-red-dark); color: #fff; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1440px) {
    .stats-grid-5 { grid-template-columns: repeat(3, 1fr); }
}

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

@media (max-width: 1024px) {
    :root { --sidebar-width: 220px; }
    .main-content { padding: 24px 24px; }
    .stats-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .two-col-grid { grid-template-columns: 1fr; }
    .two-col-grid-60 { grid-template-columns: 1fr; }
    .vehicle-spec-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }
    .sidebar { transform: translateX(-240px); width: 240px; transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .stats-grid-5, .stats-grid-4, .stats-grid-3 { grid-template-columns: 1fr 1fr; }
    .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .page-header { flex-direction: column; gap: 12px; }
    .two-col-grid { grid-template-columns: 1fr; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .vehicle-info-grid { grid-template-columns: 1fr; }
    .vehicle-spec-grid { grid-template-columns: 1fr 1fr; }
    .mobile-menu-btn { display: flex; }
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    width: 38px;
    height: 38px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* ===================== UTILITIES ===================== */
.text-red { color: var(--avis-red); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-yellow { color: var(--yellow); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-lg { font-size: 15px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }


.custom-pagination {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 15px;
    flex-wrap: wrap;
}

.custom-pagination .page {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: 0.2s;
}

.custom-pagination .page:hover {
    background: #f3f4f6;
}

.custom-pagination .active {
    background: var(--avis-red);
    border-color: var(--avis-red);
    color: #fff;
}

.custom-pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
}