/* ═══════════════════════════════════════════════════════════════
   Network Monitor v5.0 — Components CSS
   Cards, badges, buttons, modals, toasts, tabs, and UI widgets
   ═══════════════════════════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: var(--rs);
    border: 1px solid var(--br1);
    background: var(--b3);
    color: var(--t1);
    font-family: var(--f);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* ── Button loading state ── */
.btn.loading {
    pointer-events: none;
    opacity: .7;
}

.btn.loading::before {
    content: '';
    position: absolute;
    left: 8px; top: 50%;
    transform: translateY(-50%);
    width: 9px; height: 9px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: sp .7s linear infinite;
}

.btn.loading { padding-left: 22px; }

.btn:hover {
    border-color: var(--br2);
    background: var(--b4);
    color: var(--t0);
}

.btn.p {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.btn.p:hover {
    background: #1a7ae0;
    border-color: #1a7ae0;
}

/* ── Cards ── */
.C {
    background: var(--b1);
    border: 1px solid var(--br0);
    border-radius: var(--r);
    overflow: hidden;
}

.Ch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--br0);
    font-size: 11px;
    font-weight: 600;
}

.Ch .btn {
    font-size: 9px;
    padding: 3px 8px;
}

/* ── Tag Badges ── */
.tg {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.tr { background: var(--rd); color: var(--red); }
.tb { background: var(--bd); color: var(--blue); }
.tc { background: var(--cd); color: var(--cyan); }

/* ── Inline Badges ── */
.b {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 600;
    font-family: var(--m);
}

.bh { background: var(--rd); color: var(--red); }
.bt2 { background: var(--od); color: var(--ora); }
.bu { background: var(--bd); color: var(--blue); }
.bd2 { background: var(--gd); color: var(--green); }
.bs { background: var(--yd); color: var(--yel); }
.bdf { background: var(--b3); color: var(--t2); }

/* ── Risk Number Badges ── */
.rn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--m);
}

.rc { background: var(--rd); color: var(--red); }
.rh { background: var(--od); color: var(--ora); }
.rm { background: var(--yd); color: var(--yel); }

/* ── Block Button ── */
.bk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 7px 0;
    border: none;
    border-radius: var(--rs);
    background: var(--rd);
    color: var(--red);
    font-family: var(--f);
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.bk:hover {
    background: var(--red);
    color: #fff;
}

/* ── Agent Tag ── */
.at {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 8px;
    font-weight: 600;
    background: var(--cd);
    color: var(--cyan);
    border: 1px solid rgba(0, 212, 170, .2);
}

/* ── Modal ── */
.mb {
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

body.nm-sidebar-collapsed .mb {
    left: var(--sidebar-collapsed);
}

/* Change password modal must cover the full screen — it's a mandatory blocker */
#changePasswordModal {
    top: 0;
    left: 0;
    z-index: 600;
}

.mb.sh {
    opacity: 1;
    visibility: visible;
}

.md {
    background: var(--b2);
    border: 1px solid var(--br1);
    border-radius: var(--rl);
    padding: 24px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-modal);
    transform: translateY(20px) scale(.96);
    transition: all 0.3s;
}

.mb.sh .md {
    transform: translateY(0) scale(1);
}

.md h2 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--t0);
}

.md label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--t2);
    margin-bottom: 4px;
    margin-top: 12px;
}

.md input,
.md select {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--rs);
    border: 1px solid var(--br1);
    background: var(--b3);
    color: var(--t0);
    font-family: var(--f);
    font-size: 11px;
    outline: none;
    transition: border-color var(--transition);
}

.md input:focus,
.md select:focus {
    border-color: var(--blue);
}

.md select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b9bb4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.ma {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 60px;
    right: 18px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 380px;
}

.toast {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: var(--r);
    background: var(--b2);
    border: 1px solid var(--br1);
    box-shadow: var(--sh4);
    font-size: 11px;
    color: var(--t1);
    animation: toastSlideIn .3s var(--ease-expo) both;
    pointer-events: auto;
    min-width: 260px;
    max-width: 380px;
    overflow: hidden;
}

.toast-body {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
}

.toast-icon {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content { flex: 1; min-width: 0; }
.toast-content h4 { font-size: 10px; font-weight: 600; color: var(--t0); margin-bottom: 2px; }
.toast-content p  { font-size: 9px;  color: var(--t2); line-height: 1.4; }

.toast .close {
    flex-shrink: 0;
    padding: 2px 5px;
    border: none;
    background: transparent;
    color: var(--t3);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: color var(--transition);
    align-self: flex-start;
    margin-top: -1px;
}

.toast .close:hover { color: var(--t0); }

/* Toast severity left borders + progress bar colors */
.toast.critical { border-left: 3px solid var(--red); }
.toast.critical .toast-progress-bar { background: var(--red); }
.toast.high     { border-left: 3px solid var(--ora); }
.toast.high     .toast-progress-bar { background: var(--ora); }
.toast.medium   { border-left: 3px solid var(--yel); }
.toast.medium   .toast-progress-bar { background: var(--yel); }
.toast.warning  { border-left: 3px solid var(--yel); }
.toast.warning  .toast-progress-bar { background: var(--yel); }
.toast.success  { border-left: 3px solid var(--green); }
.toast.success  .toast-progress-bar { background: var(--green); }
.toast.info     { border-left: 3px solid var(--blue); }
.toast.info     .toast-progress-bar { background: var(--blue); }
.toast.low      { border-left: 3px solid var(--t3); }
.toast.low      .toast-progress-bar { background: var(--t3); }
.toast.error    { border-left: 3px solid var(--red); }
.toast.error    .toast-progress-bar { background: var(--red); }

/* Toast progress bar at bottom */
.toast-progress {
    height: 2px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    animation: toastProgress linear forwards;
    transform-origin: left;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--b2);
    border-radius: var(--rs);
    padding: 3px;
    border: 1px solid var(--br0);
    margin-bottom: 12px;
}

.tab {
    padding: 5px 12px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--t2);
    font-family: var(--f);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab:hover { color: var(--t1); background: var(--b3); }
.tab.a { background: var(--blue); color: #fff; }

/* ── Status Indicator ── */
.si {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--t2);
}

.si::before {
    content: '';
    width: 9px;
    height: 9px;
    border: 2px solid var(--br1);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: sp .8s linear infinite;
}

/* ── Process Code ── */
.pc {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--m);
    font-size: 9px;
    background: var(--b3);
    color: var(--t2);
}

/* ── Role Badges ── */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.role-admin { background: var(--rd); color: var(--red); }
.role-operator { background: var(--bd); color: var(--blue); }
.role-viewer { background: var(--gd); color: var(--green); }

/* ── State Colors ── */
.se { color: var(--green); }   /* ESTABLISHED = normal/healthy */
.sl { color: var(--blue); }    /* LISTENING = informational */
.ss { color: var(--cyan); }    /* SYN states */
.sw { color: var(--yel); }     /* WAIT/TIME_WAIT states */
.sc2 { color: var(--t3); }     /* unknown/fallback = dim gray */

/* ── Quick Actions ── */
.quick-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--rs);
    border: 1px solid var(--br0);
    background: var(--b2);
    color: var(--t2);
    font-size: 9px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.quick-action:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--bd);
}

/* ── Dash Tabs ── */
.dash-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--br0);
    background: var(--b2);
    color: var(--t2);
    font-family: var(--f);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.dash-tab:hover { border-color: var(--br2); color: var(--t1); }
.dash-tab.a { border-color: var(--cyan); background: var(--cd); color: var(--cyan); }

/* ── Risk Meter ── */
.risk-meter {
    width: 100%;
    height: 6px;
    background: var(--b3);
    border-radius: 3px;
    overflow: hidden;
}

.risk-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(.4, 0, .2, 1);
    background: var(--green);
}

.risk-meter-fill.critical { background: var(--red); }
.risk-meter-fill.high { background: var(--ora); }
.risk-meter-fill.medium { background: var(--yel); }
.risk-meter-fill.low { background: var(--green); }

/* ── Gauge ── */
.gauge-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--b3);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(.4, 0, .2, 1);
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-family: var(--m);
    font-size: 18px;
    font-weight: 700;
    color: var(--t0);
    line-height: 1;
}

.gauge-label {
    font-size: 8px;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 2px;
}

/* ── Sparkline ── */
.sparkline {
    position: relative;
    width: 100%;
    height: 40px;
    overflow: hidden;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
}

.sparkline-line {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-area {
    fill: var(--cd);
    opacity: .5;
}

.sparkline-dot {
    fill: var(--cyan);
    r: 2;
}

/* ── Progress Ring ── */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.progress-ring .ring-bg {
    stroke: var(--b3);
}

.progress-ring .ring-fill {
    stroke: var(--cyan);
}

/* ── Kill Chain ── */
.kill-chain {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 0;
}

.kill-chain-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 54px;
    padding: 6px 4px;
    border-radius: var(--rs);
    background: var(--b3);
    border: 1px solid var(--br0);
    transition: all var(--transition);
    position: relative;
}

.kill-chain-step.active {
    border-color: var(--red);
    background: var(--rd);
    animation: pulse-kc 2s infinite;
}

.kill-chain-step.completed {
    border-color: var(--ora);
    background: var(--od);
}

.kill-chain-step.inactive {
    opacity: .4;
}

.kill-chain-icon {
    font-size: 14px;
    line-height: 1;
}

.kill-chain-label {
    font-size: 7px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--t2);
    text-align: center;
    white-space: nowrap;
}

.kill-chain-step.active .kill-chain-label { color: var(--red); }
.kill-chain-step.completed .kill-chain-label { color: var(--ora); }

/* ── MITRE Heatmap ── */
.mitre-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 3px;
    padding: 8px;
}

.mitre-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--b3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 600;
    font-family: var(--m);
    color: var(--t3);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.mitre-cell:hover { transform: scale(1.15); z-index: 2; }

.mitre-cell[data-count="0"] { background: var(--b3); color: var(--t3); }
.mitre-cell[data-count="1"] { background: var(--yd); color: var(--yel); }
.mitre-cell[data-count="2"] { background: var(--od); color: var(--ora); }
.mitre-cell[data-count="3"] { background: var(--rd); color: var(--red); }
.mitre-cell[data-count="4"] { background: var(--red); color: #fff; }

.mitre-cell-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--b1);
    border: 1px solid var(--br1);
    box-shadow: var(--shadow-modal);
    font-size: 8px;
    color: var(--t1);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 10;
}

.mitre-cell:hover .mitre-cell-tooltip { opacity: 1; }

/* ── Anomaly Meter ── */
.anomaly-meter {
    display: flex;
    gap: 2px;
    height: 18px;
    align-items: flex-end;
}

.anomaly-bar {
    flex: 1;
    background: var(--b3);
    border-radius: 2px;
    min-height: 4px;
    transition: all 0.4s ease;
}

.anomaly-bar.active { background: var(--green); }
.anomaly-bar.warning { background: var(--yel); }
.anomaly-bar.critical { background: var(--red); }

/* ── Donut Center ── */
.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center-value {
    font-family: var(--m);
    font-size: 16px;
    font-weight: 700;
    color: var(--t0);
    line-height: 1;
}

.donut-center-label {
    font-size: 8px;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 2px;
}

/* ── Glass Card ── */
.glass-card {
    background: rgba(17, 23, 34, .6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--br0);
    border-radius: var(--r);
    overflow: hidden;
}

html[data-theme="light"] .glass-card {
    background: rgba(241, 245, 249, .7);
}

/* ── Severity Glow ── */
.severity-glow {
    position: relative;
}

.severity-glow.critical { box-shadow: 0 0 20px var(--rd); border-color: rgba(244, 63, 94, .3); }
.severity-glow.high { box-shadow: 0 0 16px var(--od); border-color: rgba(251, 146, 60, .3); }
.severity-glow.medium { box-shadow: 0 0 12px var(--yd); border-color: rgba(251, 191, 36, .3); }
.severity-glow.low { box-shadow: 0 0 8px var(--gd); border-color: rgba(52, 211, 153, .3); }

/* ── Bandwidth Bars ── */
.bandwidth-bar {
    height: 5px;
    background: var(--b3);
    border-radius: 3px;
    overflow: hidden;
    margin: 3px 0;
}

.bandwidth-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.bandwidth-bar-fill.rx { background: var(--cyan); }
.bandwidth-bar-fill.tx { background: var(--blue); }

/* ── Threat Timeline ── */
.threat-timeline {
    position: relative;
    padding-left: 16px;
}

.threat-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--br1);
}

.timeline-item {
    position: relative;
    padding: 8px 0 8px 12px;
    font-size: 10px;
    color: var(--t2);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--b3);
    border: 2px solid var(--br1);
}

.timeline-item.critical::before { background: var(--red); border-color: var(--red); }
.timeline-item.high::before { background: var(--ora); border-color: var(--ora); }
.timeline-item.medium::before { background: var(--yel); border-color: var(--yel); }

/* ── Flow Diagram ── */
.flow-diagram {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    min-height: 100px;
}

.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border-radius: var(--rs);
    background: var(--b3);
    border: 1px solid var(--br0);
    font-size: 9px;
    font-weight: 500;
    color: var(--t1);
    min-width: 60px;
    text-align: center;
    transition: all var(--transition);
}

.flow-node.internal { border-color: var(--cyan); background: var(--cd); }
.flow-node.external { border-color: var(--blue); background: var(--bd); }
.flow-node.risky { border-color: var(--red); background: var(--rd); animation: pulse-risky 2s infinite; }

.flow-line {
    width: 30px;
    height: 2px;
    background: var(--br1);
    position: relative;
    animation: flow-pulse 2s infinite;
}

.flow-line::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -3px;
    border: 4px solid transparent;
    border-left-color: var(--br1);
}

/* ── World Map Dots ── */
.world-map {
    position: relative;
    width: 100%;
    height: 160px;
    background: var(--b2);
    border-radius: var(--rs);
    overflow: hidden;
}

.map-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
}

.map-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    animation: map-pulse 2s infinite;
}

.map-dot.safe { color: var(--green); background: var(--green); }
.map-dot.warning { color: var(--yel); background: var(--yel); }
.map-dot.critical { color: var(--red); background: var(--red); }

/* ── Animated Stat Cards ── */
.stat-card-animated {
    position: relative;
    background: var(--b1);
    border: 1px solid var(--br0);
    border-radius: var(--r);
    padding: 12px 14px;
    overflow: hidden;
    transition: all var(--transition);
}

.stat-card-animated:hover {
    border-color: var(--br1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.stat-card-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .02), transparent);
    animation: shimmer 3s infinite;
}

/* ── Counter Animation ── */
.counter {
    font-family: var(--m);
    font-weight: 700;
    transition: all 0.3s;
}

.counter.counting {
    animation: count-pulse 0.3s ease;
}

/* ── Connection Details ── */
.conn-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: var(--rs);
    background: var(--b2);
    font-size: 9px;
    color: var(--t2);
    font-family: var(--m);
}

/* ── Process Reputation Badges ── */
.rep-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.rep-trusted { background: var(--gd); color: var(--green); }
.rep-suspicious { background: var(--od); color: var(--ora); }
.rep-unknown { background: var(--b3); color: var(--t3); }

/* ── Threat Cards ── */
.threat-card {
    background: var(--b1);
    border: 1px solid var(--br0);
    border-radius: var(--r);
    padding: 10px 14px;
    transition: all var(--transition);
}

.threat-card:hover {
    border-color: var(--br1);
}

.threat-card.critical {
    border-left: 3px solid var(--red);
    background: linear-gradient(90deg, var(--rd), var(--b1) 40%);
}

.threat-card.high {
    border-left: 3px solid var(--ora);
    background: linear-gradient(90deg, var(--od), var(--b1) 40%);
}

.threat-card.medium {
    border-left: 3px solid var(--yel);
    background: linear-gradient(90deg, var(--yd), var(--b1) 40%);
}

/* ── GeoIP Badge ── */
.geo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 500;
    background: var(--b3);
    border: 1px solid var(--br0);
    color: var(--t2);
}

.geo-badge img,
.geo-badge .flag {
    width: 12px;
    height: 9px;
    border-radius: 1px;
}

/* ── Network Map ── */
.network-map {
    position: relative;
    width: 100%;
    min-height: 200px;
    background: var(--b2);
    border-radius: var(--rs);
    overflow: hidden;
}

.map-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
    transition: all var(--transition);
}

.map-point:hover {
    transform: translate(-50%, -50%) scale(1.5);
}

.map-tooltip {
    position: absolute;
    padding: 6px 10px;
    border-radius: var(--rs);
    background: var(--b1);
    border: 1px solid var(--br1);
    box-shadow: var(--shadow-modal);
    font-size: 9px;
    color: var(--t1);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity var(--transition);
}

.map-point:hover + .map-tooltip { opacity: 1; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 9px;
}

.stat-card {
    background: var(--b1);
    border: 1px solid var(--br0);
    border-radius: var(--r);
    padding: 12px 14px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--br1);
}

.stat-card .trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 600;
    font-family: var(--m);
}

.stat-card .trend.up { color: var(--green); }
.stat-card .trend.down { color: var(--red); }

/* ── View Transition Animation ── */
@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.view-enter {
    animation: viewFadeIn .25s ease-out;
}

/* ── Widget Drag States ── */
[data-widget-id][draggable="true"] {
    transition: opacity .2s, box-shadow .2s;
}

[data-widget-id].drag-over {
    box-shadow: 0 -2px 0 0 var(--blue);
}

.drag-handle {
    cursor: grab;
    opacity: .3;
    transition: opacity .2s;
}

.drag-handle:hover {
    opacity: .8;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--t3);
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: .4;
}

.empty-state-text {
    font-size: 11px;
}
