/* Sculops design system — corporate, calm, high-contrast. No external fonts or libraries. */
:root {
  --navy-900: #1E3A8A;
  --navy-800: #2A4DA0;
  --navy-700: #3B5BB5;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --gray-50:  #F8FAFC;
  --white:    #FFFFFF;
  --accent:   #2563EB;
  --accent-600: #1D4ED8;
  --ok: #15803D;   --ok-bg: #DCFCE7;
  --warn: #B45309; --warn-bg: #FEF3C7;
  --bad: #B91C1C;  --bad-bg: #FEE2E2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--navy-900); background: var(--white); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--slate-500); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; font-size: .95rem;
  padding: .65rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy-900); color: var(--white); }
.btn-primary:hover { background: var(--navy-800); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-600); }
.btn-ghost { background: var(--white); color: var(--navy-900); border-color: var(--slate-300); }
.btn-ghost:hover { background: var(--gray-50); border-color: var(--slate-500); }
.btn-sm { padding: .4rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* Forms */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--navy-700); }
.input, select.input, textarea.input { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--slate-300); border-radius: var(--radius-sm); background: var(--white); color: var(--navy-900); }
.input:focus { border-color: var(--accent); outline: 2px solid rgba(37,99,235,.2); }
.hint { font-size: .8rem; color: var(--slate-500); }
.hint.ok { color: var(--ok); } .hint.bad { color: var(--bad); }
.alert { padding: .7rem .9rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1rem; }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }

/* Cards, tables, badges */
.card { background: var(--gray-50); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card h3 { font-size: 1rem; margin-bottom: .75rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
td { padding: .6rem; border-bottom: 1px solid var(--slate-200); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-neutral { background: var(--slate-200); color: var(--navy-700); }
.empty { padding: 1.5rem; text-align: center; color: var(--slate-500); font-size: .9rem; }

/* ===== Landing page ===== */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--slate-200); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; color: var(--navy-900); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--navy-900); display: grid; place-items: center; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a.link { color: var(--navy-700); font-weight: 500; font-size: .95rem; }
.hero { background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%); color: var(--white); padding: 5rem 0 6rem; }
.hero .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.hero p.lead { color: var(--slate-300); font-size: 1.15rem; max-width: 34em; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero .btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.35); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.08); }
.hero .btn-primary { background: var(--white); color: var(--navy-900); }
.hero .btn-primary:hover { background: var(--slate-100); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--slate-300); margin-bottom: 1rem; }
.mock { background: var(--white); color: var(--navy-900); border-radius: 14px; padding: 1rem; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.mock .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .8rem; }
.mock .kpi { background: var(--gray-50); border: 1px solid var(--slate-200); border-radius: 8px; padding: .6rem; }
.mock .kpi b { display: block; font-size: 1.05rem; } .mock .kpi span { font-size: .7rem; color: var(--slate-500); }
.section { padding: 4.5rem 0; }
.section.alt { background: var(--gray-50); border-block: 1px solid var(--slate-200); }
.section h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section .sub { color: var(--slate-600); max-width: 42em; margin-bottom: 2.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.4rem; }
.feature .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--navy-900); display: grid; place-items: center; margin-bottom: .9rem; }
.feature h3 { font-size: 1.05rem; } .feature p { color: var(--slate-600); font-size: .93rem; margin: 0; }
.scope-note { display: flex; gap: .75rem; align-items: flex-start; background: var(--white); border: 1px dashed var(--slate-300); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1.5rem; color: var(--slate-600); font-size: .92rem; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.step { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.4rem; }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy-900); color: var(--white); font-weight: 700; font-size: .85rem; margin-bottom: .8rem; }
.domain { font-family: var(--mono); background: var(--navy-900); color: var(--white); padding: .15rem .5rem; border-radius: 4px; font-size: .88em; }
.price-card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--navy-900); box-shadow: var(--shadow); }
.price { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; margin: .4rem 0; }
.price small { font-size: .9rem; font-weight: 500; color: var(--slate-500); }
.price-card ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; flex: 1; }
.price-card li { padding: .35rem 0 .35rem 1.6rem; position: relative; font-size: .92rem; color: var(--navy-700); }
.price-card li::before { content: ""; position: absolute; left: 0; top: .72rem; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.signup { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; align-items: start; }
.slug-row { display: flex; align-items: stretch; }
.slug-row .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.slug-suffix { display: grid; place-items: center; padding: 0 .8rem; background: var(--slate-100); border: 1px solid var(--slate-300); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--slate-600); font-size: .9rem; white-space: nowrap; }
.footer { background: var(--navy-900); color: var(--slate-300); padding: 2.5rem 0; font-size: .9rem; }
.footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ===== Auth pages ===== */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(160deg, var(--navy-900), var(--navy-800)); color: var(--white); padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-size: 1.8rem; max-width: 14em; }
.auth-side p { color: var(--slate-300); max-width: 28em; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 1.6rem; }
.otp-row { display: flex; gap: .5rem; justify-content: space-between; margin: .5rem 0 1rem; }
.otp-row input { width: 100%; max-width: 54px; height: 58px; text-align: center; font-size: 1.5rem; font-weight: 700; border: 1px solid var(--slate-300); border-radius: var(--radius-sm); font-family: var(--mono); }
.otp-row input:focus { border-color: var(--accent); outline: 2px solid rgba(37,99,235,.2); }
.tenant-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--slate-100); border: 1px solid var(--slate-200); border-radius: 999px; padding: .25rem .75rem; font-size: .8rem; color: var(--navy-700); margin-bottom: 1.25rem; }

/* ===== App shell / dashboard ===== */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: var(--gray-50); }
.sidebar { background: var(--navy-900); color: var(--slate-300); padding: 1.1rem .8rem; display: flex; flex-direction: column; gap: .25rem; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: var(--white); padding: .3rem .6rem 1.2rem; }
.sidebar .brand-mark { background: var(--white); }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: var(--radius-sm); color: var(--slate-300); font-weight: 500; font-size: .93rem; background: none; border: 0; font-family: inherit; text-align: left; cursor: pointer; width: 100%; }
.side-link:hover { background: rgba(255,255,255,.06); color: var(--white); text-decoration: none; }
.side-link.active { background: var(--navy-800); color: var(--white); }
.side-foot { margin-top: auto; padding: .75rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; }
.main { min-width: 0; }
.topbar { background: var(--white); border-bottom: 1px solid var(--slate-200); padding: .85rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 1.2rem; margin: 0; }
.topbar .who { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-900); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.menu-btn { display: none; }
.content { padding: 1.5rem; display: grid; gap: 1.25rem; }
.quick { display: flex; gap: .6rem; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.kpi-card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.kpi-card .label { font-size: .8rem; color: var(--slate-500); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card .value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin-top: .2rem; }
.kpi-card .sub { font-size: .8rem; color: var(--slate-500); }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; }
.panel { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; gap: .75rem; }
.panel-head h3 { margin: 0; font-size: 1rem; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--slate-600); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; }
.bar-list { display: grid; gap: .65rem; }
.bar-item .top { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .2rem; }
.bar-track { height: 8px; background: var(--slate-200); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy-800); border-radius: 999px; }
.skeleton { background: linear-gradient(90deg, var(--slate-200), var(--slate-100), var(--slate-200)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; min-height: 1.2em; }
@keyframes sk { to { background-position: -200% 0; } }

/* Dialog */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(520px, calc(100% - 2rem)); box-shadow: 0 25px 60px rgba(15,23,42,.35); }
dialog::backdrop { background: rgba(15,23,42,.55); }
.dlg-head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--slate-200); display: flex; justify-content: space-between; align-items: center; }
.dlg-head h3 { margin: 0; }
.dlg-body { padding: 1.2rem 1.4rem; max-height: 70vh; overflow: auto; }
.dlg-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--slate-200); display: flex; justify-content: flex-end; gap: .6rem; background: var(--gray-50); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.toast { position: fixed; bottom: 1.25rem; right: 1.25rem; background: var(--navy-900); color: var(--white); padding: .75rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 100; font-size: .9rem; max-width: 360px; }
.toast.bad { background: var(--bad); }

/* Responsive */
@media (max-width: 980px) {
  .hero .grid, .signup, .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .grid-3, .steps { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 50; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .nav-links .link { display: none; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .hero { padding: 3rem 0 4rem; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
