/* ====================================================================
   Backbone NMS - Network Management & Monitoring Platform
   NOC Modern Dark Dashboard Theme
==================================================================== */

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: #151d2f;
    --bg-card-hover: #1c273e;
    --border-color: #27354d;
    --border-subtle: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-cyan: #06b6d4;
    
    --status-up: #10b981;
    --status-up-glow: rgba(16, 185, 129, 0.25);
    --status-down: #ef4444;
    --status-down-glow: rgba(239, 68, 68, 0.25);
    --status-warning: #f59e0b;
    --status-warning-glow: rgba(245, 158, 11, 0.25);
    --status-unknown: #6b7280;
    
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    
    --sidebar-width: 250px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ====================================================================
   Utility & Components
==================================================================== */
.hidden { display: none !important; }

/* Status Badges & Glow */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pill.online, .status-pill.up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-up);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.down, .status-pill.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-down);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.online { background-color: var(--status-up); box-shadow: 0 0 8px var(--status-up); }
.status-dot.down { background-color: var(--status-down); box-shadow: 0 0 8px var(--status-down); }
.status-dot.warning { background-color: var(--status-warning); box-shadow: 0 0 8px var(--status-warning); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ====================================================================
   Login Screen
==================================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at top center, #172554 0%, #0b0f19 70%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: white;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9375rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.alert-box {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-box.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ====================================================================
   Main App Layout
==================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-badge {
    font-size: 0.65rem;
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    padding: 10px 12px 4px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 3px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    font-weight: 600;
    border-left: 3px solid var(--accent-blue);
}

.nav-item .icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background-color: var(--status-down);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 9999px;
}

/* Header */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-header {
    height: var(--header-height);
    background-color: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.clock-display {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role-label {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

/* Content Body */
.app-content {
    flex: 1;
    padding: 28px;
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-icon {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 12px;
}

.stat-breakdown {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.775rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

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

.panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Health Monitor Widget */
.health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.health-item:last-child { border-bottom: none; }

.health-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 16px;
    box-sizing: border-box;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: min(92vh, calc(100vh - 32px)) !important;
    height: auto;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
    overflow: hidden !important;
    position: relative;
    box-sizing: border-box;
}

/* Ensure forms inside modal-dialog flex properly so modal-body scrolls and modal-footer stays permanently visible */
.modal-dialog > form,
.modal-dialog form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    width: 100% !important;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0 !important;
    background: var(--bg-card);
    z-index: 5;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 20px 24px;
    overflow-y: auto !important;
    overflow-x: hidden;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0 !important;
    position: relative;
    z-index: 10;
}

/* Sticky thead inside modal tables so headers stay visible when scrolling long lists */
.modal-dialog .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0f172a;
    box-shadow: 0 1px 0 var(--border-color);
}

/* Action buttons */
.btn-action {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}
.btn-action:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Button Groups for Time Range Filtering */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
}

.btn-group .btn:last-child {
    border-right: none;
}

.btn-group .btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-group .btn.active {
    background: var(--accent-blue);
    color: #ffffff;
}

/* Topology Inspector Card */
.topo-inspector-card {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 320px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    z-index: 10;
    max-height: 90%;
    overflow-y: auto;
}

/* Leaflet Dark GIS Customization */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65) !important;
    border-radius: var(--radius-md) !important;
}

.leaflet-popup-content {
    margin: 12px 14px !important;
    line-height: 1.5 !important;
    font-size: 0.8125rem;
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
}

.leaflet-container {
    font-family: inherit !important;
}

.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-bar a:hover {
    background-color: var(--bg-tertiary) !important;
    color: var(--accent-blue) !important;
}

/* Topology Fullscreen Styles */
#panel-topology-map:fullscreen,
#panel-topology-map:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: #070d17 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: none !important;
    border-radius: 0 !important;
}

#panel-topology-map:fullscreen #topo-canvas-wrapper,
#panel-topology-map:-webkit-full-screen #topo-canvas-wrapper {
    height: 100vh !important;
    width: 100vw !important;
}

#panel-topology-map:fullscreen #topology-canvas,
#panel-topology-map:-webkit-full-screen #topology-canvas {
    height: 100vh !important;
    width: 100vw !important;
    flex: 1 !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #0b132b !important;
    background-image: radial-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px) !important;
    background-size: 24px 24px !important;
}

#panel-topology-map:fullscreen .modal-overlay,
#panel-topology-map:-webkit-full-screen .modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100000 !important;
    background: rgba(3, 7, 18, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#panel-topology-map:fullscreen .modal-overlay.hidden,
#panel-topology-map:-webkit-full-screen .modal-overlay.hidden {
    display: none !important;
}

/* Fullscreen Tooltips & Inspector: Sesuai Mode Non-Fullscreen (Ideal & Pas, Natural Auto Height) */
#panel-topology-map:fullscreen #topo-node-hover-tooltip,
#panel-topology-map:-webkit-full-screen #topo-node-hover-tooltip,
#panel-topology-map:fullscreen #topo-link-hover-tooltip,
#panel-topology-map:-webkit-full-screen #topo-link-hover-tooltip {
    height: auto !important;
    max-height: none !important;
    width: auto !important;
    max-width: 390px !important;
    padding: 10px 14px !important;
    font-size: inherit !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7) !important;
    z-index: 100050 !important;
}

#panel-topology-map:fullscreen #topo-inspector,
#panel-topology-map:-webkit-full-screen #topo-inspector {
    height: auto !important;
    max-height: calc(100vh - 40px) !important;
    width: 320px !important;
}

#panel-topology-map:fullscreen #topo-context-menu,
#panel-topology-map:-webkit-full-screen #topo-context-menu,
#panel-topology-map:fullscreen #topo-device-context-menu,
#panel-topology-map:-webkit-full-screen #topo-device-context-menu {
    z-index: 100060 !important;
}

/* Live Staggered Hardware & Sensor Telemetry Glows */
.hw-telemetry-item {
    transition: all 0.4s ease;
}
.hw-telemetry-item.glow-blue {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45) !important;
    background: rgba(56, 189, 248, 0.15) !important;
}
.hw-telemetry-item.glow-purple {
    border-color: #a78bfa !important;
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.45) !important;
    background: rgba(167, 139, 250, 0.15) !important;
}
.hw-telemetry-item.glow-amber {
    border-color: #f59e0b !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.45) !important;
    background: rgba(245, 158, 11, 0.15) !important;
}
.hw-telemetry-item.glow-green {
    border-color: #34d399 !important;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.45) !important;
    background: rgba(52, 211, 153, 0.15) !important;
}

/* Autocomplete Searchable Combobox for Links & Forms */
.combobox-wrapper {
    position: relative;
    width: 100%;
}
.combobox-input {
    width: 100%;
    cursor: text;
}
.combobox-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}
.combobox-toggle {
    transition: transform 0.2s ease, color 0.15s ease;
}
.combobox-wrapper.open .combobox-toggle {
    transform: rotate(180deg);
    color: var(--accent-blue) !important;
}
.combobox-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1080;
    background: #0b1329;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
}
.combobox-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.12s ease;
    user-select: none;
}
.combobox-item:hover, .combobox-item.active {
    background: rgba(56, 189, 248, 0.18);
}
.combobox-item.selected {
    background: rgba(56, 189, 248, 0.28);
    border-left: 3px solid #38bdf8;
}
.combobox-clear:hover {
    color: #ef4444 !important;
}

/* Topology Canvas Context Menu */
.topo-cxt-item {
    transition: background 0.12s ease, color 0.12s ease;
    border-radius: 4px;
    margin: 1px 6px;
}
.topo-cxt-item:hover {
    background: rgba(14, 165, 233, 0.22) !important;
    color: #ffffff !important;
}

/* Topo Quick Floating Bar (Top Right) */
.topo-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.topo-quick-btn:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(148, 163, 184, 0.5);
    color: #ffffff;
}
.topo-quick-btn:active {
    transform: translateY(1px);
}

.topo-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9999px;
    color: #f1f5f9;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.topo-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.topo-pill-btn.active {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.75);
    color: #38bdf8;
    font-weight: 600;
}
.topo-pill-btn:active {
    transform: translateY(1px);
}

/* Telemetry Unified Page (POP Drill-Down) */
.telemetry-pop-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.telemetry-pop-card:hover {
    border-color: rgba(14, 165, 233, 0.7);
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.telemetry-iface-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(51, 65, 85, 0.65);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s ease;
}
.telemetry-iface-card:hover {
    border-color: rgba(14, 165, 233, 0.45);
}

/* Switch Rack Showcase & Real Hardware Front-Panel LED Blink */
.switch-rack-chassis {
    position: relative;
    width: 100%;
    min-height: 82px;
    max-height: 105px;
    background: radial-gradient(ellipse at 50% 50%, #0e172a 0%, #020617 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    margin: 4px 0 2px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.95), 0 4px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.telemetry-pop-card:hover .switch-rack-chassis {
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.98), 0 0 16px rgba(56, 189, 248, 0.2);
}
.chassis-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    line-height: 0;
    max-width: 100%;
}
.chassis-img {
    display: block;
    max-height: 90px;
    max-width: 100%;
    width: auto;
    height: auto;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.95));
}
.chassis-led-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    line-height: normal;
}
.chassis-model-tag {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.6rem;
    color: #38bdf8;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    background: rgba(3, 7, 18, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 1px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    pointer-events: none;
    z-index: 15;
}

/* ==========================================================================
   Real Hardware Port Aperture Glow ("Pada Port Fisik Menyala")
   ========================================================================== */
.real-hw-port-glow {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
    border-radius: 2px;
    z-index: 8;
}

/* Port UP: Lubang Port Fisik Menyala Hijau Neon + Inner Glow + Transceiver Glow Aura */
.real-hw-port-glow.is-up {
    background: rgba(0, 255, 102, 0.42);
    border: 1.5px solid #00ff66;
    box-shadow: 
        inset 0 0 7px rgba(0, 255, 102, 0.9),
        0 0 10px rgba(0, 255, 102, 0.8),
        0 0 20px rgba(0, 255, 102, 0.45);
    backdrop-filter: brightness(1.25);
}

/* Port SFP/Optik UP: Lubang Port Fisik & Laser Transceiver Menyala Biru/Cyan */
.real-hw-port-glow.port-sfp.is-up {
    background: rgba(56, 189, 248, 0.45);
    border: 1.5px solid #38bdf8;
    box-shadow: 
        inset 0 0 7px rgba(56, 189, 248, 0.9),
        0 0 10px rgba(56, 189, 248, 0.8),
        0 0 20px rgba(56, 189, 248, 0.45);
    backdrop-filter: brightness(1.25);
}

/* Port DOWN & Termonitoring: ALARM MERAH NEON BERKEDIP (Kabel/Link Putus) */
.real-hw-port-glow.is-down-monitored {
    background: rgba(239, 68, 68, 0.45);
    border: 1.5px solid #ef4444;
    box-shadow: 
        inset 0 0 7px rgba(239, 68, 68, 0.9),
        0 0 10px rgba(239, 68, 68, 0.85),
        0 0 20px rgba(239, 68, 68, 0.5);
    backdrop-filter: brightness(1.2);
    z-index: 12;
}

/* Port DOWN & Tidak Termonitoring: Samar dan Tembus Pandang agar Sasis Hardware Asli Rapi (Port Kosong) */
.real-hw-port-glow.is-down,
.real-hw-port-glow.is-down-unmonitored {
    background: rgba(15, 23, 42, 0.12);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    opacity: 0.25;
}

/* Port Saat Device OFFLINE / Terputus: Padam Total, Animasi Berhenti & Gelap */
.real-hw-port-glow.is-device-offline {
    background: rgba(15, 23, 42, 0.55) !important;
    border: 1px solid rgba(71, 85, 105, 0.25) !important;
    box-shadow: none !important;
    animation: none !important;
    opacity: 0.18 !important;
    filter: grayscale(1) !important;
    pointer-events: none;
}

/* ==========================================================================
   Device Offline Visual Styling (Border Merah Menyala & Alarm Sasis)
   ========================================================================== */
.telemetry-pop-card.card-device-offline,
div.telemetry-pop-card.card-device-offline {
    border: 1.5px solid #ef4444 !important;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.4), inset 0 0 16px rgba(239, 68, 68, 0.1) !important;
    background: linear-gradient(180deg, rgba(38, 12, 18, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
}

.telemetry-pop-card.card-device-offline .switch-rack-chassis {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.3) !important;
}

.telemetry-pop-card.card-device-offline .chassis-model-tag {
    border-color: rgba(239, 68, 68, 0.6) !important;
    background: rgba(45, 10, 15, 0.92) !important;
    color: #f87171 !important;
}

.telemetry-pop-card.card-device-offline .status-dot.down {
    background: #ef4444 !important;
    box-shadow: 0 0 8px #ef4444 !important;
    animation: offlinePulse 1.8s infinite !important;
}

.telemetry-pop-card.card-device-offline .badge {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.6) !important;
    color: #f87171 !important;
}

@keyframes offlinePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

.real-hw-port-glow:hover {
    transform: translate(-50%, -50%) scale(1.12) !important;
    z-index: 25;
    border-color: #38bdf8 !important;
    box-shadow: 
        inset 0 0 9px #38bdf8,
        0 0 14px rgba(56, 189, 248, 0.9),
        0 0 24px rgba(56, 189, 248, 0.5) !important;
}

@keyframes realHwPortPulse {
    0%, 100% {
        opacity: 0.82;
        box-shadow: inset 0 0 6px rgba(0, 255, 102, 0.85), 0 0 9px rgba(0, 255, 102, 0.75);
        filter: brightness(1);
    }
    18% {
        opacity: 0.5;
        box-shadow: inset 0 0 3px rgba(0, 255, 102, 0.5), 0 0 4px rgba(0, 255, 102, 0.4);
        filter: brightness(0.9);
    }
    45% {
        opacity: 1;
        box-shadow: inset 0 0 10px rgba(0, 255, 102, 1), 0 0 16px rgba(0, 255, 102, 0.95), 0 0 26px rgba(0, 255, 102, 0.6);
        filter: brightness(1.35);
    }
    75% {
        opacity: 0.75;
        box-shadow: inset 0 0 5px rgba(0, 255, 102, 0.7), 0 0 7px rgba(0, 255, 102, 0.6);
        filter: brightness(1.05);
    }
}

@keyframes realHwPortPulseSfp {
    0%, 100% {
        opacity: 0.85;
        box-shadow: inset 0 0 6px rgba(56, 189, 248, 0.85), 0 0 9px rgba(56, 189, 248, 0.75);
        filter: brightness(1);
    }
    18% {
        opacity: 0.55;
        box-shadow: inset 0 0 3px rgba(56, 189, 248, 0.5), 0 0 4px rgba(56, 189, 248, 0.4);
        filter: brightness(0.9);
    }
    45% {
        opacity: 1;
        box-shadow: inset 0 0 10px rgba(56, 189, 248, 1), 0 0 16px rgba(56, 189, 248, 0.95), 0 0 26px rgba(56, 189, 248, 0.6);
        filter: brightness(1.35);
    }
    75% {
        opacity: 0.78;
        box-shadow: inset 0 0 5px rgba(56, 189, 248, 0.7), 0 0 7px rgba(56, 189, 248, 0.6);
        filter: brightness(1.05);
    }
}

@keyframes portAlarmPulse {
    0%, 100% {
        opacity: 0.95;
        box-shadow: inset 0 0 7px rgba(239, 68, 68, 0.95), 0 0 12px rgba(239, 68, 68, 0.9), 0 0 22px rgba(239, 68, 68, 0.55);
        filter: brightness(1.2);
    }
    50% {
        opacity: 0.4;
        box-shadow: inset 0 0 3px rgba(239, 68, 68, 0.5), 0 0 5px rgba(239, 68, 68, 0.4);
        filter: brightness(0.85);
    }
}

@keyframes ifLedAlarmBlink {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.9);
        box-shadow: 0 0 2px #ef4444;
    }
    50% {
        opacity: 1;
        transform: scale(1.18);
        box-shadow: 0 0 8px #f87171, 0 0 14px rgba(239, 68, 68, 0.8);
    }
}

.real-hw-led {
    position: absolute;
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.real-hw-led.is-up {
    background: #00ff66;
    background: radial-gradient(circle, #ffffff 15%, #22c55e 55%, #15803d 100%);
    box-shadow: 0 0 4px #00ff66, 0 0 8px rgba(0, 255, 102, 0.9), 0 0 14px rgba(34, 197, 94, 0.7);
}
.real-hw-led.is-down {
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.6);
    opacity: 0.45;
    box-shadow: none;
}
.real-hw-led:hover {
    transform: translate(-50%, -50%) scale(2.2) !important;
    z-index: 25;
    filter: drop-shadow(0 0 6px #00ff66);
}

@keyframes realHwLedActivity {
    0%, 100% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 4px #00ff66, 0 0 8px rgba(0, 255, 102, 0.9);
    }
    18% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(0.85);
        box-shadow: 0 0 2px #00ff66;
    }
    38% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 6px #55ff99, 0 0 12px #00ff66, 0 0 18px rgba(0, 255, 102, 0.85);
    }
    60% {
        opacity: 0.35;
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 2px #00ff66;
    }
    78% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 5px #00ff66, 0 0 10px rgba(0, 255, 102, 0.8);
    }
}

/* NOC Dashboard V3 - Top 10 Leaderboard & Live Incidents */
.top10-panel {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}
.top10-tabs-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.top10-tab-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.top10-tab-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: var(--text-main);
    border-color: rgba(56, 189, 248, 0.4);
}
.top10-tab-btn.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(59, 130, 246, 0.25));
    border-color: var(--accent-cyan);
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}
.top10-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}
.top10-progress-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transition: width 0.1s linear;
}
.top10-table-wrapper {
    flex: 1;
    overflow-x: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.4);
}
.top10-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.top10-table th {
    background: rgba(30, 41, 59, 0.85);
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top10-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    vertical-align: middle;
}
.top10-clickable-row {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.top10-clickable-row:hover {
    background: rgba(56, 189, 248, 0.12) !important;
}
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
}
.rank-gold {
    background: #f59e0b;
    color: #0f172a;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.rank-silver {
    background: #94a3b8;
    color: #0f172a;
    box-shadow: 0 0 6px rgba(148, 163, 184, 0.4);
}
.rank-bronze {
    background: #b45309;
    color: #ffffff;
    box-shadow: 0 0 6px rgba(180, 83, 9, 0.4);
}
.rank-normal {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}
.meter-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.meter-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(51, 65, 85, 0.6);
    border-radius: 3px;
    overflow: hidden;
    min-width: 50px;
}
.meter-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Live Incident Feed Styles */
.incident-feed-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}
.incident-feed-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 4px solid var(--accent-cyan);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.incident-feed-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateX(2px);
}
.incident-feed-item.critical {
    border-left-color: var(--status-down);
    background: rgba(239, 68, 68, 0.06);
}
.incident-feed-item.warning {
    border-left-color: var(--status-warning);
    background: rgba(245, 158, 11, 0.06);
}

/* Quick Navigation Grid */
.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.quick-nav-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.quick-nav-card:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.quick-nav-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.quick-nav-info h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}
.quick-nav-info p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   SDM Employee ID Card & RBAC Scoping Styles
   ========================================================================== */

.sdm-id-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.sdm-id-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #3b82f6);
}

.sdm-avatar-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.sdm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sdm-badge-tetap {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.sdm-badge-kontrak {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.sdm-badge-mitra {
    background: rgba(147, 51, 234, 0.15);
    color: #c084fc;
    border: 1px solid rgba(147, 51, 234, 0.4);
}

.sdm-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.sdm-info-item {
    background: rgba(2, 6, 23, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.sdm-info-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.sdm-info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.scope-pill-read {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.4);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.scope-pill-write {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.scope-pill-none {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.scope-table-row {
    transition: background 0.15s ease;
}

.scope-table-row:hover {
    background: rgba(30, 41, 59, 0.5);
}

.scope-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    user-select: none;
    transition: background 0.15s;
}

.scope-radio-label:hover {
    background: rgba(255, 255, 255, 0.05);
}







