/*
 * Identidade do CreativeHub (ag.twentyhub.com.br): estilo macOS atual (Liquid Glass).
 * Canvas cinza-claro com "papel de parede" em degradê, superfícies brancas de cantos
 * contínuos, vidro translúcido nas camadas de navegação e azul Apple como cor de ação.
 * Mesmos tokens de CreativeHub/src/index.css. O tema escuro vem da classe .dark no <html>.
 */
:root {
  --brand: 0 113 227; /* #0071e3 */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --line: rgb(0 0 0 / 0.08);
  --line-strong: rgb(0 0 0 / 0.16);
  --fill: rgb(118 118 128 / 0.12);
  --lime: #e3eefc; /* tinta de seleção */
  --lime-ink: #0058b9;
  --violet: #0066cc;
  --in: #1f8a3b;
  --out: #d70015;
  --warn: #c25e00;
  --glass: rgb(255 255 255 / 0.62);
  --glass-strong: rgb(255 255 255 / 0.8);
  --glass-edge: rgb(255 255 255 / 0.7);
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  --shadow-float: 0 1px 1px rgb(0 0 0 / 0.04), 0 12px 40px rgb(0 0 0 / 0.12);
  /* Degradê do fundo: o "atmosphere" do CreativeHub (papel de parede pastel do macOS) */
  --wall:
    radial-gradient(55% 65% at 0% 0%, rgb(150 210 255 / 0.6), transparent 70%),
    radial-gradient(45% 60% at 100% 0%, rgb(190 170 255 / 0.55), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, rgb(255 180 210 / 0.55), transparent 70%),
    radial-gradient(55% 60% at 15% 100%, rgb(170 225 255 / 0.5), transparent 70%),
    linear-gradient(135deg, #eef4ff 0%, #f5f2ff 50%, #fdf2f7 100%);
  color-scheme: light;
}
.dark {
  --brand: 10 132 255; /* #0a84ff */
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --fg: #f5f5f7;
  --muted: #98989d;
  --line: rgb(255 255 255 / 0.1);
  --line-strong: rgb(255 255 255 / 0.18);
  --fill: rgb(118 118 128 / 0.24);
  --lime: #12345c;
  --lime-ink: #9ccbff;
  --violet: #4da3ff;
  --in: #30d158;
  --out: #ff453a;
  --warn: #ff9f0a;
  --glass: rgb(30 30 32 / 0.58);
  --glass-strong: rgb(36 36 38 / 0.78);
  --glass-edge: rgb(255 255 255 / 0.1);
  --shadow-card: 0 0 0 1px rgb(255 255 255 / 0.04);
  --shadow-float: 0 0 0 1px rgb(255 255 255 / 0.06), 0 16px 48px rgb(0 0 0 / 0.5);
  --wall:
    radial-gradient(55% 65% at 0% 0%, rgb(40 140 255 / 0.3), transparent 70%),
    radial-gradient(45% 60% at 100% 0%, rgb(120 90 255 / 0.32), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, rgb(255 100 150 / 0.22), transparent 70%),
    radial-gradient(55% 60% at 15% 100%, rgb(100 210 255 / 0.16), transparent 70%),
    linear-gradient(135deg, #05070d 0%, #0b0716 55%, #120710 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
*, ::before, ::after { border-color: var(--line); }
html, body { margin: 0; min-height: 100%; }

body {
  background: var(--wall);
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', Inter, 'Helvetica Neue', 'Segoe UI', sans-serif;
  letter-spacing: -0.008em;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgb(var(--brand) / 0.25); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.grow, .spacer { flex: 1; }

/* Logo: mesmo símbolo do CreativeHub */
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; letter-spacing: -0.01em; }
.logo-mark {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, #3a3a3c, #000);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 1px 3px rgb(0 0 0 / 0.25);
}
.logo-mark::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 2.5px solid #fff; box-sizing: border-box; }
.logo-mark::after {
  content: ''; position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, #64d2ff, #bf5af2);
}
.logo-text { line-height: 1; }
.logo-text b { display: block; font-size: 15px; font-weight: 600; }
.logo-text small { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--muted); }

/* Barra superior (vidro) */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px; }
.top .logo { margin-right: 14px; }

.search { position: relative; width: min(300px, 30vw); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search input {
  width: 100%; height: 36px; padding: 0 14px 0 34px; border-radius: 999px; border: 0;
  background: var(--fill); outline: none; transition: box-shadow 0.15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { box-shadow: 0 0 0 4px rgb(var(--brand) / 0.18); }
.pill-select {
  height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--fill);
  outline: none; cursor: pointer; max-width: 180px; font-size: 13px; font-weight: 500;
}
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--fill); color: var(--fg); }

/* Botões em pílula */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: filter 0.15s, background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: rgb(var(--brand)); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.lime { background: var(--lime); color: var(--lime-ink); }
.btn.lime:hover { filter: brightness(0.95); }
.btn.ghost { background: var(--fill); color: var(--fg); }
.btn.ghost:hover { background: color-mix(in oklab, var(--fill), var(--fg) 6%); }
.btn.plain { background: none; color: var(--muted); }
.btn.plain:hover { background: var(--fill); color: var(--fg); }
.btn.danger:hover { color: var(--out); }
.btn.sm { padding: 6px 12px; font-size: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-card); }

/* Página do quadro */
.board-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.hero { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 24px 16px 6px; }
.hero-text { flex: 1; min-width: 220px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.hero h1 { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -0.028em; line-height: 1.08; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(118px, 1fr)); gap: 10px; }
.stat {
  text-align: left; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
  font: inherit; color: inherit;
}
.stat:hover { border-color: var(--line-strong); }
.stat.active { border-color: rgb(var(--brand)); box-shadow: 0 0 0 3px var(--lime); }
.stat .n { font-size: 28px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .t { margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.tone-out { color: var(--out); }
.tone-brand { color: rgb(var(--brand)); }
.tone-violet { color: var(--violet); }

.board {
  flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 16px 24px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain;
}

/* Colunas em vidro */
.column {
  flex: 0 0 292px; max-height: 100%; display: flex; flex-direction: column;
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 24px;
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), var(--shadow-card);
  scroll-snap-align: start;
}
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 16px; }
.column-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-head .count {
  font-size: 12px; font-weight: 600; color: var(--muted); background: var(--fill);
  border-radius: 99px; padding: 0 8px; line-height: 20px; font-variant-numeric: tabular-nums;
}
.column.is-done .column-head .count { background: color-mix(in srgb, var(--in) 14%, transparent); color: var(--in); }
.column-head .menu-btn { border: 0; background: none; cursor: pointer; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.column-head .menu-btn:hover { background: var(--fill); color: var(--fg); }
.column-head h2 input { width: 100%; font-weight: 600; border: 0; background: var(--surface); border-radius: 8px; padding: 3px 8px; outline: none; box-shadow: 0 0 0 3px rgb(var(--brand) / 0.25); }

.cards { flex: 1; min-height: 8px; overflow-y: auto; padding: 2px 8px 4px; display: flex; flex-direction: column; gap: 8px; }

.task {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-card); padding: 11px 13px; cursor: pointer; user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.task:hover { border-color: var(--line-strong); box-shadow: var(--shadow-float); }
.task:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(var(--brand) / 0.35); }
.task.dragging { opacity: 0.35; }
.task .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.task .label { height: 6px; min-width: 32px; border-radius: 99px; }
.task .label.named { height: auto; min-width: 0; font-size: 11px; font-weight: 600; padding: 1px 8px; color: #fff; line-height: 16px; }
.task .title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.task .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.task .meta:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; background: var(--fill); color: var(--muted); white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.client { color: var(--fg); }
.chip.late { color: var(--out); background: color-mix(in srgb, var(--out) 12%, transparent); }
.chip.soon { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.chip.today { color: var(--lime-ink); background: var(--lime); }
.chip svg.i { width: 12px; height: 12px; }

/* Check de concluída: aparece ao passar o mouse, como no Trello */
.task { -webkit-touch-callout: none; -webkit-user-select: none; }
.title-row { display: flex; align-items: flex-start; }
.check {
  flex: none; display: grid; place-items: center; width: 0; height: 17px; margin: 1px 0 0; padding: 0;
  border: 0; border-radius: 50%; background: none; color: transparent; opacity: 0; overflow: hidden; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--muted); transition: width 0.15s, margin 0.15s, opacity 0.15s, background 0.15s;
}
.task:hover .check, .task:focus-within .check, .task.is-done .check { width: 17px; margin-right: 7px; opacity: 1; }
.check svg.i { width: 11px; height: 11px; stroke-width: 3.2; }
.check:hover { color: var(--muted); }
.task.is-done .check { background: var(--in); box-shadow: none; color: #fff; }
.task.is-done .title { color: var(--muted); }

/* Arrastar */
.drag-ghost {
  position: fixed; z-index: 60; margin: 0; pointer-events: none; transform: rotate(3deg);
  box-shadow: 0 20px 44px rgb(0 0 0 / 0.28) !important; opacity: 0.97;
}
.column.drag-ghost { max-height: none; }
.card-placeholder { flex: none; border-radius: 14px; background: var(--fill); }
.list-placeholder { flex: 0 0 292px; align-self: flex-start; border-radius: 24px; background: var(--fill); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.board.panning { cursor: grabbing; user-select: none; }
.column-head { cursor: grab; }

.column-foot { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.add-card {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; cursor: pointer;
  color: var(--muted); padding: 8px 10px; border-radius: 12px; font-weight: 500; text-align: left;
}
.add-card:hover { background: var(--fill); color: var(--fg); }
.add-card svg.i { width: 15px; height: 15px; }
.composer textarea {
  width: 100%; resize: none; border: 1px solid rgb(var(--brand)); border-radius: 14px; background: var(--surface);
  padding: 10px 13px; outline: none; box-shadow: 0 0 0 4px rgb(var(--brand) / 0.18); min-height: 60px;
}
.composer .row { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.show-more { border: 0; background: none; color: var(--violet); cursor: pointer; padding: 4px 10px; font-weight: 500; text-align: left; }
.show-more:hover { text-decoration: underline; text-underline-offset: 4px; }

.add-list { flex: 0 0 292px; }
.add-list .add-card { background: var(--glass); border: 1px dashed var(--line-strong); padding: 14px 16px; border-radius: 24px; }
.add-list input { width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid rgb(var(--brand)); background: var(--surface); outline: none; box-shadow: 0 0 0 4px rgb(var(--brand) / 0.18); }

/* Popover / menu (vidro forte) */
.menu {
  position: fixed; z-index: 40; min-width: 220px; padding: 6px; border-radius: 16px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-float); animation: fade-up 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.menu button:hover { background: var(--fill); }
.menu button.danger { color: var(--out); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 8px; }

/* Janelas (modais) */
dialog.sheet {
  width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 20px 22px 18px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--fg);
  box-shadow: var(--shadow-float);
}
dialog.sheet.narrow { width: min(420px, calc(100vw - 32px)); }
dialog.sheet[open] { animation: fade-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
dialog::backdrop { background: rgb(0 0 0 / 0.3); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-head strong { font-size: 17px; color: var(--fg); }
.title-input {
  width: 100%; resize: none; border: 0; background: none; outline: none; padding: 0; margin: 0 0 16px;
  font-size: 24px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.25; overflow: hidden;
}
.sheet-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; min-width: 0; margin-bottom: 14px; }
.sheet-grid .field { margin-bottom: 0; }
.field label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); outline: none; min-height: 40px; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgb(var(--brand)); box-shadow: 0 0 0 4px rgb(var(--brand) / 0.18); }
.label-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.label-picker button {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; background: var(--fill);
  border-radius: 999px; padding: 5px 12px 5px 7px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--fg);
}
.label-picker .swatch { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 800; }
.label-picker button[aria-pressed='true'] { background: var(--lime); color: var(--lime-ink); border-color: rgb(var(--brand) / 0.35); }
.label-picker button[aria-pressed='false'] .swatch { color: transparent; }
.sheet-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.settings-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 14px; }
.settings-row { display: flex; align-items: center; gap: 8px; }
.settings-row input[type='text'] { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.settings-row input[type='text']:focus { border-color: rgb(var(--brand)); box-shadow: 0 0 0 4px rgb(var(--brand) / 0.18); }
.count-pill {
  min-width: 26px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--fill); border-radius: 99px; padding: 0 8px; line-height: 22px; font-variant-numeric: tabular-nums;
}
.inline-new { display: flex; gap: 6px; align-items: center; }
.inline-new input {
  flex: 1; min-width: 0; padding: 9px 13px; border-radius: 10px; border: 1px solid rgb(var(--brand)); background: var(--surface);
  outline: none; box-shadow: 0 0 0 4px rgb(var(--brand) / 0.18); min-height: 40px;
}
#clients-dialog .inline-new { margin: 10px 0 4px; }
#clients-dialog .settings-list { max-height: 50dvh; overflow-y: auto; padding: 2px; }
.settings-row input[type='color'] { width: 32px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--glass-strong); color: var(--fg); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  padding: 10px 18px; border-radius: 999px; font-weight: 500; box-shadow: var(--shadow-float);
}

/* Login: painel preto com brilho no horizonte, como o CreativeHub */
.login { display: grid; min-height: 100vh; min-height: 100dvh; }
.golden-hour {
  display: none; position: relative; overflow: hidden; padding: 48px; color: #fff; flex-direction: column;
  background:
    radial-gradient(55% 45% at 50% 115%, rgb(94 92 230 / 0.7), transparent 70%),
    radial-gradient(35% 35% at 25% 105%, rgb(100 210 255 / 0.45), transparent 70%),
    radial-gradient(35% 35% at 78% 105%, rgb(255 100 130 / 0.4), transparent 70%),
    #000;
}
.golden-hour .logo-text small { color: rgb(255 255 255 / 0.6); }
.golden-hour h2 { margin: auto 0 0; font-size: clamp(44px, 5.4vw, 80px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.golden-hour p { margin: 20px 0 0; max-width: 440px; font-size: 18px; color: rgb(255 255 255 / 0.7); }
.text-gradient {
  background: linear-gradient(90deg, #64d2ff 0%, #5e5ce6 45%, #bf5af2 75%, #ff6482 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-side { display: grid; place-items: center; padding: 24px 16px; }
.login-form { width: 100%; max-width: 360px; }
.login-form .logo { margin-bottom: 32px; }
.login-form h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.022em; }
.login-form p { margin: 8px 0 24px; color: var(--muted); }
.login-form .btn { width: 100%; margin-top: 4px; padding: 12px; font-size: 15px; }
.login-form .error { color: var(--out); font-size: 13px; margin-top: 12px; min-height: 18px; }
@media (min-width: 1024px) {
  .login { grid-template-columns: 1fr 1fr; }
  .golden-hour { display: flex; }
  .login-form .logo { display: none; }
}

@media (max-width: 900px) {
  .hero h1 { font-size: 32px; }
  .stats { width: 100%; grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .top .logo { margin-right: 0; }
  .logo-text { display: none; }
  .search { width: auto; flex: 1; min-width: 0; }
  .pill-select { max-width: 112px; }
  .spacer { display: none; }
  .hero { padding-top: 18px; gap: 14px; }
  .hero h1 { font-size: 28px; }
  .stats { gap: 6px; }
  .stat { padding: 9px 10px; border-radius: 16px; }
  .stat .n { font-size: 22px; }
  .stat .t { font-size: 11px; line-height: 1.25; }
  .column, .add-list { flex-basis: min(300px, calc(100vw - 48px)); }
  .sheet-grid { grid-template-columns: 1fr 1fr; }
  .sheet-grid .field:first-child { grid-column: 1 / -1; }
}

/* Dentro do CreativeHub: sem logo, tema e "Sair" (o CreativeHub já tem); barra sem vidro próprio */
.embedded .top .logo, .embedded #theme-toggle, .embedded #logout { display: none; }
.embedded .top { position: static; background: transparent; border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.embedded .top-inner { height: 56px; padding-top: 8px; }
.embedded .hero { padding-top: 10px; }

/* --- Painel Ads ------------------------------------------------------------
 * Cores de dados (paleta categórica validada: azul, laranja, violeta), separadas
 * do azul de interface. O tema escuro usa os degraus próprios do escuro.
 */
:root { --viz-blue: #2a78d6; --viz-orange: #eb6834; --viz-violet: #6250d6; --chip-up: #e6f4ea; --chip-down: #fde8e7; }
.dark { --viz-blue: #3987e5; --viz-orange: #d95926; --viz-violet: #9085e9; --chip-up: rgb(48 209 88 / 0.16); --chip-down: rgb(255 69 58 / 0.16); }

/* O papel de parede fica preso à janela e cobre a página inteira */
.dash-page { background: var(--bg); min-height: 100vh; }
.dash-page::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--wall); pointer-events: none; }

.dash { max-width: 1240px; margin: 0 auto; padding: 0 16px 48px; transition: opacity 0.2s; }
.loading .dash { opacity: 0.55; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--fill); gap: 2px; flex: none; }
.segmented button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: color 0.15s, background 0.15s; }
.segmented button:hover { color: var(--fg); }
.segmented button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 2px 8px rgb(0 0 0 / 0.06); }
.segmented.sm button { padding: 4px 10px; font-size: 12px; }
#sync svg { width: 14px; height: 14px; }
#sync.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Perfil */
.profile { display: flex; align-items: center; gap: 20px; padding: 32px 0 8px; }
.avatar {
  width: 76px; height: 76px; border-radius: 50%; flex: none; padding: 3px;
  background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
}
.avatar img, .avatar span { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--surface); display: grid; place-items: center; object-fit: cover; }
.avatar span { background: var(--surface-2); font-size: 28px; font-weight: 600; }
.profile .eyebrow { margin-bottom: 2px; }
.profile h1 { margin: 0; font-size: 44px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.profile h1 .unit { font-weight: 500; color: var(--muted); font-size: 0.55em; letter-spacing: -0.02em; }
.profile-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--fill); font-weight: 600; font-size: 12px; }
.chip.up { background: var(--chip-up); color: var(--in); }
.chip.down { background: var(--chip-down); color: var(--out); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 14px; }
.section-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.section-title .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.ig { background: linear-gradient(135deg, #fa7e1e, #d62976 50%, #4f5bd5); }
.dot.ads { background: var(--viz-violet); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { position: relative; padding: 16px 18px 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s, box-shadow 0.15s; }
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-float); }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi-value { margin-top: 6px; font-size: 27px; font-weight: 650; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; min-height: 20px; white-space: nowrap; overflow: hidden; }
.kpi-foot .muted { overflow: hidden; text-overflow: ellipsis; }
.kpi-spark { height: 34px; margin: 8px -18px 0; }
.kpi-spark.blue { color: var(--viz-blue); }
.kpi-spark.violet { color: var(--viz-violet); }
.spark { display: block; width: 100%; height: 100%; }
.delta { font-weight: 600; color: var(--muted); padding: 1px 7px; border-radius: 999px; background: var(--fill); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--in); background: var(--chip-up); }
.delta.down { color: var(--out); background: var(--chip-down); }

/* Painéis e gráficos */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 12px; margin-bottom: 12px; }
.panel { padding: 20px 20px 14px; min-width: 0; margin-bottom: 12px; }
.grid-2 .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.panel-head p { margin: 2px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.s-in { background: var(--viz-blue); }
.s-out { background: var(--viz-orange); }
.chart { min-height: 240px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--fg); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .cursor { stroke: var(--line-strong); stroke-width: 1; }
.chart .mark { transition: opacity 0.12s; }
.chart svg.hovering .mark { opacity: 0.35; }
.chart svg.hovering .mark.on { opacity: 1; }
.chart .hit { cursor: crosshair; }
.empty { display: grid; place-items: center; min-height: 140px; color: var(--muted); font-size: 13px; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 150px; padding: 8px 12px; border-radius: 12px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line); box-shadow: var(--shadow-float); font-size: 12px;
}
.tip-date { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip-row span { flex: 1; color: var(--muted); }
.tip-row b { font-variant-numeric: tabular-nums; }

/* Composição das interações */
.mix { display: grid; gap: 14px; padding-top: 6px; }
.mix-label { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.mix-label span:first-child { flex: 1; }
.mix-label b { font-variant-numeric: tabular-nums; }
.mix-label .muted { width: 36px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.mix-track { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--viz-blue) 14%, transparent); overflow: hidden; }
.mix-fill { height: 100%; border-radius: 999px; background: var(--viz-blue); }
.mix-foot { margin: 6px 0 0; }

.notice { margin: 12px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--lime); color: var(--lime-ink); font-size: 13px; }
.notice code { font-size: 12px; }

/* Posts */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.post { color: inherit; text-decoration: none; border-radius: 16px; overflow: hidden; background: var(--surface-2); transition: transform 0.18s, box-shadow 0.18s; }
.post:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); }
.thumb { position: relative; aspect-ratio: 4 / 5; background: linear-gradient(160deg, color-mix(in srgb, var(--viz-blue) 30%, var(--surface-2)), color-mix(in srgb, #d62976 22%, var(--surface-2))); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0.28), transparent 32%); pointer-events: none; }
.rank { position: absolute; z-index: 1; left: 10px; top: 8px; color: #fff; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; text-shadow: 0 1px 6px rgb(0 0 0 / 0.35); }
.badge { position: absolute; z-index: 1; right: 8px; top: 9px; padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 11px; font-weight: 500; }
.post-meta { padding: 10px 12px 12px; display: grid; gap: 8px; }
.post-cap { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.post-nums { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.post-nums span { display: inline-flex; align-items: center; gap: 4px; }
.post-nums svg { width: 13px; height: 13px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }

/* Tabela de campanhas */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 500; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td:first-child { white-space: normal; min-width: 170px; width: 40%; }
.camp-name { font-weight: 600; }
.camp-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--fill); color: var(--muted); flex: none; }
.share { flex: 1; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--viz-violet) 14%, transparent); overflow: hidden; max-width: 140px; }
.share i { display: block; height: 100%; border-radius: 999px; background: var(--viz-violet); }

.foot { margin-top: 28px; text-align: center; }
@media (max-width: 640px) {
  .top .logo-text, #sync span { display: none; }
  .segmented button { padding: 6px 8px; font-size: 12px; }
  .profile { gap: 14px; padding-top: 22px; }
  .avatar { width: 60px; height: 60px; }
  .profile h1 { font-size: 32px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 22px; }
}
