/* Hybridpod Mission Control — light, futuristic, restrained. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-var-latin.woff2') format('woff2');
  font-weight: 300 700; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var-latin.woff2') format('woff2');
  font-weight: 100 900; font-display: swap;
}

:root {
  --bg: #f7f9fc; --surface: #fff; --ink: #0a1020; --muted: #5a6478;
  --accent: #2962ff; --accent-2: #00c2ff; --accent-deep: #1e4fe0;
  --accent-rgb: 41, 98, 255;
  --hairline: rgba(10, 16, 32, 0.08);
  --shadow: 0 1px 2px rgba(10, 16, 32, 0.04), 0 12px 40px rgba(10, 16, 32, 0.06);
  --ok: #0e9f6e; --bad: #e5484d; --warn: #d97706;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--ink);
  font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Space Grotesk', system-ui, sans-serif; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---- buttons / pills ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 14px; padding: 10px 20px; border-radius: 999px; border: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn--primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.3); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px rgba(10, 16, 32, 0.2); }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--danger { background: var(--bad); color: #fff; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--muted);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill--ok .dot { background: var(--ok); animation: pulse 2.2s infinite; }
.pill--bad .dot { background: var(--bad); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---- shell layout ---- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: #fff; border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; padding: 22px 14px; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}
.side__brand { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk'; font-weight: 600; font-size: 15px; padding: 0 8px; }
.side__nav { display: grid; gap: 4px; }
.side__nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  font-weight: 500; font-size: 14px; color: var(--muted); transition: background 0.15s, color 0.15s;
}
.side__nav a .ico { width: 18px; text-align: center; opacity: 0.8; }
.side__nav a:hover { background: rgba(10, 16, 32, 0.04); color: var(--ink); }
.side__nav a.active { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.side__foot { margin-top: auto; padding: 0 8px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px 0;
}
.top h1 { font-size: 26px; }
.view { padding: 24px 32px 48px; display: grid; gap: 18px; align-content: start; animation: viewin 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes viewin { from { opacity: 0; transform: translateY(10px); } }

/* ---- cards / grids ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border-radius: 18px; padding: 22px;
  box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow);
}
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.card .big { font-family: 'Space Grotesk'; font-size: 26px; font-weight: 700; }
.card .sub { color: var(--muted); font-size: 13px; }
.kv { display: grid; gap: 7px; font-size: 13.5px; }
.kv div { display: flex; justify-content: space-between; gap: 14px; }
.kv span:first-child { color: var(--muted); }
.kv .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- theme studio ---- */
.themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.theme-card {
  border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}
.theme-card:hover { transform: translateY(-3px); }
.theme-card.applied { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.theme-card__preview { height: 110px; position: relative; padding: 14px; }
.theme-card__preview .tp-title { height: 10px; width: 55%; border-radius: 5px; margin-bottom: 7px; }
.theme-card__preview .tp-sub { height: 7px; width: 75%; border-radius: 4px; opacity: 0.4; margin-bottom: 14px; }
.theme-card__preview .tp-btn { height: 18px; width: 64px; border-radius: 999px; }
.theme-card__preview .tp-orb { position: absolute; right: -18px; top: -18px; width: 90px; height: 90px; border-radius: 50%; opacity: 0.25; filter: blur(2px); }
.theme-card__body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.theme-card__body h3 { font-size: 14.5px; }
.theme-card__row { display: flex; gap: 8px; }
.swatches { display: flex; gap: 5px; }
.swatches i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }

.view-h2 { font-size: 18px; margin: 14px 0 -4px; }

/* mini phone preview (mobile theme cards) */
.theme-card__preview--phone { display: grid; place-items: center; background: rgba(10, 16, 32, 0.03); height: 150px; }
.mini-phone {
  width: 74px; height: 136px; border-radius: 16px; background: #0c1322; padding: 4px;
  box-shadow: 0 10px 26px rgba(10, 16, 32, 0.25);
}
.mini-phone__screen {
  background: #f7f9fc; border-radius: 12px; height: 100%; position: relative;
  padding: 6px 6px 22px; display: grid; gap: 5px; align-content: start; overflow: hidden;
}
.mp-bar { height: 9px; border-radius: 4px; margin: 0 -6px 2px; transform: translateY(-6px); border-radius: 0; opacity: 0.92; }
.mp-bubble { height: 11px; border-radius: 6px; }
.mp-bubble--user { width: 62%; justify-self: end; opacity: 0.92; }
.mp-bubble--ai { width: 78%; background: #fff; box-shadow: inset 0 0 0 1px rgba(10, 16, 32, 0.08); }
.mp-fab { position: absolute; right: 7px; bottom: 22px; width: 16px; height: 16px; border-radius: 50%; }
.mp-input { position: absolute; left: 6px; right: 28px; bottom: 6px; height: 11px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px rgba(10, 16, 32, 0.08); }

/* site-motion switch grid */
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fx-switch {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 11px 14px; border-radius: 12px; font-size: 13.5px;
  background: rgba(10, 16, 32, 0.025); box-shadow: inset 0 0 0 1px var(--hairline);
  transition: background 0.15s;
}
.fx-switch:hover { background: rgba(var(--accent-rgb), 0.06); }
.fx-switch input { accent-color: var(--accent); width: 16px; height: 16px; }

.custom-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.color-field { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.color-field input[type='color'] {
  width: 100%; height: 38px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

/* ---- logs ---- */
.logbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
select, input[type='text'], textarea {
  font: inherit; color: var(--ink); background: #fff; border: 0; border-radius: 12px;
  padding: 10px 14px; box-shadow: inset 0 0 0 1px var(--hairline); outline: none;
}
select:focus, input:focus, textarea:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.logwin {
  background: #0c1322; color: #d7e0ee; border-radius: 16px; padding: 16px;
  font-family: var(--mono); font-size: 12.3px; line-height: 1.65;
  height: 480px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.logwin .t { color: #6b7a93; }
.logwin .ok { color: #4ade80; }
.logwin .err { color: #f87171; }
.logwin .meta { color: #7dd3fc; }
.logwin:empty::before { content: 'Select a worker and press Start — events stream here in real time.'; color: #5a6478; }

/* ---- database ---- */
textarea.sql { width: 100%; min-height: 110px; font-family: var(--mono); font-size: 13px; resize: vertical; }
.tablewrap { overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--hairline); background: #fff; }
table.grid { border-collapse: collapse; width: 100%; font-size: 12.8px; }
table.grid th, table.grid td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--hairline); font-family: var(--mono); white-space: nowrap; }
table.grid th { font-family: 'Inter'; font-weight: 600; color: var(--muted); background: rgba(10, 16, 32, 0.025); position: sticky; top: 0; }
.row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
label.switch { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }

/* ---- notices ---- */
.notice {
  border-radius: 16px; padding: 18px 20px; font-size: 13.8px;
  background: rgba(217, 119, 6, 0.07); box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.25);
}
.notice--info { background: rgba(var(--accent-rgb), 0.06); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.2); }
.notice code { font-family: var(--mono); font-size: 12.3px; background: rgba(10, 16, 32, 0.06); border-radius: 6px; padding: 1.5px 6px; }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #0c1322; color: #fff; border-radius: 999px; padding: 12px 22px;
  font-size: 13.5px; box-shadow: 0 16px 40px rgba(10, 16, 32, 0.3); z-index: 100;
  animation: toastin 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---- login ---- */
.login-body { display: grid; place-items: center; min-height: 100vh; overflow: hidden; }
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.aurora__a, .aurora__b { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; animation: drift 24s ease-in-out infinite alternate; }
.aurora__a { width: 55vw; height: 55vw; left: -15vw; top: -18vw; background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 65%); }
.aurora__b { width: 45vw; height: 45vw; right: -12vw; bottom: -16vw; background: radial-gradient(circle, rgba(0, 194, 255, 0.15), transparent 65%); animation-delay: -10s; }
@keyframes drift { to { transform: translate(4vw, 3vw) scale(1.1); } }
.login-card {
  width: min(380px, 92vw); background: #fff; border-radius: 24px; padding: 40px 36px;
  box-shadow: inset 0 0 0 1px var(--hairline), 0 30px 80px rgba(10, 16, 32, 0.12);
  display: grid; gap: 10px; justify-items: center; text-align: center;
}
.login-card h1 { font-size: 24px; margin-top: 6px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.login-card form { display: grid; gap: 12px; width: 100%; }
.login-card input { text-align: center; }
.login-err { color: var(--bad); font-size: 13px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .side__nav { display: flex; }
  .side__foot { margin: 0; }
}
