/* ═══════════════════════════════════════════════════════════════════════
   Consig All — Design System v2
   Premium dark theme — ultra-modern, glassmorphism, cinematic
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ──────────────────────────────────────────────────── */
:root {
    /* Base Colors */
    --bg-primary: #070b14;
    --bg-secondary: #0d1424;
    --bg-tertiary: #131d2e;
    --bg-card: rgba(13, 20, 36, 0.75);
    --bg-card-hover: rgba(19, 29, 46, 0.95);
    --bg-glass: rgba(13, 20, 36, 0.45);
    --bg-input: rgba(7, 11, 20, 0.8);
    --bg-input-focus: rgba(13, 20, 36, 0.95);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-active: rgba(99, 179, 237, 0.4);
    --border-highlight: rgba(59, 130, 246, 0.3);

    --text-primary: #f0f4ff;
    --text-secondary: #8899b8;
    --text-muted: #4a5878;
    --text-accent: #60a5fa;

    /* Accent palette */
    --accent-blue: #3b82f6;
    --accent-blue-dim: rgba(59, 130, 246, 0.15);
    --accent-blue-hover: #2563eb;
    --accent-green: #10d48a;
    --accent-green-dim: rgba(16, 212, 138, 0.15);
    --accent-red: #f05252;
    --accent-red-dim: rgba(240, 82, 82, 0.15);
    --accent-yellow: #f59e0b;
    --accent-yellow-dim: rgba(245, 158, 11, 0.15);
    --accent-purple: #a78bfa;
    --accent-purple-dim: rgba(167, 139, 250, 0.15);
    --accent-cyan: #22d3ee;
    --accent-cyan-dim: rgba(34, 211, 238, 0.15);
    --accent-orange: #fb923c;
    --accent-orange-dim: rgba(251, 146, 60, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --gradient-success: linear-gradient(135deg, #10d48a 0%, #06b6d4 100%);
    --gradient-danger: linear-gradient(135deg, #f05252 0%, #f59e0b 100%);
    --gradient-purple: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%);
    --gradient-card: linear-gradient(145deg, rgba(19, 29, 46, 0.8), rgba(13, 20, 36, 0.9));
    --gradient-sidebar: linear-gradient(180deg, #0a1020 0%, #070b14 100%);
    --gradient-glow-blue: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 70%);

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.8);
    --shadow-glow-blue: 0 0 24px rgba(59, 130, 246, 0.35), 0 0 80px rgba(59, 130, 246, 0.12);
    --shadow-glow-green: 0 0 24px rgba(16, 212, 138, 0.3), 0 0 60px rgba(16, 212, 138, 0.1);
    --shadow-glow-purple: 0 0 24px rgba(167, 139, 250, 0.3);
    --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 20px rgba(0,0,0,0.5);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Sizing */
    --sidebar-width: 252px;
    --header-height: 64px;
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

#app { min-height: 100vh; }

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── Global background noise texture ──────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(59, 130, 246, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(167, 139, 250, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── Login Page ────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 700px; height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.07), transparent 70%);
    top: -200px; left: -200px;
    animation: loginGlow 8s ease-in-out infinite alternate;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.06), transparent 70%);
    bottom: -100px; right: -100px;
    animation: loginGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes loginGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(20px, 20px); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 440px;
    padding: 48px 40px;
    background: rgba(13, 20, 36, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-2xl);
    backdrop-filter: blur(32px);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.02) inset;
    animation: fadeInUp 0.5s ease-out;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-card .logo-icon {
    width: 56px; height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 26px;
    box-shadow: var(--shadow-glow-blue);
}

.login-card .logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-card .logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 6px;
}

/* ── Layout ────────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(8, 13, 22, 0.95);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 36px; height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.sidebar-header-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sidebar-header-text span {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    padding: 0 12px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: inherit;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    box-shadow: inset 2px 0 0 var(--accent-blue), 0 1px 0 rgba(59,130,246,0.05) inset;
}

.nav-item .material-icons-round {
    font-size: 19px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.nav-item:hover .material-icons-round {
    transform: translateX(1px);
}

.nav-item.active .material-icons-round {
    color: var(--accent-blue);
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    animation: pulse-soft 2s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sidebar-footer {
    padding: 12px 10px 16px;
    border-top: 1px solid var(--border-subtle);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-info:hover { background: rgba(255, 255, 255, 0.04); }

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.user-details { flex: 1; min-width: 0; }

.user-details .name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details .role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Main Content ──────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 32px 36px;
    min-height: 100vh;
    position: relative;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary) 0%, rgba(240,244,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(59, 130, 246, 0.06);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 .material-icons-round {
    font-size: 18px;
    color: var(--accent-blue);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

/* ── Stat Cards ────────────────────────────────────────────────────── */
.stat-card {
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255,255,255,0.1);
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    position: relative;
}

.stat-icon::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: currentColor;
    opacity: 0.08;
    filter: blur(6px);
}

.stat-icon.blue { background: var(--accent-blue-dim); color: var(--accent-blue); }
.stat-icon.green { background: var(--accent-green-dim); color: var(--accent-green); }
.stat-icon.yellow { background: var(--accent-yellow-dim); color: var(--accent-yellow); }
.stat-icon.purple { background: var(--accent-purple-dim); color: var(--accent-purple); }
.stat-icon.cyan { background: var(--accent-cyan-dim); color: var(--accent-cyan); }
.stat-icon.red { background: var(--accent-red-dim); color: var(--accent-red); }
.stat-icon.orange { background: var(--accent-orange-dim); color: var(--accent-orange); }

.stat-content .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-content .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:hover, .form-select:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.form-input:focus, .form-select:focus {
    border-color: var(--accent-blue);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input::placeholder { color: var(--text-muted); }

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5878' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

/* Checkbox */
input[type="checkbox"] {
    width: 16px; height: 16px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    background: var(--bg-input);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

input[type="checkbox"]:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px; top: 2px;
    width: 5px; height: 8px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.1px;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition-fast);
    border-radius: inherit;
}

.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }
.btn:active::after { background: rgba(0,0,0,0.1); }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    box-shadow: var(--shadow-glow-blue);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 2px 12px rgba(16, 212, 138, 0.25);
}
.btn-success:hover {
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 2px 8px rgba(240, 82, 82, 0.25);
}
.btn-danger:hover {
    background: #e03e3e;
    box-shadow: 0 0 20px rgba(240, 82, 82, 0.35);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.btn-warning:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: none;
}
.btn-ghost:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
}

.btn-sm { padding: 5px 12px; font-size: 0.8rem; gap: 5px; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }
.btn-block { width: 100%; }

.btn .material-icons-round { font-size: 17px; }
.btn-sm .material-icons-round { font-size: 15px; }
.btn-lg .material-icons-round { font-size: 20px; }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Table ─────────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(7, 11, 20, 0.6);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover { background: rgba(59, 130, 246, 0.04); }
tbody tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.badge-success { background: var(--accent-green-dim); color: var(--accent-green); border: 1px solid rgba(16,212,138,0.2); }
.badge-error, .badge-danger { background: var(--accent-red-dim); color: var(--accent-red); border: 1px solid rgba(240,82,82,0.2); }
.badge-warning { background: var(--accent-yellow-dim); color: var(--accent-yellow); border: 1px solid rgba(245,158,11,0.2); }
.badge-info { background: var(--accent-blue-dim); color: var(--accent-blue); border: 1px solid rgba(59,130,246,0.2); }
.badge-neutral { background: rgba(148,163,184,0.1); color: var(--text-secondary); border: 1px solid rgba(148,163,184,0.15); }
.badge-purple { background: var(--accent-purple-dim); color: var(--accent-purple); border: 1px solid rgba(167,139,250,0.2); }
.badge-cyan { background: var(--accent-cyan-dim); color: var(--accent-cyan); border: 1px solid rgba(34,211,238,0.2); }
.badge-orange { background: var(--accent-orange-dim); color: var(--accent-orange); border: 1px solid rgba(251,146,60,0.2); }

/* Running badge pulsing effect */
.badge-running {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border: 1px solid rgba(59,130,246,0.25);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
    50% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
}

/* API status badges */
.badge-api-ok { background: var(--accent-green-dim); color: var(--accent-green); border: 1px solid rgba(16,212,138,0.2); }
.badge-api-slow { background: var(--accent-yellow-dim); color: var(--accent-yellow); border: 1px solid rgba(245,158,11,0.2); }
.badge-api-unstable { background: var(--accent-red-dim); color: var(--accent-red); border: 1px solid rgba(240,82,82,0.2); animation: badgePulse 1.5s ease-in-out infinite; }

/* ── Progress Bar ──────────────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; bottom: 0;
    width: 50%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.progress-bar-fill.slow { background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange)); }
.progress-bar-fill.unstable { background: linear-gradient(135deg, var(--accent-red), var(--accent-orange)); }

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Mining Job Card (Active) ──────────────────────────────────────── */
.mining-job-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.mining-job-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; bottom: 0;
    background: var(--gradient-primary);
    border-radius: 0 0 0 var(--radius-sm);
}

.mining-job-card.status-slow::before { background: var(--gradient-danger); }
.mining-job-card.status-unstable::before { background: linear-gradient(180deg, var(--accent-red), var(--accent-orange)); }

.mining-job-card:hover {
    border-color: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.mining-job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.mining-job-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.mining-job-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    animation: rotateIcon 3s linear infinite;
}

@keyframes rotateIcon {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mining-job-title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mining-job-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mining-job-stats {
    text-align: right;
    flex-shrink: 0;
}

.mining-job-count {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.mining-job-pct {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.mining-job-progress {
    margin: 12px 0;
}

.mining-job-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mining-job-counters {
    display: flex;
    gap: 14px;
    font-size: 0.82rem;
}

.mining-counter-success { color: var(--accent-green); font-weight: 600; }
.mining-counter-error { color: var(--accent-red); font-weight: 600; }

.mining-job-actions {
    display: flex;
    gap: 8px;
}

.mining-latency {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
    padding: 20px;
}

.modal {
    background: rgba(13, 20, 36, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 500px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.03) inset;
    position: relative;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.4), transparent);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h2, .modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close, .close-modal {
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px; height: 30px;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    text-decoration: none;
}

.modal-close:hover, .close-modal:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.modal-body { margin-bottom: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toast Notifications ───────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(13, 20, 36, 0.96);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 380px;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    font-size: 0.875rem;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
}

.toast.success::before { background: var(--accent-green); }
.toast.error::before { background: var(--accent-red); }
.toast.warning::before { background: var(--accent-yellow); }
.toast.info::before { background: var(--accent-blue); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.toast .material-icons-round { font-size: 18px; flex-shrink: 0; }
.toast.success .material-icons-round { color: var(--accent-green); }
.toast.error .material-icons-round { color: var(--accent-red); }
.toast.warning .material-icons-round { color: var(--accent-yellow); }
.toast.info .material-icons-round { color: var(--accent-blue); }

/* ── Connection Status Indicator ───────────────────────────────────── */
.connection-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.connection-dot.connected {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
    animation: pulse 2s ease-in-out infinite;
}

.connection-dot.disconnected { background: var(--text-muted); }

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 212, 138, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(16, 212, 138, 0); }
}

/* ── Empty State ───────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-muted);
}

.empty-state .material-icons-round {
    font-size: 52px;
    opacity: 0.2;
    margin-bottom: 14px;
    display: block;
}

.empty-state h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── File Upload Zone ──────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(59, 130, 246, 0.02);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.08);
}

.upload-zone .material-icons-round {
    font-size: 44px;
    color: var(--accent-blue);
    opacity: 0.5;
    margin-bottom: 12px;
    display: block;
}

.upload-zone h4 { margin-bottom: 4px; color: var(--text-secondary); font-weight: 600; }
.upload-zone p { font-size: 0.83rem; color: var(--text-muted); }

/* ── Tab Selector ──────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 3px;
    background: rgba(255,255,255,0.04);
    padding: 3px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
}

.tab {
    flex: 1;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.tab.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: var(--shadow-xs);
}

/* ── Loading Spinner ───────────────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,0.08);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

.spinner-lg { width: 36px; height: 36px; border-width: 3.5px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 11, 20, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
    backdrop-filter: blur(4px);
}

/* ── Alert / Info Banner ───────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border: 1px solid;
    margin-bottom: 16px;
}

.alert .material-icons-round { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--accent-blue-dim); border-color: rgba(59,130,246,0.25); color: var(--text-primary); }
.alert-info .material-icons-round { color: var(--accent-blue); }
.alert-warning { background: var(--accent-yellow-dim); border-color: rgba(245,158,11,0.25); color: var(--text-primary); }
.alert-warning .material-icons-round { color: var(--accent-yellow); }
.alert-error { background: var(--accent-red-dim); border-color: rgba(240,82,82,0.25); color: var(--text-primary); }
.alert-error .material-icons-round { color: var(--accent-red); }
.alert-success { background: var(--accent-green-dim); border-color: rgba(16,212,138,0.25); color: var(--text-primary); }
.alert-success .material-icons-round { color: var(--accent-green); }

/* ── Divider ───────────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 20px 0;
}

/* ── Animations ────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

.animate-in { animation: fadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-in-right { animation: fadeInRight 0.3s ease; }

/* Stagger for grid children */
.card-grid > *:nth-child(1) { animation-delay: 0ms; }
.card-grid > *:nth-child(2) { animation-delay: 60ms; }
.card-grid > *:nth-child(3) { animation-delay: 120ms; }
.card-grid > *:nth-child(4) { animation-delay: 180ms; }

/* ── Utilities ─────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.ml-auto { margin-left: auto; }
.p-0 { padding: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.72rem; }
.text-sm { font-size: 0.83rem; }
.text-base { font-size: 0.9rem; }
.text-lg { font-size: 1rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-green); }
.text-error { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }
.text-blue { color: var(--accent-blue); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-mono { font-family: var(--font-mono); }
.w-full { width: 100%; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.no-wrap { white-space: nowrap; }
