@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --bg: #07090f;
    --bg2: #0c1018;
    --surface: rgba(255, 255, 255, 0.032);
    --surface2: rgba(255, 255, 255, 0.058);
    --surface3: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.07);
    --border2: rgba(255, 255, 255, 0.11);
    --text: #e8eaf0;
    --text2: #8892a4;
    --text3: #3d4a5c;
    --blue: #3b82f6;
    --cyan: #06b6d4;
    --emerald: #10b981;
    --green: #22c55e;
    --red: #ef4444;
    --orange: #f97316;
    --purple: #a855f7;
    --pink: #ec4899;
    --yellow: #eab308;
    --r: 14px;
    --rs: 8px;
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px
}

/* ── BG ORBS ── */
.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .1;
    animation: float 22s ease-in-out infinite
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #3b82f6, transparent);
    top: -250px;
    left: -200px;
    animation-duration: 28s
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #a855f7, transparent);
    bottom: -200px;
    right: -200px;
    animation-duration: 22s;
    animation-delay: -10s
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #10b981, transparent);
    top: 40%;
    left: 45%;
    animation-duration: 35s;
    animation-delay: -5s
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1)
    }

    33% {
        transform: translate(35px, -25px) scale(1.06)
    }

    66% {
        transform: translate(-25px, 35px) scale(.94)
    }
}

/* ── CONTAINER ── */
.container {
    position: relative;
    z-index: 1;
    max-width: 1420px;
    margin: 0 auto;
    padding: 24px 20px 80px
}

/* ── GLASS ── */
.glass {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--r)
}

/* ── HEADER ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 26px;
    margin-bottom: 24px;
    background: rgba(7, 9, 15, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--r);
    position: sticky;
    top: 12px;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: pulse-logo 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(59, 130, 246, .3);
}

@keyframes pulse-logo {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, .3)
    }

    50% {
        box-shadow: 0 0 36px rgba(168, 85, 247, .5)
    }
}

.brand-name {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.02em
}

.brand-sub {
    font-size: .72rem;
    color: var(--text2);
    margin-top: 2px
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center
}

.btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--rs);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .2s;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, .4)
}

.btn-ghost {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border2)
}

.btn-ghost:hover {
    background: var(--surface3);
    transform: translateY(-1px)
}

/* ── LOADER ── */
.loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    gap: 18px
}

.loader-ring {
    width: 54px;
    height: 54px;
    border: 3px solid var(--surface2);
    border-top: 3px solid var(--blue);
    border-radius: 50%;
    animation: spin .75s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.loader-wrap p {
    color: var(--text2);
    font-size: .88rem
}

.hidden {
    display: none !important
}

/* ── KPI GRID ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px
}

.kpi-grid-wide {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 16px
}

@media(max-width:1100px) {
    .kpi-grid-wide {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:900px) {

    .kpi-grid,
    .kpi-grid-wide {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:540px) {

    .kpi-grid,
    .kpi-grid-wide {
        grid-template-columns: 1fr
    }
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: border-color .2s;
    height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-card:hover {
    border-color: var(--border2)
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px
}

.accent-blue {
    border-top: 2px solid var(--blue)
}

.accent-blue:hover {
    box-shadow: 0 8px 28px rgba(59, 130, 246, .18)
}

.accent-emerald {
    border-top: 2px solid var(--emerald)
}

.accent-emerald:hover {
    box-shadow: 0 8px 28px rgba(16, 185, 129, .18)
}

.accent-green {
    border-top: 2px solid var(--green)
}

.accent-green:hover {
    box-shadow: 0 8px 28px rgba(34, 197, 94, .18)
}

.accent-red {
    border-top: 2px solid var(--red)
}

.accent-red:hover {
    box-shadow: 0 8px 28px rgba(239, 68, 68, .18)
}

.accent-orange {
    border-top: 2px solid var(--orange)
}

.accent-orange:hover {
    box-shadow: 0 8px 28px rgba(249, 115, 22, .18)
}

.accent-purple {
    border-top: 2px solid var(--purple)
}

.accent-purple:hover {
    box-shadow: 0 8px 28px rgba(168, 85, 247, .18)
}

.accent-cyan {
    border-top: 2px solid var(--cyan)
}

.accent-cyan:hover {
    box-shadow: 0 8px 28px rgba(6, 182, 212, .18)
}

.accent-pink {
    border-top: 2px solid var(--pink)
}

.accent-pink:hover {
    box-shadow: 0 8px 28px rgba(236, 72, 153, .18)
}

.accent-yellow {
    border-top: 2px solid var(--yellow)
}

.accent-yellow:hover {
    box-shadow: 0 8px 28px rgba(234, 179, 8, .18)
}

.kpi-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px
}

.kpi-icon {
    font-size: 1.05rem
}

.kpi-label {
    font-size: .72rem;
    color: var(--text2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em
}

.kpi-value {
    font-family: 'Syne', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1
}

.kpi-sub {
    font-size: .72rem;
    color: var(--text2);
    margin-top: 5px
}

.kpi-trend {
    font-size: .72rem;
    font-weight: 600;
    margin-top: 4px
}

.kpi-trend.up {
    color: var(--green)
}

.kpi-trend.down {
    color: var(--red)
}

.kpi-trend.neutral {
    color: var(--text2)
}

/* ── HEALTH SCORE CARD ── */
.health-score-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(168, 85, 247, .08));
    border: 1px solid rgba(99, 102, 241, .2);
    border-radius: var(--r);
    padding: 26px 28px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.health-gauge-wrap {
    position: relative;
    flex-shrink: 0
}

.health-gauge-wrap svg {
    transform: rotate(-90deg)
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, .06);
    stroke-width: 10
}

.gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.4s cubic-bezier(.4, 0, .2, 1)
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center
}

.gauge-score {
    font-family: 'Syne', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1
}

.gauge-label-sm {
    font-size: .65rem;
    color: var(--text2);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .06em
}

.health-details {
    flex: 1;
    min-width: 260px
}

.health-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 4px
}

.health-subtitle {
    font-size: .78rem;
    color: var(--text2);
    margin-bottom: 18px
}

.health-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.hbar {
    display: flex;
    flex-direction: column;
    gap: 5px
}

.hbar-label {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--text2)
}

.hbar-track {
    height: 5px;
    background: rgba(255, 255, 255, .07);
    border-radius: 3px;
    overflow: hidden
}

.hbar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1.2s ease
}

/* ── INSIGHTS ── */
.insights-panel {
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap
}

.insights-header {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text2)
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-ring 2s ease-out infinite;
    flex-shrink: 0
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .6)
    }

    70% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0)
    }
}

.insights-badge {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    color: #fff;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: .62rem;
    font-weight: 700
}

.insights-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    flex: 1
}

.insight-chip {
    background: var(--surface2);
    border: 1px solid var(--border2);
    padding: 6px 11px;
    border-radius: 20px;
    font-size: .76rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background .2s;
    cursor: default
}

.insight-chip:hover {
    background: var(--surface3)
}

.insight-chip.warn {
    border-color: rgba(239, 68, 68, .25);
    background: rgba(239, 68, 68, .05)
}

.insight-chip.good {
    border-color: rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .05)
}

.insight-chip.info {
    border-color: rgba(59, 130, 246, .25);
    background: rgba(59, 130, 246, .05)
}

.insight-chip.yellow {
    border-color: rgba(234, 179, 8, .25);
    background: rgba(234, 179, 8, .05)
}

/* ── FILTERS ── */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 16px
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px
}

.filter-item label {
    font-size: .68rem;
    color: var(--text2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em
}

.glass-select {
    background: var(--surface2);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 8px 30px 8px 10px;
    border-radius: var(--rs);
    font-family: 'DM Sans', sans-serif;
    font-size: .8rem;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%238892a4' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.glass-select:focus {
    border-color: var(--blue)
}

.glass-select option {
    background: #1a2030;
    color: var(--text)
}

.count-badge {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 600;
    align-self: flex-end;
    white-space: nowrap
}

/* ── SECTION DIVIDER ── */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px
}

.section-divider span {
    font-family: 'Syne', sans-serif;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text3);
    white-space: nowrap
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border)
}

/* ── CHART GRID ── */
.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px
}

.row-2 .wide {
    grid-column: span 2
}

.row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px
}

@media(max-width:900px) {

    .row-2,
    .row-3 {
        grid-template-columns: 1fr
    }

    .row-2 .wide {
        grid-column: span 1
    }
}

.chart-card {
    padding: 20px 22px;
    transition: transform .25s, box-shadow .25s
}

.chart-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35)
}

.chart-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px
}

.chart-hdr h3 {
    font-family: 'Syne', sans-serif;
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: -.01em
}

.toggler {
    display: flex;
    background: var(--surface2);
    border-radius: var(--rs);
    padding: 3px;
    gap: 2px
}

.tog {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--text2);
    font-size: .72rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all .2s;
    white-space: nowrap
}

.tog.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff
}

canvas {
    max-height: 255px
}

/* ── MINI STAT ROW ── */
.mini-stat-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px
}

.mini-stat {
    flex: 1;
    min-width: 80px;
    background: var(--surface2);
    border-radius: var(--rs);
    padding: 10px 12px;
    text-align: center
}

.mini-stat-val {
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    font-weight: 800
}

.mini-stat-lbl {
    font-size: .65rem;
    color: var(--text2);
    margin-top: 2px
}

/* ── CARRIER TABLE ── */
.carrier-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto
}

.carrier-row {
    display: grid;
    grid-template-columns: 1.6fr 55px 55px 55px 100px;
    align-items: center;
    padding: 9px 12px;
    border-radius: var(--rs);
    background: var(--surface2);
    gap: 6px;
    transition: background .2s
}

.carrier-row:hover {
    background: var(--surface3)
}

.carrier-name {
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.carrier-stat {
    font-size: .76rem;
    text-align: center;
    font-family: 'Syne', sans-serif;
    font-weight: 700
}

.carrier-header {
    display: grid;
    grid-template-columns: 1.6fr 55px 55px 55px 100px;
    padding: 4px 12px;
    gap: 6px;
    font-size: .62rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px
}

.cbar-wrap {
    height: 5px;
    background: rgba(255, 255, 255, .06);
    border-radius: 3px;
    overflow: hidden
}

.cbar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease
}

/* ── SKU LIST ── */
.sku-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 270px;
    overflow-y: auto
}

.sku-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--rs);
    background: var(--surface2);
    transition: background .2s
}

.sku-row:hover {
    background: var(--surface3)
}

.sku-rank {
    font-family: 'Syne', sans-serif;
    font-size: .7rem;
    font-weight: 800;
    color: var(--text3);
    width: 18px;
    text-align: center;
    flex-shrink: 0
}

.sku-info {
    flex: 1;
    min-width: 0
}

.sku-name {
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.sku-meta {
    font-size: .68rem;
    color: var(--text2);
    margin-top: 2px
}

.sku-bar-wrap {
    width: 70px;
    height: 4px;
    background: rgba(255, 255, 255, .06);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0
}

.sku-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #a855f7);
    border-radius: 3px
}

.sku-count {
    font-family: 'Syne', sans-serif;
    font-size: .82rem;
    font-weight: 800;
    min-width: 28px;
    text-align: right;
    flex-shrink: 0
}

/* ── HOUR HEATMAP ── */
.hour-heatmap {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding: 4px 0
}

.hour-cell {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    cursor: default;
    transition: transform .2s;
    position: relative
}

.hour-cell:hover {
    transform: scale(1.2);
    z-index: 5
}

.hour-cell .tt {
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2030;
    border: 1px solid var(--border2);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: .68rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    z-index: 10
}

.hour-cell:hover .tt {
    opacity: 1
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: .68rem;
    color: var(--text2)
}

.heatmap-legend-bar {
    display: flex;
    gap: 2px
}

.heatmap-legend-cell {
    width: 14px;
    height: 10px;
    border-radius: 2px
}

/* ── SCORE METERS ── */
.meter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px
}

.meter-card {
    flex: 1;
    min-width: 130px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px;
    text-align: center;
    transition: transform .2s
}

.meter-card:hover {
    transform: translateY(-2px)
}

.meter-ring-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 10px
}

.meter-ring-wrap svg {
    transform: rotate(-90deg)
}

.m-bg {
    fill: none;
    stroke: rgba(255, 255, 255, .06);
    stroke-width: 7
}

.m-fg {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.3s ease
}

.meter-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Syne', sans-serif;
    font-size: .95rem;
    font-weight: 800
}

.meter-lbl {
    font-size: .68rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .05em
}

/* ── COMPARISON CARDS ── */
.compare-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px
}

@media(max-width:900px) {
    .compare-row {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:540px) {
    .compare-row {
        grid-template-columns: 1fr
    }
}

.compare-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px 20px
}

.compare-title {
    font-size: .72rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 14px;
    font-weight: 600
}

.compare-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .04)
}

.compare-item:last-child {
    border-bottom: none
}

.compare-label {
    font-size: .78rem;
    color: var(--text2)
}

.compare-val {
    font-family: 'Syne', sans-serif;
    font-size: .9rem;
    font-weight: 700
}

.tag-up {
    color: var(--green);
    font-size: .7rem;
    margin-left: 4px
}

.tag-down {
    color: var(--red);
    font-size: .7rem;
    margin-left: 4px
}

/* ── HIGH VALUE TABLE ── */
.hv-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 260px;
    overflow-y: auto
}

.hv-row {
    display: grid;
    grid-template-columns: 1fr 80px 90px 80px;
    align-items: center;
    padding: 9px 12px;
    border-radius: var(--rs);
    background: var(--surface2);
    gap: 8px;
    transition: background .2s
}

.hv-row:hover {
    background: var(--surface3)
}

.hv-header {
    display: grid;
    grid-template-columns: 1fr 80px 90px 80px;
    padding: 4px 12px;
    gap: 8px;
    font-size: .62rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px
}

.hv-name {
    font-size: .78rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.hv-val {
    font-family: 'Syne', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    text-align: right
}

.hv-stat {
    font-size: .74rem;
    text-align: center
}

/* ── DAY OF WEEK BARS ── */
.dow-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100px;
    padding: 0 4px
}

.dow-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px
}

.dow-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 1.2s ease;
    background: linear-gradient(180deg, #3b82f6, #6366f1);
    min-height: 4px
}

.dow-lbl {
    font-size: .63rem;
    color: var(--text2)
}

.dow-cnt {
    font-size: .65rem;
    color: var(--text2);
    font-weight: 600
}

/* ── PINCODE ── */
.pincode-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 230px;
    overflow-y: auto
}

.pincode-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--rs);
    background: var(--surface2)
}

.pc-rank {
    font-size: .68rem;
    color: var(--text3);
    width: 18px;
    text-align: center
}

.pc-code {
    font-family: 'Syne', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    min-width: 60px
}

.pc-state {
    font-size: .72rem;
    color: var(--text2);
    flex: 1
}

.pc-bar-wrap {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, .06);
    border-radius: 3px;
    overflow: hidden
}

.pc-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #a855f7);
    border-radius: 3px
}

.pc-count {
    font-family: 'Syne', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    min-width: 28px;
    text-align: right
}

/* ── TABLE ── */
.table-card {
    padding: 22px;
    margin-bottom: 16px
}

.table-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px
}

.table-top h3 {
    font-family: 'Syne', sans-serif;
    font-size: .9rem;
    font-weight: 700
}

.tbl-sub {
    font-size: .7rem;
    color: var(--text2);
    margin-top: 2px
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    padding: 8px 12px;
    border-radius: var(--rs)
}

.search-wrap svg {
    color: var(--text3);
    flex-shrink: 0
}

.search-input {
    background: none;
    border: none;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: .8rem;
    outline: none;
    width: 210px
}

.search-input::placeholder {
    color: var(--text3)
}

.table-wrap {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

thead tr {
    border-bottom: 1px solid var(--border2)
}

th {
    padding: 9px 12px;
    text-align: left;
    font-size: .65rem;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    cursor: pointer;
    user-select: none
}

th:hover {
    color: var(--text2)
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, .03);
    transition: background .12s
}

tbody tr:hover {
    background: rgba(255, 255, 255, .025)
}

td {
    padding: 10px 12px;
    font-size: .78rem;
    color: var(--text2);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis
}

td strong {
    color: var(--text);
    font-weight: 500
}

.track-link {
    color: var(--blue);
    text-decoration: none;
    font-size: .73rem
}

.track-link:hover {
    text-decoration: underline
}

/* ── STATUS BADGES ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap
}

.status-delivered {
    background: rgba(34, 197, 94, .1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, .18)
}

.status-rto {
    background: rgba(239, 68, 68, .1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, .18)
}

.status-cancelled {
    background: rgba(168, 85, 247, .1);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, .18)
}

.status-undelivered {
    background: rgba(249, 115, 22, .1);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, .18)
}

.status-pending {
    background: rgba(234, 179, 8, .1);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, .18)
}

.status-transit {
    background: rgba(6, 182, 212, .1);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, .18)
}

.status-default {
    background: rgba(148, 163, 184, .08);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, .12)
}

/* ── ERROR BOX ── */
.error-box {
    background: rgba(239, 68, 68, .07);
    border: 1px solid rgba(239, 68, 68, .18);
    border-radius: var(--r);
    padding: 36px;
    text-align: center;
    margin: 40px 0
}

.error-box h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #f87171
}

.error-box p {
    color: var(--text2);
    font-size: .84rem;
    margin-bottom: 16px
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.fade-in {
    animation: fadeUp .5s ease both
}

.fade-in:nth-child(1) {
    animation-delay: .04s
}

.fade-in:nth-child(2) {
    animation-delay: .08s
}

.fade-in:nth-child(3) {
    animation-delay: .12s
}

.fade-in:nth-child(4) {
    animation-delay: .16s
}

.fade-in:nth-child(5) {
    animation-delay: .2s
}

.fade-in:nth-child(6) {
    animation-delay: .24s
}

.fade-in:nth-child(7) {
    animation-delay: .28s
}

.fade-in:nth-child(8) {
    animation-delay: .32s
}

/* ── RESPONSIVE ── */
@media(max-width:768px) {
    .container {
        padding: 12px 12px 60px
    }

    .header {
        padding: 12px 14px;
        top: 8px
    }

    .brand-name {
        font-size: 1.05rem
    }

    .kpi-value {
        font-size: 1.6rem
    }

    .filters-bar {
        flex-direction: column
    }

    .header-actions .btn span {
        display: none
    }

    .health-score-card {
        flex-direction: column;
        gap: 18px
    }

    .health-bars {
        grid-template-columns: 1fr
    }

    .compare-row {
        grid-template-columns: 1fr
    }
}