@layer base,layout,components,responsive;
@layer base {
  :root { color-scheme:light; --bg:#f5f6f4; --surface:#fff; --surface-soft:#f8f9f7; --ink:#17211c; --muted:#68736c; --line:#e1e6e1; --accent:#255c44; --accent-soft:#eaf3ed; --danger:#b9413b; --shadow:0 20px 70px #17211c14; }
  :root.dark { color-scheme:dark; --bg:#0c0e0d; --surface:#151817; --surface-soft:#1b201d; --ink:#edf1ee; --muted:#a1aaa4; --line:#2c332e; --accent:#8bd0aa; --accent-soft:#213b2b; --danger:#f2968e; --shadow:0 20px 70px #0008; }
  * { box-sizing:border-box; }
  body { margin:0; color:var(--ink); background:var(--bg); font:14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
  [hidden] { display:none!important; }
  button,input,select,textarea { font:inherit; }
  button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
  button { cursor:pointer; }
  button:disabled { opacity:.55; cursor:wait; }
  a { color:inherit; }
  h1,h2,h3,p { margin:0; }
  h1 { font-size:28px; line-height:1.25; letter-spacing:-.035em; font-weight:650; }
  h2 { font-size:21px; line-height:1.35; letter-spacing:-.025em; font-weight:650; }
  h3 { font-size:16px; font-weight:650; line-height:1.4; }
  small { font-size:12px; line-height:1.5; }
  input,select,textarea { width:100%; min-height:43px; padding:10px 12px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--surface); outline:none; }
  input:focus,select:focus,textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent); }
  input[type=checkbox] { width:18px; height:18px; min-height:0; margin:2px 0 0; accent-color:var(--accent); flex:none; }
  input[type=color] { padding:5px; }
  textarea { min-height:88px; resize:vertical; }
  label { display:grid; gap:7px; font-size:13px; font-weight:600; }
  label small { color:var(--muted); font-weight:400; }
  :focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
  .muted { color:var(--muted); }
  .eyebrow { display:block; color:var(--muted); font-size:10px; letter-spacing:.15em; font-weight:700; }
  .button { display:inline-flex; justify-content:center; align-items:center; gap:7px; padding:9px 14px; min-height:39px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--surface); font-size:13px; font-weight:600; white-space:nowrap; text-decoration:none; }
  .button:hover { background:var(--surface-soft); border-color:color-mix(in srgb,var(--ink) 24%,var(--line)); }
  .button.primary { border-color:var(--accent); background:var(--accent); color:var(--surface); }
  :root.dark .button.primary { color:#102019; }
  .button.primary:hover { filter:brightness(.94); }
  .button.quiet { background:transparent; }
  .button.danger { color:var(--danger); border-color:color-mix(in srgb,var(--danger) 25%,var(--line)); }
  .button.small { min-height:32px; padding:6px 10px; font-size:12px; }
  .text-button { border:0; background:none; color:var(--muted); padding:8px; font-size:12px; font-weight:600; }
  .text-button:hover { color:var(--ink); }
  .full { width:100%; }
  .brand { display:flex; align-items:center; gap:11px; text-decoration:none; font-size:18px; font-weight:750; letter-spacing:-.035em; }
  .brand-symbol { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--ink); color:var(--surface); font-size:23px; font-weight:650; }
  .brand small { display:block; color:var(--muted); font-size:11px; letter-spacing:0; font-weight:500; margin-top:-1px; }
}
@layer layout {
  .boot { min-height:100vh; display:grid; align-content:center; justify-items:center; gap:14px; color:var(--muted); }
  .workspace { display:grid; grid-template-columns:220px minmax(0,1fr); min-height:100vh; }
  .sidebar { position:sticky; top:0; height:100vh; padding:26px 18px 20px; background:var(--surface); border-right:1px solid var(--line); display:flex; flex-direction:column; }
  .sidebar .brand { padding:0 10px; }
  .sidebar-label { font-size:9px; font-weight:650; letter-spacing:.12em; color:var(--muted); margin:38px 12px 12px; }
  .sidebar nav { display:grid; gap:5px; }
  .nav-button { display:flex; align-items:center; gap:12px; width:100%; text-align:left; padding:12px 13px; border:0; border-radius:9px; background:none; color:var(--muted); font-size:13px; font-weight:550; }
  .nav-button:hover { color:var(--ink); background:var(--surface-soft); }
  .nav-button.active { color:var(--accent); background:var(--accent-soft); font-weight:650; }
  .nav-button svg { flex:none; }
  .sidebar-note { display:flex; gap:9px; align-items:flex-start; margin-top:auto; padding:16px 10px 0; border-top:1px solid var(--line); font-size:12px; font-weight:550; }
  .sidebar-note small { display:block; margin-top:4px; color:var(--muted); font-size:10px; font-weight:400; }
  .small-dot { width:6px; height:6px; border-radius:50%; background:var(--accent); margin-top:6px; flex:none; }
  .main-shell { min-width:0; display:flex; flex-direction:column; }
  .topbar { display:flex; justify-content:space-between; align-items:center; gap:16px; min-height:64px; padding:0 32px; border-bottom:1px solid var(--line); background:var(--surface); }
  .topbar-caption { font-size:12px; color:var(--muted); }
  .topbar-caption span:first-child { margin:0 12px; opacity:.5; }
  .topbar-caption span:last-child { color:var(--ink); }
  .topbar-tools { display:flex; align-items:center; gap:13px; }
  .user-name { font-size:12px; font-weight:600; max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .page { width:100%; max-width:1600px; margin:0 auto; padding:34px 32px; flex:1; }
  .page-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:26px; }
  .page-heading .eyebrow { margin-bottom:8px; }
  .page-heading p { margin-top:8px; font-size:13px; max-width:700px; }
  .page-actions { display:flex; gap:9px; flex-wrap:wrap; flex:none; }
  .page-content { display:grid; gap:20px; }
  .workspace-footer { padding:16px 32px 20px; font-size:11px; color:var(--muted); }
  .search-toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:18px; }
  .search-label { position:relative; width:330px; }
  .search-label span { position:absolute; top:12px; left:13px; color:var(--muted); font-size:12px; font-weight:400; }
  .search-label input { padding-left:49px; min-height:41px; }
  .search-toolbar p { font-size:12px; }
  .auth-view { min-height:100vh; display:grid; grid-template-columns:minmax(330px,.95fr) minmax(470px,1.05fr); background-color:var(--bg); background-image:radial-gradient(var(--line) .8px,transparent .8px); background-size:18px 18px; }
  .auth-story { display:flex; flex-direction:column; padding:45px 10%; }
  .auth-story-copy { margin:auto 0; padding:70px 0; }
  .auth-story-copy h1 { font-size:clamp(36px,4vw,61px); line-height:1.1; letter-spacing:-.05em; font-weight:600; margin:22px 0; }
  .auth-story-copy p { max-width:340px; color:var(--muted); font-size:16px; line-height:1.7; }
  .auth-flow { display:grid; gap:10px; margin-top:38px; }
  .auth-flow span { display:flex; align-items:center; gap:13px; color:var(--muted); font-size:11px; }
  .auth-flow b { font-size:12px; color:var(--ink); font-weight:500; }
  .auth-foot { font-size:11px; color:var(--muted); }
  .auth-form-area { display:grid; place-items:center; padding:42px; }
  .auth-card { width:100%; max-width:450px; padding:36px; background:var(--surface); border:1px solid var(--line); border-radius:22px; box-shadow:var(--shadow); }
  .auth-card h2 { font-size:25px; margin:12px 0 10px; }
  .auth-card > p { font-size:13px; }
  .auth-card form { display:grid; gap:18px; margin-top:27px; }
  .auth-card .button { margin-top:4px; min-height:45px; }
  .auth-card-note { color:var(--muted); padding-top:22px; margin-top:23px; border-top:1px solid var(--line); line-height:1.6; }
}
@layer components {
  .stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
  .stat { position:relative; overflow:hidden; padding:22px; border-radius:14px; background:var(--surface); border:1px solid var(--line); }
  .stat > span { color:var(--muted); font-size:12px; }
  .stat strong { display:block; font-size:33px; font-weight:600; letter-spacing:-.04em; margin:9px 0 7px; }
  .stat small { color:var(--muted); font-size:11px; }
  .stat::after { content:""; width:100px; height:100px; border:14px double currentColor; border-radius:50%; position:absolute; right:-38px; bottom:-40px; opacity:.055; pointer-events:none; }
  .stat:nth-child(2)::after { border-radius:20px; transform:rotate(-25deg); }
  .stat:nth-child(3)::after { width:140px; height:70px; border-radius:45%; }
  .stat:nth-child(4)::after { width:70px; border-radius:8px; border-style:solid; transform:rotate(25deg); }
  .panel { border:1px solid var(--line); border-radius:14px; background:var(--surface); overflow:hidden; }
  .panel-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:21px 22px; border-bottom:1px solid var(--line); }
  .panel-heading p { color:var(--muted); font-size:12px; margin-top:4px; }
  .split-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(280px,.7fr); gap:20px; }
  .quick-steps { display:grid; padding:8px 22px; }
  .quick-step { display:flex; align-items:center; gap:15px; padding:18px 0; text-decoration:none; border:0; border-bottom:1px solid var(--line); background:none; color:var(--ink); text-align:left; }
  .quick-step:last-child { border-bottom:0; }
  .step-number { display:grid; place-items:center; width:32px; height:32px; border:1px solid var(--line); border-radius:9px; color:var(--muted); font-size:12px; flex:none; }
  .step-number.complete { color:var(--accent); background:var(--accent-soft); border-color:var(--accent-soft); }
  .quick-step strong { display:block; font-size:13px; font-weight:600; }
  .quick-step small { display:block; color:var(--muted); margin-top:3px; }
  .quick-step .arrow { margin-left:auto; color:var(--muted); }
  .card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:17px; }
  .plan-card { padding:23px; }
  .plan-card header { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
  .plan-card p { min-height:39px; font-size:12px; color:var(--muted); margin:10px 0 20px; }
  .plan-card footer { display:flex; justify-content:space-between; align-items:center; border-top:1px solid var(--line); padding-top:17px; margin-top:21px; color:var(--muted); font-size:12px; }
  .chips { display:flex; flex-wrap:wrap; gap:7px; }
  .chip { display:inline-flex; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:var(--surface-soft); font-size:11px; color:var(--muted); }
  .badge { display:inline-flex; align-items:center; gap:5px; border-radius:20px; padding:4px 9px; font-size:11px; font-weight:600; white-space:nowrap; background:var(--surface-soft); color:var(--muted); }
  .badge.active { color:var(--accent); background:var(--accent-soft); }
  .badge.suspended,.badge.expired { color:var(--danger); background:color-mix(in srgb,var(--danger) 9%,var(--surface)); }
  .badge.soon { color:#9a641b; background:#fff6e6; }
  .table-scroll { overflow:auto; }
  table { border-collapse:collapse; width:100%; text-align:left; font-size:13px; }
  caption { text-align:left; color:var(--muted); padding:14px 22px; font-size:12px; }
  th { background:var(--surface-soft); color:var(--muted); font-weight:500; font-size:11px; padding:12px 20px; white-space:nowrap; }
  td { padding:16px 20px; border-top:1px solid var(--line); vertical-align:middle; }
  td strong { display:block; font-size:13px; font-weight:600; }
  td small { display:block; color:var(--muted); margin-top:3px; font-size:11px; }
  tbody tr:hover { background:var(--surface-soft); }
  .row-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
  .empty { padding:47px 24px; text-align:center; display:grid; justify-items:center; gap:11px; }
  .empty p { max-width:400px; color:var(--muted); font-size:13px; }
  .empty .button { margin-top:6px; }
  .notice { border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); color:var(--muted); padding:13px 15px; font-size:12px; line-height:1.6; }
  .notice strong { color:var(--ink); }
  dialog { width:min(680px,calc(100% - 30px)); max-height:calc(100dvh - 40px); padding:0; border:1px solid var(--line); border-radius:17px; color:var(--ink); background:var(--surface); box-shadow:var(--shadow); }
  dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
  dialog > form { display:flex; flex-direction:column; min-height:0; max-height:calc(100dvh - 42px); }
  .dialog-heading,.dialog-actions { flex-shrink:0; }
  dialog::backdrop { background:#0f191844; backdrop-filter:blur(6px); }
  .dialog-heading { display:flex; justify-content:space-between; gap:20px; padding:24px 26px 18px; border-bottom:1px solid var(--line); }
  .dialog-heading h2 { font-size:21px; }
  .dialog-heading p { color:var(--muted); font-size:12px; margin-top:7px; }
  .close-button { border:0; background:var(--surface-soft); width:29px; height:29px; border-radius:7px; color:var(--muted); font-size:20px; line-height:1; flex:none; }
  .dialog-body { display:grid; gap:18px; padding:23px 26px; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
  .dialog-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; padding:17px 26px; border-top:1px solid var(--line); background:var(--surface-soft); }
  .field-grid { display:grid; grid-template-columns:1fr 1fr; gap:17px; }
  .module-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .module-option { display:flex; align-items:flex-start; gap:10px; padding:13px; border:1px solid var(--line); border-radius:10px; font-size:13px; font-weight:600; cursor:pointer; }
  .module-option:has(input:checked) { background:var(--accent-soft); border-color:color-mix(in srgb,var(--accent) 40%,var(--line)); }
  .module-option small { display:block; margin-top:4px; font-size:11px; }
  .checkbox-label { display:flex; align-items:flex-start; gap:10px; }
  .section-label { font-size:12px; font-weight:650; }
  .form-error { padding:11px 13px; border-radius:8px; color:var(--danger); background:color-mix(in srgb,var(--danger) 9%,var(--surface)); font-size:12px; }
  details { border:1px solid var(--line); border-radius:9px; padding:13px; }
  summary { cursor:pointer; color:var(--muted); font-size:12px; font-weight:600; }
  details > div { padding-top:17px; }
  .key-value { display:grid; grid-template-columns:125px minmax(0,1fr); font-size:12px; gap:12px 20px; }
  .key-value dt { color:var(--muted); }
  .key-value dd { margin:0; overflow-wrap:anywhere; }
  .mono { font:11px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap:anywhere; }
  textarea.mono { min-height:100px; }
  .notifications { position:fixed; right:24px; bottom:24px; z-index:100; display:grid; gap:10px; max-width:min(400px,calc(100vw - 32px)); }
  .toast { padding:14px 17px; background:var(--ink); color:var(--surface); border-radius:11px; box-shadow:var(--shadow); font-size:13px; }
  .toast.error { background:var(--danger); color:white; }
}
@layer responsive {
  @media(min-width:1600px) { .page { padding-top:42px; } }
  @media(max-width:1100px) { .workspace { grid-template-columns:190px minmax(0,1fr); } .page { padding:26px 23px; } .topbar { padding:0 23px; } .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .split-grid { grid-template-columns:1fr; } .auth-story { padding:36px 10%; } .auth-form-area { padding:30px; } .auth-story-copy h1 { font-size:43px; } }
  @media(max-width:760px) { .workspace { display:block; } .sidebar { position:relative; height:auto; padding:16px; border-right:0; border-bottom:1px solid var(--line); } .sidebar .brand { padding:0; } .sidebar-label,.sidebar-note { display:none; } .sidebar nav { display:flex; overflow:auto; margin:17px -4px -3px; gap:4px; } .nav-button { width:auto; flex:none; padding:10px; font-size:12px; gap:7px; } .nav-button svg { width:17px; height:17px; } .topbar { min-height:52px; padding:0 17px; } .topbar-caption { font-size:11px; } .topbar-caption span:first-child { margin:0 6px; } .topbar-tools { gap:7px; } .user-name { display:none; } .page { padding:24px 16px; } .page-heading { display:block; margin-bottom:22px; } .page-heading h1 { font-size:26px; } .page-actions { margin-top:18px; } .stats-grid { gap:10px; } .stat { padding:18px 16px; } .stat strong { font-size:29px; } .card-grid { grid-template-columns:1fr; } .search-toolbar { display:block; } .search-label { width:100%; } .search-toolbar p { margin-top:9px; } th,td { padding-left:16px; padding-right:16px; } .row-actions { min-width:180px; } .workspace-footer { padding:8px 17px 20px; } .auth-view { display:block; } .auth-story { padding:27px 25px 8px; } .auth-story-copy,.auth-foot { display:none; } .auth-form-area { padding:22px 16px 40px; min-height:calc(100dvh - 80px); align-content:center; } .auth-card { padding:27px; } }
  @media(max-width:440px) { .dialog-heading { padding:20px; } .dialog-body { padding:20px; } .dialog-actions { padding:15px 20px; } .field-grid,.module-grid { grid-template-columns:1fr; } .module-option { padding:12px; } .key-value { grid-template-columns:1fr; gap:4px; } .key-value dd { margin-bottom:10px; } .stat > span { font-size:11px; } .stat small { font-size:10px; } .topbar-caption { max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .notifications { right:16px; bottom:16px; } }
  @media(prefers-reduced-motion:no-preference) { button,a { transition:background .15s,color .15s,border-color .15s; } dialog[open] { animation:appear .16s ease-out; } @keyframes appear { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } } }
}
