/* ============================================================
   AINTECH Design System v2.0 — "The Cosmos" Dark Theme
   Product: AIT-Theta Auth | Color accent: #F44336
   Source of truth: aintech-cloud globals.css + figma-tokens.json
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Syne:wght@600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* === CSS VARIABLES === */
:root {
    /* Core palette */
    --primary: #00D9FF;
    --primary-hover: #00B8D9;
    --primary-dim: rgba(0, 217, 255, 0.15);
    --primary-glow: rgba(0, 217, 255, 0.08);
    --primary-border: rgba(0, 217, 255, 0.2);

    /* Product accent (Theta = Red) — used sparingly */
    --theta: #F44336;
    --theta-dim: rgba(244, 67, 54, 0.12);

    /* Backgrounds & Surfaces */
    --bg: #0A0E1A;
    --bg-elevated: #111627;
    --bg-card: #1A1F2E;
    --bg-hover: #252B3D;
    --bg-input: #1E2435;
    --surface-2: #1E2435;
    --surface-3: #252B3D;

    /* Borders */
    --border: #2E3548;
    --border-light: rgba(46, 53, 72, 0.6);

    /* Text */
    --text: #FFFFFF;
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --text-muted: #475569;

    /* Status */
    --success: #10B981;
    --success-dim: rgba(16, 185, 129, 0.12);
    --error: #EF4444;
    --error-dim: rgba(239, 68, 68, 0.12);
    --warning: #F59E0B;
    --warning-dim: rgba(245, 158, 11, 0.12);
    --info: #3B82F6;
    --info-dim: rgba(59, 130, 246, 0.12);

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Syne', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--primary-glow);
    --shadow-glow-strong: 0 0 60px rgba(0, 217, 255, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.5;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* === SELECTION === */
::selection { background: var(--primary-dim); color: var(--primary); }

/* === BACKGROUND EFFECTS === */
.bg-grid {
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(0, 217, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}
.bg-glow {
    position: fixed; top: -300px; left: 50%; transform: translateX(-50%);
    width: 900px; height: 900px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.06) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* === GLASS === */
.glass {
    background: rgba(26, 31, 46, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--primary-border);
}
.glass-card {
    background: rgba(26, 31, 46, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.glass-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-glow);
}

/* === TYPOGRAPHY === */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.text-gradient {
    background: linear-gradient(135deg, #00D9FF, #0088CC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-mono { font-family: var(--font-mono); font-size: 13px; }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #0A0E1A;
    border-color: transparent;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}
.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card);
    border-color: var(--primary-border);
    color: var(--primary);
}
.btn-danger {
    background: var(--error-dim);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { color: var(--primary); background: var(--primary-dim); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-md); }
.btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
}

/* === INPUTS === */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all var(--transition-normal);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 4px; }

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.card:hover { border-color: var(--border-light); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
}
.card-title {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600;
    color: var(--text);
}
.card-body { padding: 24px; }
.card-body[style*="padding:0"], .card-body[style*="padding: 0"] { padding: 0; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
}

/* === STAT CARDS === */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--border);
    transition: background var(--transition-normal);
}
.stat-card:hover { border-color: var(--primary-border); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.stat-card:hover::before { background: linear-gradient(90deg, var(--primary), transparent); }
.stat-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 8px; }
.stat-card.cyan .stat-value { color: var(--primary); }
.stat-card.cyan::before { background: linear-gradient(90deg, var(--primary), transparent); }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.green::before { background: linear-gradient(90deg, var(--success), transparent); }
.stat-card.yellow .stat-value { color: var(--warning); }
.stat-card.yellow::before { background: linear-gradient(90deg, var(--warning), transparent); }
.stat-card.red .stat-value { color: var(--error); }
.stat-card.red::before { background: linear-gradient(90deg, var(--error), transparent); }
.stat-card.blue .stat-value { color: var(--info); }
.stat-card.blue::before { background: linear-gradient(90deg, var(--info), transparent); }
.stat-card.theta .stat-value { color: var(--theta); }
.stat-card.theta::before { background: linear-gradient(90deg, var(--theta), transparent); }

/* === BADGES === */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-primary { background: var(--primary-dim); color: var(--primary); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-error { background: var(--error-dim); color: var(--error); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-info { background: var(--info-dim); color: var(--info); }
.badge-neutral { background: rgba(100, 116, 139, 0.15); color: var(--text-secondary); }
.badge-theta { background: var(--theta-dim); color: var(--theta); }

/* === STATUS DOTS === */
.status-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; margin-right: 6px;
    flex-shrink: 0;
}
.status-dot.online, .status-dot.green { background: var(--success); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.status-dot.offline, .status-dot.red { background: var(--error); }
.status-dot.warning, .status-dot.yellow { background: var(--warning); }
.status-dot.idle, .status-dot.blue { background: var(--info); }
.status-dot.pulse { animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* === TABLES === */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left; padding: 12px 16px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    position: sticky; top: 0; z-index: 1;
}
tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}
tbody tr:hover td { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }
td .cell-primary { color: var(--text); font-weight: 500; }
td .cell-mono { font-family: var(--font-mono); font-size: 12px; }

/* === PAGINATION === */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0; gap: 12px;
}
.pagination-info { font-size: 13px; color: var(--text-secondary); }
.pagination-controls { display: flex; gap: 4px; }
.pagination-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: transparent; color: var(--text-secondary);
    cursor: pointer; font-size: 13px; font-weight: 500;
    transition: all var(--transition-fast);
}
.pagination-btn:hover { border-color: var(--primary-border); color: var(--primary); background: var(--primary-dim); }
.pagination-btn.active { background: var(--primary); color: #0A0E1A; border-color: var(--primary); font-weight: 700; }
.pagination-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* === MODAL === */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: all var(--transition-normal);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%; max-width: 560px; max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-slow);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 24px 0;
}
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
    background: var(--bg-hover); color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 18px; transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--error-dim); color: var(--error); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 0 24px 24px;
    display: flex; justify-content: flex-end; gap: 12px;
}

/* === TOAST === */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    min-width: 300px; max-width: 420px;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: transform var(--transition-slow);
    border: 1px solid transparent;
}
.toast.show { transform: translateX(0); }
.toast-success { background: rgba(16, 185, 129, 0.15); color: var(--success); border-color: rgba(16, 185, 129, 0.2); }
.toast-error { background: rgba(239, 68, 68, 0.15); color: var(--error); border-color: rgba(239, 68, 68, 0.2); }
.toast-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); border-color: rgba(245, 158, 11, 0.2); }
.toast-info { background: rgba(0, 217, 255, 0.1); color: var(--primary); border-color: var(--primary-border); }

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width); position: fixed; top: 0; bottom: 0; left: 0;
    background: rgba(10, 14, 26, 0.98);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 20px 12px;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-slow);
}
.sidebar-logo {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 12px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.sidebar-logo-icon {
    font-family: var(--font-display);
    font-size: 32px; font-weight: 800;
    background: linear-gradient(135deg, var(--theta), #ff6b5b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-logo-text {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 700;
    color: var(--text);
}
.sidebar-logo-ver {
    font-size: 10px; color: var(--text-tertiary);
    font-weight: 400; margin-top: 1px;
}
.nav-section {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-tertiary); padding: 16px 12px 6px;
    font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all var(--transition-fast);
    text-decoration: none; position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon, .nav-item svg.nav-icon { width: 18px; height: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-badge {
    margin-left: auto;
    background: var(--primary-dim);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10px; font-weight: 700;
}

/* === MAIN CONTENT === */
.main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative; z-index: 1;
}
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #0A0E1A;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-tertiary); }

.content { padding: 32px; }
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.page-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.page-description { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* === GRID LAYOUTS === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* === SEARCH & FILTERS === */
.search-bar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}
.search-input {
    flex: 1; padding: 10px 16px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text); font-size: 13px;
    font-family: var(--font-body);
    transition: all var(--transition-normal);
    position: relative;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.search-wrapper { position: relative; flex: 1; }
.search-wrapper::before {
    content: ''; position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    pointer-events: none;
    box-sizing: border-box;
}
.search-wrapper::after {
    content: ''; position: absolute; left: 26px; top: calc(50% + 6px);
    width: 2px; height: 6px;
    background: var(--text-muted);
    transform: rotate(-45deg);
    transform-origin: top left;
    pointer-events: none;
}
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* === TABS === */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab {
    padding: 10px 20px; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    background: none; border-top: none; border-left: none; border-right: none;
    font-family: var(--font-body);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* === EMPTY STATE === */
.empty-state {
    text-align: center; padding: 60px 24px;
    color: var(--text-tertiary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-text { font-size: 13px; max-width: 400px; margin: 0 auto 20px; }

/* === LOADING === */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-tertiary); font-size: 13px; display: flex; align-items: center; gap: 10px; justify-content: center; padding: 40px; }

/* === TOGGLE === */
.toggle {
    width: 44px; height: 24px; border-radius: 12px;
    background: var(--bg-hover); border: 1px solid var(--border);
    cursor: pointer; position: relative;
    transition: all var(--transition-normal);
}
.toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--text-secondary);
    transition: all var(--transition-normal);
}
.toggle.active { background: var(--primary-dim); border-color: var(--primary); }
.toggle.active::after { transform: translateX(20px); background: var(--primary); }

/* === CHIP / TAG === */
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 500;
    background: var(--bg-hover); color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* === ACCESSIBILITY === */
/* Focus-visible for keyboard navigation */
.btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible,
.pagination-btn:focus-visible, .toggle:focus-visible, .modal-close:focus-visible,
.chip:focus-visible, .help-toggle:focus-visible, .help-option:focus-visible,
.aintech-sso-btn:focus-visible, .login-submit:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Improve muted text contrast (WCAG AA 4.5:1) */
:root { --text-muted: #6B7A90; }

/* Toast container screen reader announcements */
.toast-container { role: status; }

/* Ensure minimum touch targets on mobile */
@media (max-width: 768px) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 38px; }
    .pagination-btn { min-width: 40px; min-height: 40px; }
    .nav-item { min-height: 44px; }
    .toggle { min-height: 32px; }
}

/* === ANIMATIONS === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 5px var(--primary-glow); }
    50% { box-shadow: 0 0 20px rgba(0, 217, 255, 0.15); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }
.slide-up { animation: slideUp 0.4s ease forwards; }

/* === SIDEBAR MOBILE OVERLAY === */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0; visibility: hidden;
    transition: all var(--transition-normal);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* === SCROLLABLE CONTENT === */
.scroll-y { overflow-y: auto; max-height: 60vh; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active + .sidebar { transform: translateX(0); }
    .main { margin-left: 0; }
    .content { padding: 20px 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 12px 16px; }
    .modal { width: 95%; max-width: none; margin: 10px; }
    .search-bar { flex-direction: column; }
    .filter-group { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
