/* Hallmark · macrostructure: Split-Studio · tone: editorial-utilitarian · anchor hue: neutral (chrome)
 * pre-emit critique: P5 H4 E4 S4 R5 V4
 * =============================================================
   MONEY BACK RECORDS — Admin
   Shares the label's black / chrome / silver design language.
   Auth = split studio (brand slab + form). App = rail + workbench.
   ============================================================= */

:root {
  --black:     #000000;
  --bg:        #060606;
  --bg-2:      #0b0b0b;
  --surface:   #101010;
  --surface-2: #171717;
  --surface-3: #1e1e1e;
  --ink:       #f4f4f4;
  --ink-soft:  #b9b9b9;
  --muted:     #7e7e7e;
  --faint:     #565656;
  --line:      rgba(255, 255, 255, 0.10);
  --line-2:    rgba(255, 255, 255, 0.22);
  --good:      #7ee0a6;
  --warn:      #f0c463;
  --bad:       #f08a8a;

  --chrome: linear-gradient(178deg,
              #ffffff 0%, #f2f3f5 18%, #b6b9be 42%,
              #75797f 52%, #d3d6da 68%, #ffffff 88%, #9ea2a8 100%);

  --font-display: "Anton", "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 4px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
::selection { background: #fff; color: #000; }

.display { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; line-height: 0.95; letter-spacing: 0.01em; }
.chrome {
  background: var(--chrome); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .chrome { color: #fff; -webkit-text-fill-color: #fff; background: none; }
}
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.15rem; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.1s;
  white-space: nowrap;
}
.btn:hover { border-color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--solid { background: #fff; color: #000; border-color: #fff; }
.btn--solid:hover { background: #d9d9d9; }
.btn--sm { padding: 0.45rem 0.8rem; font-size: 0.68rem; }
.btn--ghost { border-color: transparent; color: var(--ink-soft); }
.btn--ghost:hover { border-color: var(--line-2); color: #fff; }
.btn--danger { border-color: rgba(240,138,138,0.4); color: var(--bad); }
.btn--danger:hover { background: rgba(240,138,138,0.12); border-color: var(--bad); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- Fields ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > label { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.4rem; }
.input, .textarea, .select {
  width: 100%; padding: 0.7rem 0.85rem; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  transition: border-color 0.2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--line-2); outline: none; }
.textarea { min-height: 92px; resize: vertical; }
.hint { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }
.row { display: grid; gap: 1rem; }
@media (min-width: 620px) { .row--2 { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   LOGIN — split studio: brand slab (left) + form (right)
   ============================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }

/* --- Brand slab --- */
.auth__slab {
  position: relative; overflow: hidden; padding: clamp(2rem, 4vw, 3.5rem);
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #0a0a0a 0%, #000 60%);
  border-right: 1px solid var(--line);
}
.auth__slab::after { /* film grain, ties it to the public site */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth__slab-top { display: flex; align-items: center; gap: 0.65rem; position: relative; z-index: 1; }
.auth__slab-top img { width: 30px; height: auto; }
.auth__slab-top b { font-family: var(--font-display); font-size: 0.95rem; line-height: 1; letter-spacing: 0.02em; }
.auth__slab-top span { display: block; font-size: 0.58rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.auth__headline { position: relative; z-index: 1; }
.auth__kicker { font-size: 0.68rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem; }
.auth__headline h2 { font-family: var(--font-display); font-size: clamp(2.6rem, 5.5vw, 5rem); line-height: 0.92; text-transform: uppercase; }
.auth__headline p { max-width: 34ch; color: var(--ink-soft); font-size: 0.95rem; margin-top: 1.3rem; }
.auth__slab-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 1rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }

/* --- Form panel --- */
.auth__panel { display: flex; align-items: center; justify-content: center; padding: clamp(2rem, 4vw, 3.5rem); background: var(--bg); }
.auth__form-wrap { width: 100%; max-width: 360px; }
.auth__title { font-size: 1.9rem; margin-bottom: 0.3rem; }
.auth__sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 2rem; }
.auth__divider { display: flex; align-items: center; gap: 0.8rem; color: var(--faint); font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; margin: 1.4rem 0; }
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__error { background: rgba(240,138,138,0.1); border: 1px solid rgba(240,138,138,0.35); color: var(--bad); font-size: 0.8rem; padding: 0.6rem 0.8rem; border-radius: var(--radius); margin-bottom: 1.1rem; }
.auth__foot { margin-top: 2rem; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--faint); }
.auth__foot a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
.google-btn svg { width: 18px; height: 18px; }

@media (max-width: 780px) {
  .auth { grid-template-columns: 1fr; }
  .auth__slab { min-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth__headline p { display: none; }
  .auth__panel { padding-block: 2.4rem; }
}

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

/* Pin the two real regions to explicit grid cells so the content area can
   never wrap off-screen. Auto-placement is fragile: any extra direct child
   of .app (the mobile scrim, or anything injected by the browser/CDN) would
   otherwise claim column 2 and shove .main onto a second row — which is what
   made the whole dashboard render blank. With both regions pinned to row 1,
   stray children land elsewhere and .main always fills the content column. */
.side { grid-column: 1; grid-row: 1; }
.main { grid-column: 2; grid-row: 1; }

.side {
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side__brand { display: flex; align-items: center; gap: 0.6rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); }
.side__brand img { width: 30px; height: auto; }
.side__brand b { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.02em; line-height: 1; }
.side__brand span { display: block; font-size: 0.6rem; letter-spacing: 0.24em; color: var(--muted); text-transform: uppercase; }
.side__nav { padding: 0.8rem 0.7rem; flex: 1; overflow-y: auto; }
.side__link {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.75rem; border-radius: var(--radius);
  color: var(--ink-soft); font-size: 0.85rem; font-weight: 500; margin-bottom: 0.15rem;
  transition: background 0.15s, color 0.15s;
}
.side__link:hover { background: var(--surface); color: #fff; }
.side__link.is-active { background: var(--surface-2); color: #fff; }
.side__link .ic { width: 18px; text-align: center; opacity: 0.85; }
.side__foot { padding: 0.9rem 1rem; border-top: 1px solid var(--line); }
.side__user { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.side__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--chrome); color: #000; display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; }
.side__user small { display: block; color: var(--muted); font-size: 0.7rem; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem clamp(1.1rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(6,6,6,0.85); backdrop-filter: blur(10px); z-index: 20;
}
.topbar__title { font-size: 1.35rem; }
.topbar__actions { display: flex; gap: 0.6rem; align-items: center; }
.content { padding: clamp(1.1rem, 3vw, 2.2rem); }

.menu-btn { display: none; }

/* The mobile menu scrim is a direct child of the .app grid. Keep it out of
   the layout on desktop — otherwise it claims a grid cell and pushes .main
   onto a second row, leaving the whole content area blank. It becomes a
   fixed overlay only inside the mobile breakpoint below. */
.scrim { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 244px; z-index: 60;
    transform: translateX(-100%); transition: transform 0.3s var(--ease);
  }
  .side.is-open { transform: translateX(0); }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 55; }
  .scrim.is-open { display: block; }
  .menu-btn { display: inline-flex; }
}

/* ---------- Stat cards ---------- */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.8rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.2rem 1.3rem; }
.stat__label { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; margin-top: 0.5rem; }
.stat__meta { font-size: 0.74rem; color: var(--muted); margin-top: 0.5rem; }

/* ---------- Panels & tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 1.8rem; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel__head h2 { font-size: 1.05rem; }
.panel__body { padding: 0.4rem 0; }
.panel--pad .panel__body { padding: 1.25rem; }

.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th { text-align: left; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--line); }
.table td { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .thumb { width: 42px; height: 42px; border-radius: var(--radius); object-fit: cover; background: var(--surface-3); }
.table .cell-main { font-weight: 600; }
.table .cell-sub { color: var(--muted); font-size: 0.76rem; }
.table .actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.col-right { text-align: right; }

.avatar-cell { display: flex; align-items: center; gap: 0.75rem; }
.avatar-sq { width: 40px; height: 40px; border-radius: var(--radius); object-fit: cover; background: var(--surface-3); display: grid; place-items: center; color: var(--faint); font-size: 0.7rem; }

.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; padding: 0.25rem 0.55rem; border-radius: 100px; border: 1px solid var(--line-2); color: var(--ink-soft); }
.badge--live { color: var(--good); border-color: rgba(126,224,166,0.4); background: rgba(126,224,166,0.08); }
.badge--draft { color: var(--warn); border-color: rgba(240,196,99,0.35); background: rgba(240,196,99,0.07); }
.badge--sold { color: var(--ink-soft); }

.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty .display { font-size: 1.4rem; color: var(--ink-soft); margin-bottom: 0.5rem; }

/* ---------- Drawer / modal form ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: block; }
.modal__scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.modal__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto;
  transform: translateX(100%); transition: transform 0.3s var(--ease);
  display: flex; flex-direction: column;
}
.modal.is-open .modal__panel { transform: translateX(0); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal__head h3 { font-size: 1.15rem; }
.modal__body { padding: 1.4rem; flex: 1; }
.modal__foot { padding: 1.1rem 1.4rem; border-top: 1px solid var(--line); display: flex; gap: 0.7rem; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); }
.close-x { font-size: 1.5rem; line-height: 1; color: var(--muted); width: 34px; height: 34px; border-radius: var(--radius); display: grid; place-items: center; }
.close-x:hover { background: var(--surface-2); color: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #fff; color: #000; font-weight: 600; letter-spacing: 0.04em; padding: 0.8rem 1.3rem;
  border-radius: var(--radius); z-index: 200; opacity: 0; transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 14px 44px rgba(0,0,0,0.6); font-size: 0.78rem; text-transform: uppercase; max-width: 90vw;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Storage note callout ---------- */
.note { display: flex; gap: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 6px; padding: 1.1rem 1.3rem; }
.note h3 { font-size: 0.95rem; margin-bottom: 0.3rem; text-transform: none; font-family: var(--font-ui); font-weight: 700; letter-spacing: 0; }
.note p { color: var(--ink-soft); font-size: 0.85rem; }
.note .ic { font-size: 1.1rem; }

.file-drop { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 1.1rem; text-align: center; color: var(--muted); font-size: 0.8rem; background: var(--bg-2); }
.file-drop b { color: var(--ink-soft); }
