/* Canvas · Mídia AD Perus — base */
:root {
  --bg: #0D0E12;
  --bg-2: #14161C;
  --panel: #181A21;
  --panel-2: #1F222B;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --text: #F2F0EB;
  --text-2: #B8B6B0;
  --text-3: #85838C;
  --accent: #FF5A1F;
  --accent-ink: #160A05;
  --accent-soft: rgba(255,90,31,.14);
  --ok: #35C47C;
  --warn: #F5B841;
  --danger: #FF4D5E;
  --stage: #08090B;
  --r-lg: 18px; --r-md: 12px; --r-sm: 8px; --r-pill: 999px;
  --f-ui: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F3F1EC; --bg-2: #EAE7E0; --panel: #FFFFFF; --panel-2: #F6F4EF;
    --line: rgba(20,18,14,.09); --line-2: rgba(20,18,14,.16);
    --text: #17161A; --text-2: #4B4950; --text-3: #7A7880;
    --accent-soft: rgba(255,90,31,.12); --stage: #DEDAD2;
    --shadow: 0 18px 50px rgba(30,20,10,.14); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F3F1EC; --bg-2: #EAE7E0; --panel: #FFFFFF; --panel-2: #F6F4EF;
  --line: rgba(20,18,14,.09); --line-2: rgba(20,18,14,.16);
  --text: #17161A; --text-2: #4B4950; --text-3: #7A7880;
  --accent-soft: rgba(255,90,31,.12); --stage: #DEDAD2;
  --shadow: 0 18px 50px rgba(30,20,10,.14); color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 500 14px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--text-3); }
.hidden { display: none !important; }

/* ── botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--panel-2); font-weight: 650; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: color-mix(in srgb, var(--panel-2) 80%, var(--text) 8%); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; flex: none; }

/* ── campos */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 650; color: var(--text-2); letter-spacing: .01em; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--bg-2); outline: none;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ── switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { appearance: none; position: absolute; inset: 0; margin: 0; border-radius: 99px; background: var(--line-2); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

/* ── cartões e chips */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; font-weight: 650; color: var(--text-2);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ── topo das páginas */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px;
}
.brand small { font-family: var(--f-ui); font-weight: 600; color: var(--text-3); font-size: 12px; margin-left: 2px; }
.spacer { flex: 1; }
.user-pill { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line-2);
}

.page { max-width: 1240px; margin: 0 auto; padding: 36px 24px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { margin: 0; font: 700 clamp(30px, 5vw, 46px)/1.02 var(--f-display); letter-spacing: -.025em; }
.page-head p { margin: 8px 0 0; color: var(--text-2); }
.eyebrow { font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); margin-bottom: 10px; }

/* ── modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(5,5,8,.6); backdrop-filter: blur(4px); animation: fade .15s ease;
}
.modal {
  width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow);
  animation: pop .18s cubic-bezier(.2,.9,.3,1.2);
}
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal-head h2 { margin: 0; font: 700 21px/1.2 var(--f-display); letter-spacing: -.01em; flex: 1; }
.modal-body { padding: 12px 22px 8px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ── toast */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 650; font-size: 13px;
  box-shadow: var(--shadow); animation: pop .2s ease; max-width: min(520px, calc(100vw - 32px));
}
.toast.error { background: var(--danger); color: #fff; }

/* ── vazio */
.empty { text-align: center; padding: 56px 20px; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty strong { display: block; color: var(--text); font: 700 18px var(--f-display); margin-bottom: 6px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .page { padding: 24px 16px 64px; }
  .brand small { display: none; }
}
