/* RevAlpha admin — uses the website's colours, fonts and shapes. */
:root {
  --paper: #fdfcf9; --ivory: #f6f3ec; --sand: #efe9dc; --stone: #e2dccd;
  --line: rgba(11, 31, 58, 0.1); --line-strong: rgba(11, 31, 58, 0.18);
  --navy: #0b1f3a; --navy-deep: #07162b; --blue-slate: #163a63; --slate: #5b6b7c; --slate-2: #8391a1; --soft-white: #f7f8fa;
  --gold: #b08a2e; --gold-bright: #d9b85c; --gold-soft: rgba(176, 138, 46, 0.1); --gold-line: rgba(176, 138, 46, 0.35); --champagne: #f1e3b3;
  --mint: #2f9e74; --coral: #cf5f45;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "Roboto Mono", ui-monospace, Menlo, monospace;
  --radius-s: 12px; --radius-m: 18px;
  --shadow-card: 0 1px 2px rgba(11, 31, 58, 0.04), 0 18px 50px -30px rgba(11, 31, 58, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 1.55; color: var(--navy); background: var(--ivory); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(28px, 3vw, 38px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.boot { padding: 60px 20px; text-align: center; color: var(--slate); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar__in { max-width: 1320px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.topbar__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar__logo img { height: 30px; width: auto; }
.topbar__logo span { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-line); border-radius: 999px; padding: 4px 10px; }
.topnav { display: flex; gap: 4px; margin-left: 14px; }
.topnav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--slate); }
.topnav a:hover { color: var(--navy); background: var(--ivory); }
.topnav a.is-on { color: var(--navy); background: var(--sand); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--slate); }

.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 20px 80px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.muted { color: var(--slate); }
.small { font-size: 13px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 1px solid var(--navy); background: var(--navy); color: var(--soft-white); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: background-color 0.25s var(--ease), border-color 0.25s, color 0.25s, transform 0.25s; white-space: nowrap; }
.btn:hover { background: var(--blue-slate); border-color: var(--blue-slate); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.btn--ghost:hover { background: #fff; border-color: var(--navy); }
.btn--gold { background: linear-gradient(110deg, #d9b85c, #f1e3b3, #d9b85c); border-color: transparent; color: var(--navy); }
.btn--gold:hover { background: var(--champagne); border-color: transparent; }
.btn--danger { background: transparent; color: var(--coral); border-color: rgba(207, 95, 69, 0.4); }
.btn--danger:hover { background: rgba(207, 95, 69, 0.08); border-color: var(--coral); }
.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cards and forms ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-card); padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel__title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field { display: block; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { display: flex; align-items: baseline; gap: 4px; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.label .req { color: var(--coral); font-weight: 700; }
.hint { font-size: 12.5px; color: var(--slate); margin-top: 6px; }
.count { margin-left: auto; font-weight: 600; font-size: 12px; color: var(--slate-2); font-variant-numeric: tabular-nums; }
.count.is-over { color: var(--coral); }
.input, .select, .textarea { width: 100%; min-width: 0; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; transition: border-color 0.2s, box-shadow 0.2s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.textarea { min-height: 90px; resize: vertical; }
.textarea--code { font-family: var(--font-mono); font-size: 13px; min-height: 160px; }
.has-error .input, .has-error .select, .has-error .textarea, .has-error .dropzone, .has-error .tox-tinymce { border-color: var(--coral) !important; }
.field-error { color: var(--coral); font-size: 13px; margin-top: 6px; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline .input, .inline .select { flex: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; }

.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert--error { background: rgba(207, 95, 69, 0.07); border-color: rgba(207, 95, 69, 0.35); color: #8a3420; }
.alert--ok { background: rgba(47, 158, 116, 0.08); border-color: rgba(47, 158, 116, 0.35); color: #1d6b4e; }
.alert--info { background: var(--gold-soft); border-color: var(--gold-line); color: var(--navy); }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(900px 500px at 80% -10%, rgba(217,184,92,0.18), transparent 60%), var(--ivory); }
.auth__box { width: 100%; max-width: 420px; }
.auth__logo { height: 38px; width: auto; margin: 0 auto 26px; }
.auth h1 { text-align: center; margin-bottom: 8px; }
.auth .muted { text-align: center; margin-bottom: 22px; }
.code { font-family: var(--font-mono); background: var(--sand); padding: 2px 6px; border-radius: 6px; font-size: 0.92em; }

/* ---------- Dashboard ---------- */
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr) 1fr 1fr auto; gap: 10px; margin-bottom: 16px; align-items: end; }
.filters .label { font-size: 12px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-card); }
.table th { text-align: left; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate); padding: 12px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.thumb { width: 74px; height: 50px; border-radius: 8px; object-fit: cover; background: var(--sand); }
.thumb--none { display: grid; place-items: center; font-size: 11px; color: var(--slate-2); }
.t-title { font-weight: 700; color: var(--navy); text-decoration: none; }
.t-title:hover { color: var(--gold); }
.t-sub { font-size: 12.5px; color: var(--slate-2); margin-top: 3px; word-break: break-all; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill--published { color: #1d6b4e; border-color: rgba(47,158,116,0.4); background: rgba(47,158,116,0.08); }
.pill--draft { color: var(--slate); border-color: var(--line-strong); background: var(--paper); }
.pill--unpublished { color: #8a3420; border-color: rgba(207,95,69,0.35); background: rgba(207,95,69,0.06); }
.pill--type { color: var(--navy); border-color: var(--line-strong); background: #fff; font-weight: 600; letter-spacing: 0; }
.pill--legacy { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; flex-wrap: wrap; }
.empty { text-align: center; padding: 50px 20px; color: var(--slate); }
.menu { position: relative; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px -20px rgba(11,31,58,0.35); padding: 6px; z-index: 60; }
.menu__list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.menu__list button:hover { background: var(--ivory); }
.menu__list small { display: block; color: var(--slate); font-size: 12px; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.editor__side { position: sticky; top: 78px; display: grid; gap: 18px; }
.status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.stack { display: grid; gap: 8px; }
.dropzone { position: relative; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--paper); padding: 18px; text-align: center; color: var(--slate); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: var(--gold-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.preview { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.preview .stack, .file-row > span { min-width: 0; overflow-wrap: anywhere; }
.editor__main, .editor__side, .panel, .field { min-width: 0; }
.preview img { width: 180px; max-height: 140px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: var(--ivory); }
.preview--logo img { width: auto; height: 44px; padding: 6px 10px; background: #fff; }
.files { display: grid; gap: 8px; margin-top: 12px; }
.file-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.file-row img, .file-row .pdf { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--sand); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--coral); }
.faq-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--paper); margin-bottom: 10px; }
.faq-item__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; font-size: 13px; color: var(--slate); }
.url-preview { font-family: var(--font-mono); font-size: 12.5px; color: var(--slate); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; word-break: break-all; }
.url-preview b { color: var(--navy); font-weight: 600; }
.subpanel { border: 1px solid var(--gold-line); background: var(--gold-soft); border-radius: 12px; padding: 14px; margin-top: 10px; }
details.adv > summary { cursor: pointer; font-weight: 700; font-size: 13.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 13px; }
details.adv[open] > summary::before { content: "\2212"; }
details.adv > div { margin-top: 14px; }
.tox-tinymce { border-radius: 12px !important; border-color: var(--line-strong) !important; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--navy); color: var(--soft-white); padding: 12px 20px; border-radius: 999px; box-shadow: 0 20px 50px -20px rgba(11,31,58,0.6); font-size: 14px; max-width: calc(100% - 32px); }
.toast--error { background: #8a3420; }
.list-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.grid-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor { grid-template-columns: 1fr; }
  .editor__side { position: static; order: -1; }
}
@media (max-width: 760px) {
  .topbar__in { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .topbar__right .who { display: none; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2, .row3, .grid-settings { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { display: grid; grid-template-columns: 74px 1fr; gap: 4px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .table td { padding: 0; border: 0; }
  .table td.c-thumb { grid-row: span 4; }
  .table td.c-actions { grid-column: 1 / -1; margin-top: 8px; }
  .wrap { padding: 20px 14px 70px; }
  .panel { padding: 16px; }
}
