/* VIP admin — deliberately plain. The client should be able to find things,
   not admire them. Built around the ten tasks they actually do. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
:root {
  --gold: #C59D5F; --ink: #14141A; --line: #E3E0DA; --bg: #F6F4F1;
  --muted: #6E6960; --ok: #1F7A46; --err: #B03A3A;
  --aesth: #6B5BD2; --tann: #D2843A;
}
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; }

.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }

.sidebar { background: var(--ink); color: #C9C4BB; padding: 1.5rem 1rem; }
.sidebar .logo { display: flex; align-items: center; gap: .6rem; margin-bottom: 2rem; }
.sidebar .logo b { color: var(--gold); font-size: 1.1rem; letter-spacing: .1em; }
.sidebar nav { display: flex; flex-direction: column; gap: .2rem; }
.sidebar nav a { padding: .6rem .8rem; border-radius: 6px; text-decoration: none; font-size: .92rem; }
.sidebar nav a:hover { background: #23232B; color: #fff; }
.sidebar nav a.on { background: var(--gold); color: #17130C; font-weight: 600; }
.sidebar .sep { margin: 1.2rem 0 .6rem; font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: #6C665C; }
.sidebar .who { margin-top: auto; padding-top: 1.5rem; font-size: .82rem; color: #8A8478; }
.sidebar .side-body { display: flex; flex-direction: column; flex: 1; }
.sidebar .menu-toggle { display: none; margin-left: auto; background: var(--gold); color: #17130C;
  border: 0; border-radius: 6px; padding: .45rem .9rem; font-weight: 600; cursor: pointer; }

/* On a phone the menu starts closed, so the page itself is the first thing seen. */
@media (max-width: 800px) {
  .sidebar { padding: .8rem 1rem; }
  .sidebar .logo { margin-bottom: 0; }
  .sidebar .menu-toggle { display: inline-block; }
  .sidebar .side-body { display: none; margin-top: 1rem; }
  .sidebar.open .side-body { display: flex; }
}

.main { padding: 2rem 2.2rem 4rem; max-width: 1100px; }
@media (max-width: 800px) { .main { padding: 1.2rem; } }

.page-title { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; margin-bottom: 1.6rem; }
.page-title h1 { font-size: 1.6rem; font-weight: 600; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 1.4rem; margin-bottom: 1.4rem; }
.panel h2 { font-size: 1.05rem; margin-bottom: 1rem; font-weight: 600; }

.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem; }
.stat-box b { display: block; font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.stat-box span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
table.data tr:hover td { background: #FAF8F5; }

.tag { display: inline-block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .18rem .5rem; border-radius: 999px; border: 1px solid; }
.tag-aesth { color: var(--aesth); border-color: var(--aesth); }
.tag-tann { color: var(--tann); border-color: var(--tann); }
.tag-new { color: var(--ok); border-color: var(--ok); }
.tag-draft { color: var(--muted); border-color: var(--line); background: #F3F1EE; }
.tag-live { color: var(--ok); border-color: var(--ok); }
.tag-both { color: #7A3AA8; border-color: #7A3AA8; font-weight: 600; }

.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.05rem;
  border-radius: 7px; border: 1px solid var(--line); background: #fff; text-decoration: none;
  font-size: .88rem; cursor: pointer; }
.btn:hover { border-color: var(--gold); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #17130C; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-danger { color: var(--err); border-color: #E8CACA; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }

.form { display: grid; gap: 1rem; }
.form .row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form label { display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .3rem; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=url],
.form input[type=number], .form input[type=date], .form select, .form textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
.form textarea { min-height: 9rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.form .help { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.form .check { display: flex; gap: .5rem; align-items: center; }
.form .check input { accent-color: var(--gold); }

.msg { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; font-size: .9rem; border: 1px solid; }
.msg-ok { background: #F0F8F3; border-color: #BEDCC5; color: var(--ok); }
.msg-err { background: #FCF3F3; border-color: #EBC9C9; color: var(--err); }
.msg-info { background: #FFF9EC; border-color: #EEDCB4; color: #7A5B14; }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tabs a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; text-decoration: none; font-size: .85rem; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 2.2rem; width: min(380px, 100%); }
.login-card h1 { font-size: 1.3rem; margin-bottom: .3rem; }
.login-card p.sub { color: var(--muted); font-size: .88rem; margin-bottom: 1.5rem; }

.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }

/* THE HOUSE CREDIT IN THE ADMIN.
   The same component the public footer carries, so the mark a client sees while
   working in their admin is the mark on their site — smaller, because an admin
   is a workspace and this is a signature, not a banner. */
.admin-credit { display: flex; justify-content: center; padding: 2rem 1rem 2.5rem; }
.admin-credit .built-by {
  position: relative; display: inline-flex; flex-direction: column;
  align-items: center; gap: 0; text-decoration: none; --r4-red: #b91e24;
}
.admin-credit .built-by, .admin-credit .built-by:hover { text-decoration: none; }
.admin-credit .built-by-label {
  font-size: 0.46rem; letter-spacing: 0.13em; text-transform: uppercase;
  line-height: 1; margin-bottom: 6px; white-space: nowrap;
  color: var(--r4-credit-label, #c9a227);
}
.admin-credit .r4-mark-slot { width: 54px; height: 54px; display: block; flex: none; }
.admin-credit .r4-mark-slot > svg, .admin-credit .r4-mark-slot > span { width: 100%; height: 100%; display: block; }
.admin-credit .r4-mark { height: 100%; width: 100%; display: block; }
.admin-credit .r4-px rect { fill: var(--r4-red); transition: fill 0.2s ease; }
.admin-credit .built-by:hover .r4-px rect { fill: currentColor; }
.admin-credit .built-by-name {
  position: absolute; left: 50%; bottom: -0.8rem; transform: translate(-50%, 2px);
  font-size: 0.48rem; letter-spacing: 0.11em; text-transform: uppercase;
  line-height: 1; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.admin-credit .built-by:hover .built-by-name,
.admin-credit .built-by:focus-visible .built-by-name { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .admin-credit .built-by-name { transition: none; } }

/* ------------------------------------------------- advertising compliance */
/* Loud on purpose. A refused publish has to be impossible to scroll past —
   the whole failure mode this guards against is copy going live because
   nobody noticed the warning. */
.notice-block {
  border-left: 4px solid var(--err); background: #FDF5F5;
}
.notice-block h3 { color: var(--err); font-size: 1rem; margin-bottom: .5rem; }
.notice-ok { border-left: 4px solid var(--ok); background: #F4FAF6; }
.notice-ok h3 { color: var(--ok); font-size: 1rem; }

.compliance-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.compliance-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.compliance-table tr:last-child td { border-bottom: 0; }
.compliance-table code {
  background: #F1EEE9; padding: .1rem .35rem; border-radius: 4px; font-size: .82em;
}
.compliance-table .c-sev { font-weight: 600; letter-spacing: .06em; white-space: nowrap; }
.compliance-table tr.block .c-sev { color: var(--err); }
.compliance-table tr.review .c-sev { color: #9A6B1F; }
.compliance-table .c-rule,
.compliance-table .c-field { white-space: nowrap; color: var(--muted); }

.compliance-rules summary { cursor: pointer; }
.compliance-rules ol { margin: .9rem 0 0 1.1rem; display: flex; flex-direction: column; gap: .45rem; font-size: .87rem; }
.compliance-rules .help { font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* ------------------------------------------------ documents register */
.doc-group { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 1.6rem 0 .6rem; }
.doc-group:first-of-type { margin-top: 0; }
.doc { border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; margin-bottom: .7rem; }
.doc-head { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.doc-summary { font-size: .9rem; margin-top: .6rem; max-width: 62ch; }
.doc-notes { font-size: .88rem; margin-top: .5rem; max-width: 62ch;
  background: #FFF9EC; border-left: 3px solid #EEDCB4; padding: .5rem .75rem; border-radius: 0 6px 6px 0; }
.doc-edit { margin-top: .8rem; }
.doc-edit > summary { cursor: pointer; font-size: .82rem; color: var(--muted);
  letter-spacing: .06em; text-transform: uppercase; }
.doc-edit > summary:hover { color: var(--ink); }
.doc-edit[open] > summary { margin-bottom: 1rem; }

/* Per-review site filing. The Google profile covers both arms of the business,
   so this control is used on every synced review. */
.review-brand select { font-size: .82rem; padding: .3rem .45rem; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; max-width: 12rem; }

/* Window over the page for a file (data-viewer in ui.js) */
#viewer-back { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.viewer { background: #fff; border-radius: 8px; width: min(1000px, 100%); height: 100%; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,.35); overflow: hidden; }
.viewer header { display: flex; align-items: center; gap: 1rem; padding: .6rem .9rem; background: #f1f2f4; }
.viewer header strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer header button { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #7a736a; }
.viewer iframe { flex: 1; border: 0; width: 100%; }
