/*
 * Studio on the SignalWealth app theme: same frame as the CRM (sidebar + top bar), theme tokens instead
 * of the old navy/gold palette. Loaded after sw-theme.css and crm-ui.css.
 */
:root, :root[data-theme="dark"] {
  --navy: var(--sw-text);
  --slate: var(--sw-text-2);
  --mid: var(--sw-text-3);
  --gold: var(--sw-accent);
  --gold-light: var(--sw-accent);
  --bg: var(--sw-bg);
  --ivory: var(--sw-accent-soft);
  --line: var(--sw-border);
  --red: var(--sw-err);
  --green: var(--sw-ok);
  --serif: var(--sw-font-display);
  --sans: var(--sw-font-ui);
  --label: var(--sw-font-ui);
}
body { font-size: 14px; color: var(--sw-text); background: var(--sw-bg); }

/* ── Frame ── */
.sw-shell { display: flex; min-height: 100vh; }
.sw-shell > .sidebar {
  position: sticky; top: 0; height: 100vh; width: 248px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--sw-surface); border-right: 1px solid var(--sw-border);
}
.sw-shell > .sidebar .sidebar-nav { flex: 1; display: block; }
.sw-shell > .sidebar .nav-item { text-decoration: none; display: flex; align-items: center; }
.sw-shell > .sidebar .nav-section { text-transform: uppercase; }
.sw-shell > .sidebar .brand-logo { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sw-shell > .sidebar .sidebar-user { display: flex; align-items: center; }
.sw-shell > .sidebar .user-avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.sw-shell > .sidebar .user-info { min-width: 0; }
.sw-shell > .sidebar .user-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo.has-img { background: transparent; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sw-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  min-height: 64px; padding: 10px 28px; background: var(--sw-surface); border-bottom: 1px solid var(--sw-border);
}
.sw-title { display: flex; flex-direction: column; }
.sw-title h1 { font-family: var(--sw-font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; color: var(--sw-text); line-height: 1.2; }
.sw-title span { font-size: 12px; color: var(--sw-text-3); }
.sw-back { display: none; font-size: 14px; color: var(--sw-accent); text-decoration: none; font-weight: 500; }
.sw-topbar .modes { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--sw-border); border-radius: var(--sw-radius); background: var(--sw-bg); }
.sw-topbar .modes button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--sw-text-2);
  font-family: var(--sw-font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.sw-topbar .modes button:hover { color: var(--sw-text); border: 0; }
.sw-topbar .modes button.on { background: var(--sw-surface); color: var(--sw-text); box-shadow: var(--sw-shadow-sm); }
:root[data-theme="dark"] .sw-topbar .modes button.on { background: var(--sw-surface-2); }
.sw-topbar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── Controls ── */
button {
  font-family: var(--sw-font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none;
  height: 38px; padding: 0 14px; border-radius: var(--sw-radius); border: 1px solid var(--sw-border-strong);
  background: var(--sw-surface); color: var(--sw-text);
}
button:hover { border-color: var(--sw-text-3); }
button.gold { background: var(--sw-btn); border-color: transparent; color: var(--sw-on-accent); }
button.gold:hover { background: var(--sw-btn); filter: brightness(1.08); }
button.danger { color: var(--sw-err); }
.sw-theme-btn { height: 38px; padding: 0; }
input, select, textarea {
  font-family: var(--sw-font-ui); font-size: 14px; color: var(--sw-text); background: var(--sw-surface);
  border: 1px solid var(--sw-border-strong); border-radius: var(--sw-radius); padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sw-accent-dim); box-shadow: var(--sw-focus); }
input:disabled, textarea:disabled { background: var(--sw-surface-2); color: var(--sw-text-2); }
label { font-family: var(--sw-font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--sw-text-2); }
a { color: var(--sw-accent); }
code { background: var(--sw-surface-2); border-radius: 5px; }

/* ── Review list + editor ── */
.wrap { min-height: calc(100vh - 64px); grid-template-columns: 360px 1fr; }
.wrap > aside { background: var(--sw-surface); border-right: 1px solid var(--sw-border); padding: 20px; }
.tabs button { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.tabs button.on { background: var(--sw-accent-soft); color: var(--sw-accent); border-color: transparent; }
.item { border: 1px solid var(--sw-border); border-radius: 12px; background: var(--sw-surface); padding: 14px; }
.item:hover { border-color: var(--sw-border-strong); background: var(--sw-surface); }
.item.on { border-color: var(--sw-accent); background: var(--sw-surface); box-shadow: var(--sw-focus); }
.item__meta { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--sw-text-3); }
.item__title { font-family: var(--sw-font-ui); font-size: 15px; font-weight: 600; color: var(--sw-text); }
.item__sub { font-size: 13px; color: var(--sw-text-2); }
.chip { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; border-radius: 999px; padding: 2px 8px;
  background: var(--sw-surface-2); color: var(--sw-text-2); }
.chip.warn { background: var(--sw-warn-soft); color: var(--sw-warn); }
.chip.fail { background: var(--sw-err-soft); color: var(--sw-err); }
.empty, .autostat, .hint, .url { color: var(--sw-text-2); }
main { padding: 28px 36px 80px; }
.pill { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 999px;
  background: var(--sw-warn-soft); color: var(--sw-warn); }
.pill.approved, .pill.published { background: var(--sw-ok-soft); color: var(--sw-ok); }
.pill.rejected, .pill.failed { background: var(--sw-err-soft); color: var(--sw-err); }
.pill.scheduled, .pill.planned { background: var(--sw-surface-2); color: var(--sw-text-2); }
.flags, .flags.fail, .postbox, .scriptbox, .notes-box {
  border: 1px solid var(--sw-border); border-left-width: 1px; border-radius: var(--sw-radius-lg); background: var(--sw-surface);
}
.flags { background: var(--sw-warn-soft); border-color: transparent; }
.flags.fail { background: var(--sw-err-soft); border-color: transparent; }
.flags h4, .flags.fail h4, .postbox h4, .scriptbox h4, .notes-box h4, details.more summary {
  font-family: var(--sw-font-ui); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--sw-text);
}
.flags h4 { color: var(--sw-warn); } .flags.fail h4 { color: var(--sw-err); }
.flags li, .notes-box li, .plats, .plats label, .posts div, .spin, td, .pend { color: var(--sw-text); }
.phone { border-radius: 16px; }
.actions { background: color-mix(in srgb, var(--sw-bg) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--sw-border); }
.drop { background: var(--sw-surface); border: 2px dashed var(--sw-border-strong); border-radius: var(--sw-radius-lg); color: var(--sw-text-2); }
.drop.over { border-color: var(--sw-accent); background: var(--sw-accent-soft); }
.drop b { font-family: var(--sw-font-display); color: var(--sw-text); }
.bar { background: var(--sw-surface-2); } .bar i { background: var(--sw-btn); }
table { background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: var(--sw-radius-lg); border-collapse: separate; border-spacing: 0; overflow: hidden; }
th { font-family: var(--sw-font-ui); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--sw-text-3); border-bottom: 1px solid var(--sw-border); }
td { border-bottom: 1px solid var(--sw-border); }
td button, .spin button, .pend button, .acct button { height: 30px; padding: 0 10px; font-size: 12px; }
h2.sec { font-family: var(--sw-font-display); font-weight: 600; color: var(--sw-text); }
.pend { border: 1px dashed var(--sw-border-strong); border-radius: var(--sw-radius); }
.pend.bad { border-color: color-mix(in srgb, var(--sw-err) 45%, transparent); }
.acct b { color: var(--sw-text); }
#toast { background: var(--sw-text); color: var(--sw-surface); border-radius: var(--sw-radius); box-shadow: var(--sw-shadow-lg); }
#toast.err { background: var(--sw-err); color: #FFFFFF; }
#blocked { background: var(--sw-surface); border: 1px solid var(--sw-border); border-top: 3px solid var(--sw-accent); border-radius: var(--sw-radius-lg); }
#blocked h2 { font-family: var(--sw-font-display); color: var(--sw-text); }

@media (max-width: 900px) {
  .sw-shell { flex-direction: column; }
  .sw-shell > .sidebar { display: none; }
  .sw-back { display: inline-flex; }
  .sw-topbar { padding: 10px 16px; position: static; }
  .sw-topbar .modes { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .sw-topbar .modes button { white-space: nowrap; flex-shrink: 0; }
  .wrap { grid-template-columns: 1fr; }
  main { padding: 20px 16px 80px; }
}
