:root {
    /* Colors - Refined War Room & Brass Command Theme */
    --color-bg-base: #0b1324;
    --color-bg-panel: rgba(19, 30, 48, 0.84);
    --color-bg-panel-solid: #152238;
    --color-bg-hover: rgba(38, 56, 84, 0.86);

    --color-text-main: #f8fafc;
    --color-text-muted: #9fb0c7;
    --color-text-accent: #fbbf24; /* Antique Command Brass */

    --color-primary: #3b82f6;
    --color-danger: #ef4444;
    --color-success: #10b981;
    --color-warning: #f59e0b;

    --color-border: rgba(148, 163, 184, 0.24);
    --color-border-strong: rgba(214, 182, 130, 0.34);
    --color-border-glow: rgba(96, 165, 250, 0.52);

    /* Typography */
    --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-display: 'Playfair Display', 'Noto Serif SC', 'Songti SC', 'SimSun', Georgia, serif;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px 0 rgba(2, 6, 23, 0.28);
    --shadow-md: 0 6px 14px -2px rgba(2, 6, 23, 0.36), 0 2px 6px -1px rgba(2, 6, 23, 0.22);
    --shadow-lg: 0 16px 32px -6px rgba(2, 6, 23, 0.62), 0 6px 14px -3px rgba(2, 6, 23, 0.36);
    --shadow-glow: 0 0 18px var(--color-border-glow);

    --backdrop-blur: blur(14px);

    /* Layout */
    --radius-sm: 0.3rem;
    --radius-md: 0.55rem;
    --radius-lg: 0.9rem;
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --transition-fast: 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-color: rgba(148, 163, 184, 0.45) rgba(15, 23, 42, 0.32);
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.32);
}

*::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.36);
    border: 2px solid rgba(15, 23, 42, 0.32);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.58);
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    line-height: 1.5;
    overflow: hidden; /* Prevent scrolling, it's an app */
    background-image:
        radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 1) 100%),
        url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="rgba(255,255,255,0.03)"/></svg>');
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-4);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.text-accent { color: var(--color-text-accent); }
.text-muted { color: var(--color-text-muted); }

/* Components: Panels */
.glass-panel {
    background-color: var(--color-bg-panel);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2) var(--spacing-4);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: linear-gradient(180deg, rgba(59,130,246,0.1) 0%, rgba(59,130,246,0.3) 100%);
    border-color: var(--color-primary);
    color: var(--color-text-main);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(59,130,246,0.2) 0%, rgba(59,130,246,0.5) 100%);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(180deg, rgba(239,68,68,0.1) 0%, rgba(239,68,68,0.3) 100%);
    border-color: var(--color-danger);
    color: var(--color-text-main);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(239,68,68,0.2) 0%, rgba(239,68,68,0.5) 100%);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.btn-outline:hover:not(:disabled) {
    color: var(--color-text-main);
    border-color: var(--color-text-muted);
    background: rgba(255,255,255,0.05);
}

/* Disabled commands remain readable; state is shown by a muted surface. */
button, input, select, textarea { font-family: var(--font-sans); }
button { -webkit-tap-highlight-color: transparent; }
.btn:disabled {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

/* Accessibility: visible keyboard focus */
:focus-visible {
    outline: 2px solid var(--color-text-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.btn:focus-visible {
    outline-color: var(--color-primary);
}

.btn-danger:focus-visible {
    outline-color: var(--color-danger);
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--spacing-2); }
.gap-4 { gap: var(--spacing-4); }
.p-4 { padding: var(--spacing-4); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.hidden { display: none !important; }
