:root {
  color-scheme: light;
  --paper: #f6f6ef;
  --panel: #fff;
  --ink: #152e28;
  --muted: #52635c;
  --line: #d9e2d9;
  --hover: #eff4ee;
  --forest: #103d36;
  --lime: #d3f76a;
  --green: #28634a;
  --blue: #365b91;
  --amber: #815321;
  --red: #a03d3d;
  --green-bg: #e8f5e9;
  --blue-bg: #edf2fc;
  --amber-bg: #f8efe0;
  --red-bg: #faecea;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14201c;
  --panel: #1d2c26;
  --ink: #f1f4e9;
  --muted: #bdcec4;
  --line: #3a4e43;
  --hover: #293d32;
  --green: #b3efbc;
  --blue: #c2d8ff;
  --amber: #facf98;
  --red: #ffc1bf;
  --green-bg: #284533;
  --blue-bg: #2e3e59;
  --amber-bg: #483b26;
  --red-bg: #482b2c;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; color: var(--ink); background: var(--paper) }
h1, h2, p { margin: 0 }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; letter-spacing: -.055em; font-weight: 720 }
h2 { font-size: 1.18rem; letter-spacing: -.025em; line-height: 1.25 }
p { color: var(--muted) }
button, input, select { font: inherit; color: inherit; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: .54rem .8rem; background: var(--panel) }
input, select { min-width: 0 }
button { cursor: pointer; font-weight: 650 }
button:hover { background: var(--hover) }
button:disabled { cursor: wait; opacity: .65 }
:focus-visible { outline: 3px solid #6ea643; outline-offset: 2px }
.primary { background: var(--lime); color: #17291c; border-color: var(--lime) }
.primary:hover { background: #bde653; border-color: #bde653 }
.primary span { font-size: 1.25em; line-height: 1; margin-inline-end: .3em }
.layout { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr) }
.sidebar { background: var(--forest); color: #fbfcf3; padding: 1.7rem 1rem; display: flex; flex-direction: column; gap: 2.2rem }
.brand { display: flex; align-items: center; gap: .65rem; font-size: 1.22rem; font-weight: 750; letter-spacing: -.04em; white-space: nowrap }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--lime); color: #173127; font-weight: 900; font-style: italic }
.brand small { font: 650 .66rem/1.1 ui-monospace, monospace; letter-spacing: .11em; color: #d0e4d9 }
.sidebar nav, .sidebar-footer { display: grid; gap: .35rem }
.sidebar-footer { margin-top: auto }
.sidebar button { border-color: transparent; text-align: start; background: transparent; color: #ebf4e9; width: 100%; font-size: .92rem }
.sidebar button:hover, .sidebar button[aria-current] { background: #24574b }
.sidebar button[aria-current] { color: #e4ff9f }
.nav-item { display: flex; align-items: center; gap: .65rem }
.nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round }
main { width: min(100%, 1440px); min-width: 0; margin-inline: auto; padding: 3.25rem clamp(1rem, 4vw, 4rem) 3rem }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; margin-block-end: 1.9rem }
.page-head p { margin-top: .6rem }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.35rem }
.metric { position: relative; min-height: 122px; border-radius: 12px; text-align: start; display: grid; align-content: space-between; gap: .45rem; padding: 1rem 1.15rem }
.metric span { color: var(--muted); font-size: .85rem }
.metric strong { font-size: 2.35rem; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums }
.metric[aria-pressed="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green) }
.dot { display: block; width: .58rem; height: .58rem; border-radius: 50%; background: currentColor }
.metric .dot { position: absolute; inset-inline-end: 1.15rem; inset-block-end: 1.25rem }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem }
.panel-head p { font-size: .87rem; margin-top: .25rem }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 100% }
.filters input, .filters select { font-size: .9rem; max-width: 100% }
.table-wrap { overflow-x: auto }
.mobile-summary { display: none }
.account-email { display: block; color: var(--muted); font-size: .8rem; font-weight: 450 }
table { width: 100%; text-align: start; border-collapse: collapse }
th, td { text-align: start; padding: .75rem .85rem; border-top: 1px solid var(--line) }
th { color: var(--muted); background: var(--hover); font-size: .77rem }
td { font-size: .88rem; overflow-wrap: anywhere }
td:first-child, th:first-child { padding-inline-start: 1.15rem }
td:first-child { font-weight: 700; min-width: 9rem }
td:last-child { text-align: end }
td button { font-size: .84rem }
.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .57rem; border-radius: 99px; font-size: .79rem; font-weight: 700 }
.badge .dot { width: .38rem; height: .38rem }
.subscription { color: var(--green) }
.trial { color: var(--blue) }
.pending { color: var(--amber) }
.revoked, .expired, .invite_expired { color: var(--red) }
.badge.subscription { background: var(--green-bg) }
.badge.trial { background: var(--blue-bg) }
.badge.pending { background: var(--amber-bg) }
.badge.revoked, .badge.expired, .badge.invite_expired { background: var(--red-bg) }
.empty { text-align: center; padding: 3.3rem 1.1rem }
.events { list-style: none; margin: 0; padding: 0 1.15rem }
.events li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere }
.events li:last-child { border: 0 }
.events time { font-size: .85rem; color: var(--muted) }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; gap: 2.3rem; padding: clamp(1.5rem, 6vw, 5rem); background: var(--forest); color: #f9fbf1 }
.login-intro p { color: #d1e5d8; margin-top: 1rem; max-width: 34ch }
.login-art { width: min(100%, 360px); color: #b8d675 }
.login-form { display: grid; place-items: center; padding: 2rem 1.25rem }
.login-form form { display: grid; width: min(100%, 380px); gap: .75rem }
.login-form h2 { margin-bottom: 1.4rem; font-size: 1.7rem }
.notice { color: var(--red); font-size: .9rem; margin: .15rem 0 .65rem }
.notice:empty { display: none }
.startup { padding: 2rem }
dialog { width: min(460px, calc(100% - 1.5rem)); max-height: calc(100% - 1.5rem); padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--panel) }
dialog::backdrop { background: #101f1bcc }
dialog form { display: grid; gap: .8rem }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem }
.dialog-head h2 { font-size: 1.35rem; overflow-wrap: anywhere }
.dialog-head button { width: 46px; font-size: 1.3rem }
label { font-weight: 650; font-size: .9rem }
label input, label select { display: block; width: 100%; margin-top: .3rem }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: .65rem; margin-top: .6rem }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .55rem }
.account-actions { display: grid; gap: .55rem }
.danger-outline { color: var(--red) }
.sr-only { position: absolute; inset-inline-start: 0; inset-block-start: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0 }
@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 720px) {
  .layout, .login-layout { grid-template-columns: minmax(0, 1fr) }
  .sidebar { gap: .55rem; padding: .8rem 1rem }
  .sidebar nav, .sidebar-footer { display: flex; flex-wrap: wrap }
  .sidebar button { width: auto }
  main { padding-top: 1.5rem }
  .login-art { display: none }
  th:nth-child(2), td:nth-child(2), th:nth-child(4), td:nth-child(4) { display: none }
  th, td { padding-inline: .5rem }
  th:first-child, td:first-child { padding-inline-start: .75rem }
  td:first-child { min-width: 0 }
  td button { padding-inline: .55rem; white-space: nowrap }
  .badge { overflow-wrap: normal; line-height: 1.3; padding-inline: .4rem }
  .badge .dot { flex: none }
  .mobile-summary { display: block; margin-top: .25rem; color: var(--muted); font-weight: 450; font-size: .76rem }
}
@media (max-width: 400px) {
  .metric { padding: .8rem; min-height: 108px }
  .filters > * { width: 100% }
  .filters { width: 100% }
}
