@import url("./emoji.css");
/* Seuhub · visual novo (26/10/2026), escrito do zero a partir do protótipo
   "Seuhub — novo visual". Base: fontes, tokens, tipografia, campos, botões,
   selos, cartões, janela modal, aviso e utilitários.
   Ordem dos arquivos: base → shell → work → modules. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/plus-jakarta-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --font: "Plus Jakarta Sans", "Noto Color Emoji", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --subtle: #f4f6fa;
  --hover: #ebedf1;
  --line: #eceef2;
  --line-2: #e3e6eb;
  --ink: #15161a;
  --text: #3f444c;
  /* 15/11/2026 (auditoria WCAG): #8a8f98 dava 3,25:1 no branco e 2,78:1 no
     menu; #5f646e passa de 4,5:1 no branco, no menu e nos fundos claros. */
  --muted: #5f646e;
  --faint: #a3a8b0;
  --on-ink: #ffffff;
  --accent: var(--hub-accent, #16a974);
  /* Texto sobre a cor de destaque: escolhido por contraste em colors.js
     (o verde padrão pede texto escuro: branco dava 3,02:1). */
  --on-accent: #15161a;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --danger: #f0533e;
  --danger-ink: #b42318;
  --warn: #e9a23b;
  /* Pastéis: fundo / texto. Iguais na web e no celular. */
  --lilac: #eee9ff;
  --lilac-ink: #4b36a8;
  --lilac-2: #e6deff;
  --mint: #e1f6ec;
  --mint-ink: #0e6b4b;
  --mint-2: #d7f4e6;
  --sky: #e2f0fc;
  --sky-ink: #1f5c8f;
  --sky-2: #d6ecfb;
  --peach: #fdebdd;
  --peach-ink: #9a4a12;
  --peach-2: #fce7d6;
  --rose: #ffe3e0;
  --rose-ink: #b42318;
  --sun: #fff6e0;
  --sun-ink: #6b4e00;
  --r-xs: 8px;
  --r-sm: 10px;
  --r: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --shadow: 0 1px 2px rgba(21, 22, 26, 0.05);
  --shadow-pop: 0 14px 28px -18px rgba(21, 22, 26, 0.35);
  --shadow-lift: 0 26px 40px -14px rgba(36, 32, 72, 0.38);
  --shadow-dialog: 0 40px 80px -30px rgba(21, 22, 26, 0.45);
  --ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.2);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar: 264px;
  --bottom-nav: 0px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1012;
  --surface: #17181b;
  --subtle: #1f2125;
  --hover: #23262b;
  --line: #26282d;
  --line-2: #30333a;
  --ink: #f2f3f5;
  --text: #c9ccd2;
  --muted: #8d929b;
  --faint: #6b7079;
  --on-ink: #15161a;
  --lilac: #2a2440;
  --lilac-ink: #c9bdfc;
  --lilac-2: #2f2850;
  --mint: #17322a;
  --mint-ink: #8fe0bd;
  --mint-2: #1a3a30;
  --sky: #182a3b;
  --sky-ink: #9cc8f2;
  --sky-2: #1b3247;
  --peach: #3a2619;
  --peach-ink: #f3bd96;
  --peach-2: #43291a;
  --rose: #3d1f1d;
  --rose-ink: #f5a39a;
  --sun: #3a3018;
  --sun-ink: #f1d48a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 14px 28px -18px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 26px 40px -14px rgba(0, 0, 0, 0.7);
  --shadow-dialog: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

/* Aplicação da cor de destaque (Configurações › Editor visual).
   Suave: fundo, menu e linhas ganham um toque da cor; os painéis seguem
   brancos. Marcante: a mesma estrutura, com a cor mais forte. */
:root[data-tint] {
  --tint-glow: color-mix(in srgb, var(--accent) 16%, transparent);
}
:root[data-tint="soft"] {
  --bg: color-mix(in srgb, var(--accent) 7%, #f4f5f7);
  --hover: color-mix(in srgb, var(--accent) 11%, #ebedf1);
  --line-2: color-mix(in srgb, var(--accent) 12%, #e3e6eb);
}
:root[data-tint="bold"] {
  --tint-glow: color-mix(in srgb, var(--accent) 42%, transparent);
  --bg: color-mix(in srgb, var(--accent) 27%, #f4f5f7);
  --hover: color-mix(in srgb, var(--accent) 34%, #ebedf1);
  --line-2: color-mix(in srgb, var(--accent) 38%, #e3e6eb);
  --rail-bg: color-mix(in srgb, var(--accent) 34%, #f4f5f7);
}
:root[data-theme="dark"][data-tint="soft"] {
  --bg: color-mix(in srgb, var(--accent) 8%, #0f1012);
  --hover: color-mix(in srgb, var(--accent) 12%, #23262b);
  --line-2: color-mix(in srgb, var(--accent) 14%, #30333a);
}
:root[data-theme="dark"][data-tint="bold"] {
  --bg: color-mix(in srgb, var(--accent) 22%, #0f1012);
  --hover: color-mix(in srgb, var(--accent) 30%, #23262b);
  --line-2: color-mix(in srgb, var(--accent) 36%, #30333a);
  --tint-glow: color-mix(in srgb, var(--accent) 26%, transparent);
  --rail-bg: color-mix(in srgb, var(--accent) 28%, #0f1012);
}
:root[data-tint] body {
  background:
    radial-gradient(
      90vw 70vh at 100% 0%,
      var(--tint-glow),
      transparent 70%
    )
    fixed,
    var(--bg);
}

/* ---------- Reset e tipografia ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
p {
  line-height: 1.55;
}
small {
  font-size: 12px;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--ink);
}
img,
svg {
  max-width: 100%;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
kbd {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--subtle);
  color: var(--text);
}
::selection {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke-width: 1.8;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
:focus-visible {
  /* Anel de foco com 3:1 também no fundo do menu (WCAG 1.4.11 / 2.4.7):
     a cor de destaque escurecida com a tinta. */
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, var(--ink));
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

/* ---------- Utilitários ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--on-ink);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus {
  transform: none;
}
.muted {
  color: var(--muted);
}
.desktop-only {
  display: inline;
}
.mobile-only {
  display: none;
}
@media (max-width: 600px) {
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: inline;
  }
}
/* Carregamento inicial: pilha de cartões pastel se abrindo em leque, a marca
   do Seuhub no centro e uma barra fina. Aparece só se a carga demorar. */
.splash {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--bg);
  animation: splash-in 0.4s var(--ease) 0.12s backwards;
}
.splash-stack {
  position: relative;
  width: 140px;
  height: 120px;
  display: grid;
  place-items: center;
}
.splash-stack i {
  position: absolute;
  inset: 14px 30px;
  border-radius: 20px;
  box-shadow: 0 10px 24px -14px rgba(21, 22, 26, 0.35);
  animation: splash-fan 1.6s var(--ease) infinite alternate;
}
.splash-stack .tone-a {
  background: #dcd6fb;
  --fan: -18deg;
  --shift: -26px;
}
.splash-stack .tone-b {
  background: #fde4cf;
  --fan: 16deg;
  --shift: 26px;
  animation-delay: 0.08s;
}
.splash-stack .tone-c {
  background: #cdeedd;
  --fan: -4deg;
  --shift: 0px;
  animation-delay: 0.16s;
}
.splash-mark {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #15161a;
  color: #fff;
  box-shadow: 0 18px 30px -16px rgba(21, 22, 26, 0.55);
  animation: splash-mark 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.25) 0.15s backwards;
}
.splash-mark.has-logo {
  overflow: hidden;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(21, 22, 26, 0.08),
    0 16px 30px -18px rgba(21, 22, 26, 0.45);
}
.splash-mark.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.splash-mark svg {
  width: 26px;
  height: 26px;
}
.splash-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.splash-bar {
  position: relative;
  width: 120px;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}
.splash-bar b {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: var(--accent);
  animation: splash-bar 1.1s var(--ease) infinite;
}
@keyframes splash-in {
  from {
    opacity: 0;
  }
}
@keyframes splash-fan {
  from {
    transform: none;
  }
  to {
    transform: translateX(var(--shift)) rotate(var(--fan));
  }
}
@keyframes splash-mark {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-8deg);
  }
}
@keyframes splash-bar {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

/* Entrada do sistema (primeira tela) e troca de página. Fora desses momentos
   as listas não reanimam a cada atualização. */
@media (min-width: 601px) {
  .app-enter .hub-rail {
    animation: enter-rail 0.6s var(--ease) backwards;
  }
}
.app-enter .workspace-main,
.app-enter .auth-panel {
  animation: enter-main 0.65s var(--ease) 0.05s backwards;
}
.app-enter .bottom-nav {
  animation: enter-up 0.55s var(--ease) 0.25s backwards;
}
:is(.app-enter, .page-enter) :is(.page-head, .page-heading, .topbar) {
  animation: rise 0.45s var(--ease) 0.08s backwards;
}
:is(.app-enter, .page-enter)
  :is(.hub-column, .side-card, .deck-card, .settings-card) {
  animation: rise 0.5s var(--ease) backwards;
  animation-delay: calc(0.12s + var(--i, 0) * 0.05s);
}
:is(.app-enter, .page-enter)
  :is(.hub-column, .side-card, .settings-card):nth-child(2) {
  --i: 1;
}
:is(.app-enter, .page-enter)
  :is(.hub-column, .side-card, .settings-card):nth-child(3) {
  --i: 2;
}
:is(.app-enter, .page-enter)
  :is(.hub-column, .side-card, .settings-card):nth-child(n + 4) {
  --i: 3;
}
html:not(.app-enter):not(.page-enter)
  :is(.kpi, .task-line, .board-row, .cm-row) {
  animation: none;
}
@keyframes enter-rail {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
}
@keyframes enter-main {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}
@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
}

/* ---------- Campos ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
    [type="color"]
  ):not([type="file"]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
input::placeholder,
textarea::placeholder {
  /* --faint dava 2,39:1; o exemplo no campo também precisa ser lido. */
  color: var(--muted);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--subtle);
  color: var(--muted);
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  flex: none;
}
input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
}
input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
}
input[type="file"] {
  font-size: 13px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
form > .field + .field,
form > .field + .form-grid,
form > .form-grid + .field {
  margin-top: 14px;
}
.form-error {
  margin: 8px 0 0;
  color: var(--danger-ink);
  font-size: 13px;
  font-weight: 600;
}
.form-error:empty {
  display: none;
}
.form-warning {
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--sun);
  color: var(--sun-ink);
  font-size: 13px;
}
fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 13px;
}
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

/* ---------- Botões ---------- */
.dark-button,
.subtle-button,
.light-button,
.primary,
.yellow-button,
.pill,
.tool-pill,
.danger-text,
.text-button,
.auth-submit,
.quick-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.dark-button,
.primary,
.yellow-button,
.auth-submit,
.quick-save {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  box-shadow: 0 10px 22px -14px rgba(21, 22, 26, 0.6);
}
.dark-button:hover:not(:disabled),
.primary:hover:not(:disabled),
.yellow-button:hover:not(:disabled),
.auth-submit:hover:not(:disabled),
.quick-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px -12px rgba(21, 22, 26, 0.55);
}
.dark-button:active,
.primary:active,
.yellow-button:active {
  transform: scale(0.97);
}
/* Ação destrutiva confirmada (apagar, remover, desconectar). */
button.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #c2362b;
  border-radius: var(--r);
  background: #c2362b;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
button.danger:hover:not(:disabled) {
  background: #a92c22;
}
.subtle-button,
.light-button,
.pill,
.tool-pill {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}
.subtle-button:hover:not(:disabled),
.light-button:hover:not(:disabled),
.pill:hover:not(:disabled),
.tool-pill:hover:not(:disabled) {
  background: var(--subtle);
}
.tool-pill.selected,
.pill.selected,
.subtle-button.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.text-button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
}
.text-button:hover {
  background: var(--subtle);
  color: var(--ink);
}
.danger-text {
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r);
  color: var(--danger-ink);
  font-size: 14px;
}
.danger-text:hover {
  background: var(--rose);
}
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: var(--r-sm);
  color: var(--text);
  transition:
    background 0.15s,
    color 0.15s;
}
.icon-button:hover:not(:disabled) {
  background: var(--hover);
  color: var(--ink);
}
.icon-button .icon {
  width: 19px;
  height: 19px;
}
.dark-button .icon,
.subtle-button .icon,
.primary .icon,
.pill .icon,
.tool-pill .icon,
.text-button .icon,
.danger-text .icon {
  width: 17px;
  height: 17px;
}

/* ---------- Selos (chips) ---------- */
.chip,
.priority-chip,
.due-chip,
.type-chip,
.fatal-chip,
.blocked-chip,
.label-chip,
.status-pill,
.demo-badge,
.al-chip,
.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--subtle);
  color: var(--text);
}
.chip .icon,
.priority-chip .icon,
.due-chip .icon,
.type-chip .icon,
.fatal-chip .icon,
.blocked-chip .icon {
  width: 13px;
  height: 13px;
}
.chip.ok,
.al-chip.ok {
  background: var(--mint);
  color: var(--mint-ink);
}
.chip.warn {
  background: var(--peach);
  color: var(--peach-ink);
}
.chip.late {
  background: var(--rose);
  color: var(--rose-ink);
}
.chip.info {
  background: var(--sky);
  color: var(--sky-ink);
}
.chip.lilac {
  background: var(--lilac);
  color: var(--lilac-ink);
}
.chip.outline {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
}

/* ---------- Cartões e superfícies ---------- */
.glass,
.settings-card,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.settings-card + .settings-card,
.settings-card + form,
form + .settings-card {
  margin-top: 14px;
}
.settings-card > h2 {
  margin-bottom: 6px;
}
.settings-card > p {
  color: var(--muted);
  margin-bottom: 14px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
details > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 10px 2px 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
details[open] > summary::before {
  transform: rotate(45deg);
}
main > details,
.page details:not([class]),
details.legacy-documents,
details.legacy-people,
details.setup-more,
details.google-guide {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

/* ---------- Avatares ---------- */
.person-avatar,
.avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--member-color, var(--accent));
  /* Sem cor da pessoa, o fundo é a cor de destaque: texto por contraste. */
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  object-fit: cover;
}
/* Avatar com a cor da pessoa (paleta escura): texto branco, como antes. */
.person-avatar[style*="--member-color"] {
  color: #fff;
}
.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 20px;
}
.avatar-stack {
  display: inline-flex;
  align-items: center;
}
.avatar-stack > * {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 2px solid var(--surface);
  font-size: 10px;
}
.avatar-stack > *:first-child {
  margin-left: 0;
}

/* ---------- Estados vazios ---------- */
.empty,
.calm-empty,
.content-empty,
.agenda-empty,
.legal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .icon,
.agenda-empty .icon {
  width: 28px;
  height: 28px;
  color: var(--faint);
}
.empty h3,
.agenda-empty h3,
.calm-empty {
  color: var(--ink);
}
.calm-empty p,
.empty p {
  color: var(--muted);
}

/* ---------- Abas segmentadas ---------- */
.view-switch,
.agenda-views,
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
}
.view-switch > button,
.view-switch > a,
.agenda-views > button,
.segmented > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s;
}
.view-switch > button:hover,
.view-switch > a:hover,
.agenda-views > button:hover,
.segmented > button:hover {
  background: var(--subtle);
  color: var(--ink);
}
.view-switch > .selected,
.agenda-views > .selected,
.segmented > .selected,
.view-switch > [aria-pressed="true"] {
  background: var(--hover);
  color: var(--ink);
  font-weight: 700;
}
.view-switch .icon,
.segmented .icon {
  width: 17px;
  height: 17px;
}

/* ---------- Janela modal ---------- */
dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88dvh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
  overflow: auto;
}
dialog[open] {
  animation: dialog-in 0.28s var(--ease);
}
dialog::backdrop {
  background: rgba(15, 16, 20, 0.38);
  backdrop-filter: blur(2px);
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
#modal > :not(.modal-heading) {
  margin-left: 22px;
  margin-right: 22px;
}
#modal > :last-child {
  margin-bottom: 22px;
}
#modal > form > * + *,
#modal > * + :not(.modal-heading) {
  margin-top: 14px;
}
.modal-heading {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 14px 22px;
  background: var(--surface);
}
.modal-heading h2 {
  font-size: 18px;
}
.modal-heading h2:empty + .icon-button {
  margin-left: auto;
}
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
@media (max-width: 600px) {
  dialog,
  html dialog[class] {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
  }
  dialog[open] {
    animation: sheet-in 0.32s var(--ease);
  }
  @keyframes sheet-in {
    from {
      transform: translateY(40px);
      opacity: 0.4;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
}

/* ---------- Aviso (toast) ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--bottom-nav));
  z-index: 300;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-dialog);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.25s,
    transform 0.3s var(--ease);
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.has-action {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}
#toast:not(.visible) {
  pointer-events: none;
}
#toast button {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--accent);
  font-weight: 800;
}
#toast button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Movimento ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pop {
  0% {
    transform: scale(1.05) rotate(2deg);
  }
  60% {
    transform: scale(0.98);
  }
  100% {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Amostras de cor (destaque, etiquetas) ---------- */
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.15s var(--ease-spring),
    box-shadow 0.15s;
}
.swatch:hover {
  transform: scale(1.1);
}
.swatch.on {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--sw);
}
.swatch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.accent-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.swatch-free {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: conic-gradient(
    #f0533e,
    #e9a23b,
    #16a974,
    #2f7bf6,
    #7c5cf5,
    #f0533e
  );
  cursor: pointer;
}
.swatch-free input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.theme-grid .accent-field {
  grid-column: 1 / -1;
}
:root[data-theme="dark"] .swatch {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
:root[data-theme="dark"] .swatch.on {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--sw),
    0 0 0 5px rgba(255, 255, 255, 0.3);
}
.accent-field > label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}
#hub-new-label-form .swatch-row {
  margin-top: 10px;
}

/* Faixa "Descartar alterações?" no rodapé da janela. */
.discard-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0 !important;
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  animation: rise 0.25s var(--ease);
}
.discard-bar span {
  flex: 1 1 180px;
  font-weight: 700;
}

/* Atalhos do teclado */
.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--subtle);
}
.shortcut-list dt {
  min-width: 120px;
}
.shortcut-list dd {
  margin: 0;
  color: var(--text);
}
.shortcut-list kbd {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  font: 700 12px/1.4 inherit;
  white-space: nowrap;
}

/* Sem internet: faixa fina no topo enquanto durar. */
body.is-offline::before {
  content: "Sem conexão — as alterações não estão sendo salvas";
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 400;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 0 0 12px 12px;
  background: var(--danger-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
/* ---------- Aviso flutuante de menção ou atribuição ---------- */
.live-notices {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.live-notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 10px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  animation: live-notice-in 0.32s var(--ease-spring, ease-out);
}
.live-notice strong {
  font-size: 13.5px;
}
.live-notice p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.live-notice small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.live-notice-actions:empty {
  display: none;
}
.live-notice-actions {
  margin-top: 6px;
}
.live-notice-actions .text-button {
  padding: 0;
  min-height: 0;
  font-size: 13px;
  font-weight: 700;
}
.live-notice .icon-button {
  width: 28px;
  height: 28px;
  color: var(--muted);
}
@keyframes live-notice-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
@media (max-width: 600px) {
  .live-notices {
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .live-notice {
    animation: none;
  }
}
.live-notices[popover] {
  inset: auto 20px 20px auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}
@media (max-width: 600px) {
  .live-notices[popover] {
    inset: auto 16px calc(84px + env(safe-area-inset-bottom)) auto;
  }
}

/* Sino de mensagem direcionada (14/11/2026): fica no canto inferior direito,
   balança quando chega mensagem para a pessoa e abre a pílula
   "Você tem 1 mensagem!". Os avisos de menção sobem para não cobrir o sino. */
.dm-alert {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1150;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 56px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line-2));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  box-shadow: var(--shadow-pop), 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  /* Sem overflow: hidden aqui, para o número não ser cortado: quem recolhe
     é só o texto. */
  transition: gap 0.35s ease, padding 0.35s ease;
}
.dm-alert[hidden] {
  display: none;
}
.dm-alert.is-open,
.dm-alert:focus-visible {
  gap: 12px;
  padding-right: 18px;
}
.dm-alert-bell {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  transform-origin: 50% 8px;
}
.dm-alert-bell .icon {
  width: 22px;
  height: 22px;
}
.dm-alert-count {
  position: absolute;
  top: -4px;
  left: 36px;
  z-index: 2;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 10px;
  background: var(--danger);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.dm-alert-text {
  display: grid;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.35s var(--ease-spring), opacity 0.2s ease;
}
.dm-alert.is-open .dm-alert-text,
.dm-alert:focus-visible .dm-alert-text {
  max-width: min(260px, calc(100vw - 120px));
  opacity: 1;
  transition-delay: 0s, 0.12s;
}
.dm-alert-text strong {
  color: var(--mint-ink);
  font-size: 15px;
}
.dm-alert-text small {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
}
.dm-alert.is-ringing .dm-alert-bell {
  animation: dm-ring 1.1s ease-in-out 2;
}
.dm-alert.is-ringing {
  animation: dm-pop 0.45s var(--ease-spring);
}
.dm-alert.is-nudging .dm-alert-bell {
  animation: dm-ring 0.9s ease-in-out 1;
}
@keyframes dm-ring {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(16deg); }
  20% { transform: rotate(-14deg); }
  30% { transform: rotate(12deg); }
  40% { transform: rotate(-10deg); }
  50% { transform: rotate(7deg); }
  60% { transform: rotate(-5deg); }
  70% { transform: rotate(3deg); }
  80% { transform: rotate(-1deg); }
}
@keyframes dm-pop {
  from { transform: translateY(12px) scale(0.9); opacity: 0; }
}
:root[data-theme="dark"] .dm-alert-text strong {
  color: var(--accent);
}
body.has-dm-alert .live-notices {
  bottom: 92px;
}
body.has-dm-alert .live-notices[popover] {
  inset: auto 20px 92px auto;
}
@media (max-width: 600px) {
  .dm-alert {
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  body.has-dm-alert .live-notices,
  body.has-dm-alert .live-notices[popover] {
    bottom: calc(156px + env(safe-area-inset-bottom));
    inset: auto 16px calc(156px + env(safe-area-inset-bottom)) auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dm-alert,
  .dm-alert.is-ringing,
  .dm-alert.is-ringing .dm-alert-bell,
  .dm-alert.is-nudging .dm-alert-bell {
    animation: none;
    transition: none;
  }
}
@media print {
  .dm-alert {
    display: none !important;
  }
}

/* V4 1.10 — estado vazio com ação: o botão que resolve, no visual atual */
.empty-go {
  margin-top: 6px;
}
.ap-empty .empty-go {
  display: flex;
  width: fit-content;
  margin: 10px auto 0;
}
.side-empty .text-button,
.wa-empty .text-button {
  display: inline;
  padding: 0;
  min-height: 0;
  background: none;
  color: var(--ink);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
}
.mon-empty a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

/* V4 1.14 — avisos que ensinam */
.pr-hints,
.doc-missing {
  display: grid;
  gap: 6px;
}
.pr-hints:empty,
.doc-missing:empty {
  display: none;
}
.hint-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--r);
  background: var(--subtle);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.hint-line > .icon {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}
.hint-line.is-info {
  background: var(--sky);
  color: var(--sky-ink);
  font-weight: 600;
}
.hint-line.is-warn {
  background: var(--sun);
  color: var(--sun-ink);
}
.hint-line .text-button {
  display: inline;
  min-height: 0;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
}
.hint-line > span {
  min-width: 0;
}
