:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #10151f;
  --panel-2: #141b27;
  --border: rgba(148, 163, 184, .14);
  --muted: #8993a5;
  --text: #edf2fa;
  --accent: #a78bfa;
  --accent-2: #67e8f9;
  --green: #58d69a;
  --yellow: #f7c873;
  --red: #f17c91;
  --shadow: 0 18px 44px rgba(0, 0, 0, .22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 70% -20%, #212239 0, transparent 38%), var(--bg); color: var(--text); min-height: 100vh; }
button { font: inherit; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 246px; padding: 26px 17px 20px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: rgba(9, 12, 19, .74); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px 31px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #7c3aed, #22d3ee); box-shadow: 0 0 28px rgba(124, 58, 237, .34); font-size: 19px; }
.brand strong { display: block; letter-spacing: -.02em; font-size: 15px; }
.brand span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.nav { display: grid; gap: 5px; }
.nav-item { border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; font-size: 13px; transition: .18s ease; }
.nav-item span { width: 17px; text-align: center; font-size: 16px; }
.nav-item:hover, .nav-item.active { color: var(--text); background: rgba(167, 139, 250, .12); }
.nav-item.active { box-shadow: inset 2px 0 var(--accent); }
.sidebar-footer { margin-top: auto; padding: 15px 11px 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.connection-pill { display: flex; align-items: center; gap: 7px; color: #c6d1e0; font-size: 11px; margin-bottom: 13px; }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 11px currentColor; }
.connection-pill.connected i { background: var(--green); }
.main { width: calc(100% - 246px); min-width: 0; }
.topbar { min-height: 96px; padding: 24px 38px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { color: var(--accent-2); font-size: 9px; font-weight: 700; letter-spacing: .16em; margin: 0 0 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 24px; letter-spacing: -.04em; margin-bottom: 0; }
h2 { font-size: 17px; letter-spacing: -.025em; margin-bottom: 4px; }
h3 { font-size: 13px; margin-bottom: 5px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.updated { color: var(--muted); font-size: 10px; margin-right: 8px; }
.button, .icon-button { border: 1px solid var(--border); color: var(--text); background: var(--panel); border-radius: 8px; cursor: pointer; font-size: 12px; padding: 9px 13px; transition: .18s ease; }
.button:hover, .icon-button:hover { border-color: rgba(167, 139, 250, .5); transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, #7c3aed, #8b5cf6); border-color: transparent; box-shadow: 0 7px 22px rgba(124, 58, 237, .22); }
.button.secondary { color: #c8d1df; }
.button.danger { color: var(--red); }
.icon-button { padding: 8px 10px; }
.mobile-menu { display: none; }
.content { max-width: 1410px; padding: 31px 38px 55px; margin: auto; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; }
.card { background: linear-gradient(145deg, rgba(20, 27, 39, .94), rgba(13, 18, 27, .94)); border: 1px solid var(--border); border-radius: 12px; padding: 17px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 9px; font-weight: 700; }
.stat-value { font-size: 27px; letter-spacing: -.05em; font-weight: 650; margin: 9px 0 3px; }
.stat-meta { color: var(--muted); font-size: 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 29px 0 12px; }
.section-heading p { color: var(--muted); font-size: 11px; margin: 0; }
.accounts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.account-card { cursor: pointer; transition: .18s ease; }
.account-card:hover { border-color: rgba(167, 139, 250, .42); transform: translateY(-2px); }
.account-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.account-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-email { color: var(--muted); font-size: 10px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 9px; padding: 4px 7px; border-radius: 99px; background: rgba(88, 214, 154, .11); color: var(--green); white-space: nowrap; }
.badge.off { background: rgba(241, 124, 145, .1); color: var(--red); }
.badge.warn { background: rgba(251, 191, 36, .12); color: #fbbf24; }
.quota-row { display: flex; justify-content: space-between; margin-top: 20px; font-size: 11px; }
.quota-row span:last-child { color: #cfd7e5; }
.progress { overflow: hidden; height: 7px; background: #242c3a; border-radius: 99px; margin-top: 8px; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #67e8f9); }
.progress-fill { width: 0; }
.progress-fill.w-5 { width: 5%; }
.progress-fill.w-10 { width: 10%; }
.progress-fill.w-15 { width: 15%; }
.progress-fill.w-20 { width: 20%; }
.progress-fill.w-25 { width: 25%; }
.progress-fill.w-30 { width: 30%; }
.progress-fill.w-35 { width: 35%; }
.progress-fill.w-40 { width: 40%; }
.progress-fill.w-45 { width: 45%; }
.progress-fill.w-50 { width: 50%; }
.progress-fill.w-55 { width: 55%; }
.progress-fill.w-60 { width: 60%; }
.progress-fill.w-65 { width: 65%; }
.progress-fill.w-70 { width: 70%; }
.progress-fill.w-75 { width: 75%; }
.progress-fill.w-80 { width: 80%; }
.progress-fill.w-85 { width: 85%; }
.progress-fill.w-90 { width: 90%; }
.progress-fill.w-95 { width: 95%; }
.progress-fill.w-100 { width: 100%; }
.surface-copy { font-size: 11px; line-height: 1.6; }
.section-heading.compact { margin-top: 0; }
.api-key-form { margin-top: 20px; }
.field-gap { margin-top: 12px; }
.action-row { margin-top: 15px; }
.modal-actions { justify-content: flex-end; margin-top: 17px; }
.quota-note { color: var(--muted); font-size: 10px; margin-top: 9px; min-height: 15px; }
.account-footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--border); }
.two-col { grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); }
.window-list, .model-list { display: grid; gap: 10px; }
.window { display: grid; grid-template-columns: minmax(105px, 1fr) 1.4fr auto; gap: 14px; align-items: center; font-size: 11px; }
.window small { display: block; color: var(--muted); margin-top: 3px; font-size: 9px; }
.window .progress { margin: 0; }
.window-value { text-align: right; font-weight: 600; }
.model-line { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.model-line:last-child { border-bottom: 0; }
.model-line small { display: block; color: var(--muted); margin-top: 3px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--green); margin-right: 7px; }
.status-dot.warn { background: var(--yellow); }
.status-dot.bad { background: var(--red); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
td { padding: 12px 10px; border-bottom: 1px solid rgba(148, 163, 184, .09); color: #d6deea; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent-2); font-size: 10px; }
.muted { color: var(--muted); }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: 7px; }
.notice { color: #f8d78a; background: rgba(247, 200, 115, .08); border: 1px solid rgba(247, 200, 115, .2); border-radius: 9px; padding: 11px 13px; font-size: 11px; line-height: 1.5; margin-bottom: 15px; }
.notice-warn { color: #fbbf24; border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .06); }
.account-observation { font-size: 10px; margin: 12px 0; }
.account-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.form-row { display: flex; gap: 9px; align-items: center; }
.input, select { width: 100%; border: 1px solid var(--border); border-radius: 8px; background: #0b1018; color: var(--text); padding: 10px 11px; outline: none; }
.input:focus, select:focus { border-color: var(--accent); }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .66); }
.modal-backdrop.hidden { display: none; }
.modal { position: relative; width: min(590px, 100%); border: 1px solid var(--border); border-radius: 14px; background: #121823; box-shadow: 0 30px 90px #000; padding: 25px; }
.modal-close { position: absolute; top: 12px; right: 15px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; }
.modal h2 { padding-right: 25px; }
.modal p { color: var(--muted); line-height: 1.6; font-size: 11px; }
.oauth-url { display: block; margin: 14px 0; padding: 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--accent-2); word-break: break-all; font-size: 10px; }
.oauth-label { display: block; color: var(--text); font-size: 12px; margin: 0 0 8px; }
.oauth-callback { resize: vertical; min-height: 76px; font: 11px/1.5 ui-monospace, monospace; }
.oauth-open { display: inline-block; text-decoration: none; margin-bottom: 15px; }
.oauth-status { padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.oauth-status[data-status="error"] { color: var(--red); border-color: var(--red); }
.oauth-status[data-status="complete"] { color: var(--green); border-color: var(--green); }
.oauth-tunnel { margin-top: 18px; font-size: 12px; }
.oauth-tunnel summary { cursor: pointer; color: var(--accent-2); }
.oauth-tunnel p { margin-top: 12px; }
.oauth-actions { flex-wrap: wrap; margin-top: 20px; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.modal { max-height: calc(100dvh - 40px); overflow-y: auto; }
.toast-stack { position: fixed; z-index: 20; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { background: #1b2432; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 11px 14px; border-radius: 9px; font-size: 11px; max-width: 340px; }
.toast.error { color: var(--red); }
.toast.ok { color: var(--green); }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } .accounts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s ease; width: 235px; } .sidebar.open { transform: translateX(0); } .main { width: 100%; } .topbar { padding: 19px 18px; align-items: flex-start; } .mobile-menu { display: inline-block; } .topbar > div:first-of-type { margin-right: auto; } .top-actions .updated, .top-actions .secondary { display: none; } .content { padding: 22px 17px 42px; } .stats, .accounts-grid, .two-col { grid-template-columns: 1fr; } .window { grid-template-columns: 1fr auto; } .window .progress { grid-column: 1 / -1; grid-row: 2; } }
