/* ============================================================
   Sentra Mobile App — Design Tokens & Component Styles
   Target: iPhone SE (375×667) mobile-first
   Style: Swiss Expressive dark-mode
   ============================================================ */

/* --- Google Fonts are loaded via App.razor link tags --- */

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
    /* Background */
    --s-bg: #0C0C0C;
    --s-surface: #1A1A1A;
    --s-elevated: #242424;

    /* Text */
    --s-text-primary: #FFFFFF;
    --s-text-secondary: #8A8A8A;
    --s-text-muted: #525252;

    /* Border */
    --s-border: #2A2A2A;

    /* Accent */
    --s-red: #FF3B30;
    --s-green: #32D74B;
    --s-orange: #FF9500;
    --s-error: #FF453A;
    --s-blue: #4A90D9;

    /* Typography */
    --s-font-display: 'Sora', sans-serif;
    --s-font-body: 'Inter', sans-serif;

    /* Radius */
    --s-radius-phone: 40px;
    --s-radius-card: 12px;
    --s-radius-btn: 12px;
    --s-radius-badge: 4px;
    --s-radius-sheet: 20px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--s-font-body);
    color: var(--s-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #141414;
}

/* ============================================================
   Phone Frame — responsive centered column
   Fluid width up to 430px (iPhone 16 Pro Max).
   On narrow devices (<430px): fills edge-to-edge.
   On desktop: centered with border separation.
   ============================================================ */
.phone-frame {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    background: var(--s-bg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* On wider screens: hairline border for separation */
@media (min-width: 500px) {
    .phone-frame {
        border: 1px solid rgba(255, 255, 255, 0.06);
    }
}

/* ============================================================
   Status Bar
   ============================================================ */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 54px;
    padding: 14px 24px 0 24px;
    flex-shrink: 0;
}

.status-bar__time {
    font-family: var(--s-font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--s-text-primary);
}

.status-bar__icons {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--s-text-primary);
}

.status-bar__icons svg {
    width: 16px;
    height: 16px;
}

/* ============================================================
   Connection Status Bar
   ============================================================ */
.conn-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 16px;
    flex-shrink: 0;
}

.conn-bar--ok {
    background: rgba(50, 215, 75, 0.125);
    color: var(--s-green);
}

.conn-bar--warn {
    background: rgba(255, 149, 0, 0.125);
    color: var(--s-orange);
}

.conn-bar--error {
    background: rgba(255, 59, 48, 0.125);
    color: var(--s-error);
}

.conn-bar__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.conn-bar__text {
    font-size: 12px;
    font-weight: 500;
}

/* ============================================================
   Bottom Navigation
   ============================================================ */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 84px;
    padding: 12px 0 34px 0;
    background: var(--s-bg);
    border-top: 1px solid var(--s-border);
    flex-shrink: 0;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 64px;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
}

.bottom-nav__item svg,
.bottom-nav__item .nav-icon {
    width: 22px;
    height: 22px;
}

.bottom-nav__label {
    font-family: var(--s-font-body);
    font-size: 10px;
    font-weight: 500;
}

.bottom-nav__item--active .nav-icon,
.bottom-nav__item--active svg {
    color: var(--s-red);
}

.bottom-nav__item--active .bottom-nav__label {
    color: var(--s-red);
    font-weight: 600;
}

.bottom-nav__item:not(.bottom-nav__item--active) .nav-icon,
.bottom-nav__item:not(.bottom-nav__item--active) svg {
    color: var(--s-text-muted);
}

.bottom-nav__item:not(.bottom-nav__item--active) .bottom-nav__label {
    color: var(--s-text-muted);
}

/* ============================================================
   Screen Content Area
   ============================================================ */
.screen-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Onboarding Screen
   ============================================================ */
.onboarding {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.onboarding__spacer {
    flex: 1;
}

.onboarding__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 0 32px;
}

.onboarding__logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--s-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding__logo svg {
    width: 40px;
    height: 40px;
    color: var(--s-red);
}

.onboarding__titles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.onboarding__title {
    font-family: var(--s-font-display);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1.5px;
    color: var(--s-text-primary);
    text-align: center;
}

.onboarding__subtitle {
    font-family: var(--s-font-body);
    font-size: 16px;
    color: var(--s-text-secondary);
    text-align: center;
    line-height: 1.4;
}

/* Permission section */
.onboarding__perms {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.onboarding__section-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--s-text-muted);
}

.perm-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
    width: 100%;
}

.perm-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.perm-card__icon--red {
    background: rgba(255, 59, 48, 0.125);
}

.perm-card__icon--gray {
    background: var(--s-elevated);
}

.perm-card__icon svg {
    width: 22px;
    height: 22px;
}

.perm-card__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.perm-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--s-text-primary);
}

.perm-card__desc {
    font-size: 13px;
    color: var(--s-text-secondary);
}

.perm-card__badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--s-radius-badge);
    flex-shrink: 0;
}

.perm-card__badge--red {
    background: rgba(255, 59, 48, 0.125);
    color: var(--s-red);
}

.perm-card__badge--gray {
    background: var(--s-elevated);
    color: var(--s-text-secondary);
}

/* Bottom CTA */
.onboarding__cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 32px 48px 32px;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 56px;
    background: var(--s-red);
    border: none;
    border-radius: var(--s-radius-btn);
    color: var(--s-text-primary);
    font-family: var(--s-font-body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:active {
    opacity: 0.8;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.skip-link {
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--s-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.skip-link:hover {
    color: var(--s-text-secondary);
}

/* ============================================================
   Map Screen
   ============================================================ */
.map-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.map-area .maplibregl-map,
.map-area .map-container {
    width: 100% !important;
    height: 100% !important;
}

/* Zone cards — vertical scrollable list between map and bottom nav */
.zone-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 16px;
    overflow-y: auto;
    max-height: 140px;
    flex-shrink: 0;
    background: var(--s-bg);
    scrollbar-width: thin;
    scrollbar-color: var(--s-border) transparent;
}

.zone-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--s-radius-card);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    text-align: left;
    transition: transform 0.15s;
}

.zone-card:active {
    transform: scale(0.97);
}

.zone-card--own {
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.4);
}

.zone-card--server {
    background: rgba(74, 144, 217, 0.15);
    border: 1px solid rgba(74, 144, 217, 0.4);
}

.zone-card__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zone-card--own .zone-card__icon {
    background: rgba(255, 59, 48, 0.2);
}

.zone-card--server .zone-card__icon {
    background: rgba(74, 144, 217, 0.2);
}

.zone-card__icon svg {
    width: 18px;
    height: 18px;
}

.zone-card--own .zone-card__icon svg {
    color: var(--s-red);
}

.zone-card--server .zone-card__icon svg {
    color: var(--s-blue);
}

.zone-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.zone-card__name {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--s-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zone-card__meta {
    font-family: var(--s-font-body);
    font-size: 11px;
    color: var(--s-text-secondary);
    white-space: nowrap;
}

/* Alert countdown badge */
.alert-badge {
    position: absolute;
    top: 8px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--s-red);
    border-radius: 8px;
    z-index: 10;
}

.alert-badge svg {
    width: 14px;
    height: 14px;
    color: var(--s-text-primary);
}

.alert-badge__text {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--s-text-primary);
}

/* FAB buttons */
.fab-group {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.fab {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.15s;
}

.fab:active {
    transform: scale(0.93);
}

.fab--primary {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: var(--s-red);
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.375);
}

.fab--primary svg {
    width: 28px;
    height: 28px;
    color: var(--s-text-primary);
}

.fab--secondary {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: var(--s-surface);
    border: 1px solid var(--s-border);
}

.fab--secondary svg {
    width: 22px;
    height: 22px;
    color: var(--s-error);
}

/* Map entity overlays */
.map-marker {
    position: absolute;
    z-index: 5;
    pointer-events: auto;
    cursor: pointer;
}

.map-marker__circle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.map-marker__circle--train {
    width: 48px;
    height: 48px;
    background: var(--s-red);
}

.map-marker__circle--train-secondary {
    width: 40px;
    height: 40px;
    background: rgba(255, 59, 48, 0.5);
}

.map-marker__circle--crossing {
    width: 36px;
    height: 36px;
    background: var(--s-bg);
    border: 2px solid var(--s-green);
}

.map-marker__circle--crossing-forbidden {
    width: 36px;
    height: 36px;
    background: var(--s-bg);
    border: 2px solid var(--s-red);
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.375);
}

.map-marker__circle--izs {
    width: 36px;
    height: 36px;
    background: var(--s-blue);
}

.map-marker__circle--so {
    width: 36px;
    height: 36px;
    background: var(--s-orange);
}

.map-marker__circle svg {
    color: var(--s-text-primary);
}

.map-marker__label {
    padding: 4px 8px;
    border-radius: var(--s-radius-badge);
    background: rgba(12, 12, 12, 0.8);
    font-size: 11px;
    font-weight: 500;
    color: var(--s-text-primary);
    white-space: nowrap;
    margin-top: 4px;
    text-align: center;
}

/* User location dot */
.user-location {
    position: absolute;
    z-index: 6;
}

.user-location__dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--s-blue);
    border: 3px solid white;
}

.user-location__pulse {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.125);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Activity zones */
.zone-overlay {
    position: absolute;
    border-radius: 4px;
    z-index: 3;
}

.zone-overlay--own {
    background: rgba(255, 59, 48, 0.08);
    border: 2px solid rgba(255, 59, 48, 0.375);
}

.zone-overlay--server {
    background: rgba(74, 144, 217, 0.08);
    border: 2px solid rgba(74, 144, 217, 0.375);
}

.zone-label {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--s-radius-badge);
    font-size: 10px;
    font-weight: 600;
    color: var(--s-text-primary);
}

.zone-label--own {
    background: var(--s-red);
}

.zone-label--server {
    background: var(--s-blue);
}

/* ============================================================
   Traffic Report Screen
   ============================================================ */
.report-header {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 16px;
    flex-shrink: 0;
    gap: 12px;
}

.report-header__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--s-text-primary);
}

.report-header__back svg {
    width: 20px;
    height: 20px;
}

.report-header__title {
    font-family: var(--s-font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--s-text-primary);
}

.report-header__spacer {
    flex: 1;
}

.report-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 16px;
    flex: 1;
    overflow-y: auto;
}

.report-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--s-text-muted);
}

.type-grid {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.type-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100px;
    border-radius: var(--s-radius-card);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.type-card svg {
    width: 28px;
    height: 28px;
}

.type-card span {
    font-family: var(--s-font-body);
    font-size: 12px;
    font-weight: 600;
}

.type-card--selected {
    background: rgba(255, 59, 48, 0.15);
    border: 2px solid var(--s-red);
    color: var(--s-red);
}

.type-card--unselected {
    background: var(--s-surface);
    border: 2px solid transparent;
    color: var(--s-text-secondary);
}

.type-card--unselected:hover {
    border-color: var(--s-border);
}

.loc-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
}

.loc-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--s-green);
}

.loc-card__icon svg {
    width: 24px;
    height: 24px;
}

.loc-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.loc-card__coords {
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--s-text-primary);
}

.loc-card__sub {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

.snap-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--s-radius-badge);
    background: rgba(50, 215, 75, 0.15);
    color: var(--s-green);
    flex-shrink: 0;
}

.report-empty {
    font-family: var(--s-font-body);
    font-size: 14px;
    color: var(--s-text-muted);
    padding: 16px;
    text-align: center;
}

.report-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
}

.report-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.report-item__type {
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--s-text-primary);
}

.report-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--s-radius-badge);
    width: fit-content;
}

.report-badge--sent {
    background: rgba(255, 149, 0, 0.15);
    color: var(--s-orange);
}

.report-badge--confirmed {
    background: rgba(50, 215, 75, 0.15);
    color: var(--s-green);
}

.report-badge--cancelled {
    background: rgba(255, 59, 48, 0.15);
    color: var(--s-error);
}

.report-item__cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--s-error);
    border-radius: var(--s-radius-btn);
    cursor: pointer;
    flex-shrink: 0;
}

.cancel-timer {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--s-error);
}

.report-footer {
    padding: 16px;
    flex-shrink: 0;
}

/* ============================================================
   Screen Header (Zone Creation, Edit, etc.)
   ============================================================ */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
    flex-shrink: 0;
}

.screen-header__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.screen-header__back svg {
    width: 24px;
    height: 24px;
    color: var(--s-text-primary);
}

.screen-header__title {
    font-family: var(--s-font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--s-text-primary);
}

.screen-header__action {
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--s-text-primary);
    background: var(--s-red);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.screen-header__action:hover {
    opacity: 0.9;
}

.screen-header__action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   Expand Slider Bottom Sheet
   ============================================================ */
.expand-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--s-surface);
    border-radius: var(--s-radius-sheet) var(--s-radius-sheet) 0 0;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    z-index: 20;
}

.expand-sheet__handle {
    width: 40px;
    height: 4px;
    background: #3A3A3A;
    border-radius: 2px;
}

.expand-sheet__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.expand-sheet__label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--s-text-muted);
}

.expand-sheet__value {
    font-family: var(--s-font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--s-red);
}

.expand-sheet__slider {
    width: 100%;
}

.slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--s-border);
    border-radius: 2px;
    outline: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--s-red);
    border: 2px solid var(--s-text-primary);
    cursor: pointer;
}

.slider-input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--s-red);
    border: 2px solid var(--s-text-primary);
    cursor: pointer;
}

.expand-sheet__range {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: var(--s-font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--s-text-muted);
}

.expand-sheet__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.expand-sheet__input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--s-elevated);
    border: 1px solid var(--s-border);
    border-radius: 8px;
    color: var(--s-text-primary);
    font-family: var(--s-font-body);
    font-size: 14px;
    outline: none;
}

.expand-sheet__input:focus {
    border-color: var(--s-red);
}

.expand-sheet__input::placeholder {
    color: var(--s-text-muted);
}

.expand-sheet__info {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-family: var(--s-font-body);
    font-size: 13px;
    color: var(--s-text-secondary);
}

.expand-sheet__info-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--s-text-secondary);
}

/* ============================================================
   Zone Distance Label (on map)
   ============================================================ */
.zone-dist-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 20px);
    background: rgba(12, 12, 12, 0.8);
    border-radius: 6px;
    padding: 4px 10px;
    z-index: 10;
    font-family: var(--s-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--s-text-primary);
}

/* ============================================================
   Zone Drag Hint (edit mode)
   ============================================================ */
.zone-drag-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60px);
    background: rgba(12, 12, 12, 0.8);
    border-radius: 6px;
    padding: 6px 12px;
    z-index: 10;
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

/* ============================================================
   Zone Count Badge
   ============================================================ */
.zone-count-badge {
    position: absolute;
    top: 8px;
    right: 16px;
    background: var(--s-surface);
    border: 1px solid var(--s-border);
    border-radius: 8px;
    padding: 4px 10px;
    z-index: 10;
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--s-text-secondary);
}

/* ============================================================
   Context Sheet (Zone Detail Bottom Sheet — Screen 10)
   ============================================================ */
.context-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 430px;
    max-height: 80vh;
    background: var(--s-surface);
    border-radius: var(--s-radius-sheet) var(--s-radius-sheet) 0 0;
    padding: 16px 24px 34px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.context-sheet--open {
    transform: translateX(-50%) translateY(0);
}

.context-sheet__handle {
    width: 40px;
    height: 4px;
    background: #3A3A3A;
    border-radius: 2px;
    align-self: center;
}

.context-sheet__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.context-sheet__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.125);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.context-sheet__icon svg {
    width: 22px;
    height: 22px;
    color: var(--s-red);
}

.context-sheet__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.context-sheet__name {
    font-family: var(--s-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--s-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.context-sheet__meta {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

.context-sheet__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.context-sheet__close svg {
    width: 20px;
    height: 20px;
    color: var(--s-text-muted);
}

.context-sheet__badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--s-radius-badge);
    align-self: flex-start;
}

.context-sheet__badge--green {
    background: rgba(50, 215, 75, 0.125);
    color: var(--s-green);
}

.context-sheet__alert-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 59, 48, 0.08);
    border-radius: 8px;
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--s-red);
}

.context-sheet__alert-box svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.context-sheet__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.context-sheet__actions-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--s-text-muted);
    margin-bottom: 4px;
}

.context-action {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    padding: 0 16px;
    background: var(--s-elevated);
    border: none;
    border-radius: var(--s-radius-card);
    cursor: pointer;
    font-family: var(--s-font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--s-text-primary);
    width: 100%;
    text-align: left;
}

.context-action svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.context-action__chevron {
    width: 16px;
    height: 16px;
    color: var(--s-text-muted);
    margin-left: auto;
}

.context-action--danger {
    background: rgba(255, 69, 58, 0.08);
    color: var(--s-error);
}

.context-action--danger svg {
    color: var(--s-error);
}

.context-action--danger:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.context-action--muted {
    color: var(--s-text-muted);
}

.context-action--muted svg {
    color: var(--s-text-muted);
}

.context-sheet__warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 149, 0, 0.08);
    border-radius: 8px;
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-orange);
}

.context-sheet__warning svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.context-sheet__icon--green {
    background: rgba(50, 215, 75, 0.125);
}

.context-sheet__icon--green svg {
    color: var(--s-green);
}

/* ============================================================
   Zone Detail Rows
   ============================================================ */
.zone-detail__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zone-detail__section-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--s-text-muted);
}

.zone-detail__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--s-elevated);
    border-radius: var(--s-radius-card);
}

.zone-detail__row-label {
    font-family: var(--s-font-body);
    font-size: 13px;
    color: var(--s-text-muted);
}

.zone-detail__row-value {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--s-text-primary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.zone-detail__row-value--link {
    color: var(--s-blue);
    cursor: pointer;
}

/* Icon-only action row */
.context-actions-row {
    display: flex;
    gap: 8px;
}

.context-action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--s-elevated);
    border: none;
    border-radius: var(--s-radius-card);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    color: var(--s-text-primary);
}

.context-action-icon svg {
    width: 20px;
    height: 20px;
}

.context-action-icon:active {
    opacity: 0.7;
}

.context-action-icon--danger {
    background: rgba(255, 69, 58, 0.08);
    color: var(--s-error);
}

.context-action-icon--danger:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.context-action-icon--muted {
    color: var(--s-text-muted);
}

/* ============================================================
   Crossing Detail
   ============================================================ */
.crossing-detail__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crossing-detail__section-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--s-text-muted);
}

.crossing-detail__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--s-elevated);
    border-radius: var(--s-radius-card);
}

.crossing-detail__row-label {
    font-family: var(--s-font-body);
    font-size: 13px;
    color: var(--s-text-muted);
}

.crossing-detail__row-value {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--s-text-primary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.crossing-detail__flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.crossing-detail__flag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    width: calc(50% - 3px);
}

.crossing-detail__flag--on {
    background: rgba(50, 215, 75, 0.08);
}

.crossing-detail__flag--off {
    background: rgba(255, 69, 58, 0.08);
}

.crossing-detail__flag--unknown {
    background: rgba(82, 82, 82, 0.15);
}

.crossing-detail__flag-check {
    font-family: var(--s-font-body);
    font-size: 12px;
    font-weight: 700;
}

.crossing-detail__flag--on .crossing-detail__flag-check {
    color: var(--s-green);
}

.crossing-detail__flag--off .crossing-detail__flag-check {
    color: var(--s-error);
}

.crossing-detail__flag-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 500;
}

.crossing-detail__flag--on .crossing-detail__flag-label {
    color: var(--s-text-primary);
}

.crossing-detail__flag--off .crossing-detail__flag-label {
    color: var(--s-text-secondary);
}

.crossing-detail__flag--unknown .crossing-detail__flag-check {
    color: var(--s-text-muted);
}

.crossing-detail__flag--unknown .crossing-detail__flag-label {
    color: var(--s-text-muted);
}

/* ============================================================
   Infrastructure ETA Sheet
   ============================================================ */
.eta-section-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--s-text-muted);
}

.eta-signal-badge {
    font-family: var(--s-font-body);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 8px;
    border-radius: var(--s-radius-badge);
    flex-shrink: 0;
}

.eta-signal-badge--green {
    color: var(--s-green);
    background: rgba(50, 215, 75, 0.125);
}

.eta-signal-badge--red {
    color: var(--s-red);
    background: rgba(255, 59, 48, 0.125);
}

.eta-signal-badge--orange {
    color: var(--s-orange);
    background: rgba(255, 149, 0, 0.125);
}

.eta-signal-badge--muted {
    color: var(--s-text-muted);
    background: rgba(82, 82, 82, 0.2);
}

.eta-train-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--s-elevated);
    border-radius: var(--s-radius-card);
}

.eta-train-icon {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.eta-train-icon.eta-color--urgent {
    background: rgba(255, 59, 48, 0.125);
    color: var(--s-red);
}

.eta-train-icon.eta-color--warning {
    background: rgba(255, 149, 0, 0.125);
    color: var(--s-orange);
}

.eta-train-icon.eta-color--safe {
    background: rgba(50, 215, 75, 0.125);
    color: var(--s-green);
}

.eta-train-icon.eta-color--muted {
    background: rgba(82, 82, 82, 0.2);
    color: var(--s-text-muted);
}

.eta-train-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.eta-train-name {
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--s-text-primary);
}

.eta-train-meta {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

.eta-train-eta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.eta-value {
    font-family: var(--s-font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.eta-value.eta-color--urgent { color: var(--s-red); }
.eta-value.eta-color--warning { color: var(--s-orange); }
.eta-value.eta-color--safe { color: var(--s-green); }
.eta-value.eta-color--muted { color: var(--s-text-muted); }

.eta-unit {
    font-family: var(--s-font-body);
    font-size: 10px;
    font-weight: 500;
    color: var(--s-text-secondary);
}

.eta-empty {
    font-family: var(--s-font-body);
    font-size: 14px;
    color: var(--s-text-secondary);
    text-align: center;
    padding: 24px 0;
}

.eta-disclaimer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 149, 0, 0.1);
    border-radius: 8px;
    font-family: var(--s-font-body);
    font-size: 11px;
    color: var(--s-orange);
}

.eta-disclaimer svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.eta-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--s-font-body);
    font-size: 10px;
    color: #3A3A3A;
}

.eta-refresh svg {
    width: 11px;
    height: 11px;
}

/* ============================================================
   Confirmation Dialog
   ============================================================ */
.confirm-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.confirm-dialog__card {
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 340px;
    width: 100%;
}

.confirm-dialog__title {
    font-family: var(--s-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--s-text-primary);
}

.confirm-dialog__desc {
    font-family: var(--s-font-body);
    font-size: 14px;
    color: var(--s-text-secondary);
    line-height: 1.4;
}

.confirm-dialog__actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.confirm-dialog__btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.confirm-dialog__btn--cancel {
    background: var(--s-elevated);
    color: var(--s-text-primary);
}

.confirm-dialog__btn--danger {
    background: var(--s-error);
    color: var(--s-text-primary);
}

/* ============================================================
   Toast Messages
   ============================================================ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 360px;
    width: calc(100% - 48px);
    padding: 12px 16px;
    border-radius: var(--s-radius-card);
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 500;
    z-index: 300;
    text-align: center;
}

.toast--error {
    background: rgba(255, 69, 58, 0.15);
    color: var(--s-error);
    border: 1px solid rgba(255, 69, 58, 0.3);
}

/* ============================================================
   Zone Alert Pages
   ============================================================ */

/* Page layout */
.alert-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--s-bg);
}

.alert-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
    flex-shrink: 0;
}

.alert-page__title {
    font-family: var(--s-font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--s-text-primary);
    letter-spacing: -0.5px;
}

.alert-page__content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 16px;
}

/* Section label */
.section-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--s-text-muted);
    margin-bottom: -8px;
}

/* Zone checkboxes (activation page) */
.zone-check-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zone-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
    cursor: pointer;
    border: none;
    text-align: left;
    width: 100%;
}

.zone-check__box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #3A3A3A;
    background: transparent;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-check__box--active {
    background: var(--s-red);
    border-color: var(--s-red);
}

.zone-check__box svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.zone-check__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.zone-check__name {
    font-family: var(--s-font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--s-text-primary);
}

.zone-check__meta {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

/* Duration picker */
.dur-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dur-row {
    display: flex;
    gap: 6px;
}

.dur-btn {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--s-elevated);
    border: none;
    border-radius: 6px;
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--s-text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.dur-btn--active {
    background: var(--s-red);
    color: var(--s-text-primary);
}

/* ETA section */
.eta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
}

.eta-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.eta-card__title {
    font-family: var(--s-font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--s-text-primary);
}

.eta-card__desc {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

.eta-card__value {
    font-family: var(--s-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--s-red);
}

.eta-input {
    width: 80px;
    background: transparent;
    border: none;
    font-family: var(--s-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--s-red);
    text-align: right;
    outline: none;
}

.eta-input::-webkit-inner-spin-button,
.eta-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* Vehicle type filter row */
.config-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
}

.config-row__label {
    font-family: var(--s-font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--s-text-primary);
}

.config-row__value {
    font-family: var(--s-font-body);
    font-size: 14px;
    color: var(--s-text-secondary);
}

.config-row__value--accent {
    font-family: var(--s-font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--s-red);
}

/* Push notification warning */
.push-warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 149, 0, 0.08);
    border-radius: 8px;
    margin-top: auto;
}

.push-warn svg {
    width: 16px;
    height: 16px;
    color: var(--s-orange);
    flex-shrink: 0;
    margin-top: 1px;
}

.push-warn__text {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-orange);
    line-height: 1.3;
}

/* Activate / Deactivate button (full-width bottom) */
.alert-page__action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 56px;
    background: var(--s-red);
    border: none;
    cursor: pointer;
    font-family: var(--s-font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--s-text-primary);
    flex-shrink: 0;
    width: 100%;
    transition: opacity 0.15s;
}

.alert-page__action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.alert-page__action svg {
    width: 22px;
    height: 22px;
}

.alert-page__action--danger {
    background: var(--s-error);
}

/* Active alert banner */
.alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 59, 48, 0.125);
    gap: 12px;
    flex-shrink: 0;
}

.alert-banner__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-banner__left svg {
    width: 20px;
    height: 20px;
    color: var(--s-red);
}

.alert-banner__label {
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--s-red);
}

.alert-banner__timer {
    font-family: var(--s-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--s-red);
}

/* Zone list items (management page) */
.zone-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
}

.zone-item__shield {
    width: 20px;
    height: 20px;
    color: var(--s-red);
    flex-shrink: 0;
}

.zone-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.zone-item__name {
    font-family: var(--s-font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--s-text-primary);
}

.zone-item__meta {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

.zone-item__remove {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--s-error);
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

/* Action buttons (management page) */
.alert-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    background: var(--s-surface);
    border: none;
    border-radius: var(--s-radius-card);
    font-family: var(--s-font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.alert-action-btn--outline {
    color: var(--s-red);
    border: 1px solid var(--s-red);
}

.alert-action-btn--muted {
    color: var(--s-text-secondary);
    font-weight: 500;
}

.alert-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Empty state */
.alert-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 16px;
    text-align: center;
}

.alert-empty__text {
    font-family: var(--s-font-body);
    font-size: 15px;
    color: var(--s-text-secondary);
}

/* Map alert badge */
.alert-badge {
    position: absolute;
    top: 8px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--s-red);
    border-radius: 8px;
    z-index: 10;
    cursor: pointer;
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--s-text-primary);
}

/* ── Predicted Conflicts Panel ── */

.conflict-panel {
    padding: 8px 16px;
    max-height: 200px;
    overflow-y: auto;
}

.conflict-panel__header {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 700;
    color: #FF9500;
    margin-bottom: 6px;
}

.conflict-panel__table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--s-font-body);
    font-size: 11px;
    color: var(--s-text-primary);
}

.conflict-panel__table th {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--s-text-secondary);
    font-weight: 600;
}

.conflict-panel__table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.severity {
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

.severity--high {
    background: rgba(255, 59, 48, 0.25);
    color: #FF3B30;
}

.severity--medium {
    background: rgba(255, 149, 0, 0.25);
    color: #FF9500;
}

.severity--low {
    background: rgba(52, 199, 89, 0.25);
    color: #34C759;
}

/* ── Route Entities Panel ── */

.route-entity-panel {
    background: rgba(12, 12, 12, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.route-entity-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.route-entity-panel__header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 600;
    color: #30D5C8;
}

.route-entity-panel__icon {
    width: 16px;
    height: 16px;
}

.route-entity-panel__count {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.38);
}

.route-entity-panel__divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.route-entity-panel__list {
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.route-entity-panel__list::-webkit-scrollbar {
    width: 3px;
}

.route-entity-panel__list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
}

.route-entity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.route-entity-row__icon {
    width: 28px;
    height: 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.route-entity-row__icon svg {
    width: 14px;
    height: 14px;
}

.route-entity-row__icon--crossing {
    background: rgba(50, 215, 75, 0.13);
    color: #32D74B;
}

.route-entity-row__icon--zone {
    background: rgba(255, 59, 48, 0.13);
    color: #FF3B30;
}

.route-entity-row__icon--order {
    background: rgba(255, 149, 0, 0.13);
    color: #FF9500;
}

.route-entity-row__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.route-entity-row__name {
    font-family: var(--s-font-body);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.87);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-entity-row__subtitle {
    font-family: var(--s-font-body);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.38);
}

.route-entity-row__metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.route-entity-row__distance {
    font-family: var(--s-font-body);
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
}

.route-entity-row__eta {
    font-family: var(--s-font-body);
    font-size: 10px;
    color: #30D5C8;
}

/* ============================================================
   Vehicle Detail Panel
   ============================================================ */
.vehicle-detail {
    background: var(--s-bg);
    max-height: 70vh;
}

.vehicle-detail__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--s-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #FFFFFF;
}

.vehicle-detail__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vehicle-detail__section-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--s-text-muted);
}

.vehicle-detail__stat-grid {
    display: flex;
    gap: 8px;
}

.vehicle-detail__stat-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
}

.vehicle-detail__stat-label {
    font-family: var(--s-font-body);
    font-size: 11px;
    color: var(--s-text-muted);
}

.vehicle-detail__stat-value {
    font-family: var(--s-font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--s-text-primary);
}

.vehicle-detail__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
    cursor: pointer;
}

.vehicle-detail__row-label {
    font-family: var(--s-font-body);
    font-size: 13px;
    color: var(--s-text-muted);
}

.vehicle-detail__row-value {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--s-text-primary);
}

.vehicle-detail__row-action {
    width: 16px;
    height: 16px;
    color: var(--s-text-muted);
    flex-shrink: 0;
}

.vehicle-detail__freshness--good {
    color: var(--s-green);
}

.vehicle-detail__freshness--stale {
    color: var(--s-orange);
}

.vehicle-detail__freshness--old {
    color: var(--s-red);
}

/* POI list — scrollable, shows ~2 entries */
.vehicle-detail__poi-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 130px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* POI rows */
.vehicle-detail__poi-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--s-surface);
    border-radius: var(--s-radius-card);
}

.vehicle-detail__poi-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vehicle-detail__poi-icon svg {
    width: 16px;
    height: 16px;
}

.vehicle-detail__poi-icon--crossing {
    background: rgba(255, 59, 48, 0.125);
    color: var(--s-red);
}

.vehicle-detail__poi-icon--zone {
    background: rgba(74, 144, 217, 0.125);
    color: var(--s-blue);
}

.vehicle-detail__poi-icon--order {
    background: rgba(255, 149, 0, 0.125);
    color: var(--s-orange);
}

.vehicle-detail__poi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.vehicle-detail__poi-name {
    font-family: var(--s-font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--s-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-detail__poi-sub {
    font-family: var(--s-font-body);
    font-size: 12px;
    color: var(--s-text-secondary);
}

.vehicle-detail__poi-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.vehicle-detail__poi-distance {
    font-family: var(--s-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--s-text-primary);
}

.vehicle-detail__poi-eta {
    font-family: var(--s-font-body);
    font-size: 11px;
    color: var(--s-green);
}
