:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #5b6b7c;
  --line: #e2e8f0;
  --brand: #0b5fff;
  --brand-dark: #0847c7;
  --ok: #0f7b4a;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.04);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.brand span { color: var(--brand); font-weight: 600; }
nav { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.main { padding: 2rem 1.25rem 3rem; }
.footer { padding: 1.5rem 1.25rem 2.5rem; color: var(--muted); font-size: .9rem; }
h1 { font-size: 1.75rem; margin: 0 0 .5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.section { margin-top: 2rem; }
.lede { color: var(--muted); margin-top: 0; max-width: 42rem; }
.muted, .fine { color: var(--muted); font-size: .9rem; }
.grid.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.stat { font-size: 1.8rem; font-weight: 700; margin: .25rem 0 .5rem; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
.table th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: .78rem; font-weight: 600; }
.badge-paid, .badge-active { background: #ecfdf5; color: var(--ok); }
.badge-unpaid { background: #fff7ed; color: var(--warn); }
.badge-cancelled, .badge-expired, .badge-terminated { background: #fef2f2; color: #b91c1c; }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid transparent; padding: .55rem 1rem; font-weight: 600; cursor: pointer; font-size: .95rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-sm { padding: .25rem .6rem; font-size: .8rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.stack.narrow { max-width: 480px; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .9rem; }
input, textarea { font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
.alert { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); margin-bottom: 1rem; font-size: .92rem; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(160deg, #eef4ff 0%, #f4f6f9 45%, #eef2f7 100%); }
.auth-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; box-shadow: var(--shadow); }
.brand-block { margin-bottom: 1.25rem; }
.logo { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.tagline { margin: .15rem 0 0; color: var(--muted); }
