:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080b12;
  color: #f2f5fb;
  --panel: #111722;
  --panel-2: #151d2a;
  --line: #263246;
  --muted: #8e9aad;
  --accent: #72a7ff;
  --accent-2: #8d7cff;
  --success: #54d49b;
  --warning: #f4c766;
  --danger: #ff7c8d;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 75% 10%, #152341 0, transparent 34%), #080b12; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(17, 23, 34, .92); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: white; font-weight: 800; letter-spacing: -.05em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 30px rgba(114, 167, 255, .22); }
.brand-mark.small { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.eyebrow { margin: 22px 0 6px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .16em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 34px; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 28px; letter-spacing: -.035em; }
h3 { margin-bottom: 0; font-size: 20px; }
.muted { color: var(--muted); line-height: 1.6; }
form label { display: block; margin: 18px 0 8px; color: #cbd3df; font-size: 13px; font-weight: 650; }
input, select { width: 100%; min-height: 46px; padding: 0 14px; color: #f7f9fc; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #0b111b; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(114, 167, 255, .13); }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; color: #f7f9fc; background: transparent; font-weight: 700; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { background: linear-gradient(135deg, #397fee, #765be9); }
.button.secondary { border-color: var(--line); background: #182131; }
.button.ghost { width: 100%; border-color: var(--line); color: #cbd3df; }
.button.full { width: 100%; margin-top: 24px; }
.status { min-height: 21px; margin: 13px 0 0; color: var(--danger); font-size: 13px; line-height: 1.5; }
.status.success { color: var(--success); }

.app-shell { min-width: 0; min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); background: rgba(9, 13, 21, .94); }
.brand-line { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
nav { display: grid; gap: 7px; }
.nav-button { width: 100%; padding: 12px 14px; border: 0; border-radius: 10px; color: var(--muted); text-align: left; background: transparent; }
.nav-button:hover, .nav-button.active { color: white; background: #172131; }
.content { width: min(1360px, 100%); min-width: 0; padding: 30px 40px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.topbar .eyebrow { margin-top: 0; }
.account-chip { display: flex; align-items: center; gap: 10px; color: #dbe1ea; }
.badge { padding: 5px 9px; border: 1px solid rgba(84, 212, 155, .3); border-radius: 999px; color: var(--success); background: rgba(84, 212, 155, .09); font-size: 12px; }
.app-status { min-height: 0; margin: 0 0 16px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric-card, .panel { border: 1px solid var(--line); background: rgba(17, 23, 34, .9); }
.metric-card { min-height: 132px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 16px; }
.metric-card > span, .limit-grid span { color: var(--muted); font-size: 13px; }
.metric-card strong { font-size: 34px; letter-spacing: -.04em; }
.invite-card div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.invite-card strong { overflow-wrap: anywhere; font-size: 24px; }
.text-button { padding: 4px; border: 0; color: var(--accent); background: transparent; font-weight: 700; }
.panel { min-width: 0; padding: 22px; border-radius: 16px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-heading .eyebrow { margin-top: 0; }
.list-stack { display: grid; gap: 10px; }
.list-item { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; border: 1px solid var(--line); border-radius: 11px; background: #0d131e; }
.list-item > * { min-width: 0; }
.list-item strong, .list-item span { overflow-wrap: anywhere; }
.list-item p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.empty-state { padding: 20px; color: var(--muted); text-align: center; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
td { color: #dbe2ed; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--muted); background: #202a39; font-size: 12px; white-space: nowrap; }
.status-pill.active, .status-pill.approved, .status-pill.succeeded { color: var(--success); background: rgba(84, 212, 155, .1); }
.status-pill.pending, .status-pill.processing { color: var(--warning); background: rgba(244, 199, 102, .1); }
.status-pill.rejected, .status-pill.failed, .status-pill.expired { color: var(--danger); background: rgba(255, 124, 141, .1); }
.detail-panel { margin-top: 18px; }
.limit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.limit-grid > div { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #0d131e; }
.limit-grid strong { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.request-form { margin: 18px 0 28px; display: grid; grid-template-columns: minmax(170px, .6fr) minmax(260px, 1.4fr) auto; align-items: end; gap: 12px; }
.request-form > * { min-width: 0; }
.request-form label { margin-top: 0; }
.subheading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 8px 0 14px; }
.subheading h4 { margin-bottom: 0; font-size: 16px; }
.subheading span { color: var(--muted); font-size: 12px; }
progress { width: 100%; height: 6px; margin-top: 12px; overflow: hidden; border: 0; border-radius: 99px; background: #263246; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #263246; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; gap: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > div { min-width: 0; display: flex; align-items: center; overflow-x: auto; }
  .brand-line { padding: 0 14px 0 0; }
  nav { display: flex; }
  .nav-button { width: auto; white-space: nowrap; }
  .sidebar .button.ghost { width: auto; }
  .content { padding: 24px 20px 50px; }
  .request-form { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .login-card { padding: 28px 22px; }
  .sidebar { max-width: 100%; overflow: hidden; }
  .sidebar > div { flex: 1 1 auto; }
  .sidebar .button.ghost { flex: 0 0 auto; }
  .brand-line strong, .brand-mark.small { display: none; }
  .metric-grid, .limit-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .account-chip { align-items: flex-end; flex-direction: column; }
  .panel { padding: 17px; }
  .code-row { grid-template-columns: 1fr; }
}
