/* Dense and fast — the developer uses this, not the gym owners (§3). No
   hand-holding styling, just enough structure to be usable at speed. Reuses
   the public site's ground/accent colours loosely (same brand, this is its
   admin), but this file is independent of tokens.css on purpose — the admin
   ships as its own bucket/distribution and has no reason to share a build
   with the public site. */

* { box-sizing: border-box; }

:root {
  --bg: #05090c;
  --surface: #0f1418;
  --border: #262b30;
  --text: #f2f2f2;
  --text-muted: #9aa0a6;
  --accent: #e8090c;
  --accent-hover: #c00709;
  --danger: #b91c1c;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

h1 { font-size: 1.25rem; margin: 0; }
code { font-family: var(--mono); background: var(--surface); padding: 2px 5px; border-radius: 4px; font-size: 0.85em; }
.muted { color: var(--text-muted); }

.config-warning {
  max-width: 640px;
  margin: 10vh auto;
  padding: 2rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--surface);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header-right { display: flex; align-items: center; gap: 1rem; }

main { padding: 1.5rem; max-width: 960px; margin: 0 auto; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-tabs { display: flex; gap: 0.25rem; }
.filter-tab {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}
.filter-tab--active { background: var(--surface); color: var(--text); border-color: var(--text-muted); }

.btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.btn:hover { border-color: var(--text-muted); }
.btn--primary { background: var(--accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: transparent; }
.btn--danger { color: #fca5a5; border-color: var(--danger); }
.btn-link { background: none; border: none; color: var(--text-muted); cursor: pointer; font: inherit; padding: 0; }
.btn-link:hover { color: var(--text); }

.post-table { width: 100%; border-collapse: collapse; }
.post-table th {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.post-row { cursor: pointer; }
.post-row:hover { background: var(--surface); }
.post-row td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid var(--border);
}
.status-pill--draft { color: #fbbf24; border-color: #fbbf24; }
.status-pill--published { color: #4ade80; border-color: #4ade80; }
.status-pill--deleted { color: var(--text-muted); }

.editor { display: flex; flex-direction: column; gap: 1rem; }
.editor__header { display: flex; align-items: center; justify-content: space-between; }
.editor__actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.field input, .field textarea,
input[type="text"], input[type="date"], input[type="file"], textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: var(--radius);
  font: inherit;
  width: 100%;
}
.field input:disabled { opacity: 0.5; }
.counter { text-transform: none; letter-spacing: normal; }

.field-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.field-group legend { padding: 0 0.4rem; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }

.image-preview { min-height: 1.5rem; }

[data-md-toolbar] { display: flex; gap: 0.35rem; flex-wrap: wrap; }
[data-md-toolbar] button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  min-width: 32px;
}

.editor-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 900px) {
  .editor-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.editor-split textarea { font-family: var(--mono); min-height: 420px; resize: vertical; }
.preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-y: auto;
  max-height: 480px;
  color: #d0d4d7;
}
.preview h2, .preview h3 { color: var(--text); margin-top: 1em; }
.preview p { margin: 0.6em 0; }

.serp-preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; background: #fff; color: #202124; font-family: arial, sans-serif; }
.serp-title { color: #1a0dab; font-size: 1.1rem; }
.serp-url { color: #006621; font-size: 0.85rem; }
.serp-desc { color: #4d5156; font-size: 0.85rem; margin-top: 0.15rem; }
