/* ============================================================
   FOUNDRYINFRA-AI PLATFORM — DESIGN SYSTEM & STYLES
   Compute Intelligence Platform
   ============================================================ */

/* ---- DESIGN TOKENS ---- */
:root {
    --bg-color: #000000;
    --bg-elevated: #0a0a0a;
    --bg-surface: #111111;
    --bg-overlay: rgba(0, 0, 0, 0.85);
    --grid-color: rgba(255, 255, 255, 0.04);
    --text-primary: #f0f0f0;
    --text-secondary: #888888;
    --text-tertiary: #555555;
    --accent-1: #00ff9d;
    --accent-2: #00d4ff;
    --accent-3: #ff6b35;
    --accent-4: #a855f7;
    --accent-5: #f43f5e;
    --success: #00ff9d;
    --warning: #fbbf24;
    --error: #f43f5e;
    --info: #00d4ff;
    --border-color: #222222;
    --border-hover: #444444;
    --card-bg: rgba(10, 10, 10, 0.8);
    --card-hover: rgba(17, 17, 17, 0.95);
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
    --glow-green: 0 0 15px rgba(0, 255, 157, 0.4);
    --glow-cyan: 0 0 15px rgba(0, 212, 255, 0.3);
    --glow-purple: 0 0 15px rgba(168, 85, 247, 0.3);
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

a:hover { color: var(--accent-1); }

::selection {
    background: rgba(0, 255, 157, 0.25);
    color: #fff;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ---- UTILITY CLASSES ---- */
.text-accent { color: var(--accent-1); }
.text-cyan { color: var(--accent-2); }
.text-orange { color: var(--accent-3); }
.text-purple { color: var(--accent-4); }
.text-red { color: var(--accent-5); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-secondary { color: var(--text-secondary); }
.text-mono { font-family: var(--font-mono); }
.uppercase { text-transform: uppercase; }
.font-bold { font-weight: 700; }

/* ---- BACKGROUND GRID ---- */
.platform-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

.platform-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 30% 50%, transparent 0%, #000 75%);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.sidebar-logo {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    text-transform: lowercase;
    letter-spacing: 0;
}

.sidebar-logo .cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--accent-1);
}

@keyframes blink { 50% { opacity: 0; } }

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.collapsed .sidebar-logo { display: none; }
.collapsed .nav-label { display: none; }
.collapsed .nav-section-title { display: none; }
.collapsed .sidebar-nav a { justify-content: center; padding: 0.75rem; }
.collapsed .sidebar-profile-info { display: none; }

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-tertiary);
    padding: 0.75rem 1.5rem 0.4rem;
    white-space: nowrap;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
    border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--border-hover);
}

.sidebar-nav a.nav-active {
    color: var(--accent-1);
    background: rgba(0, 255, 157, 0.05);
    border-left-color: var(--accent-1);
}

.sidebar-nav a .lucide { width: 18px; height: 18px; flex-shrink: 0; }

/* Sidebar Profile */
.sidebar-profile {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-profile-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}

.sidebar-profile-info {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-profile-name {
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar-profile-role {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* ---- HEADER BAR ---- */
.header-bar {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-sep { color: var(--text-tertiary); }
.breadcrumb-current { color: var(--text-primary); }

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Region Selector */
.region-select {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--accent-1);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300ff9d'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
    transition: border-color var(--transition-fast);
}

.region-select:hover, .region-select:focus {
    border-color: var(--accent-1);
    outline: none;
}

.region-select option {
    background: #111;
    color: var(--text-primary);
}

/* Notification Bell */
.notification-wrapper {
    position: relative;
}

.notification-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    display: flex;
    align-items: center;
    position: relative;
    transition: all var(--transition-fast);
}

.notification-btn:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.notification-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 16px; height: 16px;
    background: var(--accent-5);
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    z-index: 200;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown.show { display: block; }

.notification-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notification-item:hover { background: rgba(255,255,255,0.03); }

.notification-text {
    font-size: 0.82rem;
    display: block;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.notification-success .notification-text::before { content: '✅ '; }
.notification-warning .notification-text::before { content: '⚠️ '; }
.notification-info .notification-text::before { content: 'ℹ️ '; }
.notification-error .notification-text::before { content: '❌ '; }

/* ---- CONTENT AREA ---- */
.content-area {
    padding: 2rem;
}

/* ============================================================
   VIEW TRANSITIONS
   ============================================================ */
.view-section {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-section.view-active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-1);
    margin-bottom: 0.5rem;
}

.view-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.view-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ============================================================
   STAT / METRIC CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--accent-1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.stat-card:hover { border-color: var(--border-hover); }
.stat-card:hover::before { transform: scaleX(1); }

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-change {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--error); }

/* GPU Gauge */
.gpu-gauge-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gpu-gauge-svg {
    width: 64px; height: 64px;
    transform: rotate(-90deg);
}

.gpu-gauge-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 6;
}

.gpu-gauge-fill {
    fill: none;
    stroke: var(--accent-1);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease;
    filter: drop-shadow(var(--glow-green));
}

.gpu-gauge-text {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 800;
}

/* ============================================================
   CHARTS
   ============================================================ */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-card-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.chart-container {
    position: relative;
    height: 260px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-card-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    padding: 0.75rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    font-weight: 500;
}

.data-table td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.data-table tr:hover td {
    background: rgba(255,255,255,0.02);
    color: var(--text-primary);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
}

.status-running {
    color: var(--success);
    background: rgba(0, 255, 157, 0.1);
    border: 1px solid rgba(0, 255, 157, 0.2);
}

.status-running::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-completed {
    color: var(--success);
    background: rgba(0, 255, 157, 0.08);
}

.status-queued {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-failed, .status-error {
    color: var(--error);
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.status-active {
    color: var(--accent-2);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.status-coming-soon {
    color: var(--text-tertiary);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
}

.status-compliant {
    color: var(--success);
    background: rgba(0, 255, 157, 0.08);
}

.status-action-required {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.08);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.btn-primary {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.7rem 1.5rem;
    background: transparent;
    color: var(--accent-1);
    border: 1px solid var(--accent-1);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--accent-1);
    color: #000;
    box-shadow: var(--glow-green);
}

.btn-primary.running {
    border-color: var(--accent-2);
    color: var(--accent-2);
    pointer-events: none;
    animation: borderPulse 1s infinite;
}

@keyframes borderPulse {
    0%, 100% { border-color: var(--accent-2); }
    50% { border-color: transparent; }
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
}

.btn-ghost {
    border-color: transparent;
}

.btn-ghost:hover {
    border-color: var(--border-color);
    background: rgba(255,255,255,0.03);
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-1);
    margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 1px rgba(0, 255, 157, 0.1);
}

.form-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300ff9d'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.form-select option {
    background: #111;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.toggle-track {
    width: 36px; height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    position: relative;
    transition: background var(--transition-fast);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle input { display: none; }
.toggle input:checked + .toggle-track { background: rgba(0, 255, 157, 0.3); }
.toggle input:checked + .toggle-track::after {
    transform: translateX(16px);
    background: var(--accent-1);
}

/* ============================================================
   CODE / TERMINAL BLOCKS
   ============================================================ */
.code-block {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
}

.code-block .json-key { color: var(--accent-2); }
.code-block .json-string { color: var(--accent-1); }
.code-block .json-number { color: var(--accent-3); }
.code-block .json-boolean { color: var(--accent-4); }

.terminal-block {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.terminal-block .text-accent { color: var(--accent-1); }
.terminal-block .text-success { color: var(--success); }
.terminal-block .text-cyan { color: var(--accent-2); }

/* ============================================================
   INFERENCE PLAYGROUND
   ============================================================ */
.inference-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
}

.inference-config {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.inference-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.inference-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.inference-panel-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

/* Live Metrics */
.live-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.live-metric {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
}

.live-metric-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 0.4rem;
}

.live-metric-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-1);
}

/* ============================================================
   MODEL CARDS
   ============================================================ */
.models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.model-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent-1);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--transition-normal);
}

.model-card:hover { border-color: var(--border-hover); }
.model-card:hover::before { transform: scaleY(1); }

.model-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.model-name {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: none;
}

.model-version {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.model-type-badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.2rem 0.5rem;
    border: 1px solid;
}

.model-type-llm { color: var(--accent-1); border-color: rgba(0,255,157,0.3); }
.model-type-slm { color: var(--accent-2); border-color: rgba(0,212,255,0.3); }
.model-type-vision { color: var(--accent-4); border-color: rgba(168,85,247,0.3); }
.model-type-embedding { color: var(--accent-3); border-color: rgba(255,107,53,0.3); }
.model-type-code { color: var(--warning); border-color: rgba(251,191,36,0.3); }

.model-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
}

.model-spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.model-spec-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
}

.model-spec-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-primary);
}

.model-regions {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}

.model-card-actions {
    display: flex;
    gap: 0.5rem;
}

.model-card-actions .btn-sm { flex: 1; justify-content: center; }

/* ============================================================
   PLAYGROUND TERMINAL
   ============================================================ */
.playground-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 4rem);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.playground-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.4);
}

.playground-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.8;
}

.pg-message { margin-bottom: 1rem; }
.pg-prefix { color: var(--text-tertiary); }
.pg-message.pg-user .pg-prefix { color: var(--accent-2); }
.pg-message.pg-assistant .pg-content { color: var(--text-primary); }

.pg-compliance-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.4rem 0.75rem;
    background: rgba(0,255,157,0.03);
    border-left: 2px solid var(--accent-1);
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
}

.typing-dots span {
    animation: typingDot 1.2s infinite;
    color: var(--accent-1);
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.playground-input-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0,0,0,0.4);
}

.playground-input-bar .prompt-prefix {
    font-family: var(--font-mono);
    color: var(--accent-1);
    font-size: 1rem;
    flex-shrink: 0;
}

.playground-input-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
}

.playground-input-bar input::placeholder {
    color: var(--text-tertiary);
}

/* ============================================================
   COMPLIANCE DASHBOARD
   ============================================================ */
.compliance-overview {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.compliance-score-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
}

.compliance-gauge-svg {
    width: 160px; height: 160px;
    transform: rotate(-90deg);
}

.compliance-gauge-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 8;
}

.compliance-gauge-fill {
    fill: none;
    stroke: var(--accent-1);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 439.823;
    stroke-dashoffset: 439.823;
    transition: stroke-dashoffset 1.5s ease;
    filter: drop-shadow(var(--glow-green));
}

.compliance-score-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.compliance-score-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-1);
}

.regulation-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.regulation-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    transition: border-color var(--transition-fast);
}

.regulation-card:hover { border-color: var(--border-hover); }

.regulation-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.regulation-description {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

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

/* ============================================================
   REGIONS MAP
   ============================================================ */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.region-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.region-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent-1);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--transition-normal);
}

.region-card:hover::before { transform: scaleY(1); }

.region-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.region-name {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
}

.region-code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-1);
}

.region-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.region-spec {
    text-align: center;
}

.region-spec-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.region-spec-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

/* ============================================================
   TRAINING
   ============================================================ */
.training-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 120px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.training-progress-fill {
    height: 100%;
    background: var(--accent-1);
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease;
}

.training-progress-fill[data-status="running"] {
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
}

/* ============================================================
   PROGRESS BAR GENERAL
   ============================================================ */
.progress-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.modal-close:hover { color: var(--accent-5); }

.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(8px);
}

.toast.show { transform: translateX(0); }
.toast-success { border-left: 3px solid var(--success); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-error { border-left: 3px solid var(--error); }
.toast-info { border-left: 3px solid var(--info); }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, #333 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.fade-in-up {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .models-grid { grid-template-columns: repeat(2, 1fr); }
    .inference-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    .sidebar .nav-label,
    .sidebar .nav-section-title,
    .sidebar-logo,
    .sidebar-profile-info { display: none; }
    .sidebar-nav a { justify-content: center; padding: 0.75rem; }

    .main-content { margin-left: var(--sidebar-collapsed); }
    .content-area { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .models-grid { grid-template-columns: 1fr; }
    .regions-grid { grid-template-columns: 1fr; }
    .compliance-overview { grid-template-columns: 1fr; }
    .inference-config { grid-template-columns: 1fr; }
    .regulation-cards { grid-template-columns: 1fr; }
}
