/* ============================================================
   VelvetBeautyy — control room
   System font stack on purpose: this page ships under a strict CSP
   that allows no third-party origins, so nothing loads from a CDN.
   ============================================================ */

:root {
  --bg: #0f0d0e;
  --panel: #171416;
  --panel-2: #1e1a1c;
  --line: #2b2528;
  --text: #f2ece7;
  --muted: #9c9296;
  --gold: #c9a227;
  --gold-2: #e0c46a;
  --wine: #8d1b3a;
  --green: #34d399;
  --red: #f0625a;
  --radius: 10px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*,*::before,*::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.is-booking > *:not(#boot) { display: none; }
h1,h2,h3 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; }

/* ============================== login ============================== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 6vh 5vw;
  background:
    radial-gradient(60% 50% at 20% 10%, rgba(201,162,39,.12), transparent 70%),
    radial-gradient(50% 50% at 85% 90%, rgba(141,27,58,.18), transparent 70%), var(--bg); }
.login__card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px; box-shadow: 0 40px 90px rgba(0,0,0,.5);
}
.login__brand { font-family: var(--serif); font-size: 1.1rem; color: var(--text); margin-bottom: 26px; }
.login__brand span { color: var(--gold); font-style: italic; }
.login__card h1 { font-size: 2.2rem; }
.login__sub { color: var(--muted); font-size: .82rem; margin: 8px 0 24px; }
.login__error {
  background: rgba(240,98,90,.12); border: 1px solid rgba(240,98,90,.4);
  color: #ffc7c2; padding: 10px 12px; border-radius: 8px; font-size: .82rem; margin-bottom: 14px;
}
.login__foot { color: var(--muted); font-size: .74rem; margin-top: 16px; text-align: center; }

/* ============================== shell ============================== */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.side {
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 24px 18px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}
.side__brand { font-family: var(--serif); font-size: 1.25rem; }
.side__brand span { color: var(--gold); font-style: italic; }
.side__brand small { display: block; font-family: var(--sans); font-size: .62rem;
  letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.side__nav { display: flex; flex-direction: column; gap: 4px; }
.tab {
  text-align: left; background: none; border: 0; cursor: pointer;
  padding: 11px 14px; border-radius: 8px; color: var(--muted); font-size: .9rem;
  transition: background .2s, color .2s;
}
.tab:hover { background: var(--panel-2); color: var(--text); }
.tab.is-on { background: rgba(201,162,39,.14); color: var(--gold-2); }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side__link { font-size: .82rem; text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 22px clamp(18px, 3vw, 34px); border-bottom: 1px solid var(--line);
  background: rgba(15,13,14,.86); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.bar__title { font-size: 1.7rem; }
.bar__sub { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.bar__right { display: flex; align-items: center; gap: 12px; }
.pill {
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.pill[data-state="on"] { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.who { font-size: .8rem; color: var(--muted); }

.view { display: none; padding: clamp(18px, 3vw, 34px); }
.view.is-on { display: block; }

/* ============================= toolbar ============================= */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.hint { color: var(--muted); font-size: .82rem; max-width: 62ch; }

input[type="text"], input[type="search"], input[type="password"], input[type="number"],
input[type="url"], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; width: 100%; transition: border-color .2s, background .2s;
}
input:hover, select:hover, textarea:hover { border-color: #3b3336; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; }
textarea { resize: vertical; min-height: 80px; font-family: inherit; }
#pSearch { max-width: 300px; }

.segmented { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg { background: none; border: 0; cursor: pointer; padding: 7px 14px; border-radius: 999px; font-size: .78rem; color: var(--muted); }
.seg.is-on { background: var(--gold); color: #191113; }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer;
  padding: 10px 18px; border-radius: 8px; font-size: .84rem;
  transition: background .2s, border-color .2s, transform .15s, opacity .2s;
}
.btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.btn--primary { background: var(--gold); border-color: var(--gold); color: #191113; font-weight: 600; }
.btn--primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn--danger { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn--danger:hover { background: #a52244; }
.btn--ghost { background: transparent; }
.btn--wide { width: 100%; }
.btn--mini { padding: 6px 11px; font-size: .76rem; border-radius: 6px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.filebtn { display: inline-flex; align-items: center; }

/* ============================== stats ============================== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1; }
.stat span { color: var(--muted); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.stat[data-tone="low"] b { color: var(--red); }
.stat[data-tone="good"] b { color: var(--green); }

/* ============================== table ============================== */
.tablewrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto;
}
.table th, .table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .right { text-align: right; white-space: nowrap; }
.table .muted { color: var(--muted); }
.cellname { display: flex; align-items: center; gap: 12px; }
.swatch { width: 38px; height: 38px; border-radius: 8px; flex: 0 0 auto; position: relative; overflow: hidden; }
.swatch i { position: absolute; inset: 0; }
.swatch i::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 9px; height: 24px; border-radius: 3px; background: rgba(255,255,255,.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.cellname b { font-weight: 500; }
.cellname small { display: block; color: var(--muted); font-size: .72rem; }

.tag { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag--live { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }
.tag--draft { color: var(--gold-2); border-color: rgba(201,162,39,.4); background: rgba(201,162,39,.1); }
.tag--feat { color: #f0b6c6; border-color: rgba(240,182,198,.35); }
.tag--out { color: var(--red); border-color: rgba(240,98,90,.4); }

.stockcell { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.stockcell input { width: 74px; text-align: right; padding: 6px 8px; }
.rowbtns { display: inline-flex; gap: 6px; }

/* =========================== customise ============================= */
.groups { display: grid; gap: 18px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group__head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 12px; }
.group__head h3 { font-size: 1.25rem; }
.group__head span { color: var(--muted); font-size: .76rem; }
.group__body { padding: 18px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field small { color: var(--muted); font-size: .7rem; }
.field--wide { grid-column: 1 / -1; }
.field.is-dirty > span { color: var(--gold-2); }
.field.is-dirty input, .field.is-dirty textarea, .field.is-dirty select { border-color: var(--gold); }
.colorrow { display: flex; gap: 8px; align-items: center; }
.colorrow input[type="color"] { width: 44px; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.switchrow { display: flex; align-items: center; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }

/* ============================= backups ============================= */
.backupid { font-family: var(--mono); font-size: .76rem; }
.kind { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kind--pre-restore { color: var(--gold-2); }
.kind--manual { color: var(--green); }

/* ============================ activity ============================= */
.action { font-family: var(--mono); font-size: .76rem; color: var(--gold-2); }
.action.is-danger { color: var(--red); }
.action.is-ok { color: var(--green); }
tr.is-new { animation: flash 1.4s var(--ease); }
@keyframes flash { from { background: rgba(201,162,39,.16); } }

/* ============================= security ============================= */
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.card h2 + .hint { margin-bottom: 16px; }
.card h2:not(:first-child) { margin-top: 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 8px; font-size: .84rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); font-size: .78rem; }
.ticks { display: flex; flex-direction: column; gap: 7px; font-size: .82rem; color: var(--muted); }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); }
.meter { font-size: .78rem; color: var(--muted); }
.meter[data-level="weak"] { color: var(--red); }
.meter[data-level="ok"] { color: var(--gold-2); }
.meter[data-level="strong"] { color: var(--green); }

/* ============================== modal ============================== */
.modal { border: 0; padding: 0; background: var(--panel); color: var(--text);
  border-radius: 12px; width: min(760px, 94vw); max-height: 92vh; box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.modal--sm { width: min(440px, 94vw); }
.modal::backdrop { background: rgba(5,4,5,.72); }
.modal__form { display: flex; flex-direction: column; max-height: 92vh; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 1.4rem; }
.x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.x:hover { color: var(--text); }
.modal__body { padding: 22px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal__foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid2 .field--full { grid-column: 1 / -1; }
.toggles { display: flex; gap: 20px; flex-wrap: wrap; }
.modal__error { color: #ffc7c2; background: rgba(240,98,90,.12); border: 1px solid rgba(240,98,90,.35); padding: 10px 12px; border-radius: 8px; font-size: .82rem; }
.fields-err { border-color: var(--red) !important; }

/* ============================== toasts ============================== */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  padding: 12px 16px; border-radius: 8px; font-size: .84rem; box-shadow: 0 18px 40px rgba(0,0,0,.45);
  animation: pop .3s ease; max-width: 340px; }
.toast--err { border-left-color: var(--red); }
.toast--ok { border-left-color: var(--green); }
.toast.is-out { animation: fadeout .3s ease forwards; }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } }
@keyframes fadeout { to { opacity: 0; transform: translateX(20px); } }

.emptyrow td { color: var(--muted); text-align: center; padding: 34px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; }
  .side__nav { flex-direction: row; flex-wrap: wrap; }
  .side__foot { margin: 0; flex-direction: row; align-items: center; }
  .bar { position: static; }
}
