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

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    background: radial-gradient(ellipse at top left, #1a3050 0%, #0f172a 45%, #020617 100%);
    background-attachment: fixed;
    color: #cbd5e1;
    min-height: 100vh;
}

/* ── Glassmorphism ────────────────────────────────────────────────────────── */
.glass {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 24px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
}
.glass-sidebar {
    background: rgba(10, 16, 30, 0.8);
    backdrop-filter: blur(24px) saturate(160%);
    border-right: 1px solid rgba(255,255,255,0.06);
    box-shadow: 8px 0 32px rgba(0,0,0,0.4);
}
.glass-header {
    background: rgba(10, 16, 30, 0.75);
    backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.glass-card {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: all 0.3s ease;
}
.glass-card:hover {
    background: rgba(17, 24, 39, 0.7);
    border-color: rgba(96,165,250,0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 24px rgba(59,130,246,0.1), inset 0 1px 0 rgba(255,255,255,0.06);
}
.glass-input {
    background: rgba(8, 12, 20, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
    color: #fff;
    transition: all 0.2s;
    outline: none;
}
.glass-input:focus {
    border-color: rgba(96,165,250,0.45);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* ── Glow effects ─────────────────────────────────────────────────────────── */
.glow-blue   { box-shadow: 0 0 20px rgba(59,130,246,0.2); }
.glow-purple { box-shadow: 0 0 20px rgba(168,85,247,0.2); }
.glow-green  { box-shadow: 0 0 20px rgba(16,185,129,0.2); }
.glow-amber  { box-shadow: 0 0 20px rgba(245,158,11,0.2); }
.glow-red    { box-shadow: 0 0 20px rgba(239,68,68,0.2); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.sidebar {
    width: 256px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 20;
}
.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-logo h1 {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
}
.sidebar-logo span { color: #60a5fa; text-shadow: 0 0 12px rgba(96,165,250,0.5); }
.sidebar-logo p { font-size: 0.6rem; color: #475569; letter-spacing: 0.15em; text-transform: uppercase; margin-top: 2px; }
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.nav-section-label {
    font-size: 0.6rem;
    color: #334155;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.5rem 0.75rem 0.25rem;
    margin-top: 0.5rem;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
}
.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.nav-link.active {
    background: rgba(59,130,246,0.12);
    color: #93c5fd;
    border-color: rgba(59,130,246,0.2);
    box-shadow: 0 0 16px rgba(59,130,246,0.08);
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.topbar {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 10;
    flex-shrink: 0;
}
.topbar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.page-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
.page-body::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar { width: 5px; }
.page-body::-webkit-scrollbar-track,
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.page-body::-webkit-scrollbar-thumb,
.custom-scroll::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; }

/* ── Stat Cards ───────────────────────────────────────────────────────────── */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(135deg, #1e293b 0%, #111827 100%);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.35); }
.stat-card .blob {
    position: absolute;
    right: -1rem;
    top: -1rem;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    filter: blur(2rem);
    transition: opacity 0.5s;
}
.stat-card:hover .blob { opacity: 0.4; }
.stat-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin: 0.5rem 0 0.75rem;
    letter-spacing: -0.03em;
}
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.625rem;
    border-radius: 0.375rem;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 0 16px rgba(37,99,235,0.35);
}
.btn-primary:hover { background: #3b82f6; box-shadow: 0 0 24px rgba(59,130,246,0.4); }
.btn-success {
    background: #059669;
    color: #fff;
    box-shadow: 0 0 16px rgba(5,150,105,0.3);
}
.btn-success:hover { background: #10b981; }
.btn-danger {
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-ghost {
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.06);
}
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: #fff; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.6rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.75rem; }
.btn svg { width: 14px; height: 14px; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-table thead tr { border-bottom: 1px solid rgba(255,255,255,0.05); }
.data-table thead th {
    padding: 0.75rem 1.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: left;
    background: rgba(255,255,255,0.02);
}
.data-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.data-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.data-table tbody td { padding: 0.875rem 1.25rem; color: #cbd5e1; vertical-align: middle; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.badge-blue   { background: rgba(59,130,246,0.15);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }
.badge-green  { background: rgba(16,185,129,0.15);  color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }
.badge-red    { background: rgba(239,68,68,0.15);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.badge-amber  { background: rgba(245,158,11,0.15);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.badge-purple { background: rgba(168,85,247,0.15);  color: #d8b4fe; border: 1px solid rgba(168,85,247,0.2); }
.badge-gray   { background: rgba(255,255,255,0.05); color: #94a3b8;  border: 1px solid rgba(255,255,255,0.06); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.375rem;
}
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s;
}
.form-select { width: 100%; padding: 0.75rem 1rem; border-radius: 0.625rem; font-size: 0.875rem; font-family: inherit; cursor: pointer; }
.form-textarea { width: 100%; padding: 0.75rem 1rem; border-radius: 0.625rem; font-size: 0.875rem; font-family: inherit; resize: vertical; min-height: 80px; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; border-radius: 0.75rem; font-size: 0.8125rem; font-weight: 500; margin-bottom: 1.5rem; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: #6ee7b7; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.2);  color: #fca5a5; }
.alert-info    { background: rgba(59,130,246,0.1);  border: 1px solid rgba(59,130,246,0.2);  color: #93c5fd; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    transform: translateY(12px);
    transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 800px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.modal-title { font-size: 0.8125rem; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.08em; }
.modal > form { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.5rem; }
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(96,165,250,0.35); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: rgba(96,165,250,0.55); }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: flex-end; gap: 0.5rem; flex-shrink: 0; }
.modal-close { background: rgba(255,255,255,0.05); border: none; color: #64748b; cursor: pointer; padding: 0.375rem; border-radius: 0.5rem; display: flex; transition: all 0.2s; }
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
.modal-close svg { width: 18px; height: 18px; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tab-group { display: flex; gap: 4px; padding: 0.375rem; border-radius: 1rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); width: fit-content; margin-bottom: 2rem; }
.tab-btn { padding: 0.5rem 1.25rem; border-radius: 0.625rem; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; border: none; cursor: pointer; color: #475569; background: transparent; transition: all 0.2s; display: flex; align-items: center; gap: 0.375rem; }
.tab-btn svg { width: 14px; height: 14px; }
.tab-btn.active { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); box-shadow: 0 0 12px rgba(59,130,246,0.1); }
.tab-btn:hover:not(.active) { color: #94a3b8; background: rgba(255,255,255,0.04); }

/* ── Section Headers ──────────────────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.section-title { font-size: 0.75rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.12em; display: flex; align-items: center; gap: 0.5rem; }
.section-title svg { width: 16px; height: 16px; }

/* ── Token display ────────────────────────────────────────────────────────── */
.token-box { font-family: monospace; font-size: 0.7rem; color: #6ee7b7; background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.15); padding: 0.375rem 0.625rem; border-radius: 0.375rem; word-break: break-all; }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress-bar { height: 4px; border-radius: 9999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, #3b82f6, #8b5cf6); transition: width 0.5s ease; }

/* ── Pulse dot ────────────────────────────────────────────────────────────── */
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Charts ───────────────────────────────────────────────────────────────── */
canvas { font-family: 'Inter', sans-serif !important; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-auto-fill { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.divide-subtle > * + * { border-top: 1px solid rgba(255,255,255,0.04); }
