/* ==========================================================================
   FLYRAST V2 SUPER — DARK MODE HIGH-TECH DESIGN SYSTEM
   SaaS Elite · Neon Color Coding · Glassmorphism · SVG Motion
   ========================================================================== */

/* ── 1. DESIGN TOKENS & NEON COLOR MAP ───────────────────────────── */
:root {
    /* Neon Palette per Tab */
    --neon-dashboard: #00E5FF;
    --neon-mapa: #00E676;
    --neon-veiculos: #D500F9;
    --neon-dispositivos: #FF9100;
    --neon-manutencoes: #1DE9B6;
    --neon-telemetria: #FF1744;
    --neon-usuarios: #448AFF;
    --neon-relatorios: #FFD600;
    --neon-financeiro: #FFD600;
    --neon-empresas: #76FF03;
    --neon-perfil: #B0BEC5;

    /* Active accent — default cyan */
    --c-accent: var(--neon-dashboard);
    --c-accent-15: color-mix(in srgb, var(--c-accent) 15%, transparent);
    --c-accent-30: color-mix(in srgb, var(--c-accent) 30%, transparent);
    --c-accent-glow: color-mix(in srgb, var(--c-accent) 40%, transparent);

    /* Legacy compat — JS sets --c-primary on login */
    --c-primary: #6b21a8;
    --c-primary-15: color-mix(in srgb, var(--c-primary) 15%, transparent);
    --c-primary-30: color-mix(in srgb, var(--c-primary) 30%, transparent);

    /* Semantic */
    --c-success: #00E676;
    --c-danger: #FF1744;
    --c-warning: #FF9100;
    --c-info: #448AFF;
    --c-cyan: #00E5FF;

    /* Radius */
    --r-xl: 20px;
    --r-lg: 14px;
    --r-md: 10px;
    --r-sm: 6px;
    --space: 24px;

    /* Motion */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --smooth: cubic-bezier(.16, 1, .3, 1);

    /* Typography */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── NEON SWITCHING via data-active-view ─────────────────────────── */
[data-active-view="dashboard"] {
    --c-accent: var(--neon-dashboard);
}

[data-active-view="mapa"] {
    --c-accent: var(--neon-mapa);
}

[data-active-view="veiculos"] {
    --c-accent: var(--neon-veiculos);
}

[data-active-view="dispositivos"] {
    --c-accent: var(--neon-dispositivos);
}

[data-active-view="manutencoes"] {
    --c-accent: var(--neon-manutencoes);
}

[data-active-view="telemetria"] {
    --c-accent: var(--neon-telemetria);
}

[data-active-view="usuarios"] {
    --c-accent: var(--neon-usuarios);
}

[data-active-view="relatorios"] {
    --c-accent: var(--neon-relatorios);
}

[data-active-view="financeiro"] {
    --c-accent: var(--neon-financeiro);
}

[data-active-view="empresas"] {
    --c-accent: var(--neon-empresas);
}

[data-active-view="perfil"] {
    --c-accent: var(--neon-perfil);
}

/* ── DARK THEME ─────────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-body: #161920;
    --bg-surface: rgba(26, 29, 36, .75);
    --bg-card: rgba(30, 33, 40, .85);
    --bg-card-rgb: 30, 33, 40;
    --bg-hover: rgba(255, 255, 255, .04);
    --bg-input: rgba(0, 0, 0, .4);
    --border: rgba(255, 255, 255, .06);
    --border-strong: rgba(255, 255, 255, .12);
    --text-1: #E8ECF4;
    --text-2: #8892A4;
    --text-3: #556178;
    --shadow: 0 8px 32px rgba(0, 0, 0, .45);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-modal: 0 24px 80px rgba(0, 0, 0, .7);
    --skel-base: rgba(255, 255, 255, .04);
    --skel-shine: rgba(255, 255, 255, .08);
}

[data-theme="light"] {
    --bg-body: #F0F2F5;
    --bg-surface: rgba(255, 255, 255, .8);
    --bg-card: rgba(255, 255, 255, .92);
    --bg-card-rgb: 255, 255, 255;
    --bg-hover: rgba(0, 0, 0, .03);
    --bg-input: rgba(0, 0, 0, .04);
    --border: rgba(0, 0, 0, .08);
    --border-strong: rgba(0, 0, 0, .14);
    --text-1: #0F172A;
    --text-2: #475569;
    --text-3: #94A3B8;
    --shadow: 0 4px 24px rgba(0, 0, 0, .08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .05);
    --shadow-modal: 0 24px 60px rgba(0, 0, 0, .15);
    --skel-base: rgba(0, 0, 0, .06);
    --skel-shine: rgba(0, 0, 0, .1);
}

/* ── 2. RESET ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14.5px;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-body);
    color: var(--text-1);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background .4s var(--ease), color .4s var(--ease);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input,
select,
textarea {
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* ── 3. GLASS CARD ───────────────────────────────────────────────── */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    transition: background .4s, border-color .4s, box-shadow .4s;
}

/* ── 4. BUTTONS ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: .88rem;
    white-space: nowrap;
    transition: all .25s var(--ease);
}

.btn-primary {
    background: var(--c-accent);
    color: #000;
    font-weight: 700;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--c-accent-30);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: .8rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-2);
}

.btn-outline:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 8px 12px;
    font-size: .82rem;
}

.btn-ghost:hover {
    color: var(--text-1);
    background: var(--bg-hover);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-2);
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    transition: background .2s, color .2s;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--c-accent);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: .8rem;
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--text-1);
}

.btn-danger {
    background: rgba(255, 23, 68, .12);
    color: var(--c-danger);
    border: none;
}

.btn-danger:hover {
    background: rgba(255, 23, 68, .22);
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: .8rem;
    border-radius: var(--r-md);
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-2);
    transition: all .25s;
}

.btn-export:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.btn-export svg {
    width: 16px;
    height: 16px;
}

.btn-press {
    transition: transform .15s var(--spring) !important;
}

.btn-press:active {
    transform: scale(.95) !important;
}

.btn-glow {
    transition: all .3s var(--ease);
}

.btn-glow:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px var(--c-accent-30);
}

/* ── 5. LOGIN ────────────────────────────────────────────────────── */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 30% 20%, rgba(0, 229, 255, .06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(213, 0, 249, .06) 0%, transparent 50%),
        var(--bg-body);
}

.login-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .25;
    animation: orbFloat 14s ease-in-out infinite alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--c-accent);
    top: -10%;
    left: -5%;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #D500F9;
    bottom: -8%;
    right: -5%;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: var(--c-accent);
    top: 50%;
    left: 60%;
    animation-delay: -9s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -20px) scale(1.15);
    }
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 34px;
    position: relative;
    z-index: 1;
    animation: springIn .55s var(--spring);
    border: 1px solid rgba(255, 255, 255, .08);
}

@keyframes springIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.94);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    color: var(--c-accent);
    transition: color .4s;
}

.brand-icon svg {
    width: 100%;
    height: 100%;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.5px;
}

.login-tagline {
    color: var(--text-3);
    font-size: .82rem;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-3);
    margin-bottom: 5px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 13px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-1);
    font-size: .9rem;
    transition: border-color .25s, box-shadow .25s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-15), 0 0 20px var(--c-accent-15);
}

.field-error {
    color: var(--c-danger);
    font-size: .78rem;
    min-height: 18px;
    text-align: center;
}

.company-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--c-accent-15);
    border: 1px solid var(--c-accent-30);
    border-radius: var(--r-sm);
    margin-bottom: 18px;
}

.company-badge span {
    font-weight: 600;
    color: var(--c-accent);
    font-size: .88rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── 6. APP LAYOUT ───────────────────────────────────────────────── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    animation: fadeUp .35s var(--ease);
    background: var(--bg-body);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Sidebar */
.sidebar {
    width: 240px;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 30;
    transition: background .4s, border-color .4s;
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--c-accent-30), transparent);
    transition: background .6s var(--ease);
}

.sidebar-brand {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    color: var(--c-accent);
    transition: color .4s var(--ease);
}

.sidebar-brand svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-label {
    padding: 16px 12px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.6;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-2);
    transition: all .3s var(--ease);
    position: relative;
}

.nav-link svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    transition: color .3s, filter .3s;
}

.nav-link:hover {
    color: var(--text-1);
    background: var(--bg-hover);
    transform: translateX(4px);
}

/* ── Color Coding per Tab ────────────────────────────────────────── */
.nav-link[data-view="dashboard"]:hover,
.nav-link[data-view="dashboard"].active {
    --tab-color: var(--neon-dashboard);
}

.nav-link[data-view="mapa"]:hover,
.nav-link[data-view="mapa"].active {
    --tab-color: var(--neon-mapa);
}

.nav-link[data-view="veiculos"]:hover,
.nav-link[data-view="veiculos"].active {
    --tab-color: var(--neon-veiculos);
}

.nav-link[data-view="dispositivos"]:hover,
.nav-link[data-view="dispositivos"].active {
    --tab-color: var(--neon-dispositivos);
}

.nav-link[data-view="manutencoes"]:hover,
.nav-link[data-view="manutencoes"].active {
    --tab-color: var(--neon-manutencoes);
}

.nav-link[data-view="telemetria"]:hover,
.nav-link[data-view="telemetria"].active {
    --tab-color: var(--neon-telemetria);
}

.nav-link[data-view="relatorios"]:hover,
.nav-link[data-view="relatorios"].active {
    --tab-color: var(--neon-relatorios);
}

.nav-link[data-view="financeiro"]:hover,
.nav-link[data-view="financeiro"].active {
    --tab-color: var(--neon-financeiro);
}

.nav-link[data-view="empresas"]:hover,
.nav-link[data-view="empresas"].active {
    --tab-color: var(--neon-empresas);
}

.nav-link[data-view="usuarios"]:hover,
.nav-link[data-view="usuarios"].active {
    --tab-color: var(--neon-usuarios);
}

.nav-link[data-view="perfil"]:hover,
.nav-link[data-view="perfil"].active {
    --tab-color: var(--neon-perfil);
}

.nav-link:hover {
    color: var(--tab-color, var(--text-1));
}

.nav-link.active {
    color: var(--tab-color, var(--c-accent));
    background: color-mix(in srgb, var(--tab-color, var(--c-accent)) 12%, transparent);
    font-weight: 700;
    transform: none;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--tab-color, var(--c-accent));
    border-radius: 0 4px 4px 0;
    transition: height 0.3s var(--spring);
    box-shadow: 0 0 10px var(--tab-color, var(--c-accent));
}

.nav-link.active::before {
    height: 60%;
}

.nav-link.active svg {
    filter: drop-shadow(0 0 8px var(--tab-color));
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--c-danger);
    font-size: .84rem;
    font-weight: 500;
    border-radius: var(--r-md);
    transition: background .2s;
}

.btn-logout svg {
    width: 19px;
    height: 19px;
}

.btn-logout:hover {
    background: rgba(255, 23, 68, .08);
}

/* Main & Topbar */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s var(--ease);
}

.topbar {
    height: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 10;
    transition: background .4s, border-color .4s;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar h2 {
    font-size: clamp(.9rem, 2vw, 1.05rem);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-pill {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    background: var(--c-accent);
    transition: background .4s;
}

.avatar-name {
    font-size: .82rem;
    color: var(--text-2);
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--space);
}

.mobile-only {
    display: none;
}

/* ── 7. VIEWS ────────────────────────────────────────────────────── */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: viewSlideIn .4s var(--spring);
}

@keyframes viewSlideIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── 8. KPI CARDS ────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 16px;
    margin-bottom: var(--space);
}

.kpi {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: transform .3s var(--spring), background .2s, border-color .4s, box-shadow .4s;
}

.kpi:hover {
    transform: translateY(-4px);
    border-color: var(--c-accent-30);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .2), 0 0 15px var(--c-accent-15);
}

.kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-label {
    font-size: .76rem;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.kpi-icon {
    width: 20px;
    height: 20px;
}

.kpi-value {
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1;
}

.kpi-clickable {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.kpi-clickable::after {
    content: 'Clique para ver';
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: .6rem;
    color: var(--text-3);
    opacity: 0;
    transition: opacity .2s;
}

.kpi-clickable:hover::after {
    opacity: 1;
}

.kpi-clickable:hover {
    border-color: var(--c-accent);
}

.gear-ico {
    transition: transform .3s;
}

.kpi:hover .gear-ico {
    transform: rotate(45deg);
}

/* ── 9. MAP SUMMARY PANEL ────────────────────────────────────────── */
#map-summary-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 290px;
    border-radius: var(--r-lg);
    background: var(--bg-surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-modal);
    color: var(--text-1);
    transition: width .3s var(--ease);
    overflow: hidden;
}

#map-summary-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-strong);
    background: rgba(0, 0, 0, .15);
}

#map-summary-panel .panel-header h4 {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}

#map-summary-panel .panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 18px;
    transition: max-height .4s ease, opacity .3s ease, transform .3s ease;
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
}

#map-summary-panel .summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
    transition: transform .2s, border-color .2s;
}

#map-summary-panel .summary-item:hover {
    transform: translateY(-2px);
    border-color: var(--c-accent-30);
}

#map-summary-panel .summary-item .val {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

#map-summary-panel .summary-item .lbl {
    font-size: .65rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .5px;
}

#map-summary-panel.minimized .panel-body {
    max-height: 0;
    padding: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#map-summary-panel.minimized .panel-header {
    border-bottom: none;
    background: transparent;
}

/* ── 10. CHARTS & WIDGETS ────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: var(--space);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: var(--space);
}

.widget {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: background .4s, border-color .4s, box-shadow .4s;
}

.widget:hover {
    border-color: var(--c-accent-30);
    box-shadow: 0 0 20px var(--c-accent-15);
}

.widget-title {
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title svg {
    width: 18px;
    height: 18px;
    color: var(--c-accent);
    transition: color .4s;
}

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
}

.donut-svg {
    transform: rotate(-90deg);
}

.donut-segment {
    stroke-dasharray: 0 100;
    animation: donutDraw 1.2s var(--ease) forwards;
}

@keyframes donutDraw {
    to {
        stroke-dasharray: var(--target-dash);
    }
}

.donut-val-center {
    position: absolute;
    top: 50%;
    left: 50px;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-1);
}

.donut-clickable {
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
}

.donut-clickable:hover {
    transform: scale(1.03);
    opacity: .8;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    font-size: .85rem;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.line-chart-svg {
    width: 100%;
    height: 120px;
    overflow: visible;
    margin-top: 10px;
}

.line-path {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .2));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: lineDrawIn 2s var(--ease) forwards;
}

@keyframes lineDrawIn {
    to {
        stroke-dashoffset: 0;
    }
}

.line-chart-svg .area-fill {
    opacity: 0;
    animation: areaFade .8s .5s var(--ease) forwards;
}

@keyframes areaFade {
    to {
        opacity: 1;
    }
}

.line-chart-svg .dot {
    transition: r .2s;
    opacity: 0;
    animation: dotPop .3s var(--spring) forwards;
}

.line-chart-svg .dot:hover {
    r: 5;
}

@keyframes dotPop {
    to {
        opacity: 1;
    }
}

.line-chart-svg .grid-ln {
    stroke: var(--border);
    stroke-width: 1;
}

.line-chart-svg text {
    fill: var(--text-3);
    font-size: 10px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 120px;
    margin-top: 10px;
    padding-bottom: 20px;
    position: relative;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30px;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.bar {
    width: 20px;
    border-radius: 4px 4px 0 0;
    transition: height .8s var(--smooth);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .15);
}

.bar-label {
    position: absolute;
    bottom: -20px;
    font-size: .75rem;
    color: var(--text-3);
    white-space: nowrap;
}

/* ── 11. DATA TABLES ─────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.data-table th {
    text-align: left;
    padding: 11px 14px;
    font-weight: 600;
    font-size: .72rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border-strong);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    transition: background .2s;
}

.data-table tr {
    transition: transform .2s var(--ease), opacity .3s;
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

/* ── 12. BADGES ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 230, 118, .12);
    color: var(--c-success);
}

.badge-danger {
    background: rgba(255, 23, 68, .12);
    color: var(--c-danger);
}

.badge-warning {
    background: rgba(255, 145, 0, .12);
    color: var(--c-warning);
}

.badge-info {
    background: rgba(68, 138, 255, .12);
    color: var(--c-info);
}

.badge-primary {
    background: var(--c-accent-15);
    color: var(--c-accent);
}

.badge-muted {
    background: rgba(100, 116, 139, .12);
    color: var(--text-3);
}

/* ── 13. ALERTS ──────────────────────────────────────────────────── */
.alert-list {
    display: flex;
    flex-direction: column;
    max-height: 300px;
    overflow-y: auto;
}

.alert-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    animation: alertIn .35s var(--spring) both;
}

.alert-row:last-child {
    border-bottom: none;
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.alert-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-body {
    flex: 1;
}

.alert-body strong {
    font-size: .82rem;
    display: block;
    margin-bottom: 2px;
}

.alert-body small {
    color: var(--text-3);
    font-size: .72rem;
}

/* ── 14. TABS ────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 9px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-3);
    cursor: pointer;
    transition: all .25s var(--spring);
}

.tab-btn:hover {
    border-color: var(--c-accent);
    color: var(--text-1);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #000;
    font-weight: 700;
    transform: translateY(0);
}

/* ── 15. MAP ─────────────────────────────────────────────────────── */
.map-container {
    position: relative;
    border-radius: var(--r-lg);
    height: calc(100vh - 60px - var(--space)*2);
    border: 1px solid var(--border);
    overflow: hidden;
}

#leaflet-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-1) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--r-md) !important;
    box-shadow: var(--shadow) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: .82rem !important;
}

.popup-title {
    font-weight: 700;
    font-size: .92rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-label {
    color: var(--text-3);
}

.popup-val {
    font-weight: 600;
}

.popup-bat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.popup-bat svg {
    width: 16px;
    height: 16px;
}

/* Map Filters */
.map-float-panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    color: var(--text-2);
    cursor: pointer;
}

.filter-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--c-accent);
    cursor: pointer;
}

.map-advanced-filters {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 280px;
    background: rgba(var(--bg-card-rgb), .88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 400;
}

.map-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-filter-group label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
}

.map-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.map-chip {
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-2);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s var(--smooth);
}

.map-chip:hover {
    border-color: var(--c-accent-30);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.map-chip.active {
    background: var(--c-accent);
    color: #000;
    border-color: var(--c-accent);
    box-shadow: 0 4px 12px var(--c-accent-30);
    font-weight: 700;
}

.map-summary {
    top: 16px;
    right: 16px;
    display: flex;
    gap: 16px;
}

.map-summary-item {
    text-align: center;
}

.map-summary-item .val {
    font-size: 1.2rem;
    font-weight: 700;
}

.map-summary-item .lbl {
    font-size: .70rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.map-advanced-filters.minimized {
    height: 48px !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
}

.map-advanced-filters.minimized .map-filter-group {
    display: none !important;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 15px;
    padding-bottom: 5px;
}

.map-advanced-filters.minimized .filter-header {
    margin-bottom: 0;
}

.btn-collapse {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-2);
    font-weight: bold;
}

/* Bottom Panel */
#vehicle-bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    background: rgba(var(--bg-card-rgb), .92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, .3);
    padding: 20px;
    transform: translateY(110%);
    transition: transform .3s ease;
}

#vehicle-bottom-panel.visible {
    transform: translateY(0);
}

.vpn-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.vpn-title h3 {
    margin: 0 0 4px 0;
    font-size: 1.3rem;
    color: var(--text-1);
}

.vpn-title p {
    margin: 0;
    font-size: .9rem;
    color: var(--text-2);
}

.vpn-body {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.vpn-info-item {
    background: var(--bg-body);
    padding: 10px 15px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}

.vpn-info-item span {
    display: block;
    font-size: .75rem;
    color: var(--text-3);
    text-transform: uppercase;
}

.vpn-info-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-1);
    margin-top: 4px;
}

.vpn-footer {
    display: flex;
    gap: 12px;
}

.btn-outline.anchor-active {
    background-color: rgba(255, 23, 68, .1);
    border-color: var(--c-danger);
    color: var(--c-danger);
    box-shadow: 0 0 8px rgba(255, 23, 68, .3);
}

.custom-marker {
    transition: transform .2s var(--ease);
}

.custom-marker:hover {
    transform: scale(1.15);
    z-index: 1000 !important;
}

.grid-telemetry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.grid-telemetry .full-width {
    grid-column: span 2;
}

.bp-detail {
    text-align: center;
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--r-md);
}

.bp-detail .bp-val {
    font-size: 1.1rem;
    font-weight: 800;
}

.bp-detail .bp-lbl {
    font-size: .68rem;
    color: var(--text-3);
    margin-top: 2px;
}

.bp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.bp-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-card);
    color: var(--text-2);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .25s var(--spring);
}

.bp-action-btn:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
    transform: translateY(-2px);
}

.bp-action-btn svg {
    width: 16px;
    height: 16px;
}

.bp-action-btn.anchor-active {
    border-color: var(--c-danger);
    color: var(--c-danger);
    background: rgba(255, 23, 68, .08);
}

/* ── 16. VEHICLE DRILLDOWN ───────────────────────────────────────── */
.drilldown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 10px 0;
}

.drill-section h4 {
    font-size: .85rem;
    color: var(--c-accent);
    text-transform: uppercase;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    transition: color .4s;
}

.drill-item {
    margin-bottom: 12px;
}

.drill-item span {
    display: block;
    font-size: .72rem;
    color: var(--text-3);
    text-transform: uppercase;
}

.drill-item strong {
    display: block;
    font-size: 1rem;
    color: var(--text-1);
    margin-top: 2px;
}

@media(max-width:600px) {
    .drilldown-grid {
        grid-template-columns: 1fr;
    }
}

.disp-default-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-accent);
    box-shadow: var(--shadow-sm);
    transition: color .4s;
}

.disp-default-icon svg {
    width: 18px;
    height: 18px;
}

/* ── 17. REPORTS & EXPORTS ───────────────────────────────────────── */
.report-headers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.report-title h4 {
    font-size: 1rem;
    color: var(--text-1);
    font-weight: 600;
}

.export-group {
    display: flex;
    gap: 10px;
}

/* ── 18. SKELETONS ───────────────────────────────────────────────── */
.skeleton-box {
    padding: 24px;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--skel-base);
    border-radius: var(--r-sm);
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--skel-shine), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.skel-line {
    height: 14px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--border) 25%, var(--bg-body) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}

.skel-line.w60 {
    width: 60%;
}

.skel-line.w80 {
    width: 80%;
}

.skel-line.w40 {
    width: 40%;
}

.skel-block {
    height: 200px;
    border-radius: var(--r-md);
    margin-bottom: 16px;
    background: linear-gradient(90deg, var(--border) 25%, var(--bg-body) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── 19. CALENDAR PICKER ─────────────────────────────────────────── */
.calendar-popover {
    position: absolute;
    z-index: 1000;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-modal);
    padding: 16px;
    width: 280px;
    display: none;
    animation: slideUp .3s ease;
}

.calendar-popover.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-header h5 {
    font-size: .9rem;
    color: var(--text-1);
    margin: 0;
}

.calendar-nav {
    display: flex;
    gap: 5px;
}

.calendar-nav button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.calendar-nav button:hover {
    background: var(--c-accent);
    color: #000;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.calendar-weekday {
    font-size: .7rem;
    color: var(--text-3);
    padding: 5px 0;
    font-weight: 600;
}

.calendar-day {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    color: var(--text-2);
    cursor: pointer;
    border-radius: 8px;
    transition: all .2s;
}

.calendar-day:hover {
    background: var(--bg-body);
    color: var(--c-accent);
}

.calendar-day.today {
    box-shadow: inset 0 0 0 1px var(--c-accent);
}

.calendar-day.selected {
    background: var(--c-accent);
    color: #000;
}

.calendar-day.other-month {
    opacity: .3;
}

/* ── 20. FINANCEIRO PREMIUM ──────────────────────────────────────── */
.fin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.fin-kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .3s, border-color .4s, box-shadow .4s;
}

.fin-kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--c-accent-30);
    box-shadow: 0 0 20px var(--c-accent-15);
}

.fin-kpi-label {
    font-size: .75rem;
    color: var(--text-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.fin-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-1);
}

.fin-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.chart-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    position: relative;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-1);
}

.chart-svg-container {
    width: 100%;
    height: 180px;
}

.chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.path-animate {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 2s ease-out forwards;
}

.donut-animate {
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    animation: drawDonut 1.5s ease-out forwards;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawDonut {
    to {
        stroke-dashoffset: 0;
    }
}

.fade-slide-out {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: all .4s ease;
}

.fade-slide-in {
    opacity: 1;
    transform: translateX(0);
    transition: all .4s ease;
}

.hidden-panel {
    display: none;
    opacity: 0;
    transform: translateX(20px);
}

.fin-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: var(--space);
}

.fin-card {
    padding: 20px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: background .4s, border-color .4s, transform .2s var(--spring);
}

.fin-card:hover {
    transform: translateY(-2px);
    border-color: var(--c-accent-30);
}

.fin-card .fin-val {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.fin-card .fin-label {
    font-size: .78rem;
    color: var(--text-3);
}

/* ── 21. MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modalBgIn .25s var(--ease);
}

@keyframes modalBgIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.modal-box {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSpring .4s var(--spring);
    box-shadow: var(--shadow-modal);
    border: 1px solid rgba(255, 255, 255, .08);
}

@keyframes modalSpring {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.92);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.cond-section {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.cond-section h4 {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 12px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── 22. TOGGLE SWITCH ───────────────────────────────────────────── */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    inset: 0;
    background: var(--border-strong);
    border-radius: 24px;
    cursor: pointer;
    transition: background .3s var(--ease);
}

.switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .3s var(--spring);
}

.switch input:checked+.slider {
    background: var(--c-accent);
}

.switch input:checked+.slider::before {
    transform: translateX(18px);
}

/* ── 23. DETAIL / TELEMETRY ──────────────────────────────────────── */
.detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-field .label {
    font-size: .72rem;
    color: var(--text-3);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.detail-field .value {
    font-size: .88rem;
    color: var(--text-1);
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-block;
    vertical-align: middle;
    border: 2px solid var(--border-strong);
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.telemetry-item {
    text-align: center;
    padding: 14px;
    background: var(--bg-input);
    border-radius: var(--r-md);
    transition: transform .2s var(--spring);
}

.telemetry-item:hover {
    transform: scale(1.03);
}

.telemetry-item .t-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--c-accent);
    transition: color .4s;
}

.telemetry-item .t-label {
    font-size: .72rem;
    color: var(--text-3);
    margin-top: 4px;
}

/* ── 24. PROFILE ─────────────────────────────────────────────────── */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    margin-bottom: var(--space);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    background: var(--c-accent);
    transition: background .4s;
    box-shadow: 0 0 25px var(--c-accent-30);
}

.profile-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.profile-info p {
    color: var(--text-3);
    font-size: .85rem;
    margin-top: 2px;
}

.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    animation: fadeUp .5s ease;
}

.profile-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-avatar-hero {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--c-accent);
    color: #000;
    font-size: 2.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 0 40px var(--c-accent-30);
    border: 4px solid var(--bg-card);
    transition: background .4s, box-shadow .4s;
}

.profile-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.profile-card h4 {
    font-size: 1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-custody-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.custody-item {
    background: var(--bg-input);
    padding: 15px;
    border-radius: var(--r-md);
    text-align: center;
}

.custody-val {
    font-size: 1.4rem;
    font-weight: 800;
    display: block;
}

.custody-lab {
    font-size: .7rem;
    color: var(--text-3);
    text-transform: uppercase;
}

.btn-save-profile {
    transition: all .3s var(--spring);
}

.btn-save-profile:hover {
    transform: scale(1.02);
    box-shadow: 0 0 25px var(--c-accent-30);
}

/* ── 25. SECTIONS & REPORTS FILTERS ──────────────────────────────── */
.report-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.report-filters .field {
    margin-bottom: 0;
    min-width: 140px;
}

.report-content {
    animation: viewSlideIn .4s var(--spring);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.section-header .actions {
    display: flex;
    gap: 8px;
}

/* ── 26. TOAST ───────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 14px 28px;
    border-radius: var(--r-md);
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
    background: var(--c-success);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
    transition: bottom .4s var(--spring), background .3s var(--ease);
}

.toast.show {
    bottom: 30px;
}

.toast-success {
    background: var(--c-success);
}

.toast-error {
    background: var(--c-danger);
}

/* ── 27. PERMISSIONS ─────────────────────────────────────────────── */
.perm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.perm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--r-sm);
    font-size: .82rem;
    color: var(--text-2);
}

/* ── 28. MAINTENANCE CARDS ───────────────────────────────────────── */
.maint-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 10px;
    transition: transform .2s var(--spring), border-color .4s;
    animation: alertIn .35s var(--spring) both;
}

.maint-card:hover {
    transform: translateY(-2px);
    border-color: var(--c-accent-30);
}

.maint-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.maint-body {
    flex: 1;
}

.maint-body strong {
    font-size: .88rem;
    display: block;
    margin-bottom: 2px;
}

.maint-body small {
    color: var(--text-3);
    font-size: .75rem;
}

.maint-actions {
    display: flex;
    gap: 6px;
}

/* ── 29. TENANT DRILL-DOWN ───────────────────────────────────────── */
.tenant-drill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.tenant-card-premium {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all .3s var(--spring);
    position: relative;
    overflow: hidden;
}

.tenant-card-premium:hover {
    transform: translateY(-5px);
    border-color: var(--c-accent);
    box-shadow: 0 10px 30px -10px var(--c-accent-30);
}

.tenant-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--company-color, var(--c-accent));
}

.tenant-grid-details {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
    margin-top: 30px;
}

.user-profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    transition: all .2s ease;
}

.user-profile-card:hover {
    background: var(--bg-body);
    box-shadow: var(--shadow-sm);
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--c-accent);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background .4s;
}

.user-card-info h5 {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.user-card-info p {
    font-size: .75rem;
    color: var(--text-3);
}

.vehicle-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    transition: background .2s;
}

.vehicle-mini-item:hover {
    background: var(--bg-input);
}

.glow-btn {
    box-shadow: 0 0 15px var(--c-accent-15);
}

.glow-btn:hover {
    box-shadow: 0 0 25px var(--c-accent-30);
}

/* ── 30. MAP SEARCH BAR ──────────────────────────────────────────── */
#map-search-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 320px;
    background: var(--bg-surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: var(--shadow-modal);
    display: flex;
    align-items: center;
    padding: 6px 14px;
    transition: box-shadow .3s ease, border-color .3s ease;
}

#map-search-bar:focus-within {
    border-color: var(--c-accent-30);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2), 0 0 0 3px var(--c-accent-15);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-2);
    margin-right: 8px;
}

#map-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-1);
    font-size: .9rem;
    outline: none;
    padding: 6px 0;
}

#map-search-input::placeholder {
    color: var(--text-3);
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-modal);
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.search-result-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background .2s;
    border-bottom: 1px solid var(--skel-base);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.sr-placa {
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-1);
}

.sr-detalhe {
    font-size: .75rem;
    color: var(--text-2);
    margin-top: 2px;
}

.search-result-empty {
    padding: 12px 16px;
    font-size: .85rem;
    color: var(--text-3);
    text-align: center;
}

/* ── 31. REPORT LAYOUT GRID ──────────────────────────────────────── */
.report-layout-grid {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 24px;
    align-items: start;
}

@media(max-width:900px) {
    .report-layout-grid {
        grid-template-columns: 1fr;
    }
}

.report-section-title {
    font-size: 1.1rem;
    color: var(--text-2);
    margin-bottom: 20px;
}

.report-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.report-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    text-align: center;
    transition: all .3s var(--ease);
}

.report-card:hover {
    border-color: var(--c-accent-30);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.report-card.active {
    border-color: var(--c-accent);
    background: var(--c-accent-15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, .1);
}

.report-card-icon {
    color: var(--text-2);
    transition: color .3s var(--ease);
}

.report-card.active .report-card-icon {
    color: var(--c-accent);
}

.report-card span {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-1);
}

.report-card.active span {
    color: var(--c-accent);
}

.report-right-col {
    padding: 24px;
}

.report-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-clean-data {
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}

.btn-clean-data:hover {
    color: var(--c-danger);
}

.report-form-group {
    margin-bottom: 20px;
}

.report-form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}

.report-big-input {
    width: 100%;
    height: 48px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-1);
    padding: 0 16px;
    font-size: 1rem;
    transition: border-color .2s;
}

.report-big-input:focus {
    border-color: var(--c-accent);
    outline: none;
}

.report-period-box {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-body);
    padding: 0;
    overflow: hidden;
}

.period-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}

.period-divider {
    height: 1px;
    background: var(--border);
    width: 100%;
}

.period-label {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-3);
    width: 40px;
}

.report-clean-input {
    border: none;
    background: transparent;
    color: var(--text-1);
    font-size: .95rem;
    outline: none;
}

.date-input {
    flex: 1;
    cursor: pointer;
}

.time-input {
    width: 80px;
    text-align: center;
    border-left: 1px solid var(--border);
    padding-left: 10px;
}

.report-format-toggle {
    display: flex;
    gap: 10px;
}

.format-btn {
    flex: 1;
    height: 40px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
    transition: all .2s;
}

.format-btn:hover {
    border-color: var(--text-3);
    color: var(--text-1);
}

.format-btn.active {
    background: var(--c-accent-15);
    border-color: var(--c-accent);
    color: var(--c-accent);
}

/* ── 32. TELEMETRIA AVANÇADA ─────────────────────────────────────── */
.telemetry-tabs {
    display: flex;
    gap: 10px;
    background: var(--bg-surface);
    padding: 6px;
    border-radius: var(--r-md);
    margin-bottom: 24px;
    width: fit-content;
    border: 1px solid var(--border);
}

.tel-tab-btn {
    padding: 8px 20px;
    border-radius: var(--r-sm);
    border: none;
    background: transparent;
    color: var(--text-2);
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: all .2s;
}

.tel-tab-btn.active {
    background: var(--c-accent);
    color: #000;
    box-shadow: 0 4px 12px var(--c-accent-30);
    font-weight: 700;
}

.tel-view-container {
    display: none;
    animation: fadeIn .3s ease;
}

.tel-view-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.telemetry-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    align-items: start;
}

@media(max-width:1100px) {
    .telemetry-grid {
        grid-template-columns: 1fr;
    }
}

.tel-form-box {
    padding: 24px;
}

.tel-trigger-opts {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border);
}

.geofence-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    height: 600px;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.geofence-sidebar {
    background: var(--bg-surface);
    padding: 20px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

#geofence-map {
    height: 100%;
    width: 100%;
    z-index: 10;
}

.map-draw-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.draw-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--text-1);
    transition: all .2s;
}

.draw-btn:hover {
    background: var(--bg-hover);
    color: var(--c-accent);
}

.draw-btn.active {
    background: var(--c-accent);
    color: #000;
    border-color: var(--c-accent);
}

.geofence-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--c-accent-15);
    color: var(--c-accent);
}

/* ── 33. RESPONSIVE ──────────────────────────────────────────────── */
@media(max-width:1024px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .bp-details {
        grid-template-columns: 1fr 1fr;
    }

    .perm-grid {
        grid-template-columns: 1fr;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .fin-charts-row {
        grid-template-columns: 1fr;
    }
}

@media(max-width:768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        transition: left .3s var(--ease);
        z-index: 100;
    }

    .sidebar.open {
        left: 0;
    }

    .mobile-only {
        display: flex;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .content-scroll {
        padding: 16px;
    }

    .map-summary {
        flex-direction: column;
        gap: 6px;
    }

    .fin-summary {
        grid-template-columns: 1fr;
    }

    .avatar-name {
        display: none;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .map-bottom-panel {
        left: 0;
    }

    .bp-details {
        grid-template-columns: 1fr 1fr;
    }

    .drilldown-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   DASHBOARD PREMIUM REDESIGN
   ========================================================================== */

/* ── Main Grid ────────────────────────────────────────────────── */
.dash-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 4px;
}

/* ── ROW 1: Mini KPIs ─────────────────────────────────────────── */
.dash-row-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.dash-kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}

.dash-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--c-accent-30);
}

.dkpi-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dkpi-val {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--text-1);
    line-height: 1.1;
}

.dkpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dkpi-sub {
    font-size: 0.68rem;
    color: var(--text-3);
    font-weight: 400;
}

/* ── ROW 2: Waves + Mega Donut ────────────────────────────────── */
.dash-row-mid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dash-waves-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.dash-wave-card {
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
    transition: transform .25s ease, box-shadow .25s ease;
}

.dash-wave-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 35px rgba(0, 0, 0, .35);
}

.dwc-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dwc-value {
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.dwc-value small {
    font-size: 0.65em;
    font-weight: 500;
    opacity: .8;
}

.dwc-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .75);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.dwc-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 1;
}

.dwc-wave-path {
    animation: waveFloat 4s ease-in-out infinite alternate;
}

@keyframes waveFloat {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-10px);
    }
}

/* ── Mega Donut Card ──────────────────────────────────────────── */
.dash-mega-card {
    border-radius: 16px;
    padding: 20px 24px;
}

.mega-donut-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
    padding: 10px 0;
}

.mega-donut-chart {
    position: relative;
    flex-shrink: 0;
}

.mega-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.mega-center span {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-1);
    line-height: 1;
}

.mega-center small {
    font-size: 0.65rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.mega-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.mega-legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .2s;
}

.mega-legend-row:hover {
    background: var(--c-accent-15);
}

.mega-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mega-lbl {
    font-size: 0.78rem;
    color: var(--text-2);
    flex: 1;
}

.mega-pct {
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
}

.mega-pct small {
    font-weight: 400;
    opacity: .7;
}

/* ── Dash Tooltip (shared) ────────────────────────────────────── */
.dash-tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--c-accent-30);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: var(--text-1);
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity .2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.dash-tooltip strong {
    color: var(--c-accent);
}

.dash-tooltip small {
    color: var(--text-3);
}

/* ── ROW 3: Chart Cards ───────────────────────────────────────── */
.dash-row-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dash-chart-card {
    border-radius: 16px;
    padding: 20px 24px;
}

/* ── Premium Bar Chart ────────────────────────────────────────── */
.dash-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 160px;
    padding: 10px 0 0;
}

.dash-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: 6px;
}

.dbar-val {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-2);
}

.dbar {
    width: 100%;
    max-width: 36px;
    border-radius: 6px 6px 0 0;
    transition: height 0.8s cubic-bezier(.4, 0, .2, 1);
}

.dbar-lbl {
    font-size: 0.62rem;
    color: var(--text-3);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ── Timeline / Line Chart ────────────────────────────────────── */
.tl-svg {
    width: 100%;
    height: auto;
    min-height: 100px;
}

.tl-dot:hover {
    r: 7;
    filter: drop-shadow(0 0 8px var(--c-accent));
}

/* ── Dashboard Responsive ─────────────────────────────────────── */
@media (max-width: 1200px) {
    .dash-row-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-row-mid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-row-kpis {
        grid-template-columns: 1fr;
    }

    .dash-row-charts {
        grid-template-columns: 1fr;
    }

    .dash-waves-grid {
        grid-template-columns: 1fr;
    }

    .mega-donut-wrap {
        flex-direction: column;
    }
}

/* ==========================================================================
   DASHBOARD V2 SUPER — BENTO GRID & NEON GLASSMORPHISM
   ========================================================================== */

#view-dashboard {
    padding-bottom: 40px;
    animation: fadeUp 0.5s ease;
}

.db-bento {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* KPI ROW */
.db-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.db-kpi {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.db-kpi:hover {
    transform: translateY(-4px);
    border-color: var(--kpi-accent, #fff);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.db-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.db-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-kpi-icon svg {
    width: 24px;
    height: 24px;
}

.db-kpi-body {
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.db-kpi-num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

.db-kpi-label {
    font-size: 0.85rem;
    color: var(--text-2);
    margin-top: 2px;
    font-weight: 500;
}

.db-kpi-sub {
    font-size: 0.7rem;
    margin-top: 4px;
}

.db-kpi-glow {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    filter: blur(40px);
    opacity: 0.15;
    border-radius: 50%;
    pointer-events: none;
    transition: opacity 0.3s, filter 0.3s;
}

.db-kpi:hover .db-kpi-glow {
    opacity: 0.3;
    filter: blur(30px);
}

/* CARDS COMMON */
.db-card {
    background: rgba(13, 17, 23, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: visible;
}

.db-card-wide {
    width: 100%;
}

.db-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 20px;
}

.db-card-header svg {
    color: var(--c-accent);
}

/* MID ROW (DONUT + BARS) */
.db-mid-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

/* TIMELINE (SPLINE) */
.db-line-dot:hover {
    fill: var(--text-1);
}

/* STAGGERED BARS */
.db-bar-group:hover .db-bar {
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(0, 229, 255, 0.6)) !important;
}

.db-bar-group:hover .db-bar-val {
    fill: #fff !important;
    text-shadow: 0 0 8px currentColor;
}

/* MEGA DONUT LEGEND HOVER */
.db-donut-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .db-kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .db-donut-wrap {
        flex-direction: column;
        align-items: center;
    }

    #db-donut-svg {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .db-kpi-row {
        grid-template-columns: 1fr;
    }
}

/* ── 9. SIDEBAR MINIMIZED & FILTERS ──────────────────────────────── */
.btn-sidebar-toggle {
    position: absolute;
    right: -14px;
    top: 24px;
    width: 28px;
    height: 28px;
    background: var(--c-accent);
    color: #000;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 0 12px var(--c-accent-glow);
    transition: all 0.3s var(--ease);
}

.sidebar-minimized .btn-sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar {
    transition: width 0.3s var(--smooth), background 0.3s var(--ease);
}

.sidebar.sidebar-minimized {
    width: 76px;
    min-width: 76px;
}

.sidebar-minimized #sidebar-brand span,
.sidebar-minimized .nav span,
.sidebar-minimized .nav-label,
.sidebar-minimized .sidebar-footer span {
    display: none !important;
}

.sidebar-minimized .sidebar-brand {
    justify-content: center;
    padding: 20px 0;
}

.sidebar-minimized .nav-link {
    justify-content: center;
    padding: 12px 0;
    margin: 0 10px;
}

.sidebar-minimized .nav-link:hover {
    transform: none;
}

.sidebar-minimized .sidebar-footer {
    display: flex;
    justify-content: center;
}

.sidebar-minimized .btn-logout {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
}

/* Device Filters */
.filter-pills {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.pill {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.pill:hover {
    color: var(--text-1);
    background: var(--bg-hover);
}

.pill.active-filter {
    background: var(--c-accent) !important;
    color: #000 !important;
    box-shadow: 0 0 12px var(--c-accent-glow);
}