:root {
    /* Core Palette: "Active Ops" Slate/Navy */
    --bg-app: #0F172A;
    /* Slate 900 */
    --bg-panel: #1E293B;
    /* Slate 800 */
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(51, 65, 85, 0.8);

    /* Text */
    --text-main: #F8FAFC;
    /* Slate 50 */
    --text-muted: #94A3B8;
    /* Slate 400 */

    /* Accents & Status */
    --primary: #3B82F6;
    /* Blue 500 */
    --primary-glow: rgba(59, 130, 246, 0.5);
    --success: #10B981;
    /* Emerald 500 */
    --warning: #F59E0B;
    /* Amber 500 */
    --danger: #EF4444;
    /* Red 500 */

    /* Borders */
    --border-glass: rgba(255, 255, 255, 0.1);

    /* Fonts */
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-data: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-ui);
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout: Grid for Sidebar + Main + Context */
.app-layout {
    display: grid;
    grid-template-columns: 80px 1fr 300px;
    /* Sidebar, Content, Context Panel */
    min-height: 100vh;
}

/* Mobile Layout Override */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
        /* Single column */
        grid-template-rows: auto 1fr;
    }
}

/* Global Sidebar (Left) */
.sidebar {
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    gap: 1.5rem;
    z-index: 10;
}

.nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
}

.nav-icon:hover,
.nav-icon.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Main Content Area */
.main-content {
    padding: 2rem;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Context Panel (Right) */
.context-panel {
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border-glass);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .sidebar {
        display: none;
        /* Hide sidebar on mobile for now, usually hamburger menu */
    }

    .context-panel {
        display: none;
        /* Hide context panel on mobile */
    }
}

/* Glass Components */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    transition: transform 0.2s, background-color 0.2s;
}

.card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Typography Overrides */
h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 0;
}

.font-mono {
    font-family: var(--font-data);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"] {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: var(--font-ui);
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2563EB);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Status Pills */
.status-pill {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.status-critical {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #FCD34D;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6EE7B7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Utility */
.text-muted {
    color: var(--text-muted);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.gap-2 {
    gap: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-panel);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

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

.modal-content {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-glass);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close {
    color: var(--text-muted);
    font-size: 1.5rem;
    float: right;
    cursor: pointer;
}

.close:hover {
    color: var(--text-main);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.dashboard-section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 800;
    color: #F97316;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #1E293B;
    padding-bottom: 0.5rem;
}

/* Action Cards */
.action-card {
    background: #3E4A59;
    border: 2px solid #1E293B;
    border-radius: 4px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.2s;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
    min-height: 180px;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.action-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.3);
    border-color: #F97316;
}

.action-card i {
    width: 40px;
    height: 40px;
    color: #F97316;
}

.action-card h3 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-size: 1.1rem;
}

.action-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #94A3B8;
}

/* N-Number Search Modal */
#nNumberSearchModal .modal-content {
    max-width: 550px;
}

#nNumberSearchModal .search-input-wrap {
    position: relative;
    margin-bottom: 1.5rem;
}

#nNumberSearchModal .search-input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
}

#nNumberSearchModal input[type="text"] {
    padding-left: 3rem;
    font-size: 1.1rem;
    height: 3.5rem;
    font-family: var(--font-data);
    letter-spacing: 0.05em;
}