/* =====================================================================
   FlowBoard — folha de estilos única (mobile first, temas claro/escuro)
   ===================================================================== */

:root {
  --bg:          #eef1f6;
  --bg-grad:     radial-gradient(1200px 600px at 15% -10%, #dfe7f5 0%, transparent 60%);
  --surface:     #ffffff;
  --surface-2:   #f6f8fb;
  --surface-3:   #eceff5;
  --border:      #dde3ec;
  --border-2:    #c9d2e0;
  --text:        #131a26;
  --text-2:      #48566b;
  --muted:       #6b7a90;
  --brand:       #2563eb;
  --brand-ink:   #ffffff;
  --brand-soft:  #e5edff;
  --accent:      #0d9488;
  --danger:      #dc2626;
  --danger-soft: #fdeaea;
  --warn:        #d97706;
  --warn-soft:   #fdf2dc;
  --ok:          #16a34a;
  --ok-soft:     #e6f6ec;
  --shadow-1:    0 1px 2px rgba(17, 24, 39, .06), 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-2:    0 4px 12px rgba(17, 24, 39, .10), 0 2px 4px rgba(17, 24, 39, .06);
  --shadow-3:    0 18px 40px rgba(17, 24, 39, .18);
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   18px;
  --header-h:    58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Paleta de gráficos (validada para contraste e visão de cores) */
  --series-1:   #2a78d6;
  --series-2:   #eb6834;
  --viz-grid:   #e1e0d9;
  --viz-axis:   #c3c2b7;
  --viz-muted:  #898781;
}

[data-theme="dark"] {
  --series-1:   #3987e5;
  --series-2:   #d95926;
  --viz-grid:   #2c2c2a;
  --viz-axis:   #383835;
  --viz-muted:  #898781;
}

[data-theme="dark"] {
  --bg:          #0c111b;
  --bg-grad:     radial-gradient(1200px 600px at 15% -10%, #16233c 0%, transparent 60%);
  --surface:     #151d2b;
  --surface-2:   #1b2536;
  --surface-3:   #212d42;
  --border:      #26334a;
  --border-2:    #33425c;
  --text:        #e7ecf5;
  --text-2:      #b3c0d4;
  --muted:       #8496b0;
  --brand:       #4c8dff;
  --brand-ink:   #06122a;
  --brand-soft:  #17294d;
  --accent:      #2dd4bf;
  --danger:      #f87171;
  --danger-soft: #3a1c1f;
  --warn:        #fbbf24;
  --warn-soft:   #3a2e14;
  --ok:          #4ade80;
  --ok-soft:     #12301f;
  --shadow-1:    0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2:    0 6px 16px rgba(0, 0, 0, .45);
  --shadow-3:    0 20px 44px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------- utilitários */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ boot/login */

#app { height: 100%; }
.app-loading { display: grid; place-items: center; }
.boot { text-align: center; color: var(--muted); }
.boot__mark {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; letter-spacing: .5px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.94); opacity: .7; } }

.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 24px;
}
.auth__panel {
  width: min(420px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 28px;
}
.auth__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth__brand .mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--brand);
  color: var(--brand-ink); display: grid; place-items: center; font-weight: 800;
}
.auth__title { font-size: 20px; }
.auth__sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.auth__tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin: 18px 0; }
.auth__tabs button {
  flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px;
  cursor: pointer; font-weight: 600; color: var(--muted);
}
.auth__tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.auth__hint { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* -------------------------------------------------------------- formulários */

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 9px 11px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { filter: brightness(1.06); background: var(--brand); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.06); background: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--block { width: 100%; }
.btn--sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn--icon { padding: 7px; width: 34px; height: 34px; }

.form-error {
  background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger);
  padding: 9px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px;
}

/* ------------------------------------------------------------------ shell */

.shell { display: flex; flex-direction: column; height: 100%; }

.topbar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar__brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.topbar__brand .mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.topbar__name { font-weight: 700; letter-spacing: -.02em; }
.topbar__search { position: relative; flex: 1; max-width: 380px; }
.topbar__search .input { padding-left: 32px; background: var(--surface-2); }
.topbar__search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 700; flex: none; letter-spacing: .3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.avatar--lg { width: 36px; height: 36px; font-size: 13px; }
.avatar--xs { width: 22px; height: 22px; font-size: 9.5px; }

.bell { position: relative; }
.bell__dot {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px;
  display: grid; place-items: center; font-weight: 700;
}

.popover {
  position: absolute; right: 8px; top: calc(var(--header-h) - 4px);
  width: min(360px, calc(100vw - 16px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-3);
  z-index: 60; overflow: hidden;
}
.popover__head { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--border); }
.popover__body { max-height: min(60vh, 440px); overflow: auto; }
.popover__item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 13px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.popover__item:hover { background: var(--surface-2); }
.popover__item:last-child { border-bottom: 0; }
.popover__item.is-unread { background: var(--brand-soft); }
[data-theme="dark"] .popover__item.is-unread { background: var(--surface-3); }

/* ---------------------------------------------------------------- layout */

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

.sidebar {
  width: 244px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 4px;
}
.sidebar__label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 14px 8px 6px; }
.navitem {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
  text-decoration: none; color: var(--text-2); font-weight: 550; cursor: pointer;
  border: 0; background: transparent; width: 100%; text-align: left; font-size: 14px;
}
.navitem:hover { background: var(--surface-2); color: var(--text); }
.navitem.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
[data-theme="dark"] .navitem.is-active { color: var(--text); }
.navitem__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.navitem__count { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.page { flex: 1; overflow: auto; padding: 20px; }
.page__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page__title { font-size: 21px; }
.page__sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* ------------------------------------------------------------- dashboard */

.board-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.board-card {
  position: relative; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px; box-shadow: var(--shadow-1); overflow: hidden;
  transition: transform .12s, box-shadow .12s;
}
.board-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.board-card__bar { position: absolute; inset: 0 0 auto 0; height: 5px; }
.board-card__name { margin-top: 8px; font-size: 16px; font-weight: 650; }
.board-card__meta { margin-top: 12px; display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; }
.board-card__chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2);
}
.board-card__chip.is-late { background: var(--danger-soft); color: var(--danger); }

.newboard {
  border: 1.5px dashed var(--border-2); background: transparent; border-radius: var(--radius);
  min-height: 128px; display: grid; place-items: center; cursor: pointer; color: var(--muted);
  font-weight: 600; gap: 6px;
}
.newboard:hover { border-color: var(--brand); color: var(--brand); background: var(--surface); }

.inline-form {
  grid-column: 1 / -1;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-2);
}
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }

/* ------------------------------------------------------------ board view */

.boardbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap;
}
.boardbar__title { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; }
.boardbar__color { width: 12px; height: 20px; border-radius: 5px; }
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.tabs button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-weight: 600; color: var(--muted); font-size: 13.5px;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.members { display: flex; }
.members .avatar { margin-left: -7px; border: 2px solid var(--surface); }
.members .avatar:first-child { margin-left: 0; }

.filters {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-size: 12.5px;
  font-weight: 600; color: var(--text-2);
}
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip__dot { width: 9px; height: 9px; border-radius: 3px; }
.chip--clear { border-style: dashed; color: var(--muted); }

/* --------------------------------------------------------------- colunas */

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

.list {
  width: 284px; flex: none; max-height: 100%; display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  scroll-snap-align: start; transition: width .22s ease, background .15s;
}
.list.is-expanded { width: min(440px, 82vw); }
.list.is-dropping { background: var(--brand-soft); border-color: var(--brand); }
.list__head { display: flex; align-items: center; gap: 8px; padding: 10px 11px 8px; }
.list__name {
  font-weight: 650; font-size: 14px; border: 0; background: transparent; padding: 2px 4px;
  border-radius: 6px; width: 100%; min-width: 0;
}
.list__name:hover { background: var(--surface-3); }
.list__count {
  font-size: 11.5px; color: var(--muted); background: var(--surface-3);
  padding: 1px 7px; border-radius: 999px; font-weight: 650; flex: none;
}
.list__done { color: var(--ok); flex: none; }
.list__cards { padding: 0 9px 4px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 8px; min-height: 12px; }
.list__foot { padding: 8px 9px 10px; }
.list__add {
  width: 100%; text-align: left; border: 0; background: transparent; color: var(--muted);
  padding: 7px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13.5px;
}
.list__add:hover { background: var(--surface-3); color: var(--text); }

.addlist { width: 250px; flex: none; }

/* --------------------------------------------------------------- cartões */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 10px; box-shadow: var(--shadow-1); cursor: pointer; position: relative;
  touch-action: pan-y;
}
.card:hover { border-color: var(--border-2); }
.card.is-dragging { opacity: .35; }
.card.is-expanded { cursor: default; box-shadow: var(--shadow-2); border-color: var(--brand); }
.card__ghost {
  position: fixed; z-index: 100; pointer-events: none; width: 262px;
  transform: rotate(2.5deg); box-shadow: var(--shadow-3); opacity: .96;
}
.card__labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card__label { height: 7px; min-width: 32px; border-radius: 999px; }
.card__label--named {
  height: auto; padding: 1px 7px; font-size: 10.5px; font-weight: 700; color: #fff;
  letter-spacing: .02em;
}
.card__title { font-size: 13.8px; line-height: 1.38; word-break: break-word; }
.card__meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.card__badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650;
  color: var(--muted); background: var(--surface-2); padding: 2px 7px; border-radius: 7px;
}
.card__badge--due-soon { background: var(--warn-soft); color: var(--warn); }
.card__badge--due-late { background: var(--danger-soft); color: var(--danger); }
.card__badge--done { background: var(--ok-soft); color: var(--ok); }
.card__prio { width: 3px; border-radius: 4px; align-self: stretch; }
.prio-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prio-Crítica { background: #e11d48; }
.prio-Alta    { background: #f97316; }
.prio-Média   { background: #eab308; }
.prio-Baixa   { background: #64748b; }
.card__spine {
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 4px 4px 0;
}

/* ------------------------------------------- detalhe do cartão (acordeão) */

.detail { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.detail__grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail__section { margin-top: 14px; }
.detail__section > h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 7px;
}
.detail__tabs { display: flex; gap: 4px; margin: 12px 0 10px; border-bottom: 1px solid var(--border); }
.detail__tabs button {
  border: 0; background: transparent; padding: 7px 10px; cursor: pointer; font-weight: 600;
  color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.detail__tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

.comment { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.comment:last-of-type { border-bottom: 0; }
.comment__body { flex: 1; min-width: 0; }
.comment__meta { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.comment__text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }

.attach {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface-2); margin-bottom: 6px;
}
.attach__icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.attach__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone {
  border: 1.5px dashed var(--border-2); border-radius: 10px; padding: 14px; text-align: center;
  color: var(--muted); font-size: 13px; cursor: pointer;
}
.dropzone.is-over { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.dropzone kbd {
  font: 600 11px/1.4 var(--mono); padding: 1px 5px; border-radius: 5px;
  background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-2);
}

.checklist { display: grid; gap: 2px; margin-bottom: 8px; }
.checklist__item { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.checklist__item input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: var(--brand); cursor: pointer; }
.checklist__text {
  flex: 1; min-width: 0; border: 1px solid transparent; background: transparent;
  border-radius: 7px; padding: 5px 7px; font-size: 13.5px;
}
.checklist__text:hover { background: var(--surface-2); }
.checklist__text:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.checklist__item.is-done .checklist__text { color: var(--muted); text-decoration: line-through; }
.checklist__add { display: flex; gap: 6px; }
.checklist__add .input { flex: 1; padding: 6px 9px; font-size: 13.5px; }

.labelpick { display: flex; flex-wrap: wrap; gap: 6px; }
.labelpick__item {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-size: 12px;
  font-weight: 600;
}
.labelpick__item[aria-pressed="true"] { color: #fff; border-color: transparent; }

/* ------------------------------------------------------------- relatórios */

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.kpi__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi__hint { font-size: 12px; color: var(--muted); margin-top: 3px; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.panel__title { font-size: 14.5px; margin-bottom: 2px; }
.panel__sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.panel__scroll { overflow-x: auto; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.bars { display: grid; gap: 8px; }
.bars__row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.bars__track { background: var(--surface-3); border-radius: 999px; height: 10px; overflow: hidden; }
.bars__fill { height: 100%; border-radius: 999px; }
.bars__value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- agenda */

.agenda__group { margin-bottom: 20px; }
.agenda__day {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-2);
}
.agenda__item {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 7px; cursor: pointer; text-align: left; width: 100%;
}
.agenda__item:hover { border-color: var(--brand); }
.agenda__time { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; width: 46px; flex: none; }

/* ------------------------------------------------------------------ toast */

.toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow-3); max-width: 340px; font-size: 13.5px;
  animation: toast-in .18s ease-out;
}
.toast--error { border-left-color: var(--danger); }
.toast--ok { border-left-color: var(--ok); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------- gráficos */

.viz { position: relative; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz__tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, -108%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  box-shadow: var(--shadow-2); padding: 7px 10px; font-size: 12.5px; white-space: nowrap;
  opacity: 0; transition: opacity .12s;
}
.viz__tip.is-on { opacity: 1; }
.viz__tip b { font-variant-numeric: tabular-nums; }
.viz__row { display: flex; align-items: center; gap: 6px; }
.viz__row i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.empty { text-align: center; color: var(--muted); padding: 44px 16px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ------------------------------------------------------------- responsivo */

.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; inset: var(--header-h) auto 0 0; z-index: 50; width: 254px;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-3);
  }
  .sidebar.is-open { transform: none; }
  .topbar__search { max-width: none; min-width: 120px; }
  .topbar__name { display: none; }
  /* Barra do quadro enxuta: membros e CSV migram para Configurações e Relatórios. */
  .boardbar { gap: 8px; }
  .boardbar .members,
  .boardbar__csv,
  .topbar [data-action="toggle-theme"] { display: none; }
  .boardbar .tabs { flex: 1; }
  .boardbar .tabs button { flex: 1; }
  .page { padding: 14px; }
  .board { padding: 12px; gap: 10px; }
  .list { width: min(84vw, 300px); }
  .list.is-expanded { width: min(94vw, 460px); }
  .detail__grid { grid-template-columns: 1fr; }
  .bars__row { grid-template-columns: 96px 1fr 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
