/* CYBERPULSE // MODERN NOC COMMAND DASHBOARD CSS WITH SIDEBAR NAVIGATION */
:root {
    --bg-base: #060911;
    --bg-surface: rgba(14, 22, 39, 0.75);
    --bg-surface-elevated: rgba(20, 31, 56, 0.85);
    --bg-input: rgba(8, 14, 26, 0.9);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(56, 189, 248, 0.4);
    
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --sky: #38bdf8;
    --sky-glow: rgba(56, 189, 248, 0.25);
    --indigo: #818cf8;
    --indigo-glow: rgba(129, 140, 248, 0.25);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.25);
    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.25);
    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.25);
    --rose: #ef4444;
    --rose-glow: rgba(239, 68, 68, 0.25);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow orbs */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.16;
}
.orb-1 { width: 550px; height: 550px; background: #0284c7; top: -100px; left: -100px; }
.orb-2 { width: 500px; height: 500px; background: #7c3aed; top: 35%; right: -100px; }
.orb-3 { width: 450px; height: 450px; background: #059669; bottom: -50px; left: 15%; }

/* APP LAYOUT: SIDEBAR + MAIN VIEWPORT */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ======================================================== */
/* SIDEBAR STYLES                                           */
/* ======================================================== */
.app-sidebar {
    width: 290px;
    min-width: 290px;
    max-width: 290px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: rgba(10, 16, 29, 0.88);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #0284c7, #8b5cf6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}
.brand-icon svg {
    width: 22px;
    height: 22px;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    margin-top: 2px;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-emerald {
    background: linear-gradient(135deg, #34d399, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* SIDEBAR NAVIGATION */
.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    padding: 14px 10px 6px;
    text-transform: uppercase;
}

.nav-item.tab-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    width: 100%;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.nav-item.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.nav-item.tab-btn.active {
    background: rgba(56, 189, 248, 0.12);
    color: var(--text-main);
    border-color: var(--sky);
    box-shadow: 0 0 16px var(--sky-glow);
}

.nav-item.tab-btn.tab-eagle.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--sky);
    box-shadow: 0 0 16px var(--sky-glow);
}

.nav-item.tab-btn.tab-node1.active {
    background: rgba(129, 140, 248, 0.12);
    border-color: var(--indigo);
    box-shadow: 0 0 16px var(--indigo-glow);
}

.nav-item.tab-btn.tab-node2.active {
    background: rgba(168, 85, 247, 0.12);
    border-color: var(--purple);
    box-shadow: 0 0 16px var(--purple-glow);
}

.nav-item.tab-btn.tab-flask.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--amber);
    box-shadow: 0 0 16px var(--amber-glow);
}

.nav-icon-wrap {
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

.nav-item-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-grow: 1;
    min-width: 0;
}

.nav-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-counter {
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 999px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.tab-counter.highlight-purple {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-sky-sm {
    background: rgba(56, 189, 248, 0.15);
    color: var(--sky);
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 700;
}

/* SIDEBAR FOOTER */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.sidebar-node-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.node-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
}
.node-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}
.node-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.node-name {
    font-weight: 600;
}
.node-ping {
    margin-left: auto;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.68rem;
}

.sidebar-sync-row {
    display: flex;
    justify-content: center;
}

.auto-refresh-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}
.auto-refresh-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald);
}
.dot-pulse {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ======================================================== */
/* RIGHT MAIN CONTENT AREA                                  */
/* ======================================================== */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 32px 60px;
    max-width: 1600px;
}

/* TOP CLUSTER BAR */
.top-cluster-bar {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.top-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.summary-card {
    background: rgba(10, 16, 29, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.summary-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.5), transparent);
}
.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}
.summary-value {
    font-size: 1.7rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
    color: var(--text-main);
}
.summary-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}
.summary-sub {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.top-actions-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-icon {
    width: 16px;
    height: 16px;
}
.btn-primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border-color: var(--border-subtle);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}
.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
    transform: translateY(-1px);
}
.btn-outline-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}
.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}
.btn-block {
    width: 100%;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

.badge-pulse {
    background: rgba(56, 189, 248, 0.15);
    color: var(--sky);
    border: 1px solid rgba(56, 189, 248, 0.35);
    animation: badgePulseAnim 2s infinite ease-in-out;
}
@keyframes badgePulseAnim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.02); }
}

.badge-purple.badge-pulse {
    background: rgba(168, 85, 247, 0.22) !important;
    color: #e9d5ff !important;
    border: 1px solid rgba(168, 85, 247, 0.6) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.badge-emerald.badge-pulse {
    background: rgba(16, 185, 129, 0.22) !important;
    color: #a7f3d0 !important;
    border: 1px solid rgba(16, 185, 129, 0.6) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.badge-amber.badge-pulse {
    background: rgba(245, 158, 11, 0.22) !important;
    color: #fef08a !important;
    border: 1px solid rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.btn-pulse {
    position: relative;
    animation: btnDangerGlow 1.8s infinite ease-in-out;
}
@keyframes btnDangerGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 14px 2px rgba(239, 68, 68, 0.7); }
}

.badge-sky, .badge.sky {
    background: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}
.badge-indigo, .badge.indigo {
    background: rgba(129, 140, 248, 0.12) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(129, 140, 248, 0.35) !important;
}
.badge-purple, .badge.purple {
    background: rgba(168, 85, 247, 0.12) !important;
    color: #d8b4fe !important;
    border: 1px solid rgba(168, 85, 247, 0.35) !important;
}
.badge-amber, .badge.amber {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.badge-emerald, .badge.emerald {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.badge-rose, .badge.rose {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.summary-badge.green { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.summary-badge.blue { background: rgba(56, 189, 248, 0.15); color: var(--sky); }
.summary-badge.purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); }

.tag-pill {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}
.tag-pill.sky { background: rgba(56, 189, 248, 0.12); color: var(--sky); border: 1px solid rgba(56, 189, 248, 0.25); }
.tag-pill.indigo { background: rgba(129, 140, 248, 0.12); color: var(--indigo); border: 1px solid rgba(129, 140, 248, 0.25); }
.tag-pill.purple { background: rgba(168, 85, 247, 0.12); color: var(--purple); border: 1px solid rgba(168, 85, 247, 0.25); }
.tag-pill.amber { background: rgba(245, 158, 11, 0.12); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.25); }

/* Text color utilities */
.text-sky { color: var(--sky) !important; background: transparent !important; }
.text-indigo { color: var(--indigo) !important; background: transparent !important; }
.text-purple { color: #d8b4fe !important; background: transparent !important; }
.text-amber { color: var(--amber) !important; background: transparent !important; }
.text-emerald { color: var(--emerald) !important; background: transparent !important; }
.text-rose { color: var(--rose) !important; background: transparent !important; }

/* Subtle node endpoint label */
.node-endpoint-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.status-pill-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dots: only for small bullet dots */
.dot, .tab-dot, .node-dot, .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.dot.sky, .tab-dot.sky, .node-dot.sky, .status-dot.sky { background: var(--sky); }
.dot.indigo, .tab-dot.indigo, .node-dot.indigo, .status-dot.indigo { background: var(--indigo); }
.dot.purple, .tab-dot.purple, .node-dot.purple, .status-dot.purple { background: var(--purple); }
.dot.amber, .tab-dot.amber, .node-dot.amber, .status-dot.amber { background: var(--amber); }
.dot.emerald, .tab-dot.emerald, .node-dot.emerald, .status-dot.emerald { background: var(--emerald); }
.dot.rose, .tab-dot.rose, .node-dot.rose, .status-dot.rose { background: var(--rose); }

/* TAB VIEWS */
.tab-view {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}
.tab-view.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* GRID 4 NODES (MATRIX VIEW) */
.grid-4-nodes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.node-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.node-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.card-eagle { border-top: 3px solid var(--sky); }
.card-node1 { border-top: 3px solid var(--indigo); }
.card-node2 { border-top: 3px solid var(--purple); }
.card-flask { border-top: 3px solid var(--amber); }

.node-card-top {
    padding: 18px 20px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-subtle);
}
.node-card-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.node-endpoint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.ext-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}
.ext-link:hover {
    color: var(--sky);
}

.node-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.node-ping-val {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.node-card-body {
    padding: 18px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.m-metric {
    display: flex;
    flex-direction: column;
}
.m-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}
.m-val {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-main);
    margin-top: 2px;
}
.m-val.highlight { color: var(--emerald); }
.m-val.highlight-purple { color: #d8b4fe; }

.progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.progress-track.lg {
    height: 10px;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.progress-fill.sky { background: linear-gradient(90deg, #0284c7, var(--sky)); box-shadow: 0 0 10px var(--sky-glow); }
.progress-fill.indigo { background: linear-gradient(90deg, #4f46e5, var(--indigo)); box-shadow: 0 0 10px var(--indigo-glow); }
.progress-fill.purple { background: linear-gradient(90deg, #9333ea, var(--purple)); box-shadow: 0 0 10px var(--purple-glow); }

.mini-feed {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.75rem;
    max-height: 70px;
    overflow-y: auto;
}
.feed-item {
    line-height: 1.4;
}

.status-box-flask {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}
.status-box-label {
    font-size: 0.65rem;
    color: var(--amber);
    font-weight: 700;
    letter-spacing: 0.05em;
}
.status-box-text {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-top: 2px;
}

.node-card-footer {
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* DEDICATED VIEW LAYOUTS */
.panel-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
}
@media (max-width: 1024px) {
    .panel-layout {
        grid-template-columns: 1fr;
    }
}

.cyber-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
}
.card-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-body {
    padding: 20px;
}
.card-body.p-0 {
    padding: 0;
}

/* FORMS */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 10px 12px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px var(--sky-glow);
}
.form-input-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.radio-toggle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.radio-label input {
    display: none;
}
.radio-label:has(input:checked) {
    background: rgba(56, 189, 248, 0.15);
    color: var(--text-main);
    font-weight: 600;
}

.stat-callout {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.action-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.stats-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.stat-tile {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
}
.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}
.stat-val {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-main);
    background: transparent !important;
    margin-top: 4px;
    letter-spacing: -0.01em;
}

/* PHASES TIMELINE FOR EAGLE */
.phases-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.phase-step {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}
.phase-step.active {
    border-color: var(--sky);
    background: rgba(56, 189, 248, 0.1);
    box-shadow: 0 0 12px var(--sky-glow);
}
.phase-step.complete {
    border-color: var(--emerald);
    background: rgba(16, 185, 129, 0.1);
}
.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
}
.phase-step.active .step-num {
    background: var(--sky);
    color: black;
}
.phase-step.complete .step-num {
    background: var(--emerald);
    color: black;
}
.step-title {
    font-size: 0.75rem;
    font-weight: 700;
}
.step-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* RTSP STREAM BOX & TERMINALS */
.rtsp-stream-box {
    max-height: 480px;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(4, 7, 14, 0.7);
}
.rtsp-item {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    animation: fadeIn 0.2s ease;
    transition: border-color 0.2s, background-color 0.2s;
}
.rtsp-item:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.95);
}
.rtsp-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.rtsp-thumb-wrap {
    width: 84px;
    height: 52px;
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.2);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.rtsp-thumb-wrap:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
    transform: scale(1.04);
}
.rtsp-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.rtsp-thumb-placeholder {
    font-size: 1.2rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.rtsp-thumb-placeholder span {
    font-size: 0.6rem;
    color: #64748b;
}
.rtsp-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.rtsp-link {
    color: #4ade80;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
    font-size: 0.82rem;
}
.rtsp-link:hover {
    text-decoration: underline;
    color: #86efac;
}
.rtsp-meta-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.rtsp-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.terminal-box {
    background: #04070e;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.6;
    color: #cbd5e1;
}
.log-line {
    word-break: break-all;
}

/* CYBER TABLE */
.table-wrap {
    overflow-x: auto;
}
.cyber-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.cyber-table th {
    background: rgba(0, 0, 0, 0.3);
    text-align: left;
    padding: 10px 16px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
}
.cyber-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
}
.cyber-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.ip-badge {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.table-pagination {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.pagination-buttons {
    display: flex;
    gap: 8px;
}

/* SEARCH HERO */
.search-hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-input-lg {
    padding: 14px 14px 14px 44px;
    font-size: 1rem;
}
.search-metrics {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* FLASK STATUS DISPLAY */
.flask-status-display {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--amber);
    text-align: center;
}

/* TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    font-size: 0.85rem;
    z-index: 9999;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* UTILITY CLASSES */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-highlight { color: #38bdf8; }
.hidden { display: none !important; }
.mt-4 { margin-top: 16px; }
.p-4 { padding: 16px; }
.text-center { text-align: center; }

/* RESPONSIVE LAYOUT */
@media (max-width: 992px) {
    .app-layout {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        max-width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .app-main {
        padding: 16px;
    }
    .grid-4-nodes {
        grid-template-columns: 1fr;
    }
}

/* TELEGRAM PILL & MODAL STYLES */
.tg-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 9999px;
    font-size: 0.72rem;
    color: #38bdf8;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tg-status-pill:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: #38bdf8;
}
.tg-status-pill.configured {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.tg-status-pill.configured:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #34d399;
}

.cyber-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.cyber-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.cyber-modal {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.cyber-modal-backdrop.active .cyber-modal {
    transform: scale(1) translateY(0);
}
.cyber-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.7);
}
.cyber-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cyber-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cyber-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.5);
}
.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.btn-close-modal:hover {
    color: #fff;
}

/* LIGHTBOX */
.lightbox-modal {
    max-width: 900px;
    background: #020617;
    border-color: rgba(56, 189, 248, 0.4);
}
.lightbox-img-wrap {
    width: 100%;
    min-height: 250px;
    max-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
}
.lightbox-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

/* CYBER LOGIN SCREEN */
.cyber-login-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: radial-gradient(circle at 50% 30%, #0c192e 0%, #030712 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.cyber-login-screen.hidden {
    display: none !important;
}
.login-panel {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.18);
    backdrop-filter: blur(16px);
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 9999px;
    font-size: 0.68rem;
    color: #38bdf8;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}
.login-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
}
.login-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin: 0 0 24px 0;
}
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}
.login-error {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fb7185;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    text-align: center;
}
.login-error.hidden {
    display: none;
}
.login-footer {
    margin-top: 24px;
    font-size: 0.68rem;
    color: #475569;
    font-family: var(--font-mono);
}
.user-pill {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #38bdf8;
}
