/* supplychain.observer — Dashboard Analytics Dark */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0D1117;
    color: #7D8590;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== SHARED ========== */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #E6EDF3;
    letter-spacing: 0.02em;
    text-align: center;
    margin-bottom: 2rem;
}

/* Status dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-ok {
    background: #3FB950;
}

.status-amber {
    background: #F59E0B;
}

.status-red {
    background: #F85149;
}

/* Pulsing status dots */
.pulse-green {
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5);
    animation: pulseGreen 2s ease-in-out infinite;
}

.pulse-amber {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    animation: pulseAmber 2s ease-in-out infinite;
}

@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(63, 185, 80, 0); }
}

@keyframes pulseAmber {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

.status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: #7D8590;
}

/* ========== TOP BAR ========== */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #21262D;
}

.top-bar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #E6EDF3;
    letter-spacing: 0.08em;
}

.status-cluster {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== HERO ========== */
.hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 5rem 2rem 3rem;
    text-align: center;
}

.hero-inner {
    max-width: 680px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: #E6EDF3;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}

.hero-sub {
    font-size: 1.05rem;
    color: #7D8590;
    margin-bottom: 2rem;
}

.cta-btn {
    display: inline-block;
    background: #3FB950;
    color: #0D1117;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.65rem 1.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.cta-btn:hover {
    background: #4cc764;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(63, 185, 80, 0.25);
}

.cta-btn:active {
    transform: translateY(0);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #21262D;
}

.hero-stat {
    text-align: center;
}

.hero-stat-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.6rem;
    color: #E6EDF3;
    display: block;
    margin-bottom: 0.2rem;
}

.hero-stat-label {
    font-size: 0.75rem;
    color: #7D8590;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ========== DASHBOARD ========== */
.dashboard {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.metric-card {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 8px;
    padding: 1.25rem;
    transition: border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    cursor: default;
}

.metric-card:hover {
    border-color: #3FB950;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(63, 185, 80, 0.08);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-label {
    font-size: 0.8rem;
    color: #7D8590;
}

.metric-icon {
    opacity: 0.5;
}

.metric-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 700;
    color: #E6EDF3;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.metric-alert {
    color: #F85149;
}

.metric-warn {
    color: #F59E0B;
}

.metric-ok {
    color: #3FB950;
}

.metric-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-trend {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
}

.metric-trend.up {
    color: #3FB950;
}

.metric-trend.down {
    color: #F85149;
}

.sparkline {
    width: 60px;
    height: 24px;
}

/* ========== ALERT FEED ========== */
.alerts {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.alert-entry {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.alert-entry:hover {
    background: #1c222b;
}

.alert-critical {
    border-left: 3px solid #F85149;
}

.alert-warning {
    border-left: 3px solid #F59E0B;
}

.alert-info {
    border-left: 3px solid #58A6FF;
}

.severity-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.critical {
    background: rgba(248, 81, 73, 0.15);
    color: #F85149;
}

.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.info {
    background: rgba(88, 166, 255, 0.15);
    color: #58A6FF;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-msg {
    font-size: 0.88rem;
    color: #E6EDF3;
    display: block;
    margin-bottom: 0.15rem;
}

.alert-route {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #7D8590;
}

.alert-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #7D8590;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== ROUTE PANEL ========== */
.route-panel {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.route-card {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.route-card:hover {
    border-color: #3FB950;
}

.route-card:last-child {
    margin-bottom: 0;
}

.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #21262D;
}

.route-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #E6EDF3;
}

.route-type {
    font-size: 0.75rem;
    color: #7D8590;
    background: rgba(125, 133, 144, 0.1);
    padding: 2px 10px;
    border-radius: 4px;
}

.route-viz {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.route-endpoint {
    text-align: center;
    flex-shrink: 0;
    min-width: 80px;
}

.route-origin,
.route-dest {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: #E6EDF3;
    display: block;
}

.route-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: #7D8590;
    letter-spacing: 0.04em;
}

.route-line-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.route-line {
    border-top: 2px dashed #7D8590;
    position: relative;
    height: 2px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.checkpoint {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #21262D;
    border: 2px solid #7D8590;
    position: relative;
    top: -1px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.cp-done {
    background: #3FB950;
    border-color: #3FB950;
}

.cp-active {
    background: #F59E0B;
    border-color: #F59E0B;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    animation: pulseAmber 2s ease-in-out infinite;
}

.route-progress {
    height: 3px;
    background: #21262D;
    border-radius: 2px;
    overflow: hidden;
}

.route-progress-bar {
    height: 100%;
    background: #F59E0B;
    border-radius: 2px;
    transition: width 1.2s ease-out;
}

.route-progress-ok {
    background: #3FB950;
}

.route-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.route-status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-label {
    font-size: 0.75rem;
    color: #7D8590;
}

.route-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    color: #E6EDF3;
}

.route-val-amber {
    color: #F59E0B;
}

.route-val-red {
    color: #F85149;
}

.route-val-green {
    color: #3FB950;
}

/* ========== FOOTER ========== */
.footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    border-top: 1px solid #21262D;
}

.footer-inner {
    text-align: center;
}

.footer-status {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.footer-status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.flink {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #58A6FF;
    text-decoration: none;
    transition: color 0.2s ease;
}

.flink:hover {
    color: #79bbff;
}

.footer-copy {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #7D8590;
}

/* ========== FADE-IN ANIMATION ========== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.metric-card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.metric-card.card-visible {
    opacity: 1;
    transform: translateY(0);
}

.alert-entry {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease, border-color 0.2s ease;
}

.alert-entry.alert-visible {
    opacity: 1;
    transform: translateX(0);
}

.route-card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s ease;
}

.route-card.route-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .hero-stat-num {
        font-size: 1.3rem;
    }

    .route-viz {
        flex-direction: column;
        gap: 0.75rem;
    }

    .route-line-wrapper {
        width: 100%;
    }

    .route-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .status-cluster {
        gap: 0.75rem;
    }

    .alert-entry {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .top-bar-inner {
        flex-direction: column;
        gap: 0.5rem;
    }

    .status-cluster {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-status {
        flex-direction: column;
        gap: 0.5rem;
    }
}