/* =========================================================================
   SK LABS — design system
   Black & white with electric-blue accent. Orbitron (brand) + Space Grotesk.
   ========================================================================= */
:root {
  --bg: #050608;
  --bg-2: #0a0c11;
  --surface: #0e1117;
  --surface-2: #141822;
  --line: #1d2230;
  --line-2: #2a3142;
  --text: #f3f5f9;
  --muted: #8b94a8;
  --faint: #5b6477;
  --blue: #2f6bff;
  --blue-2: #5b8cff;
  --blue-soft: rgba(47, 107, 255, .14);
  --blue-glow: rgba(47, 107, 255, .45);
  --ok: #19c37d;
  --warn: #ffb020;
  --danger: #ff4d5e;
  --radius: 14px;
  --radius-sm: 9px;
  --font-brand: "Orbitron", "Space Grotesk", system-ui, sans-serif;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
::selection { background: var(--blue); color: #fff; }
[x-cloak] { display: none !important; }
code, pre, .mono { font-family: var(--mono); font-size: .86em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand svg { height: 30px; width: auto; color: var(--text); }
.brand-word { font-family: var(--font-brand); font-weight: 700; letter-spacing: .18em; font-size: 15px; }
.brand-word b { color: var(--blue); font-weight: 700; }
.tag { font-family: var(--font); font-weight: 500; text-transform: uppercase; letter-spacing: .22em; font-size: 12px; color: var(--muted); }
.display { font-family: var(--font-brand); font-weight: 700; letter-spacing: .08em; line-height: 1.08; margin: 0; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { border-color: #3a4358; background: #192030; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 0 var(--blue-glow); }
.btn-primary:hover { background: #3d77ff; border-color: #3d77ff; box-shadow: 0 6px 24px -6px var(--blue-glow); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-danger { background: transparent; border-color: rgba(255,77,94,.35); color: #ff7b88; }
.btn-danger:hover { background: rgba(255,77,94,.12); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.hint { font-size: 12px; color: var(--faint); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2);
  font: 14px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input-sm { height: 32px; font-size: 13px; padding: 0 9px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.input.mono { font-family: var(--mono); font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.err { color: #ff7b88; font-size: 12px; }

/* ---------- layout helpers ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ---------- cards / chips ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--muted); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-live { color: var(--ok); border-color: rgba(25,195,125,.3); }
.chip-beta { color: var(--blue-2); border-color: rgba(91,140,255,.35); }
.chip-soon { color: var(--warn); border-color: rgba(255,176,32,.3); }
.chip-hidden { color: var(--faint); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.pill-blue { color: var(--blue-2); border-color: rgba(47,107,255,.3); background: var(--blue-soft); }

/* ---------- alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-ok { border-color: rgba(25,195,125,.35); background: rgba(25,195,125,.08); color: #8ff0c4; }
.alert-err { border-color: rgba(255,77,94,.4); background: rgba(255,77,94,.08); color: #ffb3bb; }
.alert-info { border-color: rgba(47,107,255,.35); background: var(--blue-soft); color: #c5d6ff; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-2); position: sticky; top: 0; }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data tr:hover td { background: rgba(255,255,255,.015); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.null { color: var(--faint); font-style: italic; font-size: 12px; }
.sort-link { display: inline-flex; gap: 4px; align-items: center; }
.sort-link:hover { color: var(--text); }

/* ---------- pagination ---------- */
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager a, .pager span { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager a:hover { border-color: var(--line-2); color: var(--text); }
.pager .active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pager .disabled { opacity: .4; }

/* =========================================================================
   PUBLIC SITE
   ========================================================================= */
.site-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 78% -10%, rgba(47,107,255,.20), transparent 60%),
    radial-gradient(700px 400px at -10% 30%, rgba(47,107,255,.08), transparent 60%),
    linear-gradient(var(--bg), var(--bg));
}
.site-bg::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at 60% 0%, #000 20%, transparent 70%);
}
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(5,6,8,.72); border-bottom: 1px solid rgba(255,255,255,.05); }
.nav .container { height: 68px; display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.04); }

.hero { padding: 96px 0 72px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6.4vw, 78px); }
.hero h1 span { color: var(--blue); text-shadow: 0 0 40px var(--blue-glow); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; margin: 24px 0 32px; }
.hero-mark { position: relative; justify-self: center; width: min(360px, 80%); aspect-ratio: 344/432; }
.hero-mark svg { width: 100%; height: 100%; color: #fff; filter: drop-shadow(0 0 60px rgba(47,107,255,.35)); position: relative; }
.hero-mark::before { content: ""; position: absolute; inset: -12% -18%; border-radius: 50%; background: radial-gradient(closest-side, rgba(47,107,255,.25), transparent); }
.hero-stats { display: flex; gap: 36px; margin-top: 44px; }
.hero-stats div { display: grid; gap: 2px; }
.hero-stats b { font: 700 26px var(--font-brand); letter-spacing: .06em; }

.section { padding: 80px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--blue); }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.app-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; min-height: 250px; }
.app-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 160px; height: 160px; background: radial-gradient(closest-side, var(--accent, var(--blue)), transparent); opacity: .16; transition: opacity .2s; }
.app-card:hover { border-color: color-mix(in srgb, var(--accent, var(--blue)) 55%, var(--line)); transform: translateY(-3px); box-shadow: 0 18px 48px -24px var(--accent, var(--blue)); }
.app-card:hover::after { opacity: .3; }
.app-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--blue)) 16%, transparent); color: var(--accent, var(--blue)); border: 1px solid color-mix(in srgb, var(--accent, var(--blue)) 35%, transparent); }
.app-icon svg { width: 24px; height: 24px; }
.app-card h3 { margin: 0; font: 700 18px var(--font-brand); letter-spacing: .06em; }
.app-card .sub { font: 12px var(--mono); color: var(--muted); }
.app-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.app-card .go { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text); }
.app-card .go svg { width: 15px; height: 15px; transition: transform .2s; }
.app-card:hover .go svg { transform: translateX(3px); }

.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.about-text p { color: var(--muted); font-size: 16px; margin: 0 0 16px; }
.feature-list { display: grid; gap: 14px; }
.feature { display: flex; gap: 16px; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.feature .n { font: 700 13px var(--font-brand); color: var(--blue); letter-spacing: .1em; padding-top: 2px; }
.feature h4 { margin: 0 0 4px; font-size: 15px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.cta { border-radius: 24px; padding: 56px; text-align: center; border: 1px solid rgba(47,107,255,.3); background: radial-gradient(600px 240px at 50% 0%, rgba(47,107,255,.25), transparent), var(--surface); }
.footer { border-top: 1px solid var(--line); padding: 32px 0; margin-top: 40px; }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 16px; }

/* =========================================================================
   ADMIN
   ========================================================================= */
.admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg-2); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; }
.side .brand { padding: 4px 8px 0; }
.side-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); padding: 0 10px; margin-bottom: 6px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-size: 14px; }
.side-nav a svg { width: 17px; height: 17px; flex: none; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.on { background: var(--blue-soft); color: #fff; }
.side-nav a.on svg { color: var(--blue-2); }
.side-nav .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; margin: 0 4px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(5,6,8,.82); backdrop-filter: blur(12px); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.crumbs b { color: var(--text); font-weight: 500; }
.page { padding: 28px; display: grid; gap: 20px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font: 700 22px var(--font-brand); letter-spacing: .06em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.menu-btn { display: none; }

.stat { padding: 18px 20px; }
.stat .label { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
.stat b { display: block; font: 700 28px var(--font-brand); letter-spacing: .04em; margin-top: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--blue); }
.tabs svg { width: 15px; height: 15px; }

.designer-row { display: grid; grid-template-columns: 1.4fr 1.2fr .7fr 1fr auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); }
.designer-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; padding-top: 4px; }
.designer-opts .check { font-size: 13px; color: var(--muted); }

.code { background: #07090d; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; overflow-x: auto; font: 12.5px/1.65 var(--mono); color: #cdd6ea; white-space: pre; }
.code .k { color: var(--blue-2); }
.sql-editor { min-height: 180px; font: 13px/1.6 var(--mono) !important; tab-size: 2; }
.qb-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg-2); display: grid; gap: 10px; }
.qb-block > .row-between h4 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.qb-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qb-line .input { width: auto; flex: 1 1 140px; min-width: 110px; }
.qb-line .w-sm { flex: 0 0 96px; min-width: 96px; }
.qb-line .w-md { flex: 0 0 140px; min-width: 120px; }
.kbd { font: 11px var(--mono); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--muted); }

.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.66); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-mark { order: -1; width: 160px; justify-self: start; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .menu-btn { display: inline-flex; }
  .page { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .designer-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
  .hero-stats { gap: 22px; }
  .section { padding: 56px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .cta { padding: 36px 20px; }
}
