:root {
  --ink: #f7f8ff;
  --muted: #aeb9d6;
  --line: rgba(155, 175, 230, .24);
  --paper: #080d1f;
  --white: #121a35;
  --surface-strong: #192449;
  --blue: #7c5cff;
  --blue-dark: #5b3ee2;
  --cyan: #49ddcf;
  --red: #ff7184;
  --green: #4ed5a4;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 12% 5%, #263c81 0, transparent 31rem), radial-gradient(circle at 88% 12%, #273369 0, transparent 27rem), var(--paper); font-family: Helvetica, Arial, sans-serif; line-height: 1.5; }
a { color: var(--cyan); text-underline-offset: 3px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.site-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 0 5vw; border-bottom: 1px solid var(--line); background: rgba(8, 13, 31, .72); backdrop-filter: blur(18px); }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; font-size: 1.12rem; letter-spacing: -.02em; }
.site-header nav { display: flex; align-items: center; gap: 20px; }
.site-header nav a, .link-button { color: var(--ink); font-size: .9rem; text-decoration: none; border: 0; padding: 0; background: transparent; }
.site-header nav a:hover, .link-button:hover { color: var(--cyan); }
.logout-form { display: inline; }
.page-shell { width: min(1180px, 90vw); margin: 0 auto; padding: 56px 0 80px; }
.login-shell { min-height: 100vh; display: grid; align-items: center; width: min(500px, 88vw); padding: 42px 0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.page-heading.narrow { width: min(700px, 100%); }
.page-heading h1, .login-card h1 { margin: 0; font-size: clamp(2rem, 5vw, 4.6rem); line-height: .98; letter-spacing: -.06em; }
.page-heading p, .intro { margin: 12px 0 0; color: var(--muted); }
.folio { color: var(--cyan); margin: 0 0 12px; font-size: .9rem; font-weight: 700; letter-spacing: .12em; }
.heading-actions, .form-actions, .control-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 15px; border: 1px solid var(--line); text-decoration: none; font-weight: 700; background: rgba(24, 35, 71, .75); color: var(--ink); border-radius: 9px; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: linear-gradient(135deg, var(--blue), #5e82ff); border-color: transparent; box-shadow: 0 10px 24px rgba(91, 62, 226, .32); color: #fff; }
.button--primary:hover { background: linear-gradient(135deg, var(--blue-dark), #4f77f5); border-color: transparent; }
.button--quiet:hover { background: var(--surface-strong); border-color: rgba(166, 185, 255, .55); color: var(--ink); }
.button--danger { color: #ff9daa; border-color: rgba(255, 113, 132, .62); }
.button--danger:hover { background: var(--red); color: var(--white); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 42px; }
.metric { min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; background: linear-gradient(145deg, rgba(27, 39, 79, .96), rgba(17, 26, 53, .9)); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 15px 30px rgba(0, 0, 0, .13); }
.metric span { color: var(--muted); font-size: .86rem; }
.metric strong { font-size: clamp(2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.06em; }
.table-wrap, .editor-card, .links-card, .subscription-card, .quota-card, .empty-state, .login-card { background: rgba(18, 26, 53, .92); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 42px rgba(0, 0, 0, .16); }
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--ink); }
.section-label h2 { margin: 0; font-size: 1rem; }
.section-label span { color: var(--muted); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 12px 18px; color: var(--muted); font-size: .8rem; font-weight: 600; border-bottom: 1px solid var(--line); background: rgba(8, 13, 31, .24); }
td { padding: 15px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 3px; direction: ltr; text-align: left; color: var(--muted); font-size: .75rem; }
.row-action { text-align: right; white-space: nowrap; }
.status { display: inline-flex; padding: 3px 8px; font-size: .79rem; border: 1px solid currentColor; border-radius: 999px; font-weight: 700; }
.status--active { color: var(--green); }
.status--inactive { color: var(--red); }
.usage { min-width: 105px; }
.usage span { display: block; font-size: .84rem; direction: ltr; text-align: left; }
.usage i, .large-meter { display: block; height: 5px; margin-top: 6px; background: rgba(161, 180, 233, .17); border-radius: 999px; overflow: hidden; }
.usage b, .large-meter b { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.empty-state { padding: 44px 24px; }
.empty-state h2 { margin: 0; font-size: 1.35rem; }
.empty-state p { color: var(--muted); margin: 10px 0 22px; }
.editor-card { width: min(700px, 100%); padding: 22px; }
.form-grid { display: grid; gap: 20px; }
label { display: grid; gap: 8px; font-weight: 700; font-size: .92rem; }
input, textarea { width: 100%; color: var(--ink); background: rgba(5, 10, 27, .7); border: 1px solid var(--line); padding: 11px 12px; border-radius: 8px; }
input:focus, textarea:focus { outline: 3px solid rgba(124, 92, 255, .3); outline-offset: 1px; border-color: #9d89ff; }
label small, .form-note, .subscription-card small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.form-pair { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-pair--three { grid-template-columns: repeat(3, 1fr); }
.detail-heading { margin-bottom: 28px; }
.mono { font-family: "Courier New", monospace; font-size: .82rem; direction: ltr; text-align: left; }
.detail-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-bottom: 16px; }
.quota-card, .subscription-card { padding: 20px; display: grid; gap: 15px; }
.quota-card > span, .subscription-card > span { color: var(--muted); font-size: .85rem; }
.quota-card strong { font-size: 2.5rem; letter-spacing: -.05em; line-height: 1; direction: ltr; text-align: left; }
.large-meter { height: 12px; margin: 0; }
.quota-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input { min-width: 0; font-family: "Courier New", monospace; font-size: .78rem; }
.control-row { margin: 16px 0 30px; }
.links-card textarea { display: block; min-height: 82px; resize: vertical; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-family: "Courier New", monospace; font-size: .77rem; line-height: 1.45; }
.links-card textarea:last-child { border-bottom: 0; }
.login-card { position: relative; padding: 34px; }
.login-card .folio { position: absolute; left: 22px; top: 22px; }
.login-card .intro { max-width: 300px; margin-bottom: 32px; }
.notice { margin-bottom: 18px; padding: 13px 16px; border: 1px solid currentColor; border-radius: 9px; background: rgba(18, 26, 53, .95); }
.notice--error { color: var(--red); }
.notice--success { color: var(--green); }
@media (max-width: 720px) {
  .site-header { align-items: flex-start; flex-direction: column; padding: 18px 5vw; gap: 14px; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  .page-shell { width: min(92vw, 620px); padding: 38px 0 60px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 94px; }
  .metric strong { font-size: 2.5rem; }
  .table-wrap { border: 0; background: transparent; box-shadow: none; }
  .table-wrap .section-label { background: rgba(18, 26, 53, .92); border: 1px solid var(--line); border-radius: 12px; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; margin-top: 12px; }
  tr { background: rgba(18, 26, 53, .92); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
  td { display: grid; grid-template-columns: 40% 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; }
  td:first-child::before { content: 'Customer'; }
  td small { text-align: left; }
  .row-action { text-align: left; }
  .row-action::before { content: ''; }
  .form-pair, .form-pair--three, .detail-grid { grid-template-columns: 1fr; }
  .quota-meta { align-items: flex-start; flex-direction: column; }
  .copy-row { grid-template-columns: 1fr; }
  .copy-row .button { width: 100%; }
}
