/* ==========================================================================
   Curator's console — the same drawer, with the lamp turned up.
   ========================================================================== */

:root {
  --ink: #0C1512;
  --ink-2: #131F1A;
  --ink-3: #1A2A23;
  --bone: #EDE7DA;
  --bone-dim: #C6CFC8;
  --muted: #8E9C94;
  --line: rgba(237,231,218,.13);
  --line-strong: rgba(237,231,218,.28);
  --lvl-1: #4E7C59;
  --lvl-2: #C9A227;
  --lvl-3: #B4552D;
  --brass: #C9A227;
  --danger: #C4523B;
  --display: 'Bodoni Moda', 'Times New Roman', serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(24px, 4vw, 34px); }
h2 { font-size: clamp(19px, 2.6vw, 24px); }
h3 { font-size: 17px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}

/* ---------------------------------------------------------------- chrome -- */

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12,21,18,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.admin-bar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 18px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.admin-brand {
  font-family: var(--display);
  font-size: 16px;
  color: var(--bone);
  white-space: nowrap;
}
.admin-brand small {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.admin-brand:hover { text-decoration: none; }

.admin-nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.admin-nav a {
  padding: 8px 13px;
  border-radius: 2px;
  font-size: 13.5px;
  color: var(--bone-dim);
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.admin-nav a:hover { background: var(--ink-2); color: var(--bone); text-decoration: none; }
.admin-nav a.is-active { background: var(--ink-3); color: var(--brass); }

.admin-shell { max-width: 1240px; margin: 0 auto; padding: 28px 18px 90px; }
.admin-shell.narrow { max-width: 780px; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.page-head p { color: var(--muted); margin: 8px 0 0; font-size: 14.5px; max-width: 62ch; }

/* --------------------------------------------------------------- pieces -- */

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 22px;
  margin-bottom: 20px;
}
.card > h2, .card > h3 { margin-bottom: 6px; }
.card-note { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.grid { display: grid; gap: 18px; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-side { grid-template-columns: minmax(0,1.6fr) minmax(260px,.9fr); align-items: start; }
}

.stat {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--brass); }
.stat.lvl-1::before { background: var(--lvl-1); }
.stat.lvl-2::before { background: var(--lvl-2); }
.stat.lvl-3::before { background: var(--lvl-3); }
.stat-figure { font-family: var(--display); font-size: 34px; line-height: 1.1; margin: 10px 0 2px; }
.stat-unit { font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------------- forms --- */

label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--bone); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.field-group { margin-bottom: 18px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--bone);
  border-radius: 2px;
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming */
  transition: border-color .2s var(--ease);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
select { appearance: none; -webkit-appearance: none; background-image: none; }

.check { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brass); flex: none; }
.check label { margin: 0; font-size: 14.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--bone);
  border-radius: 2px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.btn:hover { border-color: var(--brass); color: var(--brass); text-decoration: none; }
.btn-primary { background: var(--brass); border-color: var(--brass); color: #14100A; font-weight: 600; }
.btn-primary:hover { background: #DBB232; border-color: #DBB232; color: #14100A; }
.btn-danger { border-color: rgba(196,82,59,.55); color: #E08A73; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------- notices -- */

.notice {
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--ink-2);
  padding: 14px 16px;
  border-radius: 2px;
  margin-bottom: 16px;
  font-size: 14.5px;
}
.notice-success { border-left-color: var(--lvl-1); }
.notice-error   { border-left-color: var(--danger); }
.notice-info    { border-left-color: var(--brass); }
.notice ul { margin: 8px 0 0; padding-left: 20px; }
.notice li { margin-bottom: 4px; }

/* ---------------------------------------------------------------- table --- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 620px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  background: var(--ink-2);
  position: sticky;
  top: 0;
}
tbody tr:hover { background: rgba(237,231,218,.03); }
tbody tr:last-child td { border-bottom: 0; }
td.thumb { width: 64px; }
td.thumb img { width: 52px; height: 40px; object-fit: cover; border-radius: 2px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sci { font-family: var(--display); font-style: italic; color: var(--brass); }

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  margin-right: 4px;
}
.chip.lvl-1 { color: var(--lvl-1); }
.chip.lvl-2 { color: var(--lvl-2); }
.chip.lvl-3 { color: var(--lvl-3); }
.chip.off { color: var(--muted); }

.pill-draft { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }

/* --------------------------------------------------------------- images -- */

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

.image-tile {
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: var(--ink);
  position: relative;
  cursor: grab;
}
.image-tile.is-cover { border-color: var(--brass); }
.image-tile.dragging { opacity: .4; }
.image-tile.drop-target { border-color: var(--brass); border-style: dashed; }
.image-tile figure { margin: 0; aspect-ratio: 4/3; background: #080D0B; }
.image-tile figure img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.image-tile-body { padding: 10px; }
.image-tile input[type=text] { font-size: 13px; padding: 7px 9px; margin-bottom: 8px; }
.image-tile-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cover-flag {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  background: var(--brass); color: #14100A; padding: 3px 7px; border-radius: 2px;
}
.drag-handle {
  position: absolute; top: 8px; right: 8px;
  background: rgba(12,21,18,.8); border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; padding: 2px 7px; border-radius: 2px;
}

.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  transition: border-color .2s var(--ease), background .2s var(--ease);
  cursor: pointer;
}
.dropzone.is-over { border-color: var(--brass); background: rgba(201,162,39,.06); }
.dropzone strong { color: var(--bone); display: block; margin-bottom: 6px; font-weight: 500; }
.dropzone input[type=file] { display: none; }
.file-list { margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--bone-dim); text-align: left; }
.file-list div { padding: 4px 0; border-bottom: 1px solid var(--line); }

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

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 400px; }
.login-card .card { padding: 30px 26px; }

/* ---------------------------------------------------------------- misc ---- */

.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--bone); margin-bottom: 8px; }

.log { font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--bone-dim); max-height: 340px; overflow: auto; }
.log div { padding: 3px 0; border-bottom: 1px solid var(--line); }

.preview-table td, .preview-table th { padding: 8px 12px; font-size: 13.5px; }
.warn-list { color: var(--muted); font-size: 13.5px; max-height: 240px; overflow: auto; }
.warn-list li { margin-bottom: 5px; }

@media (max-width: 640px) {
  .admin-bar-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .admin-nav { margin-left: 0; width: 100%; padding-bottom: 2px; }
  .row-actions { justify-content: flex-start; }
}
