:root {
    --bg-deep: #050a14;
    --bg-panel: #0d121c;
    /* Slightly flatter */
    --primary: #5c6bc0;
    /* Muted Indigo/Blue - Professional look */
    --primary-dim: rgba(92, 107, 192, 0.1);
    --text-main: #f0f2f5;
    --text-muted: #8b9bb4;
    --glass: rgba(13, 18, 28, 0.85);
    /* Less transparency, more matte */
    --border: rgba(255, 255, 255, 0.08);
    --danger: #cf485e;
    /* Muted Red */
    --success: #4caf50;
    /* Muted Green */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-deep);
    /* Removed radial gradients for a cleaner flat look */
    font-family: var(--font-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: white;
    letter-spacing: -0.5px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: #8e99f3;
}

/* Removed text-shadow */

/* Minimal Panels */
.glass-panel {
    background: var(--glass);
    /* Removed blur for cleaner look */
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    /* Removed box-shadow glow */
}

.input-group {
    margin-bottom: 20px;
}

input,
select {
    width: 100%;
    background: #0d121c;
    /* Explicit Dark Background */
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    transition: 0.2s;
    font-size: 0.9rem;
}

select option {
    background: #0d121c;
    color: white;
}

input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
    /* Removed heavy box-shadow glow */
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
    /* Removed heavy gradient and shadow */
}

.btn-primary:hover {
    background: #6f7ecc;
    transform: translateY(-1px);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    /* Subtle light overlay */
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Outline Button (Logout, etc.) */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-outline:active {
    transform: translateY(0);
    background: rgba(92, 107, 192, 0.15);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.center-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85vh;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Subtle Snow (Optional - kept minimal) */
.snowflake {
    position: fixed;
    top: -10px;
    color: rgba(255, 255, 255, 0.4);
    /* Fainter */
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(105vh);
    }
}

/* --- Command Center Layout v4.0 --- */
.cmd-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-deep);
    overflow: hidden;
}

.cmd-sidebar {
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.cmd-sidebar-header {
    margin-bottom: 40px;
}

.cmd-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.cmd-nav-item {
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.cmd-nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.cmd-nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid rgba(92, 107, 192, 0.2);
}

.cmd-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.cmd-tab {
    display: none;
    animation: fadeIn 0.3s ease;
}

.cmd-tab.active {
    display: block;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 24px;
}

.mb-4 {
    margin-bottom: 24px;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-active {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.badge-inactive {
    background: rgba(207, 72, 94, 0.15);
    color: var(--danger);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

td {
    color: var(--text-main);
}

/* Utilities Added for V7 */
.flex-center {
    display: flex;
    align-items: center;
}

.gap-2 {
    gap: 12px;
}

.w-auto {
    width: auto !important;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 0.85rem;
    width: auto;
    /* Override full width */
}

/* Modal Overlay & Right Drawer */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: flex-end;
    /* Align to right */
    align-items: stretch;
    /* Full height */
    z-index: 1000;
    transition: opacity 0.3s;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #0d121c;
    border-left: 1px solid var(--border);
    width: 450px;
    max-width: 90vw;
    height: 100%;
    overflow-y: auto;
    padding: 30px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.hidden .modal-content {
    transform: translateX(100%);
}

/* Drawer Typography */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.drawer-section {
    margin-bottom: 30px;
}

.drawer-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 700;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-main);
    font-weight: 500;
    text-align: right;
}

.info-value.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}