/* CRM TMJ. Uma cor de destaque (laranja da marca), o resto em neutros quentes. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #161514;
  --muted: #5f5d57;
  --faint: #8f8d86;
  --line: #e6e3dc;
  --line-strong: #d2cfc6;
  --accent: #ff6b2b;
  --accent-ink: #b8430f;
  --accent-soft: #fff0e8;
  --danger: #bf351e;
  --danger-soft: #fcebe7;
  --ok: #2b7a4b;
  --warn: #a96500;
  --side: #141414;
  --side-ink: #cfcdc6;
  --radius: 12px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0e;
    --surface: #191918;
    --surface-2: #1f1f1d;
    --ink: #f2f1ed;
    --muted: #aeaca5;
    --faint: #7f7d77;
    --line: #2b2b28;
    --line-strong: #3d3d39;
    --accent-ink: #ff8f5c;
    --accent-soft: #2e1a0f;
    --danger: #ff806a;
    --danger-soft: #33160f;
    --ok: #62c48e;
    --warn: #e3a440;
    --side: #0a0a0a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { display: inline-flex; flex: none; }
.grow { flex: 1; }
.num { font-variant-numeric: tabular-nums; }
.tone-danger { color: var(--danger); font-weight: 600; }
.tone-accent { color: var(--accent-ink); font-weight: 600; }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 24px 14px 18px;
  background: var(--side); color: var(--side-ink);
}
.brand { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 10px; }
.brand-mark { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--accent); }
.brand-name { font-weight: 600; font-size: 15px; color: #fff; letter-spacing: 0.02em; }
.brand.dark .brand-name { color: var(--ink); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px;
  font-weight: 500; color: var(--side-ink);
  transition: background 0.15s, color 0.15s;
}
.side-link:hover { background: #ffffff12; color: #fff; }
.side-link.on { background: #ffffff18; color: #fff; }
.side-link.on .ic { color: var(--accent); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 13px; }
.side-out { display: inline-flex; align-items: center; gap: 6px; color: var(--side-ink); }
.side-out:hover { color: #fff; }

.main { padding: 34px 40px 72px; min-width: 0; }
.view { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.loading { color: var(--faint); padding: 40px 0; }
.tabbar { display: none; }

/* ---------- cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }
.page-sub { color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-bottom: -10px; width: fit-content; }
.back:hover { color: var(--ink); }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 15px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #17100b; }
.btn.primary:hover { background: #ff7d45; border-color: #ff7d45; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.quiet-danger { border-color: transparent; background: none; color: var(--danger); padding: 0 8px; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; min-height: 46px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

input[type=text], input[type=search], input[type=password], input[type=email], input[type=tel], input[type=url],
input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
input[type=color] { width: 42px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--faint); overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid > .field { grid-column: 1 / -1; }
.form-grid > .field.half { grid-column: span 1; }
.form-error { color: var(--danger); font-weight: 600; font-size: 14px; margin-top: 12px; min-height: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks.column { flex-direction: column; max-height: 50vh; overflow: auto; padding: 4px 2px; }
.check { display: inline-flex; align-items: center; gap: 9px; min-height: 30px; cursor: pointer; }

/* ---------- cartões ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card > .btn { align-self: flex-start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stack.narrow { max-width: 760px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.calm { color: var(--muted); }
.note { color: var(--muted); font-size: 13.5px; }
.notes { white-space: pre-wrap; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.big { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.more-link { color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.danger { background: var(--danger); }
.dot.accent { background: var(--accent); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.faint { background: var(--line-strong); }

/* ---------- números do topo ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
a.stat:hover { border-color: var(--line-strong); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-sub { font-size: 13px; color: var(--faint); }

/* ---------- listas ---------- */
.group { display: flex; flex-direction: column; }
.group + .group { margin-top: 6px; }
.group-title { font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0 6px; }
.line {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.line:hover .line-main { color: var(--accent-ink); }
.line-main { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.line-meta { color: var(--muted); font-size: 13.5px; text-align: right; max-width: 60%; }

.rows { display: flex; flex-direction: column; }
.rows > * { border-top: 1px solid var(--line); }
.rows > :first-child { border-top: 0; }

.bar-row { display: grid; grid-template-columns: 130px 1fr 28px; align-items: center; gap: 12px; padding: 5px 0; font-size: 14px; }
.bar-label { color: var(--muted); }
.bar-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 0; background: var(--accent); border-radius: 4px; }
.bar-fill.muted { background: var(--line-strong); }
.bar-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* tarefas */
.task { display: flex; align-items: center; gap: 4px; }
.task-check { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; flex: none; cursor: pointer; margin-left: -10px; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 9px 0; }
.task-title { font-weight: 500; overflow-wrap: anywhere; }
.task.done .task-title { text-decoration: line-through; color: var(--faint); }
.task-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.task-meta:empty { display: none; }
.inline { display: inline-flex; align-items: center; gap: 4px; }
.task-due { font-size: 13.5px; color: var(--muted); white-space: nowrap; padding-left: 8px; }
.task-due.danger { color: var(--danger); font-weight: 600; }
.task-due.accent { color: var(--accent-ink); font-weight: 600; }
.quick { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.quick input { flex: 1; }

/* posts */
.post-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 10px 0; }
.post-row:hover .post-title { color: var(--accent-ink); }
.post-when { display: flex; flex-direction: column; font-size: 13.5px; color: var(--muted); line-height: 1.3; }
.post-when strong { color: var(--ink); font-weight: 600; }
.post-main { display: flex; flex-direction: column; min-width: 0; }
.post-title { font-weight: 500; overflow-wrap: anywhere; }
.post-meta { font-size: 13px; color: var(--muted); }
.post-meta:empty { display: none; }

/* cobranças */
.charge { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.charge-main { flex: 1; min-width: 150px; display: flex; flex-direction: column; }
.charge-client { font-weight: 600; }
.charge-client:hover { color: var(--accent-ink); }
.charge-meta { font-size: 13px; color: var(--muted); }
.charge-meta:empty { display: none; }
.charge-value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- clientes ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 150px; }
.search { max-width: 340px; }
.ctable { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.crow {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 110px minmax(0, 1.3fr) 120px minmax(0, 1.2fr);
  gap: 14px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line); font-size: 14px;
}
.crow:first-child { border-top: 0; }
a.crow:hover { background: var(--surface-2); }
.crow.chead { font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 11px; padding-bottom: 11px; background: var(--surface-2); }
.c-name { display: flex; flex-direction: column; min-width: 0; }
.c-name strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.c-name small { color: var(--muted); font-size: 13px; }
.c-name small:empty { display: none; }
.c-cell { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.c-cell.num, .crow .num { text-align: right; color: var(--ink); font-weight: 600; }

.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 0 11px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: baseline; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.count { font-size: 12.5px; color: var(--faint); font-weight: 600; }

.infos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.info dt { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.info dd { overflow-wrap: anywhere; }

/* design system */
.colors { display: flex; flex-direction: column; gap: 8px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row .hex { width: 112px; flex: none; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }

/* arquivos */
.files-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-weight: 600; }
.crumbs button { color: var(--muted); padding: 4px 2px; }
.crumbs button:last-child { color: var(--ink); }
.crumbs button:hover { color: var(--accent-ink); }
.crumb-sep { color: var(--faint); }
.files { display: flex; flex-direction: column; }
.file { display: grid; grid-template-columns: 24px minmax(0, 1fr) 90px 70px; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); width: 100%; color: var(--muted); }
.file:first-child { border-top: 0; }
.file:hover { background: var(--surface-2); }
.file-name { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.file-meta { font-size: 13px; text-align: right; }
.viewer-media { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 8px; }

/* senhas */
.creds { display: flex; flex-direction: column; gap: 12px; }
.cred { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.cred-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cred-head strong { font-size: 16px; }
.cred-url { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13.5px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cred-url:hover { color: var(--accent-ink); }
.cred-head .btn { margin-left: auto; }
.cred-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cred-label { width: 62px; font-size: 13px; color: var(--faint); font-weight: 600; flex: none; }
.cred-value, .secret { flex: 1; min-width: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.secret { color: var(--muted); }
.secret.open { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; }
.shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- prospecção ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; scroll-snap-type: x proximity; }
.column { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 180px; scroll-snap-align: start; transition: border-color 0.15s, background 0.15s; }
.column.over { border-color: var(--accent); background: var(--accent-soft); }
.column.lost { opacity: 0.8; }
.column-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px; }
.column-head h2 { font-size: 14px; font-weight: 700; }
.column-meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.column-body { display: flex; flex-direction: column; gap: 8px; }
.column-empty { color: var(--faint); font-size: 13px; padding: 10px 4px; }
.column-add { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 8px 4px; }
.column-add:hover { color: var(--accent-ink); }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; cursor: grab; }
.lead:hover { border-color: var(--line-strong); }
.lead.dragging { opacity: 0.45; }
.lead-main { display: flex; flex-direction: column; gap: 2px; padding: 11px 12px 8px; width: 100%; }
.lead-main strong { font-weight: 600; overflow-wrap: anywhere; }
.lead-sub { color: var(--muted); font-size: 13.5px; }
.lead-value { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lead-next { font-size: 13px; color: var(--muted); margin-top: 4px; }
.lead-next.danger { color: var(--danger); font-weight: 600; }
.lead-next.accent { color: var(--accent-ink); font-weight: 600; }
.lead-foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 2px 8px; }
.lead-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 7px 4px; }
.lead-link:hover { color: var(--accent-ink); }

/* ---------- calendário ---------- */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav strong { display: inline-block; min-width: 158px; text-align: center; font-size: 16px; }
.month-nav strong::first-letter, .agenda-day h3::first-letter { text-transform: uppercase; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head { padding: 9px 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 112px; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:nth-child(7n + 1) { border-left: 0; }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-day span { color: var(--faint); }
.cal-day { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; padding: 0 2px; height: 24px; }
.cal-cell.today .cal-day span { background: var(--accent); color: #17100b; border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; margin-left: -4px; }
.cal-add { color: var(--faint); opacity: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--surface-2); color: var(--ink); }
.cal-post { display: flex; align-items: center; gap: 5px; width: 100%; font-size: 12.5px; padding: 3px 5px; border-radius: 6px; background: var(--surface-2); min-width: 0; }
.cal-post:hover { background: var(--accent-soft); }
.cal-post.late { background: var(--danger-soft); }
.cal-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.cal-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda { display: none; flex-direction: column; gap: 14px; }
.agenda-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.agenda-day h3 { font-size: 14px; font-weight: 700; }

/* ---------- configurações ---------- */
.plan { display: flex; justify-content: space-between; gap: 14px; align-items: center; width: 100%; padding: 11px 0; }
.plan:hover strong { color: var(--accent-ink); }
.plan-main { display: flex; flex-direction: column; min-width: 0; }
.plan-main small { color: var(--muted); font-size: 13px; }
.plan-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.key-box:empty { display: none; }
.key-box { display: flex; flex-direction: column; gap: 8px; }
.key-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.key-line code { flex: 1; min-width: 200px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; overflow-wrap: anywhere; }

/* ---------- janelas e avisos ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: #0b0a0980; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade 0.12s ease-out; }
.dialog { width: 100%; max-width: 480px; background: var(--surface); border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 24px 60px #00000040; display: flex; flex-direction: column; animation: rise 0.16s ease-out; }
.dialog.wide { max-width: 720px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 16px 6px 22px; }
.dialog-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dialog-body { padding: 12px 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.dialog-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.dialog-text, .confirm-text { color: var(--muted); overflow-wrap: anywhere; }
.more-menu { display: flex; flex-direction: column; }
.more-menu a, .more-menu button { display: flex; align-items: center; gap: 14px; padding: 15px 4px; font-weight: 600; border-top: 1px solid var(--line); width: 100%; }
.more-menu > :first-child { border-top: 0; }

.toasts { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px #00000030; animation: rise 0.18s ease-out; transition: opacity 0.2s; text-align: center; }
.toast.danger { background: var(--danger); color: #fff; }
.toast.bye { opacity: 0; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- entrada ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .brand { padding: 0; }
.auth-card h1 { font-size: 24px; letter-spacing: -0.02em; }
.auth-text { color: var(--muted); font-size: 14px; }

/* ---------- celular ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); }
  .view { gap: 18px; }
  .page-head h1 { font-size: 24px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    background: var(--side); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 52px; color: #a3a19a; font-size: 11.5px; font-weight: 600; border-radius: 10px; }
  .tab.on { color: #fff; }
  .tab.on .ic { color: var(--accent); }

  .card { padding: 16px; }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 21px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid > .field.half { grid-column: 1 / -1; }
  .infos { grid-template-columns: minmax(0, 1fr); }
  .tabs { gap: 20px; margin: 0 -16px; padding: 0 16px; }
  .toolbar select, .search { max-width: none; flex: 1; min-width: 140px; }
  .quick { min-width: 100%; }

  .ctable { background: none; border: 0; border-radius: 0; display: flex; flex-direction: column; gap: 10px; overflow: visible; }
  .crow.chead { display: none; }
  .crow { grid-template-columns: 1fr 1fr; gap: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
  .crow:first-child { border-top: 1px solid var(--line); }
  .c-name { grid-column: 1 / -1; }
  .c-cell { display: flex; flex-direction: column; font-size: 14px; color: var(--ink); }
  .c-cell.num { text-align: left; }
  .c-cell::before { content: attr(data-label); font-size: 12px; color: var(--faint); font-weight: 600; }
  .c-cell:empty { display: none; }

  .post-row { grid-template-columns: 78px minmax(0, 1fr); }
  .post-row .status { grid-column: 2; }
  .bar-row { grid-template-columns: 112px 1fr 24px; }
  .file { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .file-meta.date { display: none; }
  .color-row { flex-wrap: wrap; }
  .color-row input[type=text]:not(.hex) { flex: 1 1 100%; order: 5; }
  .cred-label { width: 100%; }

  .board { grid-auto-columns: 82%; margin: 0 -16px; padding: 0 16px 10px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
  .cal { display: none; }
  .agenda { display: flex; }
  .month-nav { width: 100%; justify-content: space-between; }

  .overlay { padding: 0; align-items: flex-end; }
  .dialog, .dialog.wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 94dvh; border-bottom: 0; }
  .dialog-body { overflow-y: auto; }
  .dialog-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
