/* ============================================================
   Vastavik Control Panel — demo theme (LIGHT, matches vastavik.org
   + creators portal): white cards on light-grey, black text, red
   #DC2323 accent, black primary buttons, Caviar Dreams headings,
   Product Sans body.
   ============================================================ */

@font-face { font-family: "Caviar Dreams"; src: url("fonts/CaviarDreams.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Caviar Dreams"; src: url("fonts/CaviarDreams-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Product Sans"; src: url("fonts/ProductSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Product Sans"; src: url("fonts/ProductSans-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Product Sans"; src: url("fonts/ProductSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --red: #DC2323;
  --red-soft: #FDECEC;
  --red-line: #F3C9C9;
  --green: #1E8E5A;
  --green-soft: #E6F4ED;
  --amber: #B9792A;
  --amber-soft: #FBF1E3;
  --ink: #1A1A1A;
  --ink-2: #333333;
  --muted: #6B7280;
  --faint: #9AA0A6;
  --page: #F4F5F7;
  --card: #FFFFFF;
  --tint: #F7F8FA;
  --line: #E6E7EB;
  --line-2: #DADCE0;
  --black: #141414;
  --head: "Caviar Dreams", "Product Sans", sans-serif;
  --body: "Product Sans", -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--ink); font-family: var(--body); font-size: 14px; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: var(--head); font-weight: 700; margin: 0; letter-spacing: .2px; }
a { color: inherit; text-decoration: none; }
button, input, select { font-family: var(--body); }
button { cursor: pointer; }
::selection { background: var(--red-soft); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 500; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; }
.btn.primary { background: var(--black); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.primary[disabled] { background: #9CA0A6; cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--tint); }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { background: #c01d1d; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- Auth (login / register) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 40px -24px rgba(16,24,40,.35); padding: 34px 34px 28px; }
.wordmark { font-family: var(--head); font-weight: 700; font-size: 28px; letter-spacing: 3px; text-align: center; }
.auth-card h2 { text-align: center; font-size: 26px; margin-top: 6px; }
.auth-card .lead { text-align: center; color: var(--muted); font-size: 13.5px; margin: 8px 0 20px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.field .req { color: var(--red); }
.field input, .field select { width: 100%; background: #fff; border: 1px solid var(--line-2); border-radius: 9px; padding: 11px 12px; font-size: 14px; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--ink); }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-foot a { color: var(--green); font-weight: 500; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--muted); margin: 4px 0 18px; }
.check input { margin-top: 2px; }
.check a { color: var(--ink); text-decoration: underline; }

/* account-type choice */
.acct-types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.acct { border: 1.5px solid var(--line-2); border-radius: 12px; padding: 14px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.acct.sel { border-color: var(--red); background: var(--red-soft); }
.acct .at-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--tint); display: grid; place-items: center; margin-bottom: 9px; color: var(--ink); }
.acct.sel .at-ico { background: #fff; color: var(--red); }
.acct .at-ico svg { width: 18px; height: 18px; stroke: currentColor; }
.acct .at-name { font-weight: 600; font-size: 13.5px; }
.acct .at-desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* ---------- App shell ---------- */
#appRoot { display: none; }
#appRoot.show { display: block; }
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

.sidebar { background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--red); display: grid; place-items: center; color: #fff; font-family: var(--head); font-weight: 700; font-size: 17px; }
.brand .name { font-family: var(--head); font-weight: 700; font-size: 18px; letter-spacing: 1.5px; }
.brand .name small { display: block; font-family: var(--body); font-weight: 400; font-size: 9.5px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; margin-top: 1px; }

.nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.nav-group-label { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; margin: 2px 0; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 500; position: relative; user-select: none; }
.nav-item svg { width: 17px; height: 17px; flex: none; stroke: currentColor; }
.nav-item:hover { color: var(--ink); background: var(--tint); }
.nav-item.active { color: var(--ink); background: var(--tint); font-weight: 600; }
.nav-item.active::before { content:""; position:absolute; left:-12px; top:8px; bottom:8px; width:3px; border-radius:3px; background: var(--red); }

.side-foot { padding: 12px; border-top: 1px solid var(--line); }
.user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.user:hover { background: var(--tint); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 12.5px; }
.user .u-name { font-size: 13px; font-weight: 500; }
.user .u-sub { font-size: 11px; color: var(--muted); }

/* ---------- Main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .page-title { font-family: var(--head); font-weight: 700; font-size: 18px; }
.topbar .spacer { flex: 1; }
.switcher { display: flex; background: var(--tint); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.switcher button { border: none; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500; padding: 6px 13px; border-radius: 7px; }
.switcher button.on { background: var(--black); color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid var(--line-2); color: var(--ink); background: #fff; }
.badge.plan { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.good { background: var(--green); } .dot.warn { background: var(--amber); } .dot.red { background: var(--red); }

.content { padding: 28px; max-width: 1180px; width: 100%; }
.view { display: none; animation: fade .25s ease; }
.view.show { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity:1; transform:none;} }

.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 24px; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.pad-lg { padding: 24px; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 12.5px; }

.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat .num { font-family: var(--head); font-weight: 700; font-size: 32px; margin-top: 8px; color: var(--ink); }
.stat .delta { font-size: 12px; margin-top: 6px; }
.delta.up { color: var(--green); } .delta.flat { color: var(--muted); }

.meter { height: 9px; background: #ECEEF1; border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.meter > span { display: block; height: 100%; background: var(--red); border-radius: 999px; }
.meter-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 10px 12px; }
.table td { padding: 13px 10px; border-top: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--muted); }
.pill { display:inline-flex; align-items:center; gap:6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.muted { background: var(--tint); color: var(--muted); }

.result { display:flex; gap:16px; align-items:flex-start; }
.result .verdict { width: 56px; height: 56px; border-radius: 14px; display:grid; place-items:center; flex:none; }
.result .verdict.ok { background: var(--green-soft); color: var(--green); }
.kv { display:grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13px; margin-top: 10px; }
.kv .k { color: var(--muted); }

.drop { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); background: var(--tint); }
.drop strong { color: var(--ink); font-weight: 500; }

.tier { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--card); position: relative; box-shadow: var(--shadow); }
.tier.sel { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), var(--shadow); }
.tier .tag { position:absolute; top:16px; right:16px; }
.tier h4 { font-size: 15.5px; }
.tier .price { font-family: var(--head); font-weight:700; font-size: 24px; margin: 10px 0 2px; }
.tier .price small { font-family: var(--body); font-weight:400; font-size: 12px; color: var(--muted); }
.tier ul { list-style: none; padding: 0; margin: 14px 0 0; }
.tier li { font-size: 12.8px; color: var(--ink-2); padding: 5px 0 5px 20px; position: relative; }
.tier li::before { content:""; position:absolute; left:2px; top:10px; width:6px; height:6px; border-radius:50%; background: var(--red); }

.ladder { display:flex; flex-direction:column; }
.rung { display:flex; align-items:center; gap:14px; padding:13px 14px; border:1px solid var(--line); border-radius:11px; margin-bottom:8px; background: #fff; }
.rung .ix { width:30px; height:30px; border-radius:8px; background:var(--tint); display:grid; place-items:center; font-weight:700; font-size:12px; color:var(--muted); flex:none; }
.rung.cur { border-color: var(--red); background: var(--red-soft); }
.rung.cur .ix { background: var(--red); color:#fff; }
.rung .r-name { font-weight:600; font-size:13.5px; }
.rung .r-desc { font-size:12px; color:var(--muted); }
.rung .r-price { margin-left:auto; font-size:12.5px; color:var(--ink-2); }

.code { background: #0E1116; border:1px solid #0E1116; border-radius: 11px; padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 12.3px; color: #e6e6e6; overflow-x:auto; position:relative; line-height:1.6; }
.code .cp { color: #7aa2f7; } .code .cs { color: #9ece6a; } .code .cc { color: #8a8f98; }
.copy { position:absolute; top:10px; right:10px; }

.section-title { font-family: var(--head); font-weight:700; font-size: 15px; margin: 26px 0 12px; }
.row { display:flex; align-items:center; gap:12px; }
.between { display:flex; align-items:center; justify-content:space-between; }
.muted { color: var(--muted); }
.hr { height:1px; background: var(--line); margin: 18px 0; border:0; }
.list-row { display:flex; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.list-row:first-child { border-top:0; }
.ico-badge { width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:var(--tint);flex:none;color:var(--muted); }
.ico-badge svg{width:17px;height:17px;stroke:currentColor;}

.enterprise-only { display: none; }
body[data-ws="enterprise"] .enterprise-only:not(.view):not(.nav-item) { display: block; }
body[data-ws="enterprise"] .nav-item.enterprise-only { display: flex; }

.notice { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:11px; background: var(--red-soft); border:1px solid var(--red-line); font-size:12.8px; color: #8a1f1f; }
.notice svg{width:17px;height:17px;flex:none;stroke:currentColor;margin-top:1px;}

/* onboarding */
.ob-steps { display:flex; gap:8px; margin: 2px 0 22px; }
.ob-dot { height:5px; flex:1; border-radius:3px; background: var(--line); }
.ob-dot.on { background: var(--red); }

@media (max-width: 1000px){ .g-3{grid-template-columns:1fr 1fr;} }
@media (max-width: 860px){
  .app{grid-template-columns:1fr;} .sidebar{display:none;}
  .g-3,.g-2,.two-col,.acct-types{grid-template-columns:1fr;} .content{padding:18px;}
}
