:root {
    --brand-dark: #153a21;
    --brand: #2d5f2e;
    --brand-light: #4a8c58;
    --surface: #ffffff;
    --surface-soft: #f6f8f3;
    --surface-strong: #e6efe5;
    --text: #1e2f25;
    --muted: #5f6b64;
    --border: rgba(34, 56, 35, 0.12);
    --bg: linear-gradient(180deg, #eef5ea 0%, #dde9db 100%);
    --card-shadow: 0 24px 60px rgba(15, 40, 21, 0.18);
    --input-bg: #fff;
    --input-border: #ddd;
    --input-text: #1e2f25;
    --surface-contrast: #ffffff;
}

html, body {
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body.theme-light {
    --brand-dark: #153a21;
    --brand: #2d5f2e;
    --brand-light: #4a8c58;
    --surface: #ffffff;
    --surface-soft: #f6f8f3;
    --surface-strong: #e6efe5;
    --text: #1e2f25;
    --muted: #5f6b64;
    --border: rgba(34, 56, 35, 0.12);
    --bg: linear-gradient(180deg, #eef5ea 0%, #dde9db 100%);
    --card-shadow: 0 24px 60px rgba(15, 40, 21, 0.18);
    --input-bg: #fff;
    --input-border: #ddd;
    --input-text: #1e2f25;
    --surface-contrast: #ffffff;
}

body.theme-dark {
    --brand-dark: #84c9a3;
    --brand: #65a87b;
    --brand-light: #80d197;
    --surface: #112118;
    --surface-soft: #132a1f;
    --surface-strong: #18322a;
    --text: #e8f5e8;
    --muted: rgba(232, 245, 232, 0.72);
    --border: rgba(255, 255, 255, 0.14);
    --bg: linear-gradient(180deg, #0a1710 0%, #112a1d 100%);
    --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.16);
    --input-text: #edf7ec;
    --surface-contrast: rgba(255, 255, 255, 0.05);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: linear-gradient(180deg, rgba(21, 58, 33, 0.08) 0%, rgba(255, 255, 255, 0.9) 40%);
    width: 100%;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(20, 56, 33, 0.14);
    padding: 36px 34px;
    border: 1px solid rgba(45, 95, 46, 0.12);
    margin: 0 auto;
    box-sizing: border-box;
}
/* ==========================================================================
   Auth Layout & Split Screen CSS
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: linear-gradient(180deg, rgba(21, 58, 33, 0.08) 0%, rgba(255, 255, 255, 0.9) 40%);
    width: 100%;
    box-sizing: border-box;
}

/* Outer wrapper para mapanatili ang grid at alignments */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

/* Left Section: QR Code Box */
.auth-qr-section {
    flex: 1;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qr-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 95, 46, 0.15);
    border-radius: 24px;
    padding: 36px 28px;
    box-shadow: 0 20px 50px rgba(15, 40, 21, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.qr-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 16px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(45, 95, 46, 0.12);
    margin-bottom: 24px;
}

.qr-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0 0 10px 0;
    line-height: 1.35;
}

.qr-card p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

/* Right Section: Form Wrapper */
.auth-card-wrapper {
    flex: 1;
    max-width: 520px;
    width: 100%;
}

/* Pinapanatili ang orihinal na sukat ng Login Container */
.auth-card {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(20, 56, 33, 0.14);
    padding: 36px 34px;
    border: 1px solid rgba(45, 95, 46, 0.12);
    margin: 0 auto;
    box-sizing: border-box;
}

/* Responsive adjustments para sa mobile at tablet screens */
@media (max-width: 900px) {
    .auth-wrapper {
        flex-direction: column-reverse;
        gap: 32px;
    }

    .auth-qr-section,
    .auth-card-wrapper {
        max-width: 520px;
    }

    .qr-image {
        width: 160px;
        height: 160px;
    }
}
.auth-card-alt {
    background: #f7fbf7;
}

.auth-branding {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(45, 95, 46, 0.2);
}

.auth-branding h1 {
    font-size: 28px;
    color: var(--brand-dark);
    margin-bottom: 12px;
}

.auth-branding p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form .form-group {
    min-width: 0;
}

.auth-form input,
.auth-form select,
.auth-form textarea,
.auth-form button {
    box-sizing: border-box;
    max-width: 100%;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 5px rgba(45, 95, 46, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.driver-info-section {
    margin-top: 10px;
    padding-top: 8px;
}

.driver-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a7f7b;
}

.driver-section-divider::before {
    content: "";
    flex: 1;
    height: 1px;
    background: #cfcfcf;
}

.driver-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #cfcfcf;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.settings-page {
    display: grid;
    gap: 24px;
    padding: 18px 0;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 26px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.section-description {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.form-grid {
    display: grid;
    column-gap: 24px;
    row-gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 18px;
}

.read-only-grid {
    margin-bottom: 0;
}

.settings-card form {
    display: grid;
    gap: 22px;
}

.settings-page .settings-card form > .btn-primary {
    width: 240px !important;
    max-width: 100%;
    justify-self: start;
}

.read-only-group {
    background: var(--surface-soft);
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(34, 56, 35, 0.08);
}

.read-only-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--muted);
    font-size: 13px;
}

.read-only-value {
    min-height: 26px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    transition: border-color 0.3s ease, background 0.3s ease;
    background: var(--input-bg);
    color: var(--input-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 5px rgba(45, 95, 46, 0.12);
}

.theme-options {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
    justify-content: flex-start;
}

.theme-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 22px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    cursor: pointer;
    min-width: 150px;
    flex: 1 1 170px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.theme-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.theme-option span {
    z-index: 1;
    font-weight: 700;
    color: var(--text);
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.18);
}

.theme-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    transform: translateY(-1px);
}

.theme-option:has(input:checked) span {
    color: #fff;
}

.theme-option input:checked + span {
    color: #fff;
}

.theme-option input:checked + span::before {
    content: '\2713';
    display: inline-block;
    margin-right: 8px;
    font-size: 16px;
    color: #fff;
}

.theme-option input:checked + span {
    color: #fff;
}

.theme-option input:checked + span {
    color: #fff;
}

.theme-option input:checked + span {
    color: #fff;
}

.btn-primary {
    background-color: var(--brand);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    min-width: 120px;
}

.btn-primary:hover {
    background-color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(19, 58, 36, 0.18);
}

.auth-switch {
    margin-top: 24px;
    text-align: center;
}

.auth-switch p {
    color: var(--muted);
    font-size: 14px;
}

.auth-switch a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.auth-credit {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.3;
    text-align: center;
}

.auth-alert {
    background: #ffecea;
    color: #802d23;
    border: 1px solid #f2c0b6;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.auth-alert p {
    margin: 0;
    font-size: 14px;
}

.container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0c301c 0%, #0f3f27 35%, #0b2f1b 70%, #072713 100%);
    padding: 14px 10px 16px;
    position: sticky; /* keep in flow and stick to top */
    top: 0;
    left: 0;
    margin-left: 0;
    padding-left: 0;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.16);
    z-index: 40;
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 35%);
    pointer-events: none;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    margin-bottom: 12px;
}

.logo {
    width: 100%;
}

.logo-image {
    width: 62px;
    height: 62px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-brand h2 {
    margin: 0;
    font-size: 14px;
    letter-spacing: 0.14em;
    color: #f3f7f8;
}

.sidebar-brand p {
    margin: 0;
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.sidebar-credit {
    display: block;
    margin-top: 6px;
    padding: 0 6px;
    font-size: 7px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    color: #ffffff !important;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.nav-section-title {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
    margin: 8px 0 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    min-height: 40px;
    color: #f8fbfb;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.01em;
    cursor: pointer;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.012);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 6px;
    border-radius: 0 10px 10px 0;
    background: transparent;
    transition: background-color 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.035);
    transform: translateY(-0.5px);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.nav-item.active::before {
    background-color: #8ee8b8;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: #c9f0da;
}

.nav-item span {
    flex: 1;
}

.nav-item.logout {
    margin-top: 14px;
    padding: 8px 10px;
    border-top: none;
}

.nav-item.logout:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    width: calc(100% - 260px); /* account for sidebar width */
    margin: 0;
    padding-top: 24px; /* keep top/bottom padding, but no left gap */
    padding-right: 24px;
    padding-bottom: 24px;
    padding-left: 0;
    min-height: 100vh;
    height: 100vh; /* make main content the scroll container */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.header {
    background-color: var(--surface);
    padding: 28px 32px;
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 24px 0;
    box-shadow: 0 10px 30px rgba(15, 40, 21, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    position: sticky; /* keep header visible at top of main content */
    top: 0;
    z-index: 30;
    width: 100%;
    box-sizing: border-box;
}

.header h1 {
    color: var(--brand-dark);
    font-size: 30px;
    font-weight: 700;
    margin: 0;
}

.header-meta {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 16px;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: transparent;
    color: #2196F3;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 32px;
    padding: 0;
    border: 2px solid transparent;
    background: #ff570b;
    color: #ffffff;
    border-radius: 999px;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.35s ease, border-color 0.35s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle--dark {
    background: #25242d;
    border-color: #41404c;
}

.theme-toggle-icon {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 14px;
    transition: opacity 0.25s ease, transform 0.35s ease;
}

.theme-toggle-sun {
    left: 7px;
    opacity: 1;
}

.theme-toggle-moon {
    right: 7px;
    opacity: 0.5;
}

.theme-toggle--dark .theme-toggle-sun {
    opacity: 0.35;
}

.theme-toggle--light .theme-toggle-moon {
    opacity: 0.35;
}

.theme-toggle--dark .theme-toggle-moon {
    opacity: 1;
}

.theme-toggle-knob {
    position: absolute;
    z-index: 2;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.24);
    transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.35s ease;
}

.theme-toggle--light .theme-toggle-knob {
    left: 34px;
}

.theme-toggle--dark .theme-toggle-knob {
    left: 2px;
    background: #dfe2ec;
}

.notification-bell:hover {
    transform: translateY(-1px);
    color: #1769aa;
}

.notification-bell i {
    font-size: 20px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: #ff3b30;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.datetime-widget {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
    color: var(--muted);
    font-size: 14px;
}

.datetime-date {
    font-weight: 700;
}

.datetime-time {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
}

.content {
    padding: 30px 24px 10px; /* top right/left bottom — keep inner spacing, header remains flush */
}

/* Dashboard Styling */
.dashboard-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 30px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 20px;
}

.dashboard-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 14px;
    align-items: stretch;
    margin-bottom: 20px;
}

.dashboard-overview-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-overview-cards .metric-card {
    padding: 8px 10px;
    gap: 8px;
    min-height: 76px;
}

.dashboard-overview-cards .card-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.dashboard-overview-cards .card-number {
    font-size: 24px;
    margin-bottom: 2px;
}

.dashboard-overview-cards .dashboard-subcards {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.dashboard-overview-cards .account-card {
    grid-column: 1 / -1;
    display: flex;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    flex-direction: row;
}

.dashboard-overview-cards .account-card .card-content {
    text-align: center;
    flex: 0 0 auto;
}

.dashboard-overview-cards .account-card .card-icon {
    flex: 0 0 42px;
}

.vehicle-status-chart {
    min-width: 0;
    padding: 12px;
    height: 100%;
    align-self: stretch;
    box-sizing: border-box;
    border: 1px solid rgba(45, 95, 46, 0.08);
    box-shadow: 0 12px 28px rgba(24, 57, 31, 0.1);
}

.chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-heading h3 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
}

.chart-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.chart-heading > i {
    color: var(--brand);
    font-size: 18px;
    padding: 9px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.chart-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 170px;
}

.vehicle-status-pie {
    --available-angle: calc(var(--available) / var(--total) * 360deg);
    --maintenance-angle: calc(var(--maintenance) / var(--total) * 360deg);
    --repair-angle: calc(var(--repair) / var(--total) * 360deg);
    width: 170px;
    height: 170px;
    flex: 0 0 170px;
    border-radius: 50%;
    background: conic-gradient(
        #81c784 0 var(--available-angle),
        #ffd580 var(--available-angle) calc(var(--available-angle) + var(--maintenance-angle)),
        #ef9a9a calc(var(--available-angle) + var(--maintenance-angle)) calc(var(--available-angle) + var(--maintenance-angle) + var(--repair-angle)),
        #b8c2c0 calc(var(--available-angle) + var(--maintenance-angle) + var(--repair-angle)) 360deg
    );
    position: relative;
    box-shadow: 0 10px 22px rgba(45, 95, 46, 0.16);
}

.vehicle-status-pie::after {
    content: '';
    position: absolute;
    inset: 29px;
    border-radius: 50%;
    background: var(--surface);
}

.vehicle-status-pie-center {
    position: absolute;
    inset: 29px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    text-align: center;
}

.vehicle-status-pie-center strong {
    color: var(--text);
    font-size: 25px;
    line-height: 1;
}

.vehicle-status-pie-center span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.vehicle-status-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    min-width: 150px;
    width: auto;
    padding: 5px 0;
}

.vehicle-status-legend div {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 25px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
}

.vehicle-status-legend strong {
    color: var(--text);
    font-size: 13px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(45, 95, 46, 0.05);
}

.legend-available { background: #81c784; }
.legend-maintenance { background: #ffd580; }
.legend-repair { background: #ef9a9a; }
.legend-other { background: #b8c2c0; }

@media (max-width: 1050px) {
    .dashboard-overview {
        grid-template-columns: 1fr;
    }

    .dashboard-overview-cards .dashboard-subcards {
        grid-column: auto;
    }

    .vehicle-status-chart {
        min-height: 210px;
        height: auto;
    }
}

@media (max-width: 620px) {
    .dashboard-overview-cards {
        grid-template-columns: 1fr;
    }

    .chart-content {
        justify-content: center;
    }
}

.dashboard-subcards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 30px;
}

.card {
    background-color: var(--surface);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-title {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-number {
    font-size: 48px;
    font-weight: bold;
    color: var(--brand);
    margin-bottom: 20px;
}

.status-indicators {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}

.status-badge {
    display: inline-flex;
    min-height: 28px;
    padding: 5px 11px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge.status-good {
    background-color: #4CAF50;
}

.status-badge.status-under-maintenance {
    background-color: #F59E0B;
}

.status-badge.status-for-repair {
    background-color: #EF4444;
}

.status-badge.status-sale {
    background-color: #2196F3;
}

.status-badge.status-unknown {
    background-color: #6B7280;
}

.details-modal .vehicle-detail-row .status-badge {
    width: fit-content;
    height: auto;
    border-radius: 999px;
    display: inline-flex;
    color: #ffffff;
}

.badge-good {
    background-color: #4CAF50;
}

.badge-maintenance {
    background-color: #FFC107;
}

.badge-repair {
    background-color: #FF9800;
}

.badge-sale {
    background-color: #F44336;
}

.card-avatar {
    width: 60px;
    height: 60px;
    background-color: var(--surface-soft);
    border-radius: 50%;
    margin-bottom: 15px;
}

.card-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 15px;
}

/* Metric Card Styling */
.metric-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #ffffff;
    flex-shrink: 0;
}

.icon-vehicles {
    background-color: #A5D6A7;
    color: #2d5f2e;
}

.icon-available {
    background-color: #81C784;
    color: #ffffff;
}

.icon-maintenance {
    background-color: #FFD580;
    color: #F57F17;
}

.icon-repair {
    background-color: #EF9A9A;
    color: #C62828;
}

.icon-fuel {
    background: linear-gradient(135deg, #ff8a00, #ff3d00);
    color: #ffffff;
}

.icon-repair-records {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #ffffff;
}

.icon-accounts {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #ffffff;
}

.metric-card--sub {
    padding: 18px 20px;
}

.main-content {
    flex: 1;
    width: calc(100% - 260px); /* account for sidebar width */
    margin: 0;
    padding: 24px; /* 1.5rem */
    min-height: 100vh;
    height: 100vh; /* make main content the scroll container */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.metric-card .card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-top: 0;
    margin-bottom: 2px;
}

.card-description {
    font-size: 12px;
    color: var(--muted);
}

/* Recent Activity Section */
.recent-activity-section {
    background-color: var(--surface);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.activity-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.activity-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-checkbox-toggle-btn,
.activity-select-all-btn,
.activity-delete-selected-btn {
    appearance: none;
    box-sizing: border-box;
    min-height: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 16px;
}

.activity-checkbox-toggle-btn:focus-visible,
.activity-select-all-btn:focus-visible,
.activity-delete-selected-btn:focus-visible {
    outline: 3px solid rgba(33, 150, 243, 0.3);
    outline-offset: 3px;
}

.activity-checkbox-toggle-btn {
    background-color: #2196F3;
    color: white;
}

.activity-checkbox-toggle-btn.active,
.activity-checkbox-toggle-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

.activity-select-all-btn {
    padding: 0 14px;
    gap: 7px;
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.22);
}

.activity-select-all-btn.active,
.activity-select-all-btn:hover:not(:disabled) {
    background-color: #388E3C;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(56, 142, 60, 0.28);
}

.activity-select-all-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.activity-delete-selected-btn {
    background-color: #f44336;
    color: white;
}

.activity-delete-selected-btn:hover:not(:disabled) {
    background-color: #d32f2f;
    transform: translateY(-1px);
}

.activity-delete-selected-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.activity-item.extra-activity {
    display: none;
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-checkbox {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
}

.activity-list.show-checkboxes .activity-checkbox {
    display: inline-flex;
}

.activity-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
    flex-shrink: 0;
}

.icon-available-activity {
    background-color: #4CAF50;
}

.icon-maintenance-activity {
    background-color: #FFC107;
    color: #F57F17;
}

.icon-repair-activity {
    background-color: #F44336;
}

.icon-added-activity {
    background-color: #4CAF50;
}

.icon-edited-activity {
    background-color: #2196F3;
}

.icon-deleted-activity {
    background-color: #FF6B6B;
}

.icon-default-activity {
    background-color: #2196F3;
}

 .activity-content {
    min-width: 0;
}

.activity-description {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

 .activity-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 100px;
}

.activity-time {
    font-size: 12px;
    color: #999;
    text-align: right;
    white-space: nowrap;
}

.activity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-checkbox-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 10px;
    cursor: pointer;
}

.activity-checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.activity-delete-btn {
    background-color: #f44336;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.activity-delete-btn:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
}

.activity-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* Concise activity change summary */
.activity-details .details-inline {
    background: rgba(255,255,255,0.9);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid rgba(45,95,46,0.08);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.activity-details .detail-summary {
    color: #333;
    font-weight: 600;
    margin-right: 6px;
}
.activity-details .detail-old-value {
    color: #666;
}
.activity-details .detail-arrow {
    color: #999;
}
.activity-details .detail-new-value {
    color: #2d5f2e;
    font-weight: 700;
}

.activity-footer {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.view-all-link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    gap: 12px;
}

/* Activity Expandable Details */
.activity-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--brand);
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-expand-btn:hover {
    transform: scale(1.2);
    color: #1d5f20;
}

.activity-expand-btn.active {
    color: #1d5f20;
}

.activity-show-more-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--brand);
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-show-more-btn:hover {
    transform: scale(1.2);
    color: #1d5f20;
}

.activity-show-more-btn.active {
    color: #1d5f20;
    transform: rotate(180deg);
}

.activity-details {
    margin: 0 0 15px 55px;
    padding: 15px;
    background-color: var(--surface-soft);
    border-left: 3px solid var(--brand);
    border-radius: 4px;
}

.details-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    min-width: 120px;
    text-transform: uppercase;
}

.detail-value {
    color: var(--text);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background-color: var(--surface);
    padding: 6px 10px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.detail-comparison {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
}

.detail-old,
.detail-new {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-arrow {
    display: flex;
    align-items: center;
    color: var(--brand);
    font-size: 14px;
    margin-top: 20px;
}

/* Vehicle Details Section */
.activity-vehicle-details {
    margin: 0 0 15px 55px;
    padding: 20px;
    background-color: var(--surface-soft);
    border-left: 3px solid var(--brand-light);
    border-radius: 4px;
}

.vehicle-details-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-info-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vehicle-info-title,
.driver-info-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 5px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.vehicle-info-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
    align-items: center;
    padding: 8px 0;
}

.info-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.info-value {
    color: var(--text);
    font-size: 14px;
    padding: 8px 12px;
    background-color: var(--surface-soft);
    border-radius: 3px;
    border: 1px solid var(--border);
    word-break: break-word;
}

.info-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin: 10px 0;
}

.details-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.details-error {
    text-align: center;
    padding: 20px;
    color: #f44336;
    font-size: 14px;
    background-color: #ffebee;
    border-radius: 4px;
}

/* Blank Page Content */
.blank-page {
    text-align: center;
    padding: 60px 30px;
    color: #999;
}

.blank-page-title {
    font-size: 24px;
    font-weight: 600;
    color: #2d5f2e;
    margin-bottom: 10px;
}

/* Records Page Cards */
.records-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}


.records-grid {
    display: grid;
    grid-template-columns: repeat(2, 260px);
    gap: 80px;
    align-items: center;
    justify-content: center;
}

.record-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    width: 260px;
    height: 260px;
    text-align: center;
}

.record-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.record-icon {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    color: #fff;
    padding: 12px;
    flex-shrink: 0;
}

.record-icon-fuel { background: linear-gradient(135deg,#ff8a00,#ff3d00); }
.record-icon-vehicle { background: linear-gradient(135deg,#4facfe,#00f2fe); }

.record-info { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.record-info h3 { margin: 0 0 12px; font-size: 28px; font-weight: 800; color: var(--text); }
.record-info p { margin: 0; color: var(--muted); font-size: 14px; }

.records-action {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.generate-report-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 42px;
    background: #0f6a31;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(15, 106, 49, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.generate-report-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(15, 106, 49, 0.28);
    background: #115f2c;
}

@media (max-width: 700px) {
    .records-grid { grid-template-columns: 1fr; gap: 24px; }
    .record-card { width: 100%; height: auto; min-height: 220px; padding: 20px; border-radius: 12px; }
    .record-icon { width: 80px; height: 80px; font-size: 28px; }
    .record-info h3 { font-size: 18px; }
}

/* Records page spacing: keep cards near the top */
.records-page {
    margin-top: 24px;
}

.report-generator {
    max-width: 580px;
    background: var(--surface);
    border-radius: 24px;
    padding: 30px 32px;
    box-shadow: 0 16px 40px rgba(15, 64, 26, 0.08);
    border: 1px solid var(--border);
    margin: 20px auto 0;
    text-align: center;
}

.report-generator p {
    margin: 0 auto 20px;
    color: var(--text);
    line-height: 1.6;
    max-width: 520px;
}

.report-generator label {
    display: block;
    margin: 0 auto 10px;
    font-weight: 700;
    color: #1e371f;
    text-align: left;
    max-width: 420px;
}

.report-generator input[type="month"] {
    width: 100%;
    max-width: 360px;
    padding: 12px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    background: #fafafa;
    color: #1f2f21;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin: 0 auto;
}

.report-generator input[type="month"]:focus {
    border-color: #2e6f3f;
    box-shadow: 0 0 0 4px rgba(46, 111, 63, 0.08);
}

.report-generator .form-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    padding-top: 0;
    border-top: none;
}

.report-generator .btn-cancel,
.report-generator .btn-primary {
    min-width: 130px;
}

.report-generator .btn-cancel {
    border-radius: 14px;
    padding: 12px 18px;
}

.report-generator .btn-primary {
    padding: 12px 22px;
    border-radius: 14px;
}

@media (max-width: 780px) {
    .report-generator {
        width: 100%;
        padding: 24px;
    }

    .record-card {
        width: 100%;
    }
}

/* Vehicle Page Styling */
.vehicle-page {
    background-color: var(--surface);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(17, 41, 19, 0.08);
    overflow: hidden;
    width: 100%;
    margin: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.vehicle-sort-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.vehicle-sort-bar label {
    font-weight: 600;
    color: var(--text);
}

.vehicle-sort-bar select {
    min-width: 220px;
    padding: 10px 14px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--input-text);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

/* Vehicles Grid Layout */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.vehicle-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    pointer-events: auto;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    pointer-events: auto;
}


.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.card-status-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    min-width: 100px;
}

.card-status {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.card-status-text {
    font-size: 12px;
    text-transform: capitalize;
    color: var(--muted);
}

.card-availability {
    font-size: 11px;
    text-transform: capitalize;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.card-availability.available {
    color: var(--brand);
}

.card-availability.not-available {
    color: #dc3545;
}

.card-status.status-good {
    background-color: #28a745;
}

.card-status.status-under-maintenance {
    background-color: #ffc107;
}

.card-status.status-for-repair {
    background-color: #dc3545;
}

.card-status.status-sale {
    background-color: #007bff;
}

.card-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: 1px solid #d5d5d5;
    border-radius: 12px;
    background: #f5f5f5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0;
}

.card-vehicle-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.05em;
}

.card-driver {
    font-size: 16px;
    line-height: 1.4;
    color: var(--muted);
    margin-bottom: 15px;
}

.card-driver strong {
    color: var(--text);
    font-weight: 700;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 0;
    pointer-events: auto;
    align-items: center;
    justify-content: center;
}

.card-checkbox {
    display: inline-flex;
    align-items: center;
}

.card-checkbox input {
    width: 16px;
    height: 16px;
}

.btn-edit,
.btn-delete {
    pointer-events: auto;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-edit,
.btn-delete {
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--brand);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-edit:hover {
    background-color: #edf7ed;
    border-color: #8ee8b8;
    transform: translateY(-1px);
}

.btn-delete {
    border-color: rgba(229, 57, 53, 0.2);
    color: #b00020;
}

.btn-delete:hover {
    background-color: rgba(229, 57, 53, 0.08);
    border-color: #b00020;
    transform: translateY(-1px);
}

/* View Details Modal */
.details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 1001;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.details-modal.active {
    display: flex;
}

.details-modal .modal-container {
    background-color: white;
    border-radius: 8px;
    max-width: 450px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
}

.details-modal .vehicle-detail-image {
    text-align: center;
    margin-bottom: 12px;
}

.details-modal .vehicle-detail-image img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.details-modal .vehicle-detail-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.16);
}

.details-modal .driver-detail-photo-block {
    margin: 6px 0 12px;
    display: flex;
    justify-content: center;
}

.details-modal .driver-detail-photo-wrap {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #eef2ef;
    box-shadow: inset 0 0 0 1px rgba(53, 74, 48, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.details-modal .driver-detail-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.details-modal .driver-detail-photo:hover {
    transform: scale(1.02);
}

.image-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1100;
}

.image-viewer-overlay.active {
    display: flex;
}

body.image-viewer-open {
    overflow: hidden;
}

.image-viewer-content {
    position: relative;
    max-width: min(95vw, 900px);
    max-height: 95vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

.image-viewer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1;
}

.details-modal .driver-photo-spacer {
    height: 4px;
}

.details-modal .vehicle-detail-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.details-modal .detail-label {
    font-weight: 600;
    color: #333;
}

.details-modal .detail-value {
    color: #444;
}

.details-modal .vehicle-detail-row:last-child {
    margin-bottom: 0;
}

.details-modal .modal-container {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.details-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background-color: white;
}

.details-modal .modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.details-modal .modal-body {
    padding: 15px;
}

.vehicle-detail-row {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.vehicle-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* Button Styling */
.btn-primary {
    background-color: var(--brand);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    min-width: 120px;
}

.btn-primary:hover {
    background-color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(19, 58, 36, 0.18);
}

.btn-secondary,
.btn-calendar {
    color: white;
    border: none;
    background-color: #4f5b6b;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-right: 10px;
}

.btn-secondary:hover,
.btn-calendar:hover {
    background-color: #394451;
    transform: translateY(-1px);
}

.btn-calendar {
    background-color: #1976D2;
}

.btn-calendar:hover {
    background-color: #145a9e;
}

.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.calendar-widget {
    display: none;
    width: 260px;
    max-width: calc(100vw - 40px);
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
    padding: 14px;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1050;
}

.calendar-widget.active {
    display: block;
}

.calendar-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-month-label {
    font-weight: 700;
    color: #1f2937;
}

.calendar-nav {
    background: none;
    border: none;
    color: #1f2937;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.calendar-nav:hover {
    background-color: #f3f4f6;
}

.calendar-days-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-cell {
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    background-color: #f9fafb;
    color: #111827;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.calendar-cell:hover {
    background-color: #eef2ff;
}

.calendar-cell.selected {
    background-color: #2563eb;
    color: white;
}

.calendar-cell.has-record .calendar-day-dot {
    opacity: 1;
}

.calendar-day-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ef4444;
    bottom: 6px;
    right: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.selected-date-label {
    display: inline-block;
    margin-top: 4px;
    color: #374151;
    font-size: 13px;
    background-color: #f3f4f6;
    padding: 6px 10px;
    border-radius: 999px;
}

.btn-block {
    width: 100%;
}

@media (max-width: 480px) {
    .auth-page {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 28px 22px;
        border-radius: 20px;
    }
}

.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.header {
    animation: fadeInDown 0.6s ease-out forwards;
}

.content {
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
    opacity: 1;
}

/* Form Modal */
.form-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.0);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    box-sizing: border-box;
    pointer-events: none; /* inactive by default */
}

.form-modal.active {
    display: flex;
    background-color: rgba(0,0,0,0.4);
    pointer-events: auto; /* allow interaction when active */
}

.form-container {
    background-color: var(--surface);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 40, 21, 0.18);
    width: 640px;
    max-width: calc(100vw - 48px);
    max-height: 86vh;
    overflow-y: auto;
    animation: slideIn 0.32s cubic-bezier(0.2,0.9,0.2,1) forwards;
    margin: 0 auto;
    padding: 18px;
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Safety: Ensure hidden overlays do not block pointer events and activity buttons are clickable */
.overlay-safety, .modal, .details-modal, .details-panel, .fuel-image-overlay, .fuel-image-modal, .image-backdrop {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none; /* default: don't intercept when hidden */
}

.form-modal, .details-modal, .details-panel, .fuel-image-overlay, .fuel-image-modal, .image-backdrop {
    /* keep form-modal handled above for active state */
}

.form-modal.active, .details-modal.active, .details-panel.active, .fuel-image-overlay.active, .fuel-image-modal.active, .image-backdrop.active {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.header, .sidebar {
    position: relative;
    z-index: 10;
}

.btn, .btn-primary, .btn-success, .btn-danger, .btn-edit, .btn-delete, .btn-icon-view, #open-add-driver, #addVehicleBtn {
    position: relative;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background-color: white;
}

.form-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Generate modal specific styling */
#generateModal .form-header h3 {
    font-size: 22px;
    color: var(--brand-dark);
}

#generateModal .form-body {
    padding: 18px 20px;
    color: var(--muted);
}

.report-type-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-option {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(34,56,35,0.08);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    color: var(--brand-dark);
    box-shadow: 0 6px 18px rgba(19,58,36,0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn-option:hover {
    transform: translateY(-3px);
}

.btn-option.active {
    background: linear-gradient(180deg, var(--brand-light), var(--brand));
    color: #fff;
    box-shadow: 0 18px 40px rgba(45,95,46,0.18);
}

#reportMonthContainer label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 600;
}

#generate_month {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e6e9e6;
    background: #fff;
    width: 220px;
}

/* Make actions more prominent */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid rgba(34,56,35,0.06);
}

.btn-primary[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

/* Form Styling */
#vehicleForm {
    padding: 25px;
}

.form-divider {
    border-top: 2px solid #eee;
    padding-top: 20px;
    margin: 30px 0;
}

.form-divider h4 {
    color: #2d5f2e;
    font-size: 16px;
    margin: 0 0 20px 0;
    border-top: 1px solid #eee;
}

.btn-submit {
    background-color: #2d5f2e;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background-color: #1d3f1f;
    transform: translateY(-2px);
}

.btn-cancel {
    background-color: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background-color: var(--surface);
    border-color: var(--brand);
}

/* Vehicle List Section */
.vehicle-list-section {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vehicle-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
}

.vehicle-list-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fuel-header-controls,
.vehicle-header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-time-input-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-time-input-row input {
    flex: 1;
    cursor: pointer;
}

.calendar-widget--form {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 100%;
    max-width: 360px;
    z-index: 1100;
}

.date-picker-button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background-color: #0f6a31;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.date-picker-button:hover {
    background-color: #115f2c;
    transform: translateY(-1px);
}

.vehicle-checkbox-toggle-btn,
.vehicle-delete-selected-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    font-size: 16px;
}

.vehicle-checkbox-toggle-btn {
    background-color: #2196F3;
    color: white;
}

.vehicle-checkbox-toggle-btn.active,
.vehicle-checkbox-toggle-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

.vehicle-delete-selected-btn {
    background-color: #f44336;
    color: white;
}

.vehicle-delete-selected-btn:hover:not(:disabled) {
    background-color: #d32f2f;
    transform: translateY(-1px);
}

.vehicle-delete-selected-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.vehicle-refresh-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
}

.vehicle-refresh-btn:hover:not(:disabled) {
    background-color: #388E3C;
    transform: translateY(-1px);
}

.vehicle-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vehicle-refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vehicle-checkbox {
    display: none;
    padding: 12px 16px;
}

.vehicles-grid.show-checkboxes .vehicle-checkbox {
    display: block;
}

.vehicle-item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.vehicle-list-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
}

.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-message p {
    font-size: 16px;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Vehicle Table */
.vehicle-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vehicle-table thead {
    background-color: var(--brand);
    color: #ffffff;
}

.vehicle-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.vehicle-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.vehicle-table tbody tr:hover {
    background-color: var(--surface-soft);
}

/* Image Preview */
.image-preview {
    margin-bottom: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fbf8;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(53, 74, 48, 0.06);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.photo-cell {
    position: relative;
    z-index: 1;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-icon-view {
    border: 1px solid var(--border);
    background: #ffffff;
    color: #1f5c2b;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(15, 81, 39, 0.08);
    position: relative;
    z-index: 2;
}

.btn-icon-view i {
    font-size: 16px;
}

.btn-icon-view:hover {
    background-color: #eff9ef;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 81, 39, 0.14);
}

.btn-icon-view:focus,
.btn-icon-view:active {
    outline: none;
    box-shadow: 0 2px 8px rgba(15, 81, 39, 0.08);
    background-color: #ffffff;
}

.image-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 320px;
    max-width: 520px;
    width: min(520px, calc(100% - 40px));
    min-height: 180px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 26px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.14);
    padding: 24px 24px 20px;
    z-index: 1110;
    pointer-events: auto;
    white-space: normal;
}

.fuel-image-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.fuel-image-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.fuel-image-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fuel-image-modal {
    display: none;
    position: relative;
    min-width: 0;
    max-width: 680px;
    width: min(680px, calc(100% - 48px));
    min-height: 280px;
    height: auto;
    background: #fcfcfb;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18);
    padding: 32px 30px;
    z-index: 1;
    pointer-events: auto;
    white-space: normal;
}

.fuel-image-modal.active {
    display: block;
}

.fuel-image-modal-content {
    display: block;
    min-height: 0;
    color: var(--text-muted);
    font-size: 18px;
    text-align: center;
    position: relative;
    padding: 0;
    line-height: 1.5;
}

.fuel-image-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 18px 22px 12px;
    border-bottom: 1px solid #e2e2e2;
}

.fuel-image-modal .modal-body {
    padding: 18px 22px 22px;
}

.fuel-image-preview-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(280px, auto) auto;
    align-items: center;
    justify-items: center;
    gap: 10px 18px;
    min-height: 320px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    box-sizing: border-box;
}

.fuel-image-preview-box.has-multiple {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.fuel-image-stage {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 280px;
    align-items: center;
    justify-content: center;
}

.fuel-image-preview-box.has-multiple .fuel-image-stage {
    grid-column: 2;
}

.fuel-image-upload-date {
    order: 1;
    margin: 0;
    color: #333333;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    margin-right: 18px;
}

.fuel-image-preview {
    display: block;
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 8px;
}

.fuel-image-nav {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: #16723b;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(12, 55, 29, 0.2);
    transition: background-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.fuel-image-nav[hidden] {
    display: none;
}

.fuel-image-nav:hover {
    background: #0f5b2e;
    transform: scale(1.06);
    box-shadow: 0 4px 10px rgba(12, 55, 29, 0.26);
}

.fuel-image-nav:focus-visible {
    outline: 3px solid rgba(22, 114, 59, 0.3);
    outline-offset: 3px;
}

.fuel-image-prev {
    grid-column: 1;
    grid-row: 1;
}

.fuel-image-next {
    grid-column: 3;
    grid-row: 1;
}

.fuel-image-counter {
    grid-column: 1;
    grid-row: 2;
    color: #333333;
    font-size: 13px;
}

.fuel-image-preview-box.has-multiple .fuel-image-counter {
    grid-column: 2;
}

.fuel-image-loading,
.fuel-image-fallback {
    text-align: center;
}

.fuel-image-modal-close {
    order: 2;
    border: none;
    background: transparent;
    color: #4a4a4a;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.image-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1100;
}

.image-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.image-popup-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    line-height: 1.4;
    word-wrap: break-word;
}

}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .main-content { width: calc(100% - 200px); }
    .vehicles-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 480px) {
    .sidebar {
        position: absolute;
        z-index: 1000;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    }

    .main-content {
        margin-left: 0;
    }
}

/* Disable animations/transitions inside dashboard */
.main-content, .main-content * {
  animation: none !important;
  transition: none !important;
  will-change: auto !important;
  transform: none !important;
}

/* Shared dashboard responsive layout */
.container {
    width: 100%;
    min-height: 100vh;
    overflow: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    box-sizing: border-box;
    z-index: 50;
}

.main-content {
    width: calc(100% - 260px);
    min-width: 0;
    margin-left: 260px;
    box-sizing: border-box;
}

.content,
.header,
.table-responsive {
    min-width: 0;
    box-sizing: border-box;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 680px;
}

.vehicle-table {
    min-width: 720px;
}

.action-buttons {
    align-items: center;
}

.action-buttons button,
.card-actions button {
    min-height: 40px;
}

.menu-toggle,
.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .container {
        height: 100vh;
        min-height: 100vh;
    }

    .sidebar {
        width: min(280px, 85vw);
        height: 100vh;
        height: 100dvh;
        position: fixed;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .container.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 40;
    }

    .container.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }

    .header {
        align-items: center;
        gap: 12px;
        padding: 16px;
        border-radius: 0 0 16px 16px;
    }

    .header h1 {
        flex: 1;
        min-width: 0;
        font-size: clamp(17px, 4vw, 24px);
        overflow-wrap: anywhere;
    }

    .header-meta {
        align-items: center;
        gap: 8px;
    }

    .datetime-widget {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        padding: 10px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--brand-dark);
        cursor: pointer;
    }

    .menu-toggle span {
        display: block;
        width: 21px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
    }

    .content {
        padding: 20px 16px 24px;
    }

    .dashboard-cards,
    .dashboard-overview,
    .dashboard-overview-cards,
    .dashboard-overview-cards .dashboard-subcards,
    .dashboard-subcards,
    .vehicles-grid,
    .records-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .content .cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-overview-cards .account-card {
        grid-column: auto;
    }

    .action-buttons {
        gap: 6px;
    }

    .action-buttons button,
    .card-actions button {
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px;
    }

    .header-meta {
        gap: 4px;
    }

    .content {
        padding: 16px 12px 20px;
    }

    .card {
        padding: 18px;
    }
}

body.theme-dark {
    color-scheme: dark;
}

body.theme-dark .content .vehicle-list-section,
body.theme-dark .content .vehicle-card,
body.theme-dark .content .driver-card,
body.theme-dark .content .form-container,
body.theme-dark .content .modal-content,
body.theme-dark .content .modal-container,
body.theme-dark .content .details-card,
body.theme-dark .content .calendar-widget,
body.theme-dark .content .fuel-image-modal,
body.theme-dark .content .image-popup {
    background: var(--surface);
    color: var(--text);
}

body.theme-dark .content .vehicle-card .card-title,
body.theme-dark .content .driver-card .card-title {
    background: var(--surface-strong);
    border-color: var(--border);
    color: var(--brand-light);
    box-shadow: none;
}

body.theme-dark .content .vehicle-card .card-vehicle-number,
body.theme-dark .content .vehicle-card .card-driver,
body.theme-dark .content .vehicle-card .card-status-text,
body.theme-dark .content .driver-card .card-vehicle,
body.theme-dark .content .driver-card .card-username,
body.theme-dark .content .details-info,
body.theme-dark .content .details-info p,
body.theme-dark .content .vehicle-detail-row .detail-label,
body.theme-dark .content .vehicle-detail-row .detail-value,
body.theme-dark .content .vehicle-list-section h3 {
    color: var(--text);
}

body.theme-dark .content .card-availability.available,
body.theme-dark .content .driver-card .card-vehicle {
    color: var(--brand-light);
}

body.theme-dark .content .driver-card .card-media,
body.theme-dark .content .driver-card .card-avatar,
body.theme-dark .content .details-modal .driver-detail-photo-wrap {
    background: var(--surface-strong);
    color: var(--brand-light);
}

body.theme-dark .content .details-modal .modal-container,
body.theme-dark .content .details-modal .modal-header,
body.theme-dark .content .details-modal .modal-body,
body.theme-dark .content .fuel-image-modal .modal-header,
body.theme-dark .content .fuel-image-modal .modal-body {
    color: var(--text);
    border-color: var(--border);
}

body.theme-dark .content .fuel-image-preview-box {
    background: var(--surface-strong);
    border-color: var(--border);
}

body.theme-dark .content .fuel-image-upload-date,
body.theme-dark .content .activity-details .detail-summary,
body.theme-dark .content .activity-details .detail-old-value {
    color: var(--text);
}

body.theme-dark .content .activity-details .details-inline {
    background: var(--surface-strong);
    border-left-color: var(--brand);
}

body.theme-dark .content .form-header {
    background: var(--surface);
    border-color: var(--border);
}

body.theme-dark .content .form-header h3,
body.theme-dark .content .details-modal .modal-header,
body.theme-dark .content .details-modal .modal-header h3,
body.theme-dark .content .form-row label,
body.theme-dark .content .modal-title {
    color: var(--text);
}

body.theme-dark .content .details-modal .modal-header {
    background: var(--surface);
    border-color: var(--border);
}

body.theme-dark .content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.theme-dark .content select,
body.theme-dark .content textarea,
body.theme-dark .content #generate_month,
body.theme-dark .content .btn-option:not(.active) {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
}

body.theme-dark .content input::placeholder,
body.theme-dark .content textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

body.theme-dark .content #reportMonthContainer label,
body.theme-dark .content .close-btn {
    color: var(--text);
}

body.theme-dark .content .form-actions {
    border-color: var(--border);
}

body.theme-dark .content .vehicle-detail-row {
    border-color: var(--border);
}

body.theme-dark .content .report-generator label,
body.theme-dark .content .calendar-month-label,
body.theme-dark .content .calendar-nav,
body.theme-dark .content .form-group small {
    color: var(--text);
}

body.theme-dark .content .calendar-days-row {
    color: var(--muted);
}

body.theme-dark .content .calendar-cell {
    background: var(--surface-strong);
    color: var(--text);
}

body.theme-dark .content .calendar-cell:hover {
    background: var(--surface-soft);
}

body.theme-dark .content .calendar-cell.selected {
    background: #2563eb;
    color: #ffffff;
}

.logout-dialog-backdrop[hidden] {
    display: none;
}

.logout-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 20, 12, 0.62);
    backdrop-filter: blur(4px);
    box-sizing: border-box;
}

.logout-dialog {
    width: min(100%, 420px);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.3);
    text-align: center;
    box-sizing: border-box;
    animation: logout-dialog-enter 0.18s ease-out;
}

.logout-dialog-icon {
    display: grid;
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 18px;
    background: var(--surface-strong);
    color: var(--brand);
    font-size: 24px;
}

.logout-dialog h2 {
    margin: 0;
    color: var(--text);
    font-size: 23px;
}

.logout-dialog p {
    margin: 10px 0 26px;
    color: var(--muted);
    line-height: 1.6;
}

.logout-dialog-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.logout-dialog-actions button {
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.logout-dialog-cancel {
    background: var(--surface-soft);
    color: var(--text);
}

.logout-dialog-confirm {
    border-color: #b42318 !important;
    background: #b42318;
    color: #ffffff;
}

.logout-dialog-actions button:focus-visible {
    outline: 3px solid var(--brand-light);
    outline-offset: 3px;
}

body.logout-dialog-open {
    overflow: hidden;
}

@keyframes logout-dialog-enter {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .logout-dialog {
        padding: 26px 20px;
        border-radius: 20px;
    }

    .logout-dialog-actions {
        flex-direction: column-reverse;
    }

    .logout-dialog-actions button {
        width: 100%;
    }
}
