/* Admin panel, modeled on the reference screenshots: black background,
   purple accent, Inter, rounded dark cards. */
:root {
  --bg: #000000;
  --card: #0a0a0b;
  --card-2: #18181b;
  --card-3: #222225;
  --border: #27272a;
  --border-strong: #3a3a3f;
  --text: #ececee;
  --muted: #9b9ba3;
  --faint: #6c6c74;
  --accent: #6d5cff;
  --accent-soft: rgba(109, 92, 255, 0.14);
  --accent-text: #9d90ff;
  --green: #22c55e;
  --red: #f05252;
  --amber: #f0a449;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; }
code { background: var(--card-3); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.error-text { color: var(--red); }
.danger-text { color: var(--red) !important; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex; align-items: flex-end;
  font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -0.2px;
}
.brand.big { font-size: 24px; margin-bottom: 18px; }
.brand-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin: 0 0 3px 2px; }
.brand-tag {
  margin-left: 8px; align-self: center;
  font-size: 11px; font-weight: 600; color: var(--accent-text);
  background: var(--accent-soft); padding: 2px 8px; border-radius: 999px;
}
.topnav { display: flex; gap: 20px; flex: 1; }
.topnav a, .topnav span { font-size: 13.5px; color: var(--muted); text-decoration: none; padding: 4px 0; }
.topnav a.active, .topnav a:hover { color: var(--text); }
.topnav .soon { opacity: 0.45; cursor: default; }
.who { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.who form { margin: 0; }
.link-button { background: none; border: none; color: var(--text); font: inherit; cursor: pointer; padding: 0; }
.link-button:hover { text-decoration: underline; }

/* ---------- Buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card-2);
  color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--card-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link { color: var(--accent-text); text-decoration: none; font-weight: 500; background: none; border: none; font: inherit; cursor: pointer; padding: 0; }
.link:hover { text-decoration: underline; }

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font: inherit; font-size: 14px;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b9ba3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input.small { height: 34px; font-size: 13px; width: auto; min-width: 200px; }
input[type=number].input { -moz-appearance: textfield; }

.prefixed { position: relative; display: flex; align-items: center; }
.prefixed .prefix { position: absolute; left: 12px; color: var(--muted); font-size: 13px; pointer-events: none; }
.prefixed .input { padding-left: 38px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.label { font-size: 13.5px; font-weight: 500; }
.help { font-size: 12px; color: var(--muted); }
.help.block { display: block; margin-top: 2px; }

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px;
}
.notice { font-size: 12.5px; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--muted); }
.notice.warn { border-color: rgba(240, 164, 73, 0.5); color: var(--amber); }
.notice.error { border-color: rgba(240, 82, 82, 0.5); color: var(--red); }

/* ---------- Listing ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; }
.page-head p { margin: 0; }
.filters { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.profile-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.profile-card-top { display: flex; gap: 12px; align-items: center; }
.mini-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--card-3) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted);
}
.profile-card-id { display: flex; flex-direction: column; min-width: 0; }
.profile-card-id span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 7px; font-size: 11.5px; font-weight: 600;
  background: var(--card-3); color: var(--muted);
}
.chip.small { height: 22px; }
.chip.green { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.chip.amber { background: rgba(240, 164, 73, 0.15); color: var(--amber); }
.chip.purple { background: var(--accent-soft); color: var(--accent-text); }
.owner { margin: 0; font-size: 12.5px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.card-actions form { margin: 0; }
.empty-card { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 16px; margin-bottom: 14px; }

/* ---------- Editor ---------- */
.editor { max-width: 1320px; margin: 0 auto; padding: 22px 28px 100px; }
.editor-head { margin-bottom: 16px; }
.editor-head .back { font-size: 13px; }
.editor-title { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.editor-title h1 { margin: 0; font-size: 22px; }
.editor-head p { margin: 4px 0 0; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  background: none; border: none; color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 500;
  padding: 10px 12px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab.is-soon { opacity: 0.5; }

.tab-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 4px 24px; }
.tab-card.readonly { opacity: 0.6; pointer-events: none; }
.section { padding: 22px 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.section-head p { margin: 0; }
.icon { display: inline-flex; width: 18px; height: 18px; }
.icon svg { width: 100%; height: 100%; }
.icon.accent { color: var(--accent-text); }
.icon.big { width: 34px; height: 34px; color: var(--faint); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; margin-top: 14px; }

.notice-box {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); margin-top: 14px;
}
.notice-box b { color: var(--text); }

.alert { position: relative; border-radius: 12px; padding: 14px 40px 14px 16px; margin-bottom: 14px; font-size: 13px; border: 1px solid; }
.alert ul { margin: 8px 0 0; padding-left: 18px; }
.alert.error { background: rgba(240, 82, 82, 0.08); border-color: rgba(240, 82, 82, 0.4); }
.alert.success { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.4); }
.alert .link { display: inline-block; margin-top: 6px; }
.alert-close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }

/* Uploads */
.images-row { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.upload-field { display: flex; flex-direction: column; gap: 6px; }
.upload-field.cover { flex: 1; max-width: 420px; }
.upload-box {
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  background: var(--card) center / cover no-repeat;
  margin-top: 4px;
}
.upload-box:hover { border-color: var(--accent); }
.upload-box.cover { height: 110px; }
.upload-box.avatar { width: 110px; height: 110px; border-radius: 50%; }
.upload-box.has-image { border-style: solid; }
.upload-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.upload-inner .icon { width: 22px; height: 22px; }
.upload-box.has-image .upload-inner {
  background: rgba(0, 0, 0, 0.6); padding: 6px 10px; border-radius: 8px; color: #fff;
}
.upload-field .link { align-self: flex-start; font-size: 12px; }

/* Status cards */
.status-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.status-option {
  text-align: left; background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 12px; cursor: pointer; color: var(--text); font: inherit;
  display: flex; flex-direction: column; gap: 6px;
}
.status-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.status-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--green); }
.dot.red { background: #f97350; }
.dot.gray { background: #71717a; }

/* Toggles */
.toggle-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin-top: 6px; }
.toggle-label { font-size: 13.5px; font-weight: 500; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .15s; }
.slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Counters */
.counter-tiles { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.counter-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-right: 1px solid var(--border); }
.counter-tile:last-child { border-right: none; }
.counter-tile strong { font-size: 18px; }
.counter-tile span { font-size: 11.5px; color: var(--muted); }
.section > .grid-2:last-child { margin-top: 16px; }

/* Lists */
.rows { display: flex; flex-direction: column; gap: 10px; }
.list-row { display: flex; align-items: center; gap: 10px; }
.list-row > .input, .list-row > .prefixed { flex: 1; }
.list-row.narrow > .prefixed { flex: 0 0 220px; }
.social-network { flex: 0 0 160px; }
.row-buttons { display: flex; gap: 2px; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--card-3); color: var(--text); }
.icon-btn.danger:hover { color: var(--red); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn .icon { width: 16px; height: 16px; }

.check { position: relative; width: 26px; height: 26px; flex-shrink: 0; cursor: pointer; }
.check input { opacity: 0; position: absolute; }
.checkmark { position: absolute; inset: 0; border-radius: 7px; background: var(--card-3); border: 1px solid var(--border-strong); }
.check input:checked + .checkmark { background: var(--card-3); }
.check input:checked + .checkmark::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--green); font-size: 13px; }

.item-card { background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.item-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); }
.item-head .row-buttons { margin-left: auto; }
.item-body { padding: 14px; }
.item-body > .help { margin: 0 0 4px; }

/* Visual */
.theme-group { margin-bottom: 18px; }
.small-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.theme-swatch { background: none; border: 2px solid transparent; border-radius: 14px; padding: 4px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 6px; }
.theme-swatch.selected { border-color: var(--accent); }
.swatch-preview { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; border: 1px solid; height: 76px; }
.swatch-card { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 6px; flex: 1; }
.swatch-line { height: 4px; width: 70%; border-radius: 2px; opacity: 0.8; }
.swatch-line.short { width: 45%; }
.swatch-bar { height: 12px; border-radius: 999px; }
.swatch-name { font-size: 12px; text-align: center; }

/* Soon */
.soon-panel { padding: 48px 20px; text-align: center; color: var(--muted); }
.soon-panel p { margin: 10px 0 0; }

/* Preview */
.editor-preview { position: sticky; top: 76px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 10px; }
.section-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: 0.6px; color: var(--muted); text-transform: uppercase; }
.phone { border: 1px solid var(--border); border-radius: 22px; overflow: hidden; background: #111; height: calc(100vh - 190px); min-height: 480px; }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.editor-preview > p { margin: 8px 0 0; }

/* Save bar */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 28px;
  background: rgba(10, 10, 11, 0.96); border-top: 1px solid var(--border);
}
.savebar-actions { display: flex; gap: 8px; }

@media (max-width: 1000px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-preview { position: static; }
  .phone { height: 640px; max-width: 400px; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; gap: 14px; flex-wrap: wrap; }
  .who span { display: none; }
  .page, .editor { padding-left: 16px; padding-right: 16px; }
  .tab-card { padding: 4px 16px; }
  .grid-2, .grid-3, .status-options { grid-template-columns: 1fr; }
  .images-row { flex-direction: column; }
  .savebar { padding: 10px 16px; }
  .savebar #saveStatus { font-size: 12px; }
}

/* ---------- Flash messages ---------- */
.flashes { max-width: 1320px; margin: 16px auto 0; padding: 0 28px; }
.flashes .alert { padding-right: 16px; word-break: break-all; }
.alert.info { background: var(--accent-soft); border-color: rgba(109, 92, 255, 0.4); }
.alert .chips { margin-top: 10px; }
.link-code { display: block; margin: 6px 0 4px; padding: 8px 10px; word-break: break-all; }

/* ---------- Preview mode switch ---------- */
.segmented { display: flex; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.segmented button { flex: 1; background: none; border: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px; border-radius: 8px; cursor: pointer; }
.segmented button.active { background: var(--card-3); color: var(--text); }

/* ---------- Mídias ---------- */
.media-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
.upload-box.square { width: 140px; height: 140px; }
.piece-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.piece-thumb {
  position: relative; width: 72px; height: 72px; border-radius: 10px;
  background: var(--card-3) center / cover no-repeat; border: 1px solid var(--border);
}
.piece-thumb.video { display: flex; align-items: center; justify-content: center; }
.piece-video { font-size: 11px; color: var(--muted); }
.piece-remove {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: var(--card-3); color: var(--text); font-size: 10px; cursor: pointer;
  box-shadow: 0 0 0 2px var(--card-2);
}
.piece-remove:hover { background: var(--red); }
.add-pieces {
  width: 100%; padding: 12px; border: 1.5px dashed var(--border-strong); border-radius: 10px;
  background: var(--card); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.add-pieces:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Publicações ---------- */
.set-choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.set-choice {
  position: relative; width: 88px; height: 88px; border-radius: 10px;
  border: 2px solid var(--border); background: var(--card-3) center / cover no-repeat;
  color: var(--text); font: inherit; font-size: 11.5px; cursor: pointer; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.set-choice.empty { align-items: center; color: var(--muted); }
.set-choice.selected { border-color: var(--accent); }
.set-label { width: 100%; background: rgba(0, 0, 0, 0.6); padding: 3px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-lock { position: absolute; left: 4px; top: 4px; font-size: 12px; }
.warn-box { background: var(--amber); color: #1c1a19; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 6px; }
.vitrine-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.vitrine-box .label { margin: 14px 0 2px; }
.vitrine-box .help { margin: 0 0 8px; display: block; }
.blur-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.selected { border-color: var(--accent); color: var(--accent-text); }
.grid-3.tight { margin-top: 0; }

/* ---------- Tables (Pedidos, Dashboard) ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; background: var(--card-2); }
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.total td { font-weight: 700; background: var(--card-2); }
table.data a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
table.data a:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 6px; }
.row-actions form { margin: 0; }
.filters .input.small { min-width: 160px; }
.filters input[type=search].input { min-width: 240px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.period-bar .btn.active { border-color: var(--accent); color: var(--accent-text); }
.period-bar form { display: flex; align-items: center; gap: 6px; margin: 0; }
.period-bar input[type=date].input { height: 34px; width: auto; font-size: 12.5px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--accent-text); text-decoration: none; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.metric { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.metric span { display: block; font-size: 11.5px; color: var(--muted); }
.metric strong { display: block; font-size: 20px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.metric em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.metric.accent { border-color: rgba(109, 92, 255, 0.5); background: var(--accent-soft); }
h2.block-title { font-size: 15px; margin: 22px 0 10px; }

@media (max-width: 760px) {
  .media-body { grid-template-columns: 1fr; }
}

/* ======================================================================
   Dashboard — dark glass cards with the panel's purple accent
   ====================================================================== */
.dash-page {
  --accent: #6d5cff;
  --accent-glow: #a597ff;
  --track: rgba(255, 255, 255, 0.07);
  --glass: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(109, 92, 255, 0.16), transparent 60%),
    radial-gradient(700px 400px at -10% 30%, rgba(109, 92, 255, 0.08), transparent 60%),
    #000;
  min-height: 100vh;
}
.dash { max-width: 1400px; margin: 0 auto; padding: 22px 28px 60px; display: flex; flex-direction: column; gap: 16px; }

.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-title { display: flex; gap: 16px; align-items: center; }
.slash { width: 6px; height: 46px; border-radius: 3px; background: linear-gradient(180deg, #b9adff, #6d5cff); transform: skewX(-18deg); box-shadow: 0 0 18px rgba(109, 92, 255, 0.7); }
.crumbs { display: flex; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--accent-text); text-decoration: none; }
.dash-title h1 { margin: 0; font-size: 26px; letter-spacing: -0.4px; }
.dash-title p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.test-flag { color: var(--amber); font-weight: 600; margin-left: 6px; }
.dash-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.period-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.period-select {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(255, 255, 255, 0.03);
}
.period-select svg { width: 17px; height: 17px; color: var(--muted); }
.period-select select { background: transparent; border: none; color: var(--text); font: inherit; font-size: 13.5px; outline: none; cursor: pointer; }
.period-select option { background: #111; }
.custom-range { display: none; gap: 6px; align-items: center; }
.custom-range.show { display: inline-flex; }
.custom-range input { height: 40px; background: rgba(255,255,255,.03); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); padding: 0 8px; font: inherit; font-size: 12.5px; }
.custom-range button, .tool-btn {
  height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03); color: var(--text); font: inherit; font-size: 13px; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; cursor: pointer;
}
.tool-btn.on { border-color: var(--amber); color: var(--amber); }
.me {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; background: linear-gradient(135deg, #b9adff, #6d5cff); color: #fff;
  box-shadow: 0 0 0 2px #000, 0 0 0 3px rgba(165, 151, 255, 0.6);
}

.card {
  position: relative; background: var(--glass), #0a0a0c;
  border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 18px; padding: 18px 20px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 600; }
.card-head h2 svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Hero */
.dash-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }
.hero-card {
  position: relative; overflow: hidden; border-radius: 20px; padding: 24px 26px;
  border: 1px solid rgba(165, 151, 255, 0.55);
  background: linear-gradient(135deg, rgba(109, 92, 255, 0.28), rgba(20, 16, 40, 0.9) 55%, #07060c);
  box-shadow: 0 0 0 1px rgba(109, 92, 255, 0.15), 0 20px 60px -20px rgba(109, 92, 255, 0.55), inset 0 1px 0 rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 6px; min-height: 290px;
}
.hero-glow { position: absolute; right: -80px; top: -60px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(165, 151, 255, 0.45), transparent 65%); pointer-events: none; }
.hero-mark {
  position: absolute; right: 26px; top: 50%; transform: translateY(-58%) skewX(-10deg);
  font-family: 'Fredoka', 'Inter', sans-serif; font-weight: 700; font-size: 190px; line-height: 1;
  background: linear-gradient(160deg, #ffffff 10%, #b9adff 45%, #3a2f8f 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 10px 30px rgba(109, 92, 255, 0.55)); opacity: 0.85; pointer-events: none; user-select: none;
}
.hero-mark span { color: #b9adff; -webkit-text-fill-color: #b9adff; }
.hero-label { position: relative; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.hero-label svg { width: 17px; height: 17px; }
.hero-value { position: relative; font-size: 42px; font-weight: 800; letter-spacing: -1px; font-style: italic; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-sub { position: relative; color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.mix { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 150px)); gap: 8px 18px; margin: 14px 0 16px; }
.mix div { display: flex; flex-direction: column; }
.mix dt { font-size: 11.5px; color: rgba(255, 255, 255, 0.55); }
.mix dd { margin: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-btn {
  position: relative; align-self: flex-start; margin-top: auto; display: inline-flex; gap: 8px; align-items: center;
  padding: 10px 16px; border-radius: 12px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff; text-decoration: none; font-weight: 600; font-size: 13px;
}
.hero-btn:hover { border-color: var(--accent-glow); }

/* Deltas */
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.delta.up { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.delta.down { color: #f87171; background: rgba(248, 113, 113, 0.1); }
.delta.flat { color: var(--muted); background: rgba(255, 255, 255, 0.05); }
.hero-label .delta { border: 1px solid rgba(255,255,255,.12); }

/* Chart */
.chart-card { display: flex; flex-direction: column; }
.seg { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.seg a { padding: 5px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a.active { background: linear-gradient(135deg, #8a7bff, #5b47f0); color: #fff; box-shadow: 0 0 14px rgba(109, 92, 255, 0.5); }
.chart { position: relative; flex: 1; min-height: 220px; }
.chart svg { display: block; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; opacity: 0;
  background: #15151a; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; padding: 6px 10px;
  display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); transition: opacity .1s;
}
.chart-tip b { color: var(--text); font-size: 13px; }
.chart-tip.pinned span { display: none; }
.chart-table { margin-top: 6px; font-size: 12px; color: var(--muted); }
.chart-table summary { cursor: pointer; }
.chart-table table { margin-top: 8px; border-collapse: collapse; }
.chart-table td, .chart-table th { padding: 3px 14px 3px 0; text-align: left; font-variant-numeric: tabular-nums; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(56px, 32%); grid-template-rows: auto auto; column-gap: 14px; row-gap: 8px; align-items: start; overflow: hidden; }
.kpi > .kpi-note { grid-column: 2 / 4; grid-row: 2; }
.kpi-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: #c9c0ff; background: linear-gradient(135deg, rgba(109, 92, 255, 0.35), rgba(109, 92, 255, 0.1));
  border: 1px solid rgba(165, 151, 255, 0.3);
}
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; position: relative; z-index: 1; }
.kpi-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.kpi-body strong { white-space: nowrap; font-size: 24px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 11.5px; color: var(--faint); }
.spark { grid-column: 3; grid-row: 1; align-self: end; width: 100%; height: 46px; opacity: 0.9; }

/* Bottom row */
.dash-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 0.9fr); gap: 16px; }
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before { content: ''; position: absolute; left: 17px; top: 12px; bottom: 12px; width: 1px; background: rgba(255, 255, 255, 0.08); }
.ev { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.ev-dot {
  width: 35px; height: 35px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: #121216; border: 1px solid rgba(255, 255, 255, 0.1); color: var(--accent-glow); z-index: 1;
}
.ev-dot svg { width: 17px; height: 17px; }
.ev-subscription .ev-dot { color: #ffd166; }
.ev-mimo .ev-dot { color: #4ade80; }
.ev-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ev-text b { font-size: 13px; font-weight: 600; }
.ev-text span { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-amount { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-note { color: var(--muted); font-size: 13px; padding: 10px 0; list-style: none; }

.rank-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.rank-tabs button { background: none; border: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 8px 0; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rank-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr) auto 76px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.rank-list li:last-child { border-bottom: none; }
.rank-list li.empty-note { display: block; }
.pos { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.pos-1 { background: linear-gradient(135deg, #ffd166, #f0a449); color: #1c1a19; }
.pos-2 { background: linear-gradient(135deg, #e4e4e7, #a1a1aa); color: #1c1a19; }
.pos-3 { background: linear-gradient(135deg, #f2b27a, #b8693a); color: #1c1a19; }
.avatar-i { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, rgba(165, 151, 255, 0.4), rgba(109, 92, 255, 0.15)); border: 1px solid rgba(165, 151, 255, 0.35); }
.rank-name { display: flex; flex-direction: column; min-width: 0; font-size: 13px; font-weight: 600; }
.rank-name a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name a:hover { color: var(--accent-glow); }
.rank-name small { font-size: 11.5px; color: var(--faint); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.rank-list .delta { justify-self: end; }

.downsell {
  border-color: rgba(165, 151, 255, 0.35);
  background: radial-gradient(400px 200px at 100% 100%, rgba(109, 92, 255, 0.25), transparent 70%), var(--glass), #0a0a0c;
}
.ring-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ring-value { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin-bottom: 6px; }
.ring { width: 118px; height: 118px; flex-shrink: 0; filter: drop-shadow(0 0 14px rgba(109, 92, 255, 0.45)); }
.ring-money { font-size: 13px; color: var(--muted); margin: 12px 0; }
.ring-money b { color: var(--text); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; }
.steps div { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 10px; padding: 8px; text-align: center; }
.steps dt { font-size: 11px; color: var(--muted); }
.steps dd { margin: 2px 0 0; font-size: 16px; font-weight: 700; }
.chip.red { background: rgba(240, 82, 82, .15); color: #f87171; }

@media (max-width: 1150px) {
  .dash-top, .dash-bottom { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dash { padding: 16px; }
  .kpis { grid-template-columns: 1fr; }
  .hero-mark { font-size: 130px; opacity: .45; }
  .hero-value { font-size: 34px; }
}

.readonly-note { align-self: center; }
.readonly-banner { margin-bottom: 14px; padding-right: 16px; }
.tab-card.readonly { opacity: 1; pointer-events: auto; }
.tab-card.readonly input, .tab-card.readonly textarea, .tab-card.readonly select { opacity: .75; cursor: not-allowed; }
.tab-card.readonly button:disabled, .tab-card.readonly .upload-box { cursor: not-allowed; }
.tab-card.readonly .upload-box { pointer-events: none; }

/* ---------- Login steps, codes, account ---------- */
.step-kicker { font-size: 12px; font-weight: 600; color: var(--accent-text); letter-spacing: .3px; margin: -6px 0 12px; }
.who-line { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; }
.login-card .notice { margin: 0 0 14px; line-height: 1.5; }
.login-card.wide-card { max-width: 440px; }
.input.mono, .codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; padding: 14px 18px 14px 36px; margin: 0 0 12px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; font-size: 15px; letter-spacing: 1px; }
.saved-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 12px 0; cursor: pointer; }
.saved-line input { width: 17px; height: 17px; accent-color: var(--accent); }
.btn.disabled { opacity: .45; cursor: not-allowed; }
.who-link { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.who-link:hover { color: var(--text); }
.page.narrow { max-width: 760px; }
.form-card { padding: 4px 24px; }
