:root {
    --bg-main: #070B14;
    --card-bg: rgba(17, 26, 42, 0.7);
    --card-border: rgba(29, 42, 68, 0.6);
    --text-main: #E6EEFF;
    --text-muted: #9BB0D8;
    --accent: #7C5CFC;
    --accent-hover: #6946F0;
    --green: #22C55E;
    --red: #EF4444;
    --blue: #3B82F6;
    --glass-blur: blur(12px);
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(124, 92, 252, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(34, 211, 238, 0.05), transparent 25%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Glassmorphism Panel Utilities */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    height: calc(100vh - 32px);
    margin: 16px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.logo-area {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--card-border);
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    box-shadow: 0 0 15px rgba(124, 92, 252, 0.4);
}

.logo-area h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent);
    border: 1px solid rgba(124, 92, 252, 0.3);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--card-border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
}

.dot.online {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
}

.greeting h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.greeting p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.quick-stats {
    display: flex;
    gap: 12px;
}

.stat-badge {
    background: rgba(15, 23, 40, 0.8);
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.stat-blue .value { color: var(--blue); font-weight: 600; }
.stat-green .value { color: var(--green); font-weight: 600; }

/* Views */
.content-view {
    display: none;
    flex: 1;
}

.content-view.active {
    display: block;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: 100%;
}

/* Form Styles */
.control-card {
    padding: 24px;
}

.control-card h3, .terminal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.cyber-form .form-group {
    margin-bottom: 16px;
}

.cyber-form label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.cyber-form input, .cyber-form select {
    width: 100%;
    background: rgba(10, 18, 33, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 12px 14px;
    border-radius: 10px;
    font-family: var(--font-sans);
    transition: border-color 0.3s;
}

.cyber-form input:focus, .cyber-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:not(:disabled):hover {
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(124, 92, 252, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:not(:disabled):hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Terminal Log */
.terminal-card {
    display: flex;
    flex-direction: column;
}

.terminal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.terminal-header h3 { margin-bottom: 0; }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.btn-icon:hover { color: var(--text-main); }

.terminal-body {
    flex: 1;
    background: #0A1221;
    margin: 16px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.log-entry { margin-bottom: 4px; line-height: 1.4; }
.log-entry.info { color: #A8C5FF; }

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