/* Unusual control panel — zinc, nothing else. */

:root {
  --bg: #09090b;          /* zinc-950 */
  --surface: #18181b;     /* zinc-900 */
  --surface-2: #27272a;   /* zinc-800 */
  --surface-3: #3f3f46;   /* zinc-700 */
  --line: #27272a;        /* zinc-800 */
  --line-strong: #3f3f46; /* zinc-700 */
  --text: #fafafa;        /* zinc-50  */
  --muted: #a1a1aa;       /* zinc-400 */
  --faint: #71717a;       /* zinc-500 */
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

/* The layout below sets display on these elements, which would otherwise beat
   the browser's own rule for [hidden] and leave hidden panels on screen. */
[hidden] { display: none !important; }

/* Lucide icons (lucide.dev, ISC), inlined as a sprite in the page. */
.sprite { display: none; }

.icon {
  width: 15px; height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }

.muted { color: var(--muted); }

/* --- boot / login -------------------------------------------------------- */

.boot { display: grid; place-items: center; height: 100vh; }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--surface-2); border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.gate { display: grid; place-items: center; min-height: 100vh; padding: 24px; }

.login { width: 100%; max-width: 340px; display: grid; gap: 14px; padding: 26px; }
.login .muted { margin-bottom: 4px; font-size: 13px; }

/* --- shell --------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.sidebar {
  position: sticky; top: 28px;
  align-self: start;
  display: grid; gap: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.brand { display: grid; gap: 1px; padding: 4px 8px 0; }
.brand strong { font-size: 14px; }
.brand small { font-size: 12px; }

nav { display: grid; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--surface-2); color: var(--text); }

.sidebar-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

/* --- panels -------------------------------------------------------------- */

.content { display: grid; gap: 18px; min-width: 0; }
.panel { display: grid; gap: 14px; }

.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head p { margin-top: 3px; font-size: 13px; }

.preview {
  flex: none;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: 1 / -1; }

.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.counter { font-style: normal; font-size: 11px; color: var(--faint); }

input, select {
  width: 100%;
  padding: 8px 11px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
}

input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--muted); }
select { appearance: none; cursor: pointer; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s, opacity 0.14s;
}

.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { background: #e4e4e7; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border-color: var(--line-strong); color: var(--danger); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.1); }
.btn.small { padding: 5px 10px; font-size: 12px; gap: 6px; }
.btn.small .icon { width: 13px; height: 13px; }
.btn.block { width: 100%; justify-content: center; }

/* --- project rows -------------------------------------------------------- */

.rows { display: grid; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: auto 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.moves { display: grid; gap: 1px; }

.row-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 8px; min-width: 0; }

.handle {
  width: 20px; height: 18px;
  display: grid; place-items: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 5px;
  color: var(--faint);
  cursor: pointer;
}

.handle .icon { width: 13px; height: 13px; }

.handle:hover { background: var(--surface-2); color: var(--text); }
.emoji { text-align: center; }

.hint { font-size: 12px; }
.error { margin: -4px 0 0; color: var(--danger); font-size: 12.5px; }

/* --- toasts -------------------------------------------------------------- */

.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 20; }

.toast {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  animation: rise 0.18s ease-out;
}

.toast.bad { border-color: rgba(248, 113, 113, 0.5); color: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; gap: 16px; padding: 18px 14px 48px; }
  .sidebar { position: static; }
  nav { grid-auto-flow: column; }
  .grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: auto 52px minmax(0, 1fr); }
  .row-fields { grid-template-columns: 1fr; }
  .row .btn.danger { grid-column: 3 / -1; justify-self: start; }
}
