:root{
    --bg:#07111f;
    --bg-2:#0b1220;
    --panel:#0f172a;
    --panel-2:#111c30;
    --panel-soft:rgba(15,23,42,.82);
    --panel-soft-strong:rgba(15,23,42,.88);
    --panel-softer:rgba(255,255,255,.03);
    --border:rgba(255,255,255,.08);
    --border-strong:rgba(148,163,184,.18);
    --text:#f8fafc;
    --muted:#94a3b8;
    --muted-2:#cbd5e1;
    --accent:#3b82f6;
    --accent-2:#60a5fa;
    --success:#22c55e;
    --warning:#f59e0b;
    --info:#38bdf8;
    --danger:#f87171;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    min-height:100vh;
    color:var(--text);
    font-family:Inter,Arial,sans-serif;
    background:
        radial-gradient(circle at top left, #18345f 0%, #07111f 38%),
        linear-gradient(135deg, #07111f 0%, #0b1220 100%);
}

.page-shell,
.wrapper{
    max-width:1440px;
    margin:0 auto;
    padding:28px 20px 60px;
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;
    margin-bottom:24px;
}

.topbar > *,
.hero-grid > *,
.hero-meta > *,
.summary-grid > *,
.table-head > *{
    min-width:0;
}

.brand-block{
    display:flex;
    gap:16px;
    align-items:flex-start;
}

.brand-mark{
    width:58px;
    height:58px;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:28px;
    background:linear-gradient(135deg, #2563eb, #60a5fa);
    box-shadow:0 16px 40px rgba(37,99,235,.35);
    flex-shrink:0;
}

.brand-title{
    font-size:34px;
    font-weight:900;
    letter-spacing:-1.4px;
    line-height:1;
    margin-top:2px;
}

.brand-sub,
.hero-desc,
.table-head-sub,
.table-muted,
.route-main,
.route-days-line,
.reason-main,
.reason-line,
.weekday-stat-line,
.detail-value,
.summary-v,
.summary-k,
.section-note,
.stat-meta{
    overflow-wrap:anywhere;
    word-break:break-word;
}

.brand-sub{
    margin-top:8px;
    color:var(--muted);
    font-size:15px;
}

.brand-chip-row{
    margin-top:12px;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:999px;
    border:1px solid var(--border);
    background:rgba(255,255,255,.03);
    color:#dbeafe;
    font-size:12px;
    font-weight:700;
    letter-spacing:.3px;
}

.top-actions{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.user-pill{
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    border-radius:999px;
    border:1px solid var(--border);
    background:rgba(255,255,255,.03);
    color:#dbeafe;
    font-size:13px;
    font-weight:700;
}

.btn-premium{
    border:none;
    border-radius:14px;
    padding:12px 16px;
    font-weight:700;
    box-shadow:0 12px 30px rgba(0,0,0,.18);
}

.btn-run{
    background:linear-gradient(135deg, #2563eb, #3b82f6);
    color:white;
}

.btn-ghost{
    border-radius:14px;
    padding:12px 16px;
    font-weight:700;
    border:1px solid var(--border-strong);
    background:rgba(255,255,255,.03);
    color:white;
    text-decoration:none;
}

.btn-soft{
    border-radius:14px;
    padding:12px 16px;
}

.hero-card,
.panel-card,
.metric-card,
.table-card,
.empty-card,
.summary-card,
.card-shell,
.detail-card{
    background:var(--panel-soft);
    border:1px solid var(--border);
    border-radius:28px;
    box-shadow:0 24px 60px rgba(0,0,0,.28);
    backdrop-filter:blur(12px);
}

.hero-card{
    padding:26px;
    margin-bottom:22px;
    overflow:hidden;
    position:relative;
}

.hero-card::after{
    content:"";
    position:absolute;
    right:-120px;
    top:-120px;
    width:280px;
    height:280px;
    border-radius:999px;
    background:radial-gradient(circle, rgba(96,165,250,.22) 0%, rgba(96,165,250,0) 70%);
    pointer-events:none;
}

.hero-grid{
    display:grid;
    grid-template-columns:1.4fr .8fr;
    gap:18px;
    position:relative;
    z-index:1;
}

.hero-title{
    font-size:30px;
    font-weight:900;
    letter-spacing:-1px;
    margin-bottom:10px;
}

.hero-desc{
    color:var(--muted-2);
    max-width:780px;
    line-height:1.6;
}

.hero-meta{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:12px;
}

.hero-mini{
    padding:16px;
    border-radius:20px;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);
    min-width:0;
}

.hero-mini-k{
    color:var(--muted);
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:1px;
}

.hero-mini-v{
    margin-top:8px;
    font-size:24px;
    font-weight:800;
}

.section-block{
    margin-bottom:24px;
}

.section-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    margin-bottom:14px;
}

.section-title{
    font-size:13px;
    font-weight:900;
    color:#bfdbfe;
    letter-spacing:1.6px;
    text-transform:uppercase;
}

.section-note{
    color:var(--muted);
    margin-top:-10px;
    margin-bottom:18px;
    font-size:14px;
}

.window-switcher{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.window-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:72px;
    padding:10px 14px;
    border-radius:14px;
    font-size:13px;
    font-weight:800;
    text-decoration:none;
    border:1px solid var(--border-strong);
    color:#dbeafe;
    background:rgba(255,255,255,.03);
}

.window-btn.active{
    background:linear-gradient(135deg, rgba(37,99,235,.85), rgba(59,130,246,.95));
    border-color:transparent;
    color:white;
    box-shadow:0 14px 32px rgba(37,99,235,.28);
}

.metrics-grid{
    display:grid;
    grid-template-columns:repeat(6, minmax(0,1fr));
    gap:14px;
}

.metric-card{
    padding:18px;
    min-width:0;
}

.metric-label{
    color:var(--muted);
    text-transform:uppercase;
    font-size:12px;
    letter-spacing:1px;
}

.metric-value{
    margin-top:12px;
    font-size:28px;
    font-weight:900;
    line-height:1;
}

.metric-sub{
    margin-top:10px;
    color:#cbd5e1;
    font-size:13px;
}

.level-high{ color:var(--success); font-weight:800; }
.level-medium{ color:var(--warning); font-weight:800; }
.level-low{ color:var(--info); font-weight:800; }

.warning-card{
    margin-top:14px;
    padding:16px 18px;
    border-radius:20px;
    background:rgba(245,158,11,.08);
    border:1px solid rgba(245,158,11,.22);
}

.warning-title{
    font-size:12px;
    font-weight:900;
    color:#fde68a;
    text-transform:uppercase;
    letter-spacing:1px;
    margin-bottom:8px;
}

.warning-item{
    color:#fde68a;
    font-size:14px;
    margin-bottom:4px;
}

.detail-grid-dashboard{
    display:grid;
    grid-template-columns:1.45fr .85fr;
    gap:18px;
}

.detail-grid-candidates{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
    padding:6px 0 2px;
}

.panel-card{
    padding:22px;
}

.panel-title{
    font-size:20px;
    font-weight:800;
    letter-spacing:-.4px;
    margin-bottom:16px;
}

.panel-sub{
    color:var(--muted);
    font-size:14px;
    margin-bottom:18px;
}

.chart-card{
    background:rgba(255,255,255,.03);
    border:1px solid rgba(255,255,255,.06);
    border-radius:22px;
    padding:16px;
}

.chart-wrap{
    height:320px;
}

.chart-wrap canvas{
    width:100% !important;
    height:100% !important;
}

.stat-stack{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:14px;
}

.stat-box{
    padding:18px;
    border-radius:20px;
    background:rgba(255,255,255,.03);
    border:1px solid rgba(255,255,255,.06);
    min-height:138px;
    min-width:0;
}

.stat-k{
    color:var(--muted);
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:1px;
}

.stat-v{
    font-size:32px;
    font-weight:900;
    margin-top:10px;
    line-height:1;
}

.stat-meta{
    margin-top:14px;
    font-size:14px;
    color:#dbeafe;
}

.back-link{
    display:inline-flex;
    align-items:center;
    gap:8px;
    text-decoration:none;
    color:#dbeafe;
    font-weight:700;
    margin-bottom:16px;
}

.table-card{
    overflow:hidden;
    min-width:0;
}

.table-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:18px 20px;
    border-bottom:1px solid var(--border);
    flex-wrap:wrap;
}

.table-head-title{
    font-size:18px;
    font-weight:800;
    letter-spacing:-.3px;
}

.table-head-sub{
    color:var(--muted);
    font-size:13px;
    margin-top:4px;
}

.table-wrap{
    overflow:auto;
}

.data-table,
.variant-table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
}

.data-table thead th,
.variant-table thead th{
    position:sticky;
    top:0;
    z-index:1;
    background:#111c30;
    color:#cbd5e1;
    text-transform:uppercase;
    font-size:11px;
    letter-spacing:1px;
    font-weight:800;
    padding:14px 16px;
    border-bottom:1px solid var(--border);
    white-space:nowrap;
}

.data-table tbody td,
.variant-table tbody td{
    padding:16px;
    border-bottom:1px solid rgba(255,255,255,.05);
    color:#e5eefc;
    vertical-align:top;
    font-size:14px;
}

.data-table tbody tr:hover,
.variant-table tbody tr:hover{
    background:rgba(255,255,255,.02);
}

.airport-link{
    color:#93c5fd;
    text-decoration:none;
    font-weight:800;
}

.airport-link:hover{
    color:#bfdbfe;
}

.pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    white-space:nowrap;
}

.pill-neutral{
    background:rgba(226,232,240,.12);
    color:#e2e8f0;
    border:1px solid rgba(226,232,240,.14);
}

.pill-high,
.level-pill-high{
    background:rgba(34,197,94,.14);
    color:#86efac;
    border:1px solid rgba(34,197,94,.18);
}

.pill-medium,
.level-pill-medium{
    background:rgba(245,158,11,.14);
    color:#fcd34d;
    border:1px solid rgba(245,158,11,.18);
}

.pill-low,
.level-pill-low{
    background:rgba(56,189,248,.14);
    color:#7dd3fc;
    border:1px solid rgba(56,189,248,.18);
}

.table-muted{
    color:#94a3b8;
    font-size:12px;
}

.route-main{
    font-weight:800;
    color:white;
}

.route-days{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:6px 12px;
    margin-top:8px;
}

.route-days-line{
    font-size:12px;
    color:#94a3b8;
}

.route-days-line strong{
    color:#dbeafe;
}

.reason-main{
    font-weight:700;
    color:#f8fafc;
}

.reason-line{
    margin-bottom:4px;
}

.weekday-stat-line{
    margin-bottom:4px;
    color:#dbeafe;
    font-size:12px;
    line-height:1.45;
}

.detail-row td{
    padding-top:0;
    background:rgba(255,255,255,.015);
}

.detail-row.is-collapsed{
    display:none;
}

.detail-card{
    background:var(--panel-softer);
    border:1px solid rgba(255,255,255,.06);
    border-radius:18px;
    padding:14px;
    min-width:0;
    overflow:hidden;
}

.detail-title{
    font-size:13px;
    font-weight:800;
    color:#bfdbfe;
    text-transform:uppercase;
    letter-spacing:.8px;
    margin-bottom:12px;
}

.detail-block{
    margin-bottom:14px;
}

.detail-block:last-child{
    margin-bottom:0;
}

.detail-label{
    color:var(--muted);
    font-size:12px;
    margin-bottom:6px;
    text-transform:uppercase;
    letter-spacing:.8px;
}

.detail-value{
    color:#e5eefc;
    font-size:14px;
    line-height:1.55;
}

.fare-link{
    color:#93c5fd;
    text-decoration:none;
    font-weight:700;
}

.fare-link:hover{
    color:#bfdbfe;
    text-decoration:underline;
}

.summary-grid{
    display:grid;
    grid-template-columns:repeat(5, minmax(0,1fr));
    gap:14px;
    margin-bottom:22px;
}

.summary-card{
    padding:18px;
    overflow:hidden;
    min-width:0;
}

.summary-k{
    color:var(--muted);
    text-transform:uppercase;
    font-size:12px;
    letter-spacing:1px;
}

.summary-v{
    margin-top:10px;
    font-size:28px;
    font-weight:900;
}

.empty-card{
    padding:36px;
    text-align:center;
    color:#cbd5e1;
}

.footer-note{
    margin-top:20px;
    color:#64748b;
    font-size:12px;
    text-align:right;
}

.toggle-rejected-btn{
    border:none;
    border-radius:14px;
    padding:12px 16px;
    font-weight:800;
    background:rgba(245,158,11,.14);
    color:#fcd34d;
    border:1px solid rgba(245,158,11,.18);
    cursor:pointer;
    transition:.18s ease;
}

.toggle-rejected-btn:hover{
    background:rgba(245,158,11,.22);
}

.detail-toggle{
    border:1px solid rgba(96,165,250,.18);
    border-radius:999px;
    padding:8px 12px;
    background:rgba(59,130,246,.10);
    color:#bfdbfe;
    font-size:12px;
    font-weight:800;
    line-height:1;
    cursor:pointer;
    transition:.18s ease;
    min-width:92px;
}

.detail-toggle-modern{
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-width:110px;
    padding:9px 14px;
    border:1px solid rgba(96,165,250,.22);
    background:linear-gradient(135deg, rgba(37,99,235,.16), rgba(96,165,250,.08));
    box-shadow:0 10px 24px rgba(15,23,42,.22);
}

.detail-toggle-modern .toggle-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:18px;
    height:18px;
    border-radius:999px;
    background:rgba(255,255,255,.08);
    color:#dbeafe;
    font-size:11px;
    flex-shrink:0;
}

.detail-toggle-modern .toggle-label{
    font-weight:800;
    letter-spacing:.2px;
}

.detail-toggle-modern:hover{
    background:linear-gradient(135deg, rgba(37,99,235,.24), rgba(96,165,250,.14));
    color:#eff6ff;
    border-color:rgba(147,197,253,.38);
    transform:translateY(-1px);
    box-shadow:0 14px 30px rgba(37,99,235,.18);
}

.detail-toggle-modern.is-open{
    background:linear-gradient(135deg, rgba(30,64,175,.28), rgba(59,130,246,.18));
    color:#ffffff;
    border-color:rgba(147,197,253,.42);
}

.rejected-section.is-hidden{
    display:none;
}

.card-shell{
    background:rgba(15,23,42,.96);
    border:1px solid var(--border);
    border-radius:26px;
    box-shadow:0 20px 60px rgba(0,0,0,.35);
    overflow:hidden;
}

.card-head{
    padding:18px 22px;
    border-bottom:1px solid var(--border);
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
}

.card-body{
    padding:22px;
}

.label{
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#cbd5e1;
    font-weight:800;
}

.status-pill{
    padding:8px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}

.meta-grid{
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:14px;
    margin-bottom:22px;
}

.meta-box{
    background:rgba(255,255,255,.03);
    border:1px solid var(--border);
    border-radius:18px;
    padding:16px;
    min-width:0;
}

.meta-k{
    font-size:12px;
    color:var(--muted);
    text-transform:uppercase;
    letter-spacing:1px;
}

.meta-v{
    font-size:24px;
    font-weight:800;
    margin-top:8px;
    overflow-wrap:anywhere;
    word-break:break-word;
}

.run-box{
    background:linear-gradient(135deg, rgba(37,99,235,.16), rgba(96,165,250,.08));
    border:1px solid rgba(96,165,250,.18);
    border-radius:22px;
    padding:22px;
    margin-bottom:20px;
}

.log{
    background:#0b1220;
    border:1px solid rgba(255,255,255,.06);
    border-radius:20px;
    overflow:hidden;
}

.log-body{
    padding:18px 20px;
    font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
    white-space:pre-wrap;
    line-height:1.55;
    font-size:14px;
    color:#dbe7ff;
    min-height:240px;
    max-height:520px;
    overflow:auto;
}

.error-box{
    background:rgba(127,29,29,.22);
    border:1px solid rgba(248,113,113,.26);
    border-radius:18px;
    padding:16px;
    margin-bottom:18px;
    color:#fecaca;
    white-space:pre-wrap;
    font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}

.warning-list{
    margin-top:10px;
    color:#fcd34d;
    font-size:14px;
}

.compact-metric{
    min-width:120px;
}

.compact-metric-inline{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    line-height:1.4;
}

.compact-metric-inline > *{
    position:relative;
    color:#dbeafe;
    font-size:12px;
    font-weight:700;
}

.compact-metric-inline > * + *{
    padding-left:12px;
}

.compact-metric-inline > * + *::before{
    content:"";
    position:absolute;
    left:0;
    top:50%;
    width:4px;
    height:4px;
    border-radius:999px;
    background:rgba(148,163,184,.6);
    transform:translateY(-50%);
}

.metric-chip{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:5px 9px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    line-height:1;
}

.metric-chip-primary{
    background:rgba(37,99,235,.16);
    color:#bfdbfe;
    border:1px solid rgba(96,165,250,.22);
}

.variant-shell{
    margin:14px 0 8px;
    background:rgba(255,255,255,.025);
    border:1px solid rgba(255,255,255,.06);
    border-radius:20px;
    overflow:hidden;
}

.variant-shell-head{
    padding:14px 18px;
    border-bottom:1px solid rgba(255,255,255,.06);
    color:#bfdbfe;
    font-size:13px;
    font-weight:800;
    letter-spacing:.6px;
    text-transform:uppercase;
}

.variant-shell-body{
    padding:0;
}

@media(max-width:1400px){
    .summary-grid{
        grid-template-columns:repeat(2, minmax(0,1fr));
    }

    .detail-grid-candidates{
        grid-template-columns:1fr;
    }
}

@media(max-width:1200px){
    .metrics-grid{
        grid-template-columns:repeat(3, minmax(0,1fr));
    }

    .hero-grid,
    .detail-grid-dashboard{
        grid-template-columns:1fr;
    }
}

@media(max-width:1100px){
    .meta-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:768px){
    .page-shell,
    .wrapper{
        padding:20px 14px 40px;
    }

    .topbar{
        flex-direction:column;
    }

    .metrics-grid{
        grid-template-columns:repeat(2, minmax(0,1fr));
    }

    .stat-stack{
        grid-template-columns:1fr;
    }

    .brand-title{
        font-size:28px;
    }

    .route-days{
        grid-template-columns:1fr;
    }
}

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

@media(max-width:560px){
    .metrics-grid,
    .summary-grid,
    .hero-meta{
        grid-template-columns:1fr;
    }

    .data-table thead th,
    .data-table tbody td,
    .variant-table thead th,
    .variant-table tbody td{
        padding:12px 10px;
    }

    .detail-toggle{
        min-width:auto;
        width:100%;
        justify-content:center;
    }

    .compact-metric-inline{
        gap:6px;
    }

    .compact-metric-inline > * + *{
        padding-left:10px;
    }
}