/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    /* Background Colors - Blue gradient theme */
    --bg-primary: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);  /* Page background - blue gradient */
    --bg-primary-solid: #1e3c72;      /* Solid fallback */
    --bg-secondary: #0f1419;           /* Panel backgrounds - very dark blue/black */
    --bg-tertiary: #1a2332;            /* Hover states, slightly lighter dark blue */
    
    /* Border Colors */
    --border-primary: #2d3e5f;         /* Subtle blue-gray borders */
    --border-secondary: #1a2332;       /* Very subtle dividers */
    
    /* Text Colors */
    --text-primary: #fff;              /* Headings, primary text */
    --text-secondary: #aaa;            /* Body text, labels */
    --text-tertiary: #888;             /* Hints, disabled text */
    --text-muted: #666;                /* Very subtle text */
    
    /* Accent Colors */
    --green: #4CAF50;
    --green-dark: #45a049;
    --green-glow: rgba(76, 175, 80, 0.6);
    
    --yellow: #ff9800;
    --yellow-dark: #f57c00;
    --yellow-glow: rgba(255, 152, 0, 0.6);
    
    --red: #f44336;
    --red-dark: #d32f2f;
    --red-glow: rgba(244, 67, 54, 0.6);
    
    --blue: #2196F3;
    --blue-dark: #1976D2;
    
    --blue-accent: #4a90e2;            /* For buttons/interactive elements */
    
    /* Font Sizes */
    --font-xs: 12px;
    --font-sm: 14px;
    --font-md: 16px;
    --font-lg: 18px;
    --font-xl: 24px;
    --font-2xl: 28px;
    
    /* Spacing */
    --space-xs: 5px;
    --space-sm: 10px;
    --space-md: 20px;
    --space-lg: 30px;
    --space-xl: 40px;
}

/* ============================================================
   BASE STYLES
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);  /* Blue gradient */
    color: var(--text-secondary);
    min-height: 100vh;
    padding: var(--space-md);
}

/* ============================================================
   LAYOUT CONTAINERS
   ============================================================ */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
}

.panel {
    background: var(--bg-secondary);   /* Dark panel on blue background */
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);  /* Depth shadow */
}

.panel-header {
    color: var(--text-primary);
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: var(--space-md);
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-primary);
}

.section-header {
    color: var(--text-primary);
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

input,
select,
textarea {
    background: #0a0e14;               /* Very dark input background */
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: var(--font-sm);
    font-family: inherit;
    width: 100%;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    background: #0f1419;  /* Slightly lighter on focus */
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}
/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}

.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    border-color: var(--green);
    color: var(--green);
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-danger:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

/* ============================================================
   TABLES
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
    font-size: var(--font-sm);
    border-bottom: 2px solid var(--border-primary);
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

tr:hover {
    background: var(--bg-tertiary);  /* Subtle blue-tinted hover */
    cursor: pointer;
}

tr.selected {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid var(--green);
}

tr.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================================
   STATUS DOTS
   ============================================================ */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

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

.status-dot.yellow {
    background: var(--yellow);
    box-shadow: 0 0 8px var(--yellow-glow);
}

.status-dot.red {
    background: var(--red);
    box-shadow: 0 0 8px var(--red-glow);
}

.status-dot.gray {
    background: var(--text-muted);
    box-shadow: none;
}

/* ============================================================
   MESSAGES/ALERTS
   ============================================================ */
.message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: var(--space-md);
    font-size: var(--font-sm);
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid var(--green);
    border-left: 4px solid var(--green);
    color: var(--green);
}

.message.error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid var(--red);
    border-left: 4px solid var(--red);
    color: #ff6b6b;
}

.message.warning {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid var(--yellow);
    border-left: 4px solid var(--yellow);
    color: #ffb84d;
}

.message.info {
    background: rgba(33, 150, 243, 0.15);
    border: 1px solid var(--blue);
    border-left: 4px solid var(--blue);
    color: #64b5f6;
}

/* ============================================================
   TABS
   ============================================================ */
.tab-nav {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-primary);
    margin-bottom: var(--space-lg);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    padding: 12px 24px;
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

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

.tab-btn.active {
    color: var(--green);
    border-bottom-color: var(--green);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-success { color: var(--green); }
.text-error { color: var(--red); }
.text-warning { color: var(--yellow); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding: var(--space-sm);
    }
    
    .panel {
        padding: var(--space-md);
    }
    
    .form-row.two-col,
    .form-row.three-col {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-xs);
    }
}

@media (max-width: 480px) {
    .panel-header {
        font-size: var(--font-lg);
    }
    
    .section-header {
        font-size: var(--font-md);
    }
}