:root {
  /* mebarez.com palette (dark) */
  --bg: #09090b; --panel: #18181b; --ink: #fafafa; --muted: #a1a1aa; --line: #27272a;
  --brand: #be123c; --brand-ink: #fafafa; --accent: #fb7185; --ok: #4ade80; --warn: #fbbf24; --bad: #fb7185; --hot: #fb923c;
  --radius: 8px; --shadow: none;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--ink); }
h1, h2 { letter-spacing: -.02em; font-weight: 900; }
th, label, .stat span { font-family: var(--mono); letter-spacing: .06em; }
a { color: var(--accent); }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
input, textarea, select { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
input[type=checkbox] { width: auto; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.logo { font-weight: 700; font-size: 18px; margin: 0 8px 24px; display: flex; gap: 8px; align-items: center; }
.logo span { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); display: inline-block; }
.side a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); margin-bottom: 2px; }
.side a.on, .side a:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
main { padding: 28px; max-width: 1200px; width: 100%; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; } .stat span { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr.click { cursor: pointer; } tr.click:hover td { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--muted); }
.badge.sent { background: #1e1b4b; color: #a5b4fc; } .badge.viewed { background: #422006; color: #fcd34d; }
.badge.accepted { background: #052e16; color: #86efac; } .badge.declined { background: #4c0519; color: #fda4af; }
.badge.hot { background: #431407; color: var(--hot); }
.badge.ready { background: #082f49; color: #7dd3fc; } .badge.paid { background: #052e16; color: #86efac; }
.score { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 3px solid var(--line); }
.feed { list-style: none; margin: 0; padding: 0; } .feed li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .feed li:last-child { border: 0; }
.dash { grid-template-columns: 2fr 1fr; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand); }

/* editor */
.editor { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.block { position: relative; }
.block .tools { position: absolute; right: 12px; top: 12px; display: flex; gap: 4px; }
.block .type { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.items td { padding: 4px; border: 0; } .items input { padding: 6px 8px; }
.adder { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius); }
.sticky { position: sticky; top: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(10, 12, 20, .5); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow: auto; }
.modal .card { width: 100%; max-width: 620px; }
#toast { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
#toast div { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; }
#toast div.bad { background: var(--bad); color: #fff; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.center .card { width: 100%; max-width: 380px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(1turn); } }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 10px; }
  .logo { margin: 0 10px 0 0; }
  main { padding: 16px; }
  .editor, .g2, .g3, .dash { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none; }
}
