/* Kit — landing, app shell and admin styles */
:root {
  --bg: #0b1120; --bg2: #0f172a; --card: #16213a; --card2: #1e293b;
  --text: #e2e8f0; --muted: #94a3b8; --line: #26334d;
  --accent: #0ea5e9; --accent2: #38bdf8; --green: #4ade80; --pink: #f472b6;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }
button { font: inherit; cursor: pointer; }

/* nav */
.nav { display: flex; align-items: center; gap: 20px; padding: 14px 28px; position: sticky; top: 0; background: rgba(11,17,32,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); z-index: 50; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-sub { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.nav-links { display: flex; gap: 18px; margin-left: 12px; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta { margin-left: auto; display: flex; gap: 10px; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 14px; transition: transform .06s ease, background .15s ease; }
.btn:hover { background: #243350; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121f; }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.big { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; }

/* hero */
.hero { max-width: 900px; margin: 0 auto; padding: 84px 24px 40px; text-align: center; }
.eyebrow { color: var(--accent2); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); margin: 14px 0 18px; font-weight: 800; }
.accent { color: var(--accent2); }
.lede { font-size: 18px; color: var(--muted); max-width: 680px; margin: 0 auto 30px; }
.lede strong { color: var(--text); }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { color: var(--muted); font-size: 13px; margin-top: 14px; }
.trust-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 0; margin: 30px 0 0; }
.trust-chips li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--muted); }

/* stats */
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 26px 20px; border-block: 1px solid var(--line); background: var(--bg2); }
.stats div { text-align: center; min-width: 130px; }
.stats strong { display: block; font-size: 30px; color: var(--accent2); }
.stats span { color: var(--muted); font-size: 13px; }

/* sections */
.section { max-width: 1100px; margin: 0 auto; padding: 64px 24px 8px; }
.section h2 { font-size: 30px; margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 26px; max-width: 720px; }

/* app grid */
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cat-filter button { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 6px 13px; font-size: 13px; }
.cat-filter button.active { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 700; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.app-card { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; align-items: flex-start; }
.app-card img { flex: none; border-radius: 10px; }
.app-card h3 { margin: 0 0 3px; font-size: 15px; }
.app-card p { margin: 0; font-size: 12.5px; color: var(--muted); }
.badges { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; border-radius: 6px; padding: 2px 7px; letter-spacing: .04em; }
.badge.free { background: rgba(74,222,128,.15); color: var(--green); }
.badge.plus { background: rgba(56,189,248,.15); color: var(--accent2); }
.badge.pro { background: rgba(244,114,182,.15); color: var(--pink); }
.badge.status { background: rgba(148,163,184,.12); color: var(--muted); }
.badge.live { background: rgba(74,222,128,.15); color: var(--green); }

/* featured */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { margin: 12px 0 6px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* pricing */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; align-items: stretch; }
.price-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; }
.price-card.popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pop-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #04121f; font-size: 11px; font-weight: 800; padding: 3px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.price-card h3 { margin: 0; font-size: 20px; }
.price { font-size: 34px; font-weight: 800; margin: 8px 0 14px; }
.price span { font-size: 14px; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.price-card li { padding: 5px 0 5px 24px; position: relative; font-size: 14px; color: var(--text); }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.price-card li.cap { color: var(--muted); font-size: 12.5px; }
.fine { color: var(--muted); font-size: 12.5px; max-width: 860px; margin-top: 18px; }

/* security */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sec-grid > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.sec-grid h3 { margin: 0 0 8px; font-size: 16px; }
.sec-grid p { margin: 0; color: var(--muted); font-size: 14px; }

/* faq */
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 2px; font-size: 14.5px; }

/* final cta + footer */
.final-cta { text-align: center; padding: 80px 24px; margin-top: 60px; background: linear-gradient(180deg, var(--bg) 0%, #0c1a30 100%); border-top: 1px solid var(--line); }
.final-cta h2 { font-size: clamp(24px, 4vw, 36px); max-width: 640px; margin: 0 auto 26px; }
.footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 26px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer p { margin: 0; }

/* modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,6,17,.75); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 30px; width: 100%; max-width: 420px; }
.modal h3 { margin: 0 0 6px; }
.modal-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 24px; line-height: 1; }
.modal label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.modal input { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
.modal input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.hint { color: var(--muted); font-size: 12px; margin: 2px 0 12px; }
.form-error { color: #f87171; font-size: 13px; margin: 0 0 12px; }
.switch { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0 0; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line); color: var(--text); padding: 12px 20px; border-radius: 12px; z-index: 200; max-width: 90vw; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast[hidden] { display: none; }

/* ---- app shell ---- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; }
.side .brand { margin-bottom: 16px; }
.side-user { font-size: 12.5px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; word-break: break-all; }
.side-user .tier-tag { display: inline-block; margin-top: 4px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; color: var(--muted); font-size: 13.5px; }
.side nav a img { border-radius: 7px; }
.side nav a:hover { background: var(--card); color: var(--text); text-decoration: none; }
.side nav a.active { background: var(--card2); color: var(--text); font-weight: 600; }
.side nav a.locked { opacity: .55; }
.side-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 14px 0 4px 9px; font-weight: 700; }
.workspace { padding: 26px 30px; max-width: 980px; }
.workspace h1 { font-size: 24px; margin: 0 0 4px; display: flex; align-items: center; gap: 12px; }
.workspace .app-blurb { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
textarea, input[type=text], input[type=number], input[type=email], input[type=password], select { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; width: 100%; }
textarea { min-height: 130px; resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
label.field { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
label.field input, label.field select, label.field textarea { margin-top: 5px; }
.out { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; min-height: 44px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: ui-monospace, Consolas, monospace; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); color: var(--text); }
.diff-view { font-family: ui-monospace, Consolas, monospace; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 420px; }
.diff-line { padding: 1px 10px; white-space: pre-wrap; }
.diff-add { background: rgba(74,222,128,.12); color: #86efac; }
.diff-del { background: rgba(248,113,113,.12); color: #fca5a5; }
.diff-ctx { color: var(--muted); }
.locked-note { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; text-align: center; }
.locked-note img { margin-bottom: 10px; }
.locked-note h2 { margin: 6px 0; }
.locked-note p { color: var(--muted); max-width: 460px; margin: 8px auto 18px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.home-card { display: flex; gap: 11px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px; color: var(--text); }
.home-card:hover { background: var(--card2); text-decoration: none; }
.home-card img { border-radius: 9px; }
.home-card strong { font-size: 14px; display: block; }
.home-card span { font-size: 11.5px; color: var(--muted); }

/* admin */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td select, td input { width: auto; padding: 5px 8px; font-size: 13px; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; }
.pill.admin { background: rgba(244,114,182,.18); color: var(--pink); }
.pill.user { background: rgba(148,163,184,.15); color: var(--muted); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { border-right: none; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .workspace { padding: 20px 16px; }
}
