/* Deliberately close to the site's own look — same dark ground, same spectrum
   accent — so the editor reads as part of Adapt rather than a bolted-on tool. */

:root {
  --ink: #0b0d0f;
  --ink-2: #101316;
  --ink-3: #15191d;
  --ink-4: #1b2025;
  --line: #262c33;
  --line-2: #1e242a;
  --text: #f2f5f7;
  --muted: #9aa4ad;
  --muted-2: #6d777f;
  --danger: #ff6b6b;
  --ok: #5ad1a0;
  --spectrum: linear-gradient(90deg, #ff3d69, #ff9f43, #ffe066, #4ade80, #38bdf8, #a78bfa);
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* Class-level `display` beats the browser's [hidden] rule, and every panel
   here is toggled through that attribute. Without this the login screen, the
   shell and both modals render on top of each other. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

.spectrum-top { height: 3px; background: var(--spectrum); }

button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- sign in ---------- */

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

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-card h1 { font-size: 24px; font-weight: 900; letter-spacing: -.03em; margin: 0 0 18px; }
.login-card h1 span { font-style: italic; font-weight: 500; color: var(--muted); }

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

.shell { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 3px); }

.sidebar {
  background: var(--ink-2);
  border-right: 1px solid var(--line-2);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand { font-size: 17px; font-weight: 900; letter-spacing: -.02em; }
.brand span { font-style: italic; font-weight: 500; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav button {
  text-align: left;
  background: none;
  border: 0;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.nav button:hover { background: var(--ink-3); color: var(--text); }
.nav button[aria-current="true"] { background: var(--ink-4); color: var(--text); }
.nav .count { float: right; color: var(--muted-2); font-weight: 500; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.main { padding: 34px 40px 80px; max-width: 1000px; }

/* ---------- shared bits ---------- */

.btn-solid, .btn-danger {
  background: #fff;
  color: #0b0d0f;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .2s;
}

.btn-solid:disabled, .btn-danger:disabled { opacity: .5; cursor: default; }
.btn-danger { background: var(--danger); color: #2b0808; }

.ghost {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: none;
  transition: color .2s;
}

.ghost:hover { color: var(--text); }

.error { color: var(--danger); font-size: 14px; margin: 4px 0 0; }
.hint { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0; }
.row-end { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.banner {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  background: var(--ink-2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
}

.banner.ok { border-left-color: var(--ok); }
.banner.bad { border-left-color: var(--danger); }
.banner.busy { border-left-color: #ffe066; }

/* ---------- list ---------- */

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.head h1 { font-size: 30px; font-weight: 900; letter-spacing: -.035em; margin: 0; }

.list { display: flex; flex-direction: column; gap: 1px; background: var(--line-2);
  border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }

.row {
  background: var(--ink-3);
  border: 0;
  text-align: left;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background .2s;
  color: inherit;
  width: 100%;
}

.row:hover { background: var(--ink-4); }
.row .title { font-weight: 700; }
.row .sub { color: var(--muted-2); font-size: 13.5px; margin-left: auto; }

.tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #ffe066;
  border: 1px solid #4a4526;
  background: #241f0d;
  border-radius: 999px;
  padding: 3px 9px;
}

.empty { color: var(--muted); padding: 34px 0; }

/* ---------- form ---------- */

.field { margin-bottom: 22px; }

.field label, .login-card label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input[type="text"], .field input[type="number"], .field input[type="date"],
.field textarea, .field select, .login-card input {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  transition: border-color .2s;
}

.field input:focus, .field textarea:focus, .field select:focus, .login-card input:focus {
  outline: none;
  border-color: #4a5560;
}

.field textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.field textarea.body { min-height: 460px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.field .help { margin-top: 7px; font-size: 13px; color: var(--muted-2); }
.field .count { float: right; text-transform: none; letter-spacing: 0; font-weight: 500; }
.field .count.over { color: var(--danger); }

.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 17px; height: 17px; accent-color: #fff; }
.check label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 14.5px; color: var(--text); font-weight: 600; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags .chip {
  background: var(--ink-4);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tags .chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.tags .chip button:hover { color: var(--danger); }

/* repeating rows: stats, features, spec tables */
.repeat-row {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 18px 18px 2px;
  margin-bottom: 12px;
  background: var(--ink-2);
}

.repeat-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }

.repeat-n {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-right: auto;
}

.repeat-x {
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  width: 26px;
  height: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}

.repeat-x:hover { color: var(--text); border-color: #4a5560; }
.repeat-row .field { margin-bottom: 16px; }

.image-field { display: flex; gap: 16px; align-items: center; }
.image-field img {
  width: 190px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ink-2);
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line-2);
}

.form-foot .spacer { margin-left: auto; }

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 9, .72);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}

.modal-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  width: min(860px, 100%);
  max-height: 82vh;
  overflow: auto;
}

.modal-card.narrow { width: min(460px, 100%); }
.modal-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-card h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; }

.upload {
  display: block;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color .2s, color .2s;
}

.upload:hover { border-color: #4a5560; color: var(--text); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.media-grid button {
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
}

.media-grid button:hover { border-color: #4a5560; }
.media-grid img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.media-grid .name { display: block; font-size: 11.5px; color: var(--muted-2); padding: 7px 8px; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .main { padding: 26px 20px 60px; }
  .head { flex-direction: column; }
}
