/* Polaris-inspired application theme
/* Shared across Site.Master and Default.aspx to keep the UI consistent. */

:root {
    --brand: #1b5e4b;
    --brand-dark: #123f33;
    --brand-soft: rgba(27, 94, 75, 0.08);
    --accent: #2b8a3e;
    --accent-soft: rgba(43, 138, 62, 0.10);
    --bg: #f5f7f8;
    --bg-soft: #fbfcfd;
    --surface: rgba(255, 255, 255, 0.98);
    --surface-solid: #ffffff;
    --surface-2: #f4f7f9;
    --surface-3: #edf2f5;
    --text: #13212c;
    --text-soft: #24333e;
    --muted: #637381;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(27, 94, 75, 0.16);
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
    --radius: 14px;
    --radius-lg: 18px;
    --ease: cubic-bezier(.16,.84,.44,1);
    --duration: 220ms;

    /* Compatibility aliases used by existing pages */
    --c1: var(--brand);
    --c2: var(--brand-dark);
    --c3: #dbe8e4;
    --bg-900: #eef2f4;
    --text-main: var(--text);
    --text-secondary: rgba(99, 115, 129, 0.82);
    --bg-card: rgba(255, 255, 255, 0.96);
    --panel-verse: rgba(255, 255, 255, 0.96);
    --soft-shadow: var(--shadow-soft);
    --topbar-height: 64px;
    --sidebar-width: 256px;
    --mobile-sidebar-width: 300px;
    --page-padding: 12px;
    --scroll-thumb: rgba(27, 94, 75, 0.35);
    --scroll-track: rgba(15, 23, 42, 0.04);
    --glass-light: rgba(255, 255, 255, 0.92);
    --glass-medium: rgba(255, 255, 255, 0.96);
    --glass-strong: rgba(255, 255, 255, 0.99);
}

html[data-theme="dark"] {
    --brand: #59b28f;
    --brand-dark: #2f7f66;
    --brand-soft: rgba(89, 178, 143, 0.10);
    --accent: #59b28f;
    --accent-soft: rgba(89, 178, 143, 0.14);
    --bg: #0f1418;
    --bg-soft: #141b20;
    --surface: rgba(19, 26, 31, 0.96);
    --surface-solid: #131a1f;
    --surface-2: #182128;
    --surface-3: #1d2830;
    --text: #eef4f1;
    --text-soft: #d5e0db;
    --muted: #94a3ab;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(89, 178, 143, 0.18);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.38);
    --bg-900: #0b1013;
    --text-main: var(--text);
    --text-secondary: rgba(212, 224, 219, 0.74);
    --bg-card: rgba(19, 26, 31, 0.96);
    --panel-verse: rgba(19, 26, 31, 0.96);
    --scroll-thumb: rgba(89, 178, 143, 0.38);
    --scroll-track: rgba(255, 255, 255, 0.03);
    --glass-light: rgba(255, 255, 255, 0.04);
    --glass-medium: rgba(255, 255, 255, 0.06);
    --glass-strong: rgba(255, 255, 255, 0.08);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body,
form {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #fbfcfd 0%, var(--bg) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}

html[data-theme="dark"] body {
    background: linear-gradient(180deg, #0d1216 0%, #10171c 100%);
}

body,
a,
button,
input,
select,
textarea {
    color-scheme: only light;
}

html[data-theme="dark"] body,
html[data-theme="dark"] a,
html[data-theme="dark"] button,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color-scheme: dark;
}

body,
.page-inner,
.content-row,
.main-column,
.content-wrap,
#mainScroll {
    min-width: 0;
}

body,
a {
    color: var(--text);
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    max-width: none;
    border-radius: 12px;
}

:focus-visible {
    outline: 3px solid rgba(27, 94, 75, 0.18);
    outline-offset: 2px;
}

.card,
.dashboard-card,
.panel-card,
.info-card,
.info-identity,
.qr-card,
.auth-card,
.site-confirm-panel,
.site-alert,
.alerts-panel,
.user-alerts-panel,
.notifications-panel,
.alerts-modal,
.content-wrap,
#mainScroll,
.vehicle-header,
.tabs,
.tab-panels,
.dashboard-header {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

#mainScroll > *,
.content-wrap > *,
.service-dashboard,
.vehicle-page,
.qr-page-container,
.dashboard,
.dashboard-shell,
.content-container,
.page-container,
.app-page,
.report-page,
.form-page,
.list-page {
    width: 100% !important;
    max-width: none !important;
}

.service-dashboard,
.vehicle-page,
.dashboard,
.dashboard-shell,
.content-container,
.page-container,
.app-page,
.report-page,
.form-page,
.list-page {
    margin-left: auto;
    margin-right: auto;
}

.card,
.dashboard-card,
.panel-card,
.info-card,
.info-identity,
.qr-card,
.auth-card,
.site-confirm-panel,
.alerts-panel,
.user-alerts-panel,
.notifications-panel,
.alerts-modal,
.vehicle-header,
.tabs,
.tab-panels,
.dashboard-header {
    border-radius: var(--radius);
}

/* Layout */
.page-inner {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    position: relative;
    width: calc(100% - (var(--page-padding) * 2));
    margin: 18px var(--page-padding) 14px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    z-index: 1800;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px 10px 8px 18px;
    backdrop-filter: blur(14px) saturate(120%);
}

.topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0));
}

.topbar-left,
.topbar-controls,
.topbar .brand,
.topbar-user-btn,
.content-row,
.sidebar,
.sidebar-body,
.sidebar-group,
.sidebar-group-header,
.menu-item,
.nav-item,
.site-confirm-actions,
.alerts-panel-header,
.user-alerts-header,
.notifications-header,
.alerts-panel-footer,
.notifications-footer,
.site-alert,
.brand-row,
.qr-card > div:first-child,
.vehicle-header,
.vehicle-actions,
.dashboard-actions,
.card-head,
.card-footer,
.metric-row,
.info-grid,
.identity-stats {
    display: flex;
}

.topbar-left,
.topbar .brand {
    align-items: center;
    gap: 14px;
    min-width: 0;
    z-index: 3;
}

.topbar .brand {
    color: var(--text);
}

.topbar .brand .title,
.brand-name,
.qr-title,
.dashboard-title,
.vehicle-title h1,
.card-title,
.alerts-panel-title,
.user-alerts-title,
.notifications-title {
    color: var(--text);
}

.topbar .brand .subtitle,
.qr-subtitle,
.dashboard-subtitle,
.vehicle-title .muted,
.card-subtitle,
.card-footer,
.alert-text,
.notification-text,
.site-alert .msg,
.brand-tagline,
.user-role,
.muted {
    color: var(--muted);
}

.topbar .brand .title {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
}

.topbar .brand .subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 1px;
    display: block;
}

.topbar-controls {
    align-items: center;
    gap: 6px;
    color: var(--text);
    z-index: 3;
    min-width: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 5px;
}

.topbar-controls-sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 4px;
}

.topbar-icon-btn,
.topbar-user-btn,
.mobile-close-btn,
.alerts-close,
.notifications-close,
.site-alert .close-btn,
.btn-glass,
.btn,
.btn-modern-primary,
.glass-action-btn {
    cursor: pointer;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
    position: relative;
    flex: 0 0 auto;
}

.topbar-icon-btn:hover,
.topbar-user-btn:hover,
.btn:hover,
.btn-modern-primary:hover,
.glass-action-btn:hover,
.btn-glass:hover,
.menu-item:hover,
.nav-item:hover,
.sidebar-group-header:hover {
    transform: translateY(-1px);
}

.topbar-icon-btn:hover {
    color: var(--brand);
    border-color: var(--border-strong);
    background: var(--surface-solid);
    box-shadow: var(--shadow-soft);
}

.topbar-icon-btn:focus,
.topbar-user-btn:focus,
.btn-glass:focus,
.site-alert .close-btn:focus,
.alerts-close:focus,
.notifications-close:focus,
.mobile-close-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(31, 122, 77, 0.12);
}

.glow-ring {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
}

.topbar-alert-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface-2);
    box-shadow: 0 4px 10px rgba(220,38,38,0.18);
}

.topbar-user-btn {
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.topbar-user-btn:hover {
    background: var(--surface-solid);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-soft);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(160deg, var(--brand), var(--brand-dark));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
    box-shadow: 0 6px 14px rgba(27, 94, 75, 0.16);
}

.user-meta,
.alert-content,
.notification-content,
.brand-text,
.page-head,
.header-left,
.vehicle-title,
.card-head,
.card-body,
.dashboard-card,
.info-identity,
.info-card,
.qr-card,
.auth-card,
.site-confirm-panel,
.site-confirm-panel .msg,
.site-alert .msg {
    min-width: 0;
}

.user-meta,
.vehicle-title,
.header-left,
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 11px;
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-row {
    gap: 16px;
    margin: 8px var(--page-padding) 0;
    align-items: stretch;
    width: calc(100% - (var(--page-padding) * 2));
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.main-column {
    flex: 1 1 0;
    flex-basis: 0;
    min-width: 0;
    width: auto;
    max-width: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
}

.content-wrap,
#mainScroll {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.page-head {
    flex: 0 0 auto;
    margin-bottom: 12px;
    padding: 2px 2px 0;
}

.page-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.3;
    font-weight: 500;
}

.page-breadcrumbs a,
.alerts-link,
.notifications-link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
}

.page-breadcrumbs a:hover,
.alerts-link:hover,
.notifications-link:hover {
    text-decoration: underline;
}

.page-breadcrumbs .crumb-current {
    color: var(--text);
    font-weight: 700;
}

.page-breadcrumbs .crumb-sep {
    color: rgba(99, 115, 129, 0.7);
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8f9 100%);
    color: var(--text);
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 14px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .26s var(--ease), opacity .26s var(--ease), width .26s var(--ease), min-width .26s var(--ease);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0));
}

.sidebar .logo-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 10px;
    position: relative;
    z-index: 3;
}

.sidebar .logo-top::before {
    content: "";
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: linear-gradient(160deg, var(--brand), var(--brand-dark));
    box-shadow: 0 6px 14px rgba(27, 94, 75, 0.18);
    z-index: 1;
}

.sidebar .logo-top img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: contain;
    background: transparent;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 8px 14px rgba(15,23,42,0.10));
}

html[data-theme="light"] .sidebar .logo-top img {
    filter: drop-shadow(0 8px 14px rgba(15,23,42,0.10));
}

html[data-theme="dark"] .sidebar .logo-top img {
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
    background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .sidebar .logo-top::before {
    background: linear-gradient(160deg, var(--brand), var(--brand-dark));
    box-shadow: 0 6px 14px rgba(27, 94, 75, 0.18);
}

.sidebar-body {
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    position: relative;
    z-index: 2;
}

.sidebar-footer {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    font-size: .80rem;
    color: rgba(99, 115, 129, 0.86);
    position: relative;
    z-index: 2;
}

.sidebar-group {
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
}

.sidebar-group-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
    transition: max-height .32s var(--ease), opacity .22s var(--ease), padding-top .32s var(--ease);
}

.sidebar-group.collapsed .sidebar-group-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    pointer-events: none;
}

.sidebar-label {
    margin: 0;
    color: rgba(99, 115, 129, 0.88);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-group-header {
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--text-soft);
    font-weight: 700;
    background: transparent;
    border: none;
    font-size: 0.70rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background .16s var(--ease), color .16s var(--ease);
    position: relative;
}

.sidebar-group-header .label-text {
    flex: 1 1 auto;
    font-weight: 700;
}

.sidebar-group-header .toggle {
    transition: transform .2s var(--ease);
    font-size: 12px;
    color: rgba(99, 115, 129, 0.72);
    margin-left: 8px;
}

.sidebar-group.collapsed .toggle {
    transform: rotate(-90deg);
}

.sidebar-group-header:hover {
    background: rgba(27, 94, 75, 0.05);
    color: var(--brand);
}

html[data-theme="dark"] .topbar {
    background: rgba(18, 24, 29, 0.96);
}

html[data-theme="dark"] .topbar::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}

html[data-theme="dark"] .topbar-controls,
html[data-theme="dark"] .content-wrap,
html[data-theme="dark"] #mainScroll,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .dashboard-header,
html[data-theme="dark"] .vehicle-header,
html[data-theme="dark"] .tabs,
html[data-theme="dark"] .tab-panels,
html[data-theme="dark"] .card,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .info-identity,
html[data-theme="dark"] .qr-card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .site-confirm-panel,
html[data-theme="dark"] .alerts-panel,
html[data-theme="dark"] .user-alerts-panel,
html[data-theme="dark"] .notifications-panel,
html[data-theme="dark"] .alerts-modal,
html[data-theme="dark"] .site-alert,
html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] .metric-row,
html[data-theme="dark"] .info-item,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .alert-item,
html[data-theme="dark"] .notification-item {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #151d23 0%, #11171c 100%);
}

html[data-theme="dark"] .sidebar::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}

html[data-theme="dark"] .sidebar .logo-top img {
    background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .sidebar .logo-top::before {
    background: linear-gradient(160deg, var(--brand), var(--brand-dark));
    box-shadow: 0 6px 14px rgba(27, 94, 75, 0.18);
}

html[data-theme="dark"] .menu-item,
html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .sidebar-label,
html[data-theme="dark"] .sidebar-group-header,
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] .user-role,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .dashboard-subtitle,
html[data-theme="dark"] .vehicle-title .muted,
html[data-theme="dark"] .alert-text,
html[data-theme="dark"] .notification-text,
html[data-theme="dark"] .alert-meta,
html[data-theme="dark"] .notification-meta,
html[data-theme="dark"] .page-breadcrumbs {
    color: var(--muted);
}

html[data-theme="dark"] .menu-item:hover,
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .menu-item:focus,
html[data-theme="dark"] .nav-item:focus,
html[data-theme="dark"] .sidebar-group-header:hover {
    background: rgba(89, 178, 143, 0.08);
    color: var(--text);
}

html[data-theme="dark"] .menu-item.active,
html[data-theme="dark"] .nav-item.active {
    color: #07110d;
    background: linear-gradient(180deg, #73c3a0, #59b28f);
}

html[data-theme="dark"] .topbar-icon-btn:hover,
html[data-theme="dark"] .topbar-user-btn:hover,
html[data-theme="dark"] .btn:hover,
html[data-theme="dark"] .btn-special:hover,
html[data-theme="dark"] .glass-btn:hover,
html[data-theme="dark"] .glass-action-btn:hover,
html[data-theme="dark"] .btn-modern-primary:hover,
html[data-theme="dark"] .btn-glass:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] .glass-btn,
html[data-theme="dark"] .btn-glass,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .alerts-close,
html[data-theme="dark"] .notifications-close,
html[data-theme="dark"] .mobile-close-btn,
html[data-theme="dark"] .site-alert .close-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--border);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    box-shadow: 0 6px 18px rgba(89, 178, 143, 0.10);
}

html[data-theme="dark"] .tab-btn.active,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .info-item,
html[data-theme="dark"] .metric-row,
html[data-theme="dark"] .alert-item,
html[data-theme="dark"] .notification-item {
    background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .tab-panels {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
}

html[data-theme="dark"] .tab-btn.active {
    background: rgba(89, 178, 143, 0.12);
    border-color: rgba(89, 178, 143, 0.16);
    color: var(--text);
}

html[data-theme="dark"] .site-loading-overlay {
    background: rgba(10, 15, 18, 0.72);
}

html[data-theme="dark"] .site-loading-overlay .glass {
    background: rgba(19, 26, 31, 0.96);
}

html[data-theme="dark"] .site-confirm-overlay {
    background: rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .site-alert.success::before,
html[data-theme="dark"] .alert-pill.success {
    background: #22c55e;
}

html[data-theme="dark"] .site-alert.error::before,
html[data-theme="dark"] .alert-pill.error {
    background: #f87171;
}

html[data-theme="dark"] .site-alert.info::before,
html[data-theme="dark"] .alert-pill.info {
    background: #60a5fa;
}

html[data-theme="dark"] .site-alert.warning::before,
html[data-theme="dark"] .alert-pill.warning {
    background: #f59e0b;
}

html[data-theme="dark"] .brand-divider,
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] .alerts-panel-header,
html[data-theme="dark"] .user-alerts-header,
html[data-theme="dark"] .notifications-header,
html[data-theme="dark"] .alerts-panel-footer,
html[data-theme="dark"] .notifications-footer {
    border-color: var(--border);
}

html[data-theme="dark"] .service-dashboard,
html[data-theme="dark"] .dashboard,
html[data-theme="dark"] .dashboard-shell,
html[data-theme="dark"] .content-container,
html[data-theme="dark"] .page-container,
html[data-theme="dark"] .app-page,
html[data-theme="dark"] .report-page,
html[data-theme="dark"] .form-page,
html[data-theme="dark"] .list-page,
html[data-theme="dark"] .vehicle-page {
    max-width: none !important;
}

.menu-item,
.nav-item {
    position: relative;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(36, 51, 62, 0.86);
    text-decoration: none;
    font-size: 13.3px;
    font-weight: 500;
    transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease), box-shadow .22s var(--ease);
    letter-spacing: 0.1px;
}

.menu-item .text,
.nav-item .text {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}

.menu-item:hover,
.nav-item:hover,
.menu-item:focus,
.nav-item:focus {
    background: rgba(27, 94, 75, 0.06);
    color: var(--brand-dark);
    outline: none;
    border-color: rgba(31, 122, 77, 0.10);
}

.menu-item.active,
.nav-item.active {
    color: #fff;
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(31, 122, 77, 0.18);
    transition: background .28s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .28s var(--ease);
}

.menu-item::after,
.nav-item::after {
    display: none !important;
}

/* Buttons and controls */
.btn,
.btn-special,
.glass-btn,
.glass-action-btn,
.btn-modern-primary,
.btn-glass {
    font-family: inherit;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: linear-gradient(180deg, #ffffff, #f6f8fa);
    color: var(--brand);
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.btn-special,
.glass-btn,
.glass-action-btn,
.btn-modern-primary,
.btn-glass.primary {
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(27, 94, 75, 0.16);
}

.btn:hover,
.btn-special:hover,
.glass-btn:hover,
.glass-action-btn:hover,
.btn-modern-primary:hover,
.btn-glass:hover {
    box-shadow: 0 12px 24px rgba(31, 122, 77, 0.14);
}

.btn:active,
.btn-special:active,
.glass-btn:active,
.glass-action-btn:active,
.btn-modern-primary:active,
.btn-glass:active,
.menu-item:active,
.nav-item:active,
.topbar-icon-btn:active,
.topbar-user-btn:active,
.sidebar-group-header:active {
    transform: scale(.98);
}

.btn-glass {
    appearance: none;
    border: 1px solid rgba(27, 94, 75, 0.14);
    background: linear-gradient(180deg, #ffffff 0%, #f5faf6 100%);
    color: var(--brand-dark);
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 700;
}

.btn-glass.primary {
    color: #fff;
}

.btn:focus-visible,
.btn-special:focus-visible,
.glass-btn:focus-visible,
.glass-action-btn:focus-visible,
.btn-modern-primary:focus-visible,
.btn-glass:focus-visible {
    outline: 3px solid rgba(27, 94, 75, 0.18);
    outline-offset: 2px;
}

/* Forms */
.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text);
    background: rgba(255,255,255,0.98);
    box-sizing: border-box;
    transition: border-color .12s, box-shadow .12s, transform .06s, background .12s;
    backdrop-filter: blur(6px);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(99, 115, 129, 0.46);
    opacity: 1;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(27, 94, 75, 0.36);
    box-shadow: 0 6px 18px rgba(27, 94, 75, 0.10);
    transform: translateY(-1px);
}

label,
.qr-label {
    color: var(--muted);
}

/* Cards / panels / dashboard */
.card,
.dashboard-card,
.panel-card,
.info-card,
.info-identity,
.qr-card,
.auth-card,
.dashboard-header,
.vehicle-header,
.tabs,
.tab-panels,
.site-confirm-panel,
.alerts-panel,
.user-alerts-panel,
.notifications-panel,
.alerts-modal,
.site-alert {
    border-radius: var(--radius);
}

.card,
.dashboard-card,
.panel-card,
.info-card,
.info-identity,
.qr-card,
.auth-card,
.dashboard-header,
.vehicle-header,
.tabs,
.tab-panels {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card,
.dashboard-card,
.panel-card,
.info-card,
.info-identity,
.qr-card,
.auth-card {
    padding: 16px;
}

.card-head {
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 4px;
}

.card-body {
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.card-footer {
    margin-top: auto;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.88rem;
}

.dashboard-header,
.vehicle-header,
.tabs,
.tab-panels {
    padding: 16px;
}

.dashboard-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.8rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.dashboard-subtitle,
.card-subtitle {
    font-size: 0.92rem;
}

.dashboard-actions,
.vehicle-actions,
.site-confirm-actions,
.alerts-panel-actions,
.user-alerts-actions,
.notifications-actions,
.identity-stats,
.info-grid,
.metric-list {
    gap: 10px;
    flex-wrap: wrap;
}

/* Tables and lists */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    color: var(--text);
}

th,
td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 10px 12px;
    vertical-align: middle;
}

th {
    background: var(--surface-2);
    color: var(--text-soft);
    font-weight: 700;
}

tr:hover td {
    background: rgba(31, 122, 77, 0.03);
}

/* Status / alerts */
.site-loading-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(248,250,249,0.78);
    backdrop-filter: blur(6px) saturate(120%);
    border-radius: 12px;
    z-index: 2500;
    pointer-events: auto;
    transition: opacity .2s var(--ease);
}

.site-loading-overlay:not([hidden]) {
    display: flex;
}

.site-loading-overlay[hidden] {
    opacity: 0;
}

.site-loading-overlay .glass {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.site-loading-overlay .spinner {
    width: 38px;
    height: 38px;
    border: 4px solid rgba(15,23,42,0.08);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.site-loading-overlay .label {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

.site-confirm-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,0.22);
    z-index: 3500;
    padding: 16px;
}

.site-confirm-overlay[hidden] {
    display: none;
}

.site-confirm-panel {
    width: 420px;
    max-width: calc(100% - 32px);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    padding: 14px;
    box-shadow: var(--shadow-lg);
    color: var(--text);
    flex-direction: column;
    gap: 12px;
}

.site-confirm-panel .msg {
    font-size: 0.94rem;
    color: var(--text);
}

.site-alert {
    position: fixed;
    right: 18px;
    bottom: 18px;
    min-width: 280px;
    max-width: 420px;
    padding: 12px 14px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 4000;
    gap: 12px;
    align-items: center;
    color: var(--text);
}

.site-alert[hidden] {
    display: none;
}

.site-alert::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #94a3b8;
    flex: 0 0 auto;
}

.site-alert.success,
.alert-pill.success {
    border-color: rgba(22,163,74,0.16);
}

.site-alert.success::before,
.alert-pill.success {
    background: #16a34a;
}

.site-alert.error,
.alert-pill.error {
    border-color: rgba(239,68,68,0.16);
}

.site-alert.error::before,
.alert-pill.error {
    background: #ef4444;
}

.site-alert.info,
.alert-pill.info {
    border-color: rgba(37,99,235,0.16);
}

.site-alert.info::before,
.alert-pill.info {
    background: #2563eb;
}

.site-alert.warning,
.alert-pill.warning {
    border-color: rgba(245,158,11,0.16);
}

.site-alert.warning::before,
.alert-pill.warning {
    background: #d97706;
}

.site-alert .close-btn,
.alerts-close,
.notifications-close,
.mobile-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-alert .close-btn:hover,
.alerts-close:hover,
.notifications-close:hover,
.mobile-close-btn:hover {
    background: rgba(15,23,42,0.05);
}

.alert-item,
.notification-item,
.metric-row,
.info-item {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.alert-item,
.notification-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    transition: border-color .14s ease, background .14s ease;
}

.alert-item:hover,
.notification-item:hover,
.alert-item.unread,
.notification-item.unread,
.info-item:hover,
.metric-row:hover {
    border-color: var(--border-strong);
    background: #f6fbf8;
}

.alert-item + .alert-item,
.notification-item + .notification-item {
    margin-top: 8px;
}

.alert-item .badge,
.notification-item .badge {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    margin-top: 4px;
    background: #94a3b8;
    flex: 0 0 auto;
}

.alert-item.unread .badge,
.notification-item.unread .badge {
    background: var(--brand);
}

.alert-title,
.notification-title {
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-text,
.notification-text {
    font-size: 0.9rem;
    line-height: 1.34;
    margin: 0;
}

.alert-meta,
.notification-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    font-size: 0.78rem;
    color: rgba(99, 115, 129, 0.9);
    flex-wrap: wrap;
}

.alert-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--muted);
}

.alerts-panel,
.user-alerts-panel,
.notifications-panel,
.alerts-modal {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.alerts-panel,
.notifications-panel {
    min-width: 320px;
    max-width: 460px;
    overflow: hidden;
}

.alerts-panel-header,
.user-alerts-header,
.notifications-header {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.alerts-panel-title,
.user-alerts-title,
.notifications-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
}

.alerts-panel-body,
.user-alerts-body,
.notifications-body {
    max-height: 420px;
    overflow: auto;
    padding: 10px;
}

.alerts-panel-footer,
.notifications-footer {
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.alerts-empty,
.notifications-empty {
    padding: 18px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.alerts-empty strong,
.notifications-empty strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}

/* Auth / landing page */
.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    position: relative;
    padding: 36px 32px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px) scale(.98);
    animation: cardIn .7s cubic-bezier(.22,1,.36,1) .05s forwards;
    transition: box-shadow .3s ease, transform .3s ease;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: -60px -60px auto auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31, 122, 77, 0.10) 0, transparent 70%);
    pointer-events: none;
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

.brand-row {
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    overflow: hidden;
    flex: none;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 10px 22px rgba(15, 74, 51, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-mark img,
.user-avatar img,
.sidebar .logo-top img {
    object-fit: contain;
}

.brand-mark img {
    width: 68%;
    height: 68%;
    display: block;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-tagline {
    margin-top: 2px;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
}

.brand-divider {
    margin: 24px 0 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(15,23,42,0.08) 0%, transparent 100%);
}

.qr-card,
.auth-card {
    width: 100%;
    max-width: 520px;
    margin: 40px auto;
}

.qr-card:hover,
.auth-card:hover {
    box-shadow: 0 28px 70px rgba(15,23,42,0.10);
}

.qr-card > div:first-child,
.qr-card > div:first-child > div {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qr-form {
    margin-top: 8px;
}

.qr-form-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 12px;
}

.qr-input-wrapper {
    flex: 1 1 100%;
    min-width: 0;
}

.qr-title {
    font-size: 1.35rem;
    margin: 0 0 8px 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.qr-subtitle {
    margin: 0;
    font-size: 0.95rem;
}

/* Vehicles / dashboards / metrics */
.vehicle-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 2px 2px 12px;
    color: var(--text);
    background: transparent;
}

.vehicle-header {
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    backdrop-filter: blur(10px) saturate(120%);
}

.vehicle-title h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 800;
}

.vehicle-title .muted {
    margin-top: 4px;
    font-size: .95rem;
}

.vehicle-actions {
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.tabs {
    gap: 8px;
    margin: 0;
    padding: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    transition: background .18s var(--ease), color .18s var(--ease), transform .12s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--brand);
}

.tab-btn.active {
    background: linear-gradient(180deg, #ffffff, #f7fafb);
    border-color: rgba(27,94,75,0.14);
    box-shadow: 0 10px 20px rgba(27,94,75,0.06);
}

.tab-panels {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,249,251,0.96));
    border-color: rgba(15,23,42,0.08);
}

.tab-panel {
    display: none;
    background: transparent;
    color: var(--text);
}

.tab-panel.active {
    display: block;
}

.vehicle-info-grid {
    display: grid;
    grid-template-columns: minmax(280px, 320px) 1fr;
    gap: 16px;
    align-items: start;
}

.info-identity {
    padding: 18px;
}

.vehicle-plate {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.plate-badge {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(27,94,75,.10), rgba(27,94,75,.06));
    color: var(--brand-dark);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 12px 24px rgba(27,94,75,0.08);
}

.plate-meta {
    text-align: right;
    color: var(--muted);
    font-size: .9rem;
}

.identity-stats {
    gap: 8px;
    margin-top: 14px;
}

.stat,
.info-item,
.metric-row {
    padding: 12px;
}

.stat {
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f7fafc);
    border: 1px solid rgba(15, 23, 42, 0.06);
    text-align: center;
}

.stat .n {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.stat .l {
    margin-top: 4px;
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.info-grid {
    gap: 10px;
    flex-wrap: wrap;
}

.info-item {
    flex-direction: column;
    min-width: 0;
    color: var(--text);
}

.info-item .label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.metric-list {
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.metric-row {
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    background: rgba(31, 122, 77, 0.03);
}

.metric-row dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-row dd {
    margin: 0;
    color: var(--brand-dark);
    font-size: 1.15rem;
    font-weight: 900;
}

.kpi-value {
    color: var(--brand-dark);
    font-size: 1.15rem;
    font-weight: 900;
}

.service-line-list,
.state-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Scrollbars */
.sidebar-body,
.content-wrap,
#mainScroll,
.alerts-panel-body,
.user-alerts-body,
.notifications-body {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

.sidebar-body::-webkit-scrollbar,
.content-wrap::-webkit-scrollbar,
#mainScroll::-webkit-scrollbar,
.alerts-panel-body::-webkit-scrollbar,
.user-alerts-body::-webkit-scrollbar,
.notifications-body::-webkit-scrollbar {
    width: 7px;
    background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb,
.content-wrap::-webkit-scrollbar-thumb,
#mainScroll::-webkit-scrollbar-thumb,
.alerts-panel-body::-webkit-scrollbar-thumb,
.user-alerts-body::-webkit-scrollbar-thumb,
.notifications-body::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
}

.sidebar-body::-webkit-scrollbar-track,
.content-wrap::-webkit-scrollbar-track,
#mainScroll::-webkit-scrollbar-track,
.alerts-panel-body::-webkit-scrollbar-track,
.user-alerts-body::-webkit-scrollbar-track,
.notifications-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Motion */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes menuItemIn {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes badgePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.15);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topbar,
.sidebar,
.content-wrap,
#mainScroll,
.topbar-alert-badge,
.site-alert:not([hidden]),
.sidebar-group-body .menu-item {
    animation: fadeSlideIn .42s var(--ease) both;
}

.sidebar {
    animation-delay: .04s;
}

.content-wrap,
#mainScroll {
    animation-delay: .08s;
}

.sidebar-group-body .menu-item {
    animation: menuItemIn .28s var(--ease) both;
}

.sidebar-group-body .menu-item:nth-child(1) { animation-delay: .02s; }
.sidebar-group-body .menu-item:nth-child(2) { animation-delay: .05s; }
.sidebar-group-body .menu-item:nth-child(3) { animation-delay: .08s; }
.sidebar-group-body .menu-item:nth-child(4) { animation-delay: .11s; }
.sidebar-group-body .menu-item:nth-child(5) { animation-delay: .14s; }
.sidebar-group-body .menu-item:nth-child(6) { animation-delay: .17s; }
.sidebar-group-body .menu-item:nth-child(n+7) { animation-delay: .20s; }

.topbar-alert-badge {
    animation: badgePop .32s var(--ease) both;
}

.site-alert:not([hidden]) {
    animation: alertSlideIn .26s var(--ease) both;
}

/* Responsive */
@media (max-width: 767px) {
    .content-row {
        gap: 16px;
        margin: 12px var(--page-padding) 28px;
        width: calc(100% - (var(--page-padding) * 2));
    }

    .main-column {
        width: 100%;
    }

    .topbar {
        margin: 12px var(--page-padding);
        border-radius: 14px;
    }

    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,0.16);
        z-index: 2000;
        opacity: 0;
        transition: opacity .24s var(--ease);
        pointer-events: none;
    }

    .mobile-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    #sidebarLg {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        transform: translateX(-110%) !important;
        transition: transform .26s var(--ease);
        z-index: 2100;
        margin: 0 !important;
        border-radius: 0;
        padding-top: 56px;
    }

    #sidebarLg.open {
        transform: translateX(0) !important;
    }

    #sidebarLg.collapsed {
        width: 100% !important;
        min-width: 0;
        padding-top: 56px;
        opacity: 1;
        pointer-events: auto;
        border: 1px solid rgba(31, 122, 77, 0.12);
        box-shadow: var(--shadow-lg);
    }

    #sidebarLg.collapsed .logo-top,
    #sidebarLg.collapsed .sidebar-body,
    #sidebarLg.collapsed .sidebar-footer,
    #sidebarLg.open.collapsed .logo-top,
    #sidebarLg.open.collapsed .sidebar-body,
    #sidebarLg.open.collapsed .sidebar-footer {
        display: none;
    }

    #sidebarLg.open .logo-top,
    #sidebarLg.open .sidebar-body,
    #sidebarLg.open .sidebar-footer {
        display: flex;
    }

    #sidebarLg .logo-top {
        display: none !important;
    }

    #sidebarLg .sidebar-body {
        padding: 24px 18px;
    }

    #sidebarLg .menu-item,
    #sidebarLg .nav-item {
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 10px;
    }

    #sidebarLg .sidebar-footer {
        padding: 18px;
        font-size: .9rem;
    }

    .mobile-close-btn {
        display: none;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: var(--surface-solid);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-soft);
        align-items: center;
        justify-content: center;
        z-index: 2200;
    }

    #sidebarLg.open .mobile-close-btn {
        display: flex !important;
    }

    .topbar-icon-btn {
        width: 46px;
        height: 46px;
    }

    .alerts-panel,
    .user-alerts-panel,
    .alerts-modal,
    .notifications-panel {
        max-width: calc(100vw - 24px);
        min-width: 0;
    }

    .site-alert {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
        min-width: 0;
    }

    .vehicle-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .vehicle-info-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .app-row > div {
        max-width: 100% !important;
        flex-basis: 100% !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .menu-item:active,
    .nav-item:active,
    .topbar-icon-btn:active,
    .topbar-user-btn:active,
    .btn:active,
    .btn-special:active,
    .glass-btn:active,
    .glass-action-btn:active,
    .btn-modern-primary:active,
    .btn-glass:active,
    .sidebar-group-header:active {
        transform: none !important;
    }
}
