
:root {
  color-scheme: light dark;
  --bg: #0b0d10;
  --panel: #15191e;
  --panel-2: #1b2027;
  --text: #f5f7fa;
  --muted: #9da7b4;
  --line: #2b323b;
  --accent: #8ee06c;
  --accent-ink: #10200d;
  --danger: #ff7a7a;
  --warning: #ffd36b;
  --ok: #8ee06c;
  --shadow: 0 14px 40px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html, body { margin:0; min-height:100%; background:var(--bg); color:var(--text); font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Arial,sans-serif; }
body { min-height:100dvh; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button,input { font:inherit; }
button { -webkit-tap-highlight-color:transparent; }
.hidden { display:none !important; }
.auth-shell { min-height:100dvh; display:flex; flex-direction:column; justify-content:center; padding:28px 18px 40px; max-width:520px; margin:0 auto; }
.brand-lockup { display:flex; gap:14px; align-items:center; margin:0 4px 22px; }
.brand-lockup h1 { margin:0 0 4px; font-size:24px; }
.brand-lockup p { margin:0; color:var(--muted); }
.logo-mark { width:52px; height:52px; border-radius:16px; display:grid; place-items:center; font-weight:900; color:var(--accent-ink); background:var(--accent); box-shadow:var(--shadow); }
.card { background:linear-gradient(180deg,var(--panel-2),var(--panel)); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); }
.auth-card { padding:22px; }
.auth-card h2 { margin:0 0 6px; }
label { display:block; margin:16px 0 7px; font-size:13px; font-weight:700; color:#cdd4dd; }
input { width:100%; border:1px solid var(--line); background:#0f1317; color:var(--text); border-radius:13px; padding:14px 14px; outline:none; }
input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(142,224,108,.12); }
button { border:0; border-radius:13px; padding:13px 16px; font-weight:800; cursor:pointer; }
button:disabled { opacity:.48; cursor:not-allowed; }
.primary { background:var(--accent); color:var(--accent-ink); }
.secondary { background:#232a32; color:var(--text); border:1px solid #343d48; }
.danger-soft { background:rgba(255,122,122,.12); color:#ff9d9d; border:1px solid rgba(255,122,122,.25); }
.wide { width:100%; margin-top:18px; }
.compact { padding:10px 12px; border-radius:11px; }
.link-btn { width:100%; margin-top:12px; background:transparent; color:#b8c2cd; padding:10px; }
.muted { color:var(--muted); }
.small { font-size:12px; }
.divider { height:1px; background:var(--line); margin:22px 0 4px; }
.error-box,.success-box { margin-top:14px; border-radius:12px; padding:11px 12px; font-size:13px; line-height:1.4; }
.error-box { background:rgba(255,122,122,.10); border:1px solid rgba(255,122,122,.25); color:#ffb0b0; }
.success-box { background:rgba(142,224,108,.09); border:1px solid rgba(142,224,108,.24); color:#bff3aa; }
.topbar { position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; padding:15px 18px 12px; background:rgba(11,13,16,.88); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); border-bottom:1px solid rgba(255,255,255,.04); }
.topbar h1 { margin:2px 0 0; font-size:21px; }
.eyebrow { color:var(--accent); font-size:10px; letter-spacing:.13em; font-weight:900; }
.icon-btn { background:#1d232a; color:#dce3ea; padding:9px 12px; border:1px solid var(--line); border-radius:11px; }
.content { padding:14px 14px 34px; max-width:760px; margin:0 auto; }
.identity { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:15px 16px; }
.identity-name { font-weight:900; font-size:16px; }
.role-pill { font-size:10px; font-weight:900; letter-spacing:.08em; padding:7px 9px; border-radius:999px; background:rgba(142,224,108,.12); color:#bdf2a7; border:1px solid rgba(142,224,108,.22); }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:10px 0 14px; }
.stat { padding:13px 10px; box-shadow:none; }
.stat span { display:block; color:var(--muted); font-size:10px; margin-bottom:5px; }
.stat strong { font-size:21px; }
.tabs { display:flex; gap:6px; margin:4px 0 12px; background:#11151a; padding:5px; border-radius:14px; border:1px solid #222931; }
.tab { flex:1; background:transparent; color:var(--muted); padding:10px; }
.tab.active { background:#20262d; color:var(--text); }
.toolbar,.section-head { display:flex; gap:9px; align-items:center; justify-content:space-between; margin-bottom:10px; }
.toolbar .search { flex:1; }
.section-head h2 { margin:0 0 3px; font-size:17px; }
.section-head p { margin:0; }
.list { display:grid; gap:9px; }
.client-card,.registration-card { padding:14px 15px; border:1px solid var(--line); border-radius:16px; background:var(--panel); }
.client-card { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; cursor:pointer; }
.client-card:active { transform:scale(.995); }
.client-name { font-weight:900; margin-bottom:3px; }
.client-sub { display:flex; flex-wrap:wrap; gap:7px; align-items:center; color:var(--muted); font-size:11px; }
.status-pill { display:inline-flex; align-items:center; border-radius:999px; padding:5px 8px; font-size:10px; font-weight:900; letter-spacing:.04em; white-space:nowrap; }
.status-active,.status-trial { color:#bdf2a7; background:rgba(142,224,108,.11); border:1px solid rgba(142,224,108,.23); }
.status-suspended,.status-payment_pending { color:#ffe59a; background:rgba(255,211,107,.10); border:1px solid rgba(255,211,107,.22); }
.status-expired,.status-archived { color:#ffaaaa; background:rgba(255,122,122,.10); border:1px solid rgba(255,122,122,.22); }
.client-meta { text-align:right; font-size:11px; color:var(--muted); }
.client-meta strong { display:block; color:#dbe2ea; font-size:12px; margin-bottom:3px; }
.registration-card h3 { margin:0 0 5px; font-size:15px; }
.registration-card p { margin:2px 0; }
.registration-actions { display:flex; gap:8px; margin-top:11px; }
.registration-actions button { flex:1; padding:10px; }
.empty { text-align:center; color:var(--muted); padding:34px 10px; }
.modal-backdrop { position:fixed; inset:0; z-index:60; background:rgba(0,0,0,.56); display:flex; align-items:flex-end; justify-content:center; padding-top:30px; }
.sheet { width:100%; max-width:760px; max-height:92dvh; overflow:auto; background:#101419; border:1px solid #2a323b; border-bottom:0; border-radius:24px 24px 0 0; padding:10px 16px calc(22px + env(safe-area-inset-bottom)); box-shadow:0 -20px 70px rgba(0,0,0,.45); }
.sheet-handle { width:44px; height:5px; border-radius:999px; background:#39424d; margin:0 auto 13px; }
.sheet-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.sheet-head h2 { margin:3px 0 0; font-size:22px; }
.license-card { margin:12px 0 14px; border-radius:15px; padding:13px 14px; background:rgba(142,224,108,.09); border:1px solid rgba(142,224,108,.22); }
.license-card.warn { background:rgba(255,211,107,.09); border-color:rgba(255,211,107,.24); }
.license-card.bad { background:rgba(255,122,122,.09); border-color:rgba(255,122,122,.24); }
.license-card .license-label { color:var(--muted); font-size:10px; font-weight:900; letter-spacing:.10em; margin-bottom:5px; }
.license-card .license-status { font-size:17px; font-weight:900; margin-bottom:4px; }
.license-card .license-sub { color:var(--muted); font-size:11px; line-height:1.5; }
.profile-list { display:grid; gap:0; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--panel); }
.profile-row { display:grid; grid-template-columns:minmax(110px,.8fr) 1.35fr; gap:12px; padding:11px 12px; border-bottom:1px solid var(--line); align-items:start; }
.profile-row:last-child { border-bottom:0; }
.profile-row span { color:var(--muted); font-size:11px; }
.profile-row strong { font-size:12px; font-weight:750; overflow-wrap:anywhere; text-align:right; }
.compact-profile { margin-top:9px; }
.section-toggle { display:flex; align-items:center; justify-content:space-between; margin-top:0; }
.section-head-inline { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:9px; }
.detail-nav-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.detail-nav-grid button.active { border-color:rgba(142,224,108,.45); background:rgba(142,224,108,.10); color:var(--text); }
.section-head-inline h3 { margin:0 0 3px; }
.filter-summary { display:grid; gap:8px; }
.filter-card { border:1px solid var(--line); background:var(--panel); border-radius:13px; padding:11px 12px; }
.filter-card h4 { margin:0 0 7px; font-size:13px; }
.filter-card .filter-line { display:flex; justify-content:space-between; gap:12px; padding:3px 0; font-size:11px; }
.filter-card .filter-line span:first-child { color:var(--muted); }
.filter-card .filter-line strong { text-align:right; }
.action-block { margin-top:17px; padding-top:15px; border-top:1px solid var(--line); }
.action-block h3 { margin:0 0 10px; font-size:14px; }
.action-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.action-grid button:last-child { grid-column:1 / -1; }
.diag-list { display:grid; gap:6px; }
.diag-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 10px; border-radius:11px; background:#171c22; border:1px solid #262e37; font-size:12px; }
.diag-ok { color:#bdf2a7; }
.diag-bad { color:#ffaaaa; }
.json-box { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; background:#0b0f13; border:1px solid #252d36; border-radius:12px; padding:12px; font-size:11px; color:#cbd4dd; max-height:260px; overflow:auto; }
.audit-list { display:grid; gap:6px; }
.audit-item { background:#171c22; border:1px solid #262e37; border-radius:11px; padding:9px 10px; }
.audit-item strong { display:block; font-size:11px; margin-bottom:3px; }
.audit-item span { color:var(--muted); font-size:10px; }
.code-result { margin-top:10px; text-align:center; padding:13px; border-radius:12px; background:rgba(142,224,108,.08); border:1px solid rgba(142,224,108,.2); font-weight:900; letter-spacing:.12em; font-size:19px; }
.toast { position:fixed; z-index:100; left:50%; bottom:calc(22px + env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(90vw,430px); padding:12px 14px; background:#252c34; color:#f1f4f7; border:1px solid #3a444f; border-radius:13px; box-shadow:var(--shadow); text-align:center; font-size:12px; }
@media (max-width:440px) {
  .stats-grid { grid-template-columns:1fr 1fr; }
  .detail-grid { grid-template-columns:1fr 1fr; }
}
@media (prefers-color-scheme: light) {
  :root { --bg:#f5f7f8; --panel:#ffffff; --panel-2:#ffffff; --text:#182027; --muted:#66727f; --line:#dce2e8; --accent:#55b438; --accent-ink:#ffffff; --shadow:0 12px 36px rgba(25,35,45,.10); }
  input { background:#fff; color:#182027; }
  label { color:#44515d; }
  .topbar { background:rgba(245,247,248,.90); }
  .icon-btn,.secondary { background:#eef2f5; color:#24303b; border-color:#d7dee5; }
  .tabs { background:#e9eef2; border-color:#d7dee5; }
  .tab.active { background:#fff; color:#182027; }
  .client-card,.registration-card { background:#fff; }
  .sheet { background:#f7f9fa; }
  .profile-list,.filter-card,.diag-item,.audit-item { background:#fff; border-color:#dde3e8; }
  .json-box { background:#fff; color:#28343f; border-color:#dce2e8; }
  .client-meta strong { color:#28343f; }
}
