/* =========================================================
   EVs - self-contained feature stylesheet.
   Extends the dashboard design tokens (dashboard.css); it does not
   replace them. Layout mirrors Dealer Insights / Used Vehicle
   Insights: full-width rows on a 12-column grid, no tabs, no
   section-level headings beyond the page title, no placeholder surfaces.
   ========================================================= */

.ev-shell {
    --ev-chart-h: clamp(190px, 24vh, 280px);
    --ev-chart-tall: clamp(230px, 30vh, 340px);
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-areas: "nav main";
    height: 100vh;
    overflow: hidden;
}

.ev-main {
    grid-area: main;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
gap: var(--gutter);
    scrollbar-width: thin;
    scrollbar-color: var(--border-panel) transparent;
}

    .ev-main::-webkit-scrollbar {
   width: 8px;
    }

    .ev-main::-webkit-scrollbar-thumb {
        background: var(--border-panel);
border-radius: 4px;
    }

/* ---------- Page header ---------- */

.ev-page-head {
    margin: 0;
    flex: 0 0 auto;
}

/* ---------- Cards ---------- */

.ev-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius);
padding: 10px 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ev-card-title {
    margin: 0 0 8px;
    font-size: var(--fs-card-title);
    font-weight: 500;
    color: var(--text-hi);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ev-card-sub {
    margin: -4px 0 8px;
    font-size: var(--fs-meta);
    color: var(--text-lo);
}

/* ---------- Full-width rows (12-column grid) ---------- */

.ev-row-1,
.ev-row-2,
.ev-row-3,
.ev-row-4 {
    display: grid;
    gap: var(--gutter);
    flex: 0 0 auto;
}

/* 12 of 12 */
.ev-row-1 {
    grid-template-columns: minmax(0, 1fr);
}

/* 6 + 6 of 12 */
.ev-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 4 + 4 + 4 of 12 */
.ev-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 3 + 3 + 3 + 3 of 12 */
.ev-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- Chart surfaces ---------- */

.ev-chart {
    width: 100%;
    height: var(--ev-chart-h);
}

.ev-chart-tall {
    height: var(--ev-chart-tall);
}

.ev-empty {
    height: 100%;
    display: flex;
    align-items: center;
justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-lo);
}

/* ---------- Source footer ---------- */

.ev-source {
    font-size: var(--fs-meta);
    color: var(--text-lo);
    border-top: 1px solid var(--border-panel);
    margin: 0;
    padding-top: 6px;
    flex: 0 0 auto;
}

/* ---------- Loading overlay ---------- */

.ev-loading {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    background: rgba(7, 9, 15, .78);
    color: var(--text-mid);
    font-size: 13px;
    font-weight: 600;
    transition: opacity .2s ease;
}

.ev-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* =========================================================
   Breakpoints
   ========================================================= */

@media (max-width: 1279px) {
    .ev-row-4 {
     grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .ev-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
        "nav"
    "main";
        height: auto;
        overflow: visible;
    }

    .ev-main {
        overflow: visible;
        height: auto;
    }

    .ev-row-2,
    .ev-row-3,
  .ev-row-4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Low-height displays: keep the page inside roughly one-and-a-bit screens. */
@media (max-height: 920px) {
    .ev-shell {
        --ev-chart-h: clamp(160px, 20vh, 220px);
   --ev-chart-tall: clamp(196px, 25vh, 268px);
    }

 .ev-card {
      padding: 8px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ev-loading {
        transition: none;
    }
}
