body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #1f2933;
}

.page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem 1.5rem;
}

h1, h2, h3 {
    margin: 0;
    color: #111827;
}

.hero-title-main {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111827;
    margin-bottom: 0.25rem;
}

.hero-title-sub {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #6b7280;
    margin-bottom: 1rem;
}

.hero-lead {
    font-size: 1rem;
    color: #1f2933;
    max-width: 640px;
    margin-bottom: 1.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.75rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hero-counters {
    background-color: #0b1120;
    color: #f9fafb;
    border-radius: 1.25rem;
    padding: 1.5rem 1.6rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.45);
}

.hero-counters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
}

@media (max-width: 640px) {
    .hero-counters-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hero-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.hero-value-large {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #f9fafb;
}

.hero-value-secondary {
    font-size: 1.4rem;
    font-weight: 600;
}

.hero-caption {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.hero-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background-color: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(55, 65, 81, 0.9);
    color: #e5e7eb;
}

.hero-secondary-panel {
    background-color: #ffffff;
    border-radius: 1.25rem;
    padding: 1.3rem 1.4rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}

.panel-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.panel-title-strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.panel-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    padding: 0.2rem 0;
}

.metric-row-label {
    color: #4b5563;
}

.metric-row-value {
    font-weight: 600;
    color: #111827;
}

.section {
    margin-top: 2.75rem;
}

/* Anchor “slide” blocks (used on Station Profile)
   Keep them as a scrolling page, but with clearer section boundaries. */
.slide-frame {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.slide-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: #111827;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.cards-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.cards-strip::-webkit-scrollbar {
    height: 6px;
}

.cards-strip::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 999px;
}

.card {
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.card-icon {
    font-size: 1.1rem;
}

.card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #4b5563;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 0.65rem;
}

.card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1.25rem;
    font-size: 0.85rem;
}

.card-metrics > .full-width {
    grid-column: span 2;
}

.card-metric-label {
    color: #6b7280;
    font-size: 0.78rem;
}

.card-metric-value {
    font-weight: 500;
    color: #111827;
}

.activity-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.activity-toggle {
    display: inline-flex;
    padding: 0.2rem;
    border-radius: 999px;
    background-color: #e5e7eb;
}

.activity-toggle button {
    border: none;
    background: transparent;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #4b5563;
}

.activity-toggle button.is-active {
    background-color: #111827;
    color: #f9fafb;
}

.table-wrapper {
    margin-top: 0.9rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 0.5rem 0.4rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4b5563;
}

tr:nth-child(even) td {
    background-color: #f9fafb;
}

.muted {
    color: #6b7280;
}

.info-link {
    text-decoration: none;
    font-weight: 600;
    color: inherit;
}

.info-link:hover {
    text-decoration: none;
    opacity: 0.75;
}

.legacy-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.legacy-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background-color: #e5e7eb;
    color: #4b5563;
    margin-bottom: 0.4rem;
}

/* Simple score tags (utility analysis) */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.tag-ok {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #065f46;
}

.tag-mid {
    background-color: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: #1e3a8a;
}

.tag-warn {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #92400e;
}

.tag-bad {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #991b1b;
}

/* Fleetmap landing modal (simulated video) */
.fleetmap-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.70);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.fleetmap-modal-card {
    width: min(980px, 100%);
    background: #0b0f14;
    color: #e6edf3;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
    overflow: hidden;
}

.fleetmap-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.fleetmap-modal-close {
    background: transparent;
    border: none;
    color: rgba(230, 237, 243, 0.85);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.fleetmap-status {
    padding: 0.5rem 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    color: rgba(230, 237, 243, 0.75);
}

.fleetmap-canvas-wrap {
    height: min(62vh, 560px);
    padding: 0 1rem 0.25rem 1rem;
}

#fleetmap-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.fleetmap-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem 1rem 1rem;
}

.fleetmap-btn {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: rgba(230, 237, 243, 0.92);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.fleetmap-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Digest subscribe popup (non-intrusive) */
.digest-popup {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 2200;
    max-width: 360px;
}

@media (max-width: 640px) {
    .digest-popup {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

.digest-popup-card {
    position: relative;
    background: rgba(17, 24, 39, 0.95);
    color: #f9fafb;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 1rem 1rem 0.9rem 1rem;
    box-shadow: 0 14px 38px rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
}

.digest-popup-close {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: rgba(249, 250, 251, 0.85);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
}

.digest-popup-title {
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.4rem;
}

.digest-popup-text {
    font-size: 0.9rem;
    color: rgba(249, 250, 251, 0.85);
    line-height: 1.35;
}

.digest-popup-text a {
    color: #93c5fd;
    text-decoration: underline;
}

.digest-popup-text a:hover {
    color: #bfdbfe;
}

.digest-popup-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    align-items: center;
}

.digest-popup-accept {
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.digest-popup-dismiss {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: transparent;
    color: rgba(249, 250, 251, 0.85);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Hamburger menu ── */
.hamburger-btn {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #334155;
    border-radius: 1px;
}
.hamburger-btn:hover {
    background: #f8fafc;
}

.hamburger-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.hamburger-overlay.open {
    opacity: 1;
    visibility: visible;
}

.hamburger-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    padding: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.hamburger-overlay.open .hamburger-menu {
    transform: translateX(0);
}

.hamburger-close {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.hamburger-close:hover {
    color: #1e293b;
}

.hamburger-link {
    display: block;
    padding: 0.7rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s;
}
.hamburger-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.hamburger-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0;
}

.hamburger-logout {
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: left;
    cursor: pointer;
}
.hamburger-logout:hover {
    color: #dc2626;
    background: #fef2f2;
}

.chart-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (max-width: 640px) {
    .chart-card {
        padding: 0.75rem;
        border-radius: 8px;
    }
}
