:root {
    --bg: #0b1020;
    --panel: #121a33;
    --panel2: #0f1730;
    --text: #e8ecff;
    --muted: #a9b2d6;
    --line: rgba(255, 255, 255, .10);
    --good: #39d98a;
    --warn: #ffcc66;
    --bad: #ff6b6b;
    --accent: #7aa2ff;
    --shadow: 0 12px 30px rgba(0, 0, 0, .35);
    --radius: 16px;
    --radius2: 12px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

body {
    margin: 0;
    font-family: var(--sans);
    background: radial-gradient(1200px 900px at 20% -10%, rgba(122, 162, 255, .25), transparent 60%),
                radial-gradient(1000px 800px at 100% 10%, rgba(57, 217, 138, .15), transparent 55%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, rgba(18, 26, 51, .95), rgba(10, 16, 35, .95));
    border-right: 1px solid var(--line);
    padding: 18px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--good));
    box-shadow: var(--shadow);
}

.brand h1 {
    font-size: 16px;
    margin: 0;
    color: var(--text);
}

.brand p {
    font-size: 12px;
    color: var(--muted);
    margin: 2px 0 0 0;
}

.sidebar-nav {
    flex: 1;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin: 16px 0 8px 0;
    padding: 0 12px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(122, 162, 255, .12);
    border-color: rgba(122, 162, 255, .25);
}

.nav-item.active {
    color: var(--accent);
    font-weight: 600;
}

/* Main Content */
.main-content {
    padding: 18px;
    overflow-y: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(18, 26, 51, .55);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.topbar h2 {
    margin: 0;
    font-size: 16px;
}

.sub {
    font-size: 12px;
    color: var(--muted);
}

.role-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .2);
    border: 1px solid var(--line);
    font-size: 11px;
}

/* Cards & Grids */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(18, 26, 51, .55);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 14px;
}

.card-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, .1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 13px;
}

.card-body {
    padding: 14px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th, td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-align: left;
}

th {
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.05em;
}

/* Buttons */
.btn {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(26, 37, 80, .65);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn:hover {
    background: rgba(26, 37, 80, .85);
    border-color: rgba(255, 255, 255, .25);
}

.btn-primary {
    background: rgba(122, 162, 255, .22);
    border-color: rgba(122, 162, 255, .35);
}

.btn-primary:hover {
    background: rgba(122, 162, 255, .32);
}

/* Badges */
.badge {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: 11px;
    background: rgba(0, 0, 0, .15);
}

.badge-success {
    background: rgba(57, 217, 138, .15);
    border-color: rgba(57, 217, 138, .35);
    color: var(--good);
}

.badge-warning {
    background: rgba(255, 204, 102, .15);
    border-color: rgba(255, 204, 102, .35);
    color: var(--warn);
}

.badge-error {
    background: rgba(255, 107, 107, .15);
    border-color: rgba(255, 107, 107, .35);
    color: var(--bad);
}

/* Quota Meter */
.quota-meter {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, .15);
    border-radius: 12px;
    font-size: 11px;
}

.quota-item {
    margin-bottom: 10px;
}

.quota-item:last-child {
    margin-bottom: 0;
}

.quota-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.quota-bar {
    height: 4px;
    background: rgba(255, 255, 255, .1);
    border-radius: 2px;
    overflow: hidden;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--good), var(--accent));
    transition: width 0.3s;
}

/* Simulation Controls */
.simulation-panel {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.sim-select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 11px;
    margin-top: 4px;
}

/* Utilities */
.hidden { display: none !important; }
.text-good { color: var(--good); }
.text-warn { color: var(--warn); }
.text-bad { color: var(--bad); }
.font-mono { font-family: var(--mono); }
