/* Dashboard timeline layout */

.dashboard-stat-grid {
    align-items: stretch;
}

.dashboard-stat-column {
    display: flex;
}

.dashboard-stat-card {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--border, #dbdbdb) 85%, transparent);
    background: var(--surface, rgba(255, 255, 255, 0.92));
    background-color: var(--surface, rgba(255, 255, 255, 0.92));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--border, #0f172a) 18%, transparent);
    color: var(--text-primary, inherit);
}

.dashboard-stat-card.has-background-warning-light {
    background: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    background-color: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    border-color: color-mix(in srgb, var(--warning, #f59e0b) 38%, var(--border, #dbdbdb)) !important;
}

.dashboard-stat-card.has-background-success-light {
    background: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    background-color: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    border-color: color-mix(in srgb, var(--success, #22c55e) 35%, var(--border, #dbdbdb)) !important;
}

.dashboard-stat-card.has-background-info-light {
    background: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    background-color: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    border-color: color-mix(in srgb, var(--info, #3A9D91) 35%, var(--border, #dbdbdb)) !important;
}

.dashboard-stat-card.has-background-primary-light {
    background: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    background-color: var(--surface, rgba(255, 255, 255, 0.92)) !important;
    border-color: color-mix(in srgb, var(--primary, #3b82f6) 35%, var(--border, #dbdbdb)) !important;
}

.dashboard-stat-card .card-content {
    padding: 0.7rem 0.75rem;
}

.dashboard-stat-card .level {
    align-items: flex-start;
}

.dashboard-stat-card .heading {
    margin: 0 0 0.3rem;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-secondary, #64748b);
    letter-spacing: 0;
    text-transform: none;
}

.dashboard-stat-card .title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: 1.1;
    word-break: break-word;
    color: var(--text-primary, inherit);
}

.dashboard-stat-card .icon {
    margin-top: 0.05rem;
}

.timeline-stack {
    min-width: 600px;
}

.timeline-dual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr);
    gap: 0.3rem;
    align-items: start;
}

.timeline-panel {
    min-width: 0;
}

/* Divider between heating and driving */

.timeline-grid-divider {
    align-self: stretch;
    background: var(--border);
    border-radius: var(--radius-pill);
    width: 3px;
    justify-self: center;
}

/* Lane variants */

.heating-lane {
    height: 20px;
}

.schedule-lane {
    height: 18px;
}

.detailed-lane {
    height: 22px;
}

/* Debug helpers */

[data-theme] .debug-summary {
    font-size: var(--text-sm);
    margin-bottom: 0.75rem;
    background-color: #b0b0b0;
    color: #ffffff;
    display: none;
}

[data-theme] .debug-line {
    margin: 0.2rem 0 0;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-family: Consolas, monospace;
    display: none;
}

/* =============================================================
   Vehicle Timeline (vt) – full-day Gantt
   Mirrors the proven layout pattern from bus-trip-overview.css:
   flex-column wrapper → fixed header + scrollable body siblings.
   No position:sticky (it conflicts with overflow and breaks flex
   width resolution on the grid column).
   ============================================================= */

:root {
    --vt-label-w: 80px;
    --vt-next-w: 110px;
    --vt-status-w: 160px;
    --vt-temp-w: 64px;
    --vt-row-h: 52px;
    --vt-axis-h: 32px;
    --vt-bg: var(--surface-alt, #f5f5f5);
    --vt-border: var(--border, #dee2e6);
    --vt-now-color: var(--danger, #e03030);
    --vt-history-bg: color-mix(in srgb, var(--text-secondary, #7a7a7a) 28%, var(--surface-alt, #f5f5f5));
    --vt-history-border: color-mix(in srgb, var(--text-secondary, #7a7a7a) 36%, var(--border, #dee2e6));
    --vt-schedule-light-bg: color-mix(in srgb, var(--info, #3A9D91) 12%, var(--surface-alt, #f5f5f5));
    --vt-schedule-light-border: color-mix(in srgb, var(--info, #3A9D91) 32%, var(--border, #dee2e6));
}

/* ── Wrapper ──────────────────────────────────────────────────
   display:flex + flex-direction:column is the key:
   the header and the body are stacked flex children.
   overflow:hidden clips the border-radius safely because we are
   NOT using position:sticky inside. */
.vt-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 70vh;
    font-size: var(--text-sm);
    border: 1px solid var(--vt-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--background, #fff);
}

/* ── Header row (does NOT scroll) ─────────────────────────────
   flex-shrink:0 keeps it at fixed height while the body grows.
   display:flex makes the label/next/grid cells sit side-by-side
   and fill the full width automatically. */
.vt-header {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: stretch;
    height: var(--vt-axis-h);
    background: var(--vt-bg);
    border-bottom: 2px solid var(--vt-border);
    z-index: 2;
    /* Never scrolls itself (overflow:hidden = no bar on the header), but reserves
       the SAME thin scrollbar gutter as the body — identical scrollbar sizing in
       both the WebKit and Firefox properties below — so the time axis stays
       aligned with the row lanes whether or not the body is scrolling. */
    overflow: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    /* Firefox: thumb and track both transparent - the header reserves the gutter
       for alignment but never scrolls, matching its transparent webkit thumb. */
    scrollbar-color: transparent transparent;
}

/* ── Scrollable body ───────────────────────────────────────────
   flex:1 + min-height:0 is the standard flex-child scroll trick:
   without min-height:0 flex items won't shrink below their content
   size, so overflow:auto never activates. */
.vt-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Thin scrollbar with the gutter always reserved (stable), so it never
       shifts the lanes when it appears and the header — which reserves an
       identical gutter — stays aligned. */
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    /* Firefox takes the thumb and track colours here; the webkit rules further
       down do the same job for Chrome, Edge and Safari. */
    scrollbar-color: var(--vt-border) transparent;
}

/* ── Fixed left columns (shared by header and body rows) ───── */
.vt-cell {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 8px;
    border-right: 1px solid var(--vt-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    font-size: var(--text-xs);
    color: var(--text-primary, #4a4a4a);
    background: var(--surface-alt, #f5f5f5);
}

.vt-header-cell {
    font-weight: 700;
    font-size: var(--text-2xs);
    color: var(--text-secondary, #7a7a7a);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vt-label-col {
    width: var(--vt-label-w);
    min-width: var(--vt-label-w);
}

.vt-label-col a {
    color: var(--text-primary, inherit);
}

.vt-label-col a:hover,
.vt-label-col a:focus-visible {
    color: var(--primary, currentColor);
}

.vt-next-col {
    width: var(--vt-next-w);
    min-width: var(--vt-next-w);
}

/* ── Status column: heater chip + exception badges ──────────── */
.vt-status-col {
    width: var(--vt-status-w);
    min-width: var(--vt-status-w);
    display: flex;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 3px 4px;
    flex-shrink: 0;
    overflow: hidden;
    white-space: normal;
}

/* Heater chip – fuses planned heating and current heater state.
   Base (no modifier) = heater off, nothing planned right now. */
.vt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    padding: 1px 7px;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid var(--border, #dbdbdb);
    background: var(--surface-alt, #f5f5f5);
    color: var(--text-secondary, #7a7a7a);
}

.vt-chip-on {
    background: color-mix(in srgb, var(--success, #48c78e) 16%, var(--surface-alt, #f5f5f5));
    border-color: color-mix(in srgb, var(--success, #48c78e) 55%, transparent);
    color: color-mix(in srgb, var(--success, #48c78e) 55%, var(--text-primary, #257953));
}

.vt-chip-bad {
    background: color-mix(in srgb, var(--danger, #ef4444) 14%, var(--surface-alt, #f5f5f5));
    border-color: color-mix(in srgb, var(--danger, #ef4444) 55%, transparent);
    color: color-mix(in srgb, var(--danger, #ef4444) 60%, var(--text-primary, #cc0f35));
}

/* Heater state unreadable (device offline / no data yet). */
.vt-chip-unknown {
    border-style: dashed;
}

/* Next planned heating inside the chip: "· HH:mm" + profile icon. */
.vt-chip-plan {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.vt-chip-plan::before {
    content: "· ";
    font-weight: 400;
}

.vt-chip-profile {
    font-size: var(--text-2xs);
    opacity: 0.75;
}

/* Exception badges – only rendered when something needs attention. */
.vt-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    text-decoration: none;
}

.vt-badge-warning {
    background: color-mix(in srgb, var(--warning, #f59e0b) 18%, var(--surface-alt, #f5f5f5));
    color: color-mix(in srgb, var(--warning, #f59e0b) 55%, var(--text-primary, #946c00));
}

.vt-badge-danger {
    background: color-mix(in srgb, var(--danger, #ef4444) 16%, var(--surface-alt, #f5f5f5));
    color: color-mix(in srgb, var(--danger, #ef4444) 60%, var(--text-primary, #cc0f35));
}

a.vt-badge:hover {
    text-decoration: underline;
}

/* Icon-only badge – keeps space-hungry labels (e.g. "Profile off") narrow so
   they stay inline instead of wrapping the status column onto another row. */
.vt-badge-icon {
    padding: 1px 5px;
    gap: 0;
}

/* Match the text badges' height: without a text node the icon's own line box
   is shorter than the badge's line-height, so give the icon the same 1.5. */
.vt-badge-icon i {
    line-height: 1.5;
}

/* ── Temp column: inside temperature over battery voltage ───── */
.vt-temp-col {
    width: var(--vt-temp-w);
    min-width: var(--vt-temp-w);
}

.vt-temp-stack {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.vt-temp-stack .vt-temp {
    font-size: var(--text-xs);
}

.vt-temp-stack .vt-volt {
    font-size: var(--text-2xs);
    color: var(--text-secondary, #7a7a7a);
}

/* ── Grid column (time axis in header / lane in rows) ─────────
   flex:1 fills all remaining horizontal space after the fixed
   left columns. min-width:0 prevents flex blowout.
   position:relative is the containing block for absolutely
   positioned ticks, blocks and the now-needle. */
.vt-grid-col {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    box-sizing: border-box;
}

/* Explicit heights so children using height:100% have a base */
.vt-header .vt-grid-col {
    height: var(--vt-axis-h);
}

.vt-row .vt-grid-col {
    height: var(--vt-row-h);
}

/* ── Time-axis inside the header grid column ──────────────────
   width/height 100% fills the grid column exactly.
   NO overflow:hidden — that clips the tick labels. */
.vt-axis {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Hour tick labels */
.vt-tick {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--text-2xs);
    font-weight: 700;
    color: var(--text-secondary, #7a7a7a);
    pointer-events: none;
    user-select: none;
    line-height: 1;
    letter-spacing: 0.03em;
}

/* ── Vehicle rows ─────────────────────────────────────────────*/
.vt-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: var(--vt-row-h);
    border-bottom: 1px solid var(--vt-border);
    background: var(--background, #fff);
    box-sizing: border-box;
}

.vt-row:last-child {
    border-bottom: none;
}

.vt-row:nth-child(even) {
    background: var(--surface, #f5f5f5);
}

/* ── Lane (holds blocks + needle) ─────────────────────────────
   width/height 100% fills the grid column. */
.vt-lane {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ── Hour grid lines drawn inside each lane ───────────────────*/
.vt-lane::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to right,
        var(--vt-border) 0,
        var(--vt-border) 1px,
        transparent 1px,
        transparent calc(100% / var(--vt-hour-count, 24))
    );
    pointer-events: none;
    z-index: 0;
}

/* ── Traffic block bars ─────────────────────────────────────── */
.vt-block {
    position: absolute;
    top: 20%;
    height: 60%;
    border-radius: var(--radius-sm);
    min-width: 3px;
    z-index: 1;
    cursor: default;
    transition: filter var(--duration-fast);
}

.vt-block:hover {
    filter: brightness(0.88);
    z-index: 3;
}

.vt-block-past {
    background: var(--vt-schedule-light-bg);
    border: 1px solid var(--vt-schedule-light-border);
    opacity: 0.78;
}

.vt-block-ongoing {
    background: var(--vt-schedule-light-bg);
    border: 1px solid var(--vt-schedule-light-border);
    box-shadow: none;
}

.vt-block-future {
    background: var(--success, #48c78e);
}

/* ── Open-ended blocks (start time only, no end time) ────────
   A fixed-width bar that fades to transparent at the right edge,
   indicating the end time is unknown. */
.vt-block-open-past,
.vt-block-open-future {
    width: 6%;
    min-width: 20px;
    max-width: 80px;
}

.vt-block-open-past {
    background: linear-gradient(to right, var(--vt-schedule-light-bg) 0%, transparent 100%);
    border-left: 1px solid var(--vt-schedule-light-border);
    opacity: 0.78;
}

.vt-block-open-future {
    background: linear-gradient(to right, var(--success, #48c78e) 0%, transparent 100%);
}

/* ── Now-needle (vertical red line) ──────────────────────────
   Used both in the axis header and in every lane row. */
.vt-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--vt-now-color);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
}

.vt-now-line::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-circle);
    background: var(--vt-now-color);
}

/* In the header axis the needle fills the axis height */
.vt-axis .vt-now-line {
    top: 0;
    height: 100%;
    bottom: unset;
}

/* Thin scrollbar for WebKit/Blink (Chrome, Edge, Safari); Firefox uses
   scrollbar-width above. The header gets the same 6px sizing so its reserved
   scrollbar-gutter matches the body's bar exactly and the axis stays aligned;
   the header's thumb is transparent since it never scrolls. */
.vt-body::-webkit-scrollbar,
.vt-header::-webkit-scrollbar        { width: 6px; }
.vt-body::-webkit-scrollbar-track,
.vt-header::-webkit-scrollbar-track  { background: transparent; }
.vt-body::-webkit-scrollbar-thumb    { background: var(--vt-border); border-radius: var(--radius-sm); }
.vt-header::-webkit-scrollbar-thumb  { background: transparent; }

/* ── Heating window bars (same row as traffic blocks) ────────
   Slightly narrower and offset so both are visible when they
   overlap – heating sits in the lower part of the same band. */
.vt-heat {
    position: absolute;
    top: 30%;
    height: 40%;
    border-radius: var(--radius-sm);
    min-width: 3px;
    z-index: 2;
    cursor: default;
    transition: filter var(--duration-fast);
}

.vt-heat:hover {
    filter: brightness(0.88);
    z-index: 3;
}

/* Upcoming and active heat bars are tinted by the vehicle's current inside
   temperature via --vt-heat-temp-color (set inline server-side and updated
   live by the telemetry script); amber fallback when the temperature is
   unknown. Completed (past) bars stay grey. */
.vt-heat-planned {
    background: color-mix(in srgb, var(--vt-heat-temp-color, var(--warning, #f5a623)) 60%, transparent);
    border: 1px solid var(--vt-heat-temp-color, var(--warning, #f5a623));
}

.vt-heat-active {
    background: var(--vt-heat-temp-color, var(--warning, #f5a623));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--vt-heat-temp-color, var(--warning, #f5a623)) 40%, transparent);
}

.vt-heat-completed {
    background: var(--vt-history-bg);
    border: 1px solid var(--vt-history-border);
    opacity: 0.72;
}


/* Operations dashboard */

.operations-dashboard {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

body.ops-fullscreen-locked {
    overflow: hidden;
}

.operations-dashboard.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow: auto;
    padding: 1rem;
    background: var(--background, #f5f5f5);
}

.ops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--border, #dbdbdb) 85%, transparent);
    border-radius: var(--radius-md);
    background: var(--surface, rgba(255, 255, 255, 0.92));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--border, #0f172a) 14%, transparent);
}

.operations-dashboard.is-fullscreen .ops-header {
    position: sticky;
    top: 0;
    z-index: 2;
}

.ops-header-left,
.ops-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.ops-header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ops-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary, #363636);
    line-height: 1.15;
}

.ops-time,
.ops-depot,
.ops-temp {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary, #7a7a7a);
    white-space: nowrap;
    font-size: var(--text-sm);
}

.ops-fullscreen-toggle {
    flex-shrink: 0;
}

.operations-dashboard.is-fullscreen .ops-fullscreen-toggle {
    border-color: var(--primary, #3b82f6);
    color: var(--primary, #3b82f6);
}

.ops-widgets,
.ops-bottom-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: stretch;
}

.ops-widget,
.ops-section {
    min-width: 0;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--border, #dbdbdb) 85%, transparent);
    background: var(--surface, rgba(255, 255, 255, 0.92));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--border, #0f172a) 16%, transparent);
    padding: 0.85rem;
}

.ops-widget {
    height: 100%;
}

.ops-widget.has-left-border,
.ops-section.has-left-border {
    border-left-width: 3px;
}

.ops-widget.has-left-border.is-warning,
.ops-section.has-left-border.is-warning {
    border-left-color: var(--warning, #f5a623);
}

.ops-widget.has-left-border.is-info,
.ops-section.has-left-border.is-info {
    border-left-color: var(--info, #3A9D91);
}

.ops-widget.has-left-border.is-success,
.ops-section.has-left-border.is-success {
    border-left-color: var(--success, #48c78e);
}

.ops-widget > .title,
.ops-section > .title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary, #363636);
}

.ops-widget > .title .icon,
.ops-section > .title .icon {
    width: 1rem;
    height: 1rem;
}

.operations-dashboard .notification {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, currentColor 24%, var(--border, #dbdbdb));
    background: transparent;
    color: var(--text-primary, #363636);
    font-size: var(--text-sm);
}

.operations-dashboard .notification:last-child {
    margin-bottom: 0;
}

.ops-stat-row,
.ops-weather-item,
.ops-depot-item,
.ops-forecast-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.ops-stat-row,
.ops-weather-item,
.ops-depot-item {
    padding: 0.45rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border, #dee2e6) 72%, transparent);
    font-size: var(--text-sm);
}

.ops-stat-row + .ops-stat-row,
.ops-weather-item + .ops-weather-item,
.ops-depot-item + .ops-depot-item,
.ops-forecast-bar + .ops-forecast-bar {
    margin-top: 0;
}

.ops-stat-row:last-child,
.ops-weather-item:last-child,
.ops-depot-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ops-stat-row:first-child,
.ops-weather-item:first-child,
.ops-depot-item:first-child {
    padding-top: 0;
}

.ops-stat-label,
.ops-weather-item span:last-child,
.ops-depot-item span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text-secondary, #7a7a7a);
}

.ops-stat-value {
    flex-shrink: 0;
    font-size: var(--text-lg);
    line-height: 1;
}

.ops-table {
    margin-bottom: 0;
    font-size: var(--text-sm);
    background: transparent;
}

.ops-table thead th {
    border-bottom-width: 1px;
    color: var(--text-secondary, #7a7a7a);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.ops-table td,
.ops-table th {
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
}

.ops-row-warning {
    background: color-mix(in srgb, var(--warning, #f5a623) 12%, transparent);
}

.ops-forecast-time {
    width: 3.5rem;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.ops-forecast-graph {
    flex: 1;
    min-width: 0;
    height: 0.55rem;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--surface-alt, #f5f5f5);
    border: 1px solid var(--border, #dee2e6);
}

.ops-forecast-fill {
    height: 100%;
    min-width: 0;
    background: var(--warning, #f5a623);
}

.ops-forecast-content {
    display: grid;
    gap: 0.55rem;
}

@media (max-width: 960px) {
    .ops-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ops-header-right {
        justify-content: flex-start;
    }

    .ops-widgets,
    .ops-bottom-row {
        grid-template-columns: 1fr;
    }
}

/* moved out of Index.cshtml */
    /* Generic Bulma dropdowns aren't themed by the app (only navbar ones are),
       so colour the refresh split-button menu from the theme variables. */
    #refreshDropdown .dropdown-content {
        background-color: var(--surface, #fff);
        border: 1px solid var(--border, #dbdbdb);
        box-shadow: 0 8px 16px rgba(10, 10, 10, 0.12);
    }
    #refreshDropdown .dropdown-item {
        color: var(--text-primary, #363636);
    }
    #refreshDropdown a.dropdown-item:hover {
        background-color: var(--surface-alt, #f5f5f5);
        color: var(--text-primary, #363636);
    }
    #refreshDropdown a.dropdown-item.is-active {
        background-color: var(--surface-alt, #f5f5f5);
        color: var(--primary, #435A5F);
        font-weight: 600;
    }

    /* Right-click context menu for timeline rows. Themed from the same variables as the
       refresh dropdown so it matches in light/dark/brand themes. */
    .vt-context-menu {
        position: fixed;
        z-index: 1000;
        min-width: 210px;
        max-width: 280px;
        padding: 0.25rem 0;
        background-color: var(--surface, #fff);
        border: 1px solid var(--border, #dbdbdb);
        border-radius: 6px;
        box-shadow: 0 8px 16px rgba(10, 10, 10, 0.18);
        display: none;
    }
    .vt-context-menu.is-active { display: block; }
    .vt-context-menu .vt-context-header {
        padding: 0.35rem 1rem 0.4rem;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 600;
        color: var(--text-muted, #7a7a7a);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .vt-context-menu .vt-context-divider {
        border-top: 1px solid var(--border, #dbdbdb);
        margin: 0.25rem 0;
    }
    .vt-context-menu .vt-context-item {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        width: 100%;
        padding: 0.45rem 1rem;
        border: none;
        background: none;
        text-align: left;
        white-space: nowrap;
        cursor: pointer;
        font-size: 0.9rem;
        color: var(--text-primary, #363636);
    }
    .vt-context-menu .vt-context-item:hover,
    .vt-context-menu .vt-context-item:focus {
        background-color: var(--surface-alt, #f5f5f5);
        color: var(--primary, #435A5F);
        outline: none;
    }
    .vt-context-menu .vt-context-item .icon {
        color: inherit;
        width: 1.1rem;
        text-align: center;
    }

    /* Clickable column sorting on the timeline header. */
    .vt-header-cell.vt-sortable {
        cursor: pointer;
        user-select: none;
        gap: 4px;
    }
    .vt-header-cell.vt-sortable:hover,
    .vt-header-cell.vt-sortable:focus-visible {
        color: var(--primary, #435A5F);
        outline: none;
    }
    .vt-header-cell .vt-sort-icon {
        margin-left: auto;
        font-size: 0.7em;
        opacity: 0.45;
    }
    .vt-header-cell.vt-sortable.is-sorted,
    .vt-header-cell.vt-sortable.is-sorted .vt-sort-icon {
        color: var(--primary, #435A5F);
        opacity: 1;
    }

/* Operations dashboard empty-state cell */
[data-theme] .ops-empty-cell {
    color: var(--text-secondary);
    font-style: italic;
}
