:root {
    --bg-dark: #020813;
    --bg-panel: rgba(4, 16, 38, 0.7);
    --bg-panel-hover: rgba(10, 30, 60, 0.85);
    --primary: #00f0ff;
    --primary-glow: rgba(0, 240, 255, 0.5);
    --text-main: #d4f0ff;
    --text-muted: #5a8ab9;
    --accent-green: #00ffaa;
    --accent-red: #ff3366;
    --accent-yellow: #fadb14;
    --border: rgba(0, 240, 255, 0.25);
    --hud-border: 1px solid var(--border);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    /* Cyber/HUD Background effect */
    background-image: 
        radial-gradient(circle at 75% 50%, rgba(0, 160, 255, 0.15) 0%, transparent 60%),
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    background-position: center center;
    color: var(--text-main);
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-panel);
    border-right: 2px solid var(--primary);
    box-shadow: 2px 0 15px rgba(0, 240, 255, 0.1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: var(--hud-border);
}

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow), inset 0 0 10px var(--primary-glow);
    text-shadow: 0 0 5px var(--primary);
}

.sidebar-header h2 {
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--text-main);
    text-shadow: 0 0 5px var(--primary-glow);
}

.nav-links {
    list-style: none;
    padding: 1.5rem 1rem;
}

.nav-links li {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.nav-links li:hover {
    background-color: var(--bg-panel-hover);
    color: var(--primary);
    border-color: var(--border);
}

.nav-links li.active {
    background-color: rgba(0, 240, 255, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.2);
    border-left: 4px solid var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Add subtle scanline effect to main content */
.main-content::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 999;
    pointer-events: none;
}

.top-bar {
    height: 70px;
    border-bottom: var(--hud-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background-color: rgba(4, 16, 38, 0.5);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(0,0,0,0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--primary);
    width: 300px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.search-bar svg {
    color: var(--primary);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--primary);
    outline: none;
    width: 100%;
}
.search-bar input::placeholder {
    color: var(--text-muted);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--primary-glow);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 0 0 12px var(--primary);
}

.blink {
    animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0.2; }
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.view-section {
    display: none;
    animation: HUDfadeIn 0.4s ease;
}

.view-section.active {
    display: block;
}

@keyframes HUDfadeIn {
    from { opacity: 0; transform: scale(0.98); filter: blur(4px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    transform: rotate(45deg);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-panel);
    padding: 1.5rem;
    border-radius: 0;
    border: 1px solid var(--border);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Cyber decorative corners */
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 15px; height: 15px;
    border-top: 2px solid var(--primary); border-left: 2px solid var(--primary);
}
.stat-card::after {
    content: ''; position: absolute; bottom: 0; right: 0; width: 15px; height: 15px;
    border-bottom: 2px solid var(--primary); border-right: 2px solid var(--primary);
}

.stat-card:hover {
    background-color: var(--bg-panel-hover);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    border-color: var(--primary);
}

.stat-card h3 {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.stat-card.warning { border-color: rgba(250, 219, 20, 0.5); }
.stat-card.warning::before, .stat-card.warning::after { border-color: var(--accent-yellow); }
.stat-card.warning h3 { color: var(--accent-yellow); }
.stat-card.warning .stat-value { color: var(--accent-yellow); text-shadow: 0 0 10px rgba(250, 219, 20, 0.4); }

.stat-card.alert { border-color: rgba(255, 51, 102, 0.5); }
.stat-card.alert::before, .stat-card.alert::after { border-color: var(--accent-red); }
.stat-card.alert h3 { color: var(--accent-red); }
.stat-card.alert .stat-value { color: var(--accent-red); text-shadow: 0 0 10px rgba(255, 51, 102, 0.4); }

/* Charts */
.charts-container {
    background-color: var(--bg-panel);
    padding: 2rem;
    border: 1px solid var(--border);
    height: 400px;
    position: relative;
}
.charts-container::before {
    content: ''; position: absolute; top: -1px; left: -1px; width: 20px; height: 20px;
    border-top: 2px solid var(--primary); border-left: 2px solid var(--primary);
}

/* Tables */
.table-container {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.table-container::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

th {
    background-color: rgba(0, 240, 255, 0.05);
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

tr:hover td {
    background-color: rgba(0, 240, 255, 0.05);
}

/* Progress Bars in Table */
.progress-container {
    width: 100%;
    background-color: rgba(0,0,0,0.5);
    height: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar {
    height: 100%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

.val-text {
    font-size: 0.85rem;
    font-family: monospace;
    letter-spacing: 1px;
}

.status-good { color: var(--accent-green); }
.status-warn { color: var(--accent-yellow); }
.status-crit { color: var(--accent-red); }

.bg-good { background-color: var(--accent-green); color: var(--accent-green); }
.bg-warn { background-color: var(--accent-yellow); color: var(--accent-yellow); }
.bg-crit { background-color: var(--accent-red); color: var(--accent-red); }

/* Buttons */
.btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--primary);
    background-color: rgba(0, 240, 255, 0.1);
    color: var(--primary);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.btn-edit:hover {
    background-color: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary {
    background-color: var(--primary);
    color: #000;
}
.btn-primary:hover {
    background-color: #fff;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,5,15,0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: HUDfadeIn 0.2s ease;
}

.modal-content {
    background-color: rgba(4, 16, 38, 0.95);
    border: 1px solid var(--primary);
    width: 400px;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
    position: relative;
}

.modal-content::before {
    content: ''; position: absolute; top: -1px; left: -1px; width: 30px; height: 30px;
    border-top: 2px solid #fff; border-left: 2px solid #fff;
}
.modal-content::after {
    content: ''; position: absolute; bottom: -1px; right: -1px; width: 30px; height: 30px;
    border-bottom: 2px solid #fff; border-right: 2px solid #fff;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(0,240,255,0.1), transparent);
}

.modal-header h2 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: #fff; text-shadow: 0 0 10px #fff; }

.modal-body {
    padding: 1.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    color: #fff;
    font-family: monospace;
    font-size: 1rem;
    transition: all 0.2s;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spin-reverse { 100% { transform: rotate(-360deg); } }

