:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --surface-2: #ffffff;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.16);

  --accent: #2a78d6;
  --series-entrada: #008300;
  --series-saida: #e34948;
  --series-trabalho: #1baf7a;
  --series-fixos: #eda100;
  --series-lazer: #e87ba4;
  --series-outros: #eb6834;
  --series-blue: #2a78d6;
  --series-violet: #4a3aa7;

  --good: #006300;
  --critical: #d03b3b;
  --status-todo: #898781;
  --status-doing: #fab219;
  --status-done: #006300;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, 0.05), 0 10px 24px rgba(16, 24, 40, 0.08);
  --brand-gradient: linear-gradient(135deg, #6e5ef2, #2a78d6);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --surface-2: #212120;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);

    --accent: #3987e5;
    --series-entrada: #008300;
    --series-saida: #e66767;
    --series-trabalho: #199e70;
    --series-fixos: #c98500;
    --series-lazer: #d55181;
    --series-outros: #d95926;
    --series-blue: #3987e5;
    --series-violet: #9085e9;

    --good: #0ca30c;
    --critical: #d03b3b;
    --status-todo: #898781;
    --status-doing: #fab219;
    --status-done: #0ca30c;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.4);
    --brand-gradient: linear-gradient(135deg, #7d6ef5, #3987e5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --surface-2: #212120;
  --page: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --accent: #3987e5;
  --series-entrada: #008300;
  --series-saida: #e66767;
  --series-trabalho: #199e70;
  --series-fixos: #c98500;
  --series-lazer: #d55181;
  --series-outros: #d95926;
  --series-blue: #3987e5;
  --series-violet: #9085e9;

  --good: #0ca30c;
  --critical: #d03b3b;
  --status-todo: #898781;
  --status-doing: #fab219;
  --status-done: #0ca30c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.4);
  --brand-gradient: linear-gradient(135deg, #7d6ef5, #3987e5);
}
:root[data-theme="light"] {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --surface-2: #ffffff;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.16);

  --accent: #2a78d6;
  --series-entrada: #008300;
  --series-saida: #e34948;
  --series-trabalho: #1baf7a;
  --series-fixos: #eda100;
  --series-lazer: #e87ba4;
  --series-outros: #eb6834;
  --series-blue: #2a78d6;
  --series-violet: #4a3aa7;

  --good: #006300;
  --critical: #d03b3b;
  --status-todo: #898781;
  --status-doing: #fab219;
  --status-done: #006300;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-md: 0 2px 6px rgba(16, 24, 40, 0.05), 0 10px 24px rgba(16, 24, 40, 0.08);
  --brand-gradient: linear-gradient(135deg, #6e5ef2, #2a78d6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; }

/* ---------- Layout ---------- */

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}
.brand-logo { height: 26px; width: auto; display: block; flex-shrink: 0; }
.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 15px;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--accent); }

body.sidebar-collapsed .sidebar { display: none; }
body.sidebar-collapsed main { width: 100%; }
.section-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.section-tab {
  padding: 7px 14px;
  border-radius: var(--radius-s);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}
.section-tab:hover { background: var(--border); color: var(--text-primary); }
.section-tab.active { background: var(--accent); color: white; }

.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 49px;
  height: calc(100vh - 49px);
  overflow-y: auto;
  align-self: flex-start;
}

.year-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 6px 8px;
}
.year-switcher button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
}
.year-switcher button:hover { background: var(--border); color: var(--text-primary); }
.year-switcher span { font-weight: 600; font-variant-numeric: tabular-nums; }

.theme-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.theme-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 48px;
  height: 27px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: background 0.15s;
}
.theme-switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch-knob {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--surface-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s;
  transform: translateX(0);
}
.theme-switch input:checked + .switch-track .switch-knob { transform: translateX(20px); }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 8px 8px 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-s);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
}
.nav-link:hover { background: var(--border); color: var(--text-primary); }
.nav-link.active { background: var(--accent); color: white; }
.nav-link .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
}
.nav-link.active .dot { background: white; }
.nav-link .mini {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.nav-link.active .mini { color: rgba(255,255,255,0.85); }

main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
}
main .page-header, main .stat-row, main .charts-row, main .panel { max-width: 1100px; }

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 10px;
}
.page-header h1 {
  font-size: 22px;
  margin: 0;
}
.page-header .subtitle { color: var(--text-muted); font-size: 13px; }

.month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.month-nav button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 5px 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
}
.month-nav button:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* ---------- Stat tiles ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-md);
  padding: 16px 18px;
}
.stat-tile .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-tile .value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-tile.entrada {
  background: linear-gradient(135deg, color-mix(in srgb, var(--series-entrada) 16%, var(--surface-1)), var(--surface-1) 70%);
  border-color: color-mix(in srgb, var(--series-entrada) 30%, var(--border));
}
.stat-tile.saida {
  background: linear-gradient(135deg, color-mix(in srgb, var(--series-saida) 16%, var(--surface-1)), var(--surface-1) 70%);
  border-color: color-mix(in srgb, var(--series-saida) 30%, var(--border));
}
.stat-tile.saldo {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface-1)), var(--surface-1) 70%);
}
.stat-tile.entrada .value { color: var(--series-entrada); }
.stat-tile.saida .value { color: var(--series-saida); }
.stat-tile.saldo .value.pos { color: var(--good); }
.stat-tile.saldo .value.neg { color: var(--critical); }

/* ---------- Cards / panels ---------- */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.panel h2 {
  font-size: 14px;
  margin: 0 0 14px;
  font-weight: 600;
}
.panel h2 .count { color: var(--text-muted); font-weight: 400; }

.charts-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 820px) {
  .charts-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
}

/* ---------- Form ---------- */

.entry-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 820px) {
  .entry-form { grid-template-columns: 1fr 1fr; }
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: var(--text-muted); }
.field input, .field select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow-sm);
}
.field-with-add { display: flex; gap: 6px; align-items: flex-end; }
.field-with-add .field { flex: 1; }
.add-cat-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  padding: 8px 11px;
  cursor: pointer;
}
.add-cat-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  padding-bottom: 8px;
}
.btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-s);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.12s, filter 0.12s;
}
.btn:hover { filter: brightness(1.08); box-shadow: var(--shadow-md); }
.btn.secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

/* ---------- Lists ---------- */

.filter-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-sm);
  padding: 6px 9px;
  font-size: 12.5px;
  color: var(--text-primary);
  font-family: inherit;
}

.entry-list { display: flex; flex-direction: column; gap: 1px; }
.entry-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--grid);
  font-size: 13.5px;
}
.entry-row:last-child { border-bottom: none; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}
.cat-chip .sw { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.entry-desc { color: var(--text-primary); }
.entry-desc .fixed-badge {
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
}
.entry-day { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-day.no-day { opacity: 0.5; }
.entry-value { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.entry-value.entrada { color: var(--series-entrada); }
.entry-value.saida { color: var(--series-saida); }
.entry-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
}
.entry-del:hover { color: var(--critical); background: var(--border); }

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  padding: 18px 4px;
  text-align: center;
}

/* ---------- Charts ---------- */

.viz-root { color-scheme: light; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.chart-legend .item { display: flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 2px; }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.08s;
  white-space: nowrap;
}
.tooltip.show { opacity: 1; }
.tooltip .t-title { font-weight: 600; margin-bottom: 2px; }
.tooltip .t-row { display: flex; align-items: center; gap: 6px; }
.tooltip .sw { width: 8px; height: 8px; border-radius: 2px; }

.bar-mark { cursor: pointer; }
.bar-mark:hover { filter: brightness(1.1); }
.donut-seg { cursor: pointer; }
.donut-seg:hover { filter: brightness(1.1); }

.fill-entrada { fill: var(--series-entrada); }
.fill-saida { fill: var(--series-saida); }
.fill-trabalho { fill: var(--series-trabalho); }
.fill-fixos { fill: var(--series-fixos); }
.fill-lazer { fill: var(--series-lazer); }
.fill-outros { fill: var(--series-outros); }
.fill-blue { fill: var(--series-blue); }
.fill-violet { fill: var(--series-violet); }
.fill-grid { fill: var(--grid); }
.stroke-grid { stroke: var(--grid); }
.stroke-baseline { stroke: var(--baseline); }
.text-muted { fill: var(--text-muted); }
.text-secondary { fill: var(--text-secondary); }

@media (max-width: 700px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; top: 0; }
  main { padding: 20px 16px 40px; }
  .top-nav { flex-wrap: wrap; row-gap: 8px; }
}

/* ---------- Kanban boards ---------- */

.board-lists {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  cursor: grab;
}
.board-lists.dragging-scroll { cursor: grabbing; user-select: none; }
.board-lists::-webkit-scrollbar { height: 6px; }
.board-lists::-webkit-scrollbar-track { background: transparent; }
.board-lists::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.board-lists::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Thin, quiet scrollbars everywhere (sidebar, modal, etc.) */
.sidebar, .modal-box { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sidebar::-webkit-scrollbar, .modal-box::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track, .modal-box::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb, .modal-box::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.board-list {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  min-height: 60px;
  width: 268px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 210px);
}
.add-list-col { background: var(--page); border-style: dashed; align-self: flex-start; max-height: fit-content; }
.add-list-col input {
  width: 100%;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-sm);
  padding: 8px 9px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}
.add-list-col input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.board-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}
.board-list-head .count { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 20px;
  border-radius: var(--radius-m);
  transition: outline 0.1s;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.card-list::-webkit-scrollbar { width: 5px; }
.card-list::-webkit-scrollbar-track { background: transparent; }
.card-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.card-list.col-drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }

.kanban-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow 0.12s, transform 0.12s;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card:active { cursor: grabbing; }
.kanban-card img { width: 100%; border-radius: 6px; margin-bottom: 8px; max-height: 110px; object-fit: cover; display: block; }
.k-title-row { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.kanban-card .k-title { font-size: 13.5px; color: inherit; min-width: 0; overflow-wrap: break-word; }
.kanban-card .k-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 23px; }

.card-check {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface-1);
  color: white;
  font-size: 9px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}
.card-check:hover { border-color: var(--good); }
.card-check.checked { background: var(--good); border-color: var(--good); }

.status-chip {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 100px;
  color: white;
  font-weight: 600;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0.12));
  background-blend-mode: overlay;
  box-shadow: var(--shadow-sm);
}
.k-desc-flag { color: var(--text-muted); font-size: 11px; }

.quick-add { margin-top: 8px; }
.quick-add input {
  width: 100%;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-sm);
  padding: 7px 9px;
  font-size: 12.5px;
  color: var(--text-primary);
  font-family: inherit;
}
.quick-add input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.board-tabs-empty { color: var(--text-muted); font-size: 13px; padding: 40px 20px; text-align: center; }

/* Status + color pickers (card modal) */
.status-picker, .color-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pill {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  padding-left: 22px;
}
.status-pill::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pill-color);
}
.status-pill.selected { border-color: var(--pill-color); color: var(--text-primary); background: var(--surface-1); box-shadow: 0 0 0 1px var(--pill-color); }

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.color-swatch.selected { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--accent); }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-md);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 22px;
}
.modal-box h3 { margin: 0 0 14px; font-size: 16px; }
.modal-field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.modal-field label { font-size: 12px; color: var(--text-muted); }
.modal-field input[type="text"],
.modal-field input[type="email"],
.modal-field input[type="password"],
.modal-field input[type="number"],
.modal-field textarea,
.modal-field select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-sm);
  padding: 13px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.modal-field input[type="text"]:focus,
.modal-field input[type="email"]:focus,
.modal-field input[type="password"]:focus,
.modal-field input[type="number"]:focus,
.modal-field textarea:focus,
.modal-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), var(--shadow-sm);
}
.modal-field textarea { min-height: 80px; resize: vertical; }
.modal-image-preview { max-width: 100%; max-height: 180px; border-radius: 8px; display: block; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: space-between; margin-top: 16px; gap: 10px; flex-wrap: wrap; }
.modal-actions .right { display: flex; gap: 8px; }
.btn.danger { background: var(--critical); }

.editable-title { cursor: text; border-radius: 4px; padding: 1px 4px; margin: -1px -4px; }
.editable-title:hover { background: var(--border); }
.inline-edit-input {
  font: inherit;
  font-weight: inherit;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0 4px;
  width: 100%;
  max-width: 220px;
}
.inline-edit-input:focus { outline: none; }

/* ---------- Redes Sociais ---------- */

.avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.profile-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--grid); }
.profile-row:last-child { border-bottom: none; }
.profile-row-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 6px;
  text-decoration: none;
  color: inherit;
}
.profile-row-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.profile-row-name { font-size: 14px; font-weight: 600; }
.profile-row-progress { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.profile-row .chev { color: var(--text-muted); font-size: 18px; }

.mini-progress {
  display: inline-block;
  width: 110px;
  height: 6px;
  border-radius: 4px;
  background: var(--grid);
  overflow: hidden;
}
.mini-progress-fill { display: block; height: 100%; background: var(--good); border-radius: 4px; }

.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.cal-cell {
  aspect-ratio: 1;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-s);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, box-shadow 0.1s;
}
.cal-cell:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.cal-cell.done { background: var(--good); border-color: var(--good); color: white; box-shadow: var(--shadow-sm); }

.social-links-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .social-links-grid { grid-template-columns: 1fr; } }
.social-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.12s, transform 0.12s;
}
.social-link-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ---------- Auth pages ---------- */

.auth-body {
  display: block;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
              radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--series-violet) 10%, transparent), transparent 55%),
              var(--page);
}
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 34px 30px;
  width: 100%;
  max-width: 400px;
}
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo img { height: 30px; width: auto; max-width: 100%; object-fit: contain; }
.auth-theme-switch { position: absolute; top: 22px; right: 22px; }
.auth-title { font-size: 19px; font-weight: 700; text-align: center; margin: 0 0 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin: 0 0 20px; }
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 11px 0;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.auth-tab.active { background: var(--accent); color: white; box-shadow: var(--shadow-sm); }
.auth-tab:not(.active):hover { background: var(--border); color: var(--text-primary); }
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-form .modal-field { margin-bottom: 14px; }
.auth-error { color: var(--critical); font-size: 12.5px; margin-bottom: 10px; display: none; }
.auth-success { color: var(--good); font-size: 12.5px; margin-bottom: 10px; display: none; }
.auth-forgot-link { text-align: right; margin: -6px 0 16px; }
.auth-forgot-link a, .auth-footer-link a { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.auth-forgot-link a:hover, .auth-footer-link a:hover { text-decoration: underline; }
.auth-footer-link { text-align: center; margin-top: 16px; }

.policy-page { min-height: 100vh; display: flex; justify-content: center; padding: 50px 20px; }
.policy-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 40px 44px 50px;
  width: 100%;
  max-width: 720px;
}
.policy-logo { height: 26px; width: auto; margin-bottom: 26px; display: block; }
.policy-card h1 { font-size: 24px; margin: 0 0 6px; }
.policy-updated { color: var(--text-muted); font-size: 12.5px; margin: 0 0 28px; }
.policy-card h2 { font-size: 15px; margin: 26px 0 8px; }
.policy-card p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.65; margin: 0 0 4px; }
.policy-card a { color: var(--accent); }

/* ---------- User menu (top nav) ---------- */

.user-menu { display: flex; align-items: center; gap: 8px; }
.user-menu .user-name { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }
.btn-text {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-text:hover { color: var(--text-primary); border-color: var(--accent); }
