:root {
  color-scheme: dark;

  /* Acelerato — dourado champanhe/bronze */
  --gold: #bb8f61;
  --gold-bright: #e8d2a8;
  --gold-soft: #dec393;
  --gold-deep: #a67c50;
  --gold-dark: #856241;

  /* Areia / off-white para textos sobre o escuro */
  --sand-100: #f6f2e9;
  --sand-200: #e7dfcf;
  --sand-300: #cabfa9;
  --sand-400: #9c9078;
  --sand-500: #7a6f5a;

  /* Fundo / superfícies (preto levemente quente da marca) */
  --bg: #0c0b08;
  --surface: #13110b;
  --surface-2: #1a1710;
  --surface-3: #241f16;

  --ink: #efe7d6;
  --muted: #9c9078;
  --line: rgba(187, 143, 97, 0.16);
  --line-dark: rgba(187, 143, 97, 0.32);

  --primary: #bb8f61;
  --primary-dark: #a67c50;
  --danger: #e58374;
  --gold-grad: linear-gradient(135deg, #e8d2a8, #bb8961);
  --focus-ring: 0 0 0 3px rgba(187, 143, 97, 0.3);

  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 0 1px rgba(187, 143, 97, 0.2), 0 20px 44px -20px rgba(187, 143, 97, 0.5);
  --radius: 10px;
  --project-col: 260px;
  --week-width: 72px;
  --row-height: 58px;
}

* {
  box-sizing: border-box;
}

/* Garante que o atributo `hidden` sempre esconda o elemento, mesmo quando
   uma regra de layout (ex.: display: grid no menu de responsáveis) o
   sobreporia. Sem isto os menus suspensos ficam sempre abertos. */
[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--sand-200);
  background: var(--bg);
  background-image: radial-gradient(1200px 620px at 50% -12%, rgba(187, 143, 97, 0.1), transparent 62%);
  background-attachment: fixed;
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

::selection {
  background: rgba(187, 143, 97, 0.32);
  color: var(--sand-100);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.24);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(187, 143, 97, 0.42);
  background-clip: content-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.view-toolbar,
.project-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* ===== Menu lateral (sidebar de módulos) ===== */
.app-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex: 0 0 248px;
  width: 248px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(12, 11, 8, 0.6);
  overflow-y: auto;
  z-index: 20;
}

.app-sidebar {
  transition: flex-basis 160ms ease, width 160ms ease, padding 160ms ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--gold-soft);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.sidebar-toggle:hover {
  background: var(--gold-grad);
  color: #17130c;
}

/* ---- Estado recolhido: só a barrinha de ícones ---- */
.app-shell.sidebar-collapsed .app-sidebar {
  flex-basis: 68px;
  width: 68px;
  padding: 20px 10px;
}

.sidebar-collapsed .sidebar-head {
  flex-direction: column;
  gap: 14px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .menu-label,
.sidebar-collapsed .user-name,
.sidebar-collapsed .user-info,
.sidebar-collapsed .menu-caret {
  display: none;
}

.sidebar-collapsed .app-nav-item,
.sidebar-collapsed .sidebar-footer .menu-trigger,
.sidebar-collapsed .sidebar-footer .user-trigger {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

/* Painéis dos menus abrem à direita (largura própria) quando recolhido */
.sidebar-collapsed .sidebar-footer .menu-panel {
  left: 0;
  right: auto;
  min-width: 210px;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
}

.app-main > main {
  display: block;
  padding: 24px 28px 40px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer .menu,
.sidebar-footer .menu-trigger,
.sidebar-footer .user-trigger {
  width: 100%;
}

.sidebar-footer .menu-trigger,
.sidebar-footer .user-trigger {
  justify-content: flex-start;
}

/* Painéis dos menus da sidebar abrem para cima */
.sidebar-footer .menu-panel,
.menu-panel-up {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-dark);
  border-radius: 11px;
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  box-shadow: inset 0 1px 0 rgba(232, 210, 168, 0.1), var(--shadow-gold);
}

.brand-mark svg {
  display: block;
  width: 26px;
  height: auto;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  color: var(--sand-100);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h2 {
  color: var(--sand-100);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  color: var(--sand-100);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.subtle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.header-actions,
.toolbar-fields,
.modal-actions,
.manager-actions,
.stage-actions,
.task-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Menu superior (header profissional) ===== */
.brand-text h1 {
  font-size: 18px;
  font-weight: 800;
}

.brand-text .eyebrow {
  margin-bottom: 2px;
  font-size: 10px;
}

/* Navegação de módulos (vertical na sidebar) */
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sand-200);
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.app-nav-item .nav-ico {
  flex: 0 0 auto;
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.app-nav-item:hover {
  background: var(--surface-3);
  color: var(--sand-100);
}

.app-nav-item.is-active {
  background: var(--gold-grad);
  color: #17130c;
}

/* Menus suspensos (Cadastros e usuário) */
.menu {
  position: relative;
}

.menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menu-ico {
  font-size: 14px;
}

.menu-caret {
  font-size: 10px;
  color: var(--muted);
  transition: transform 140ms ease;
}

.menu.is-open .menu-caret {
  transform: rotate(180deg);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 210px;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 6px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55), var(--shadow-gold);
}

.menu-panel-right {
  left: auto;
  right: 0;
}

.menu-option {
  display: block;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sand-200);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.menu-option:hover {
  background: rgba(187, 143, 97, 0.12);
  color: var(--gold-soft);
}

/* Menu de usuário */
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px 12px 4px 4px;
  color: var(--sand-200);
  cursor: pointer;
  transition: border-color 140ms ease;
}

.user-trigger:hover {
  border-color: var(--gold);
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #17130c;
  font-size: 11px;
  font-weight: 800;
}

.user-name {
  max-width: 150px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.user-info strong {
  color: var(--sand-100);
  font-size: 13px;
}

.user-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
}

.user-role-badge {
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  padding: 2px 10px;
  background: rgba(187, 143, 97, 0.16);
  color: var(--gold-soft) !important;
  font-size: 11px;
  font-weight: 800;
}

/* Estados de permissão: campos somente-leitura / desabilitados */
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.assignee-dropdown.is-readonly {
  opacity: 0.6;
  pointer-events: none;
}

.view {
  display: none;
  padding: 22px 24px;
}

.view.active {
  display: block;
}

.view-toolbar {
  margin-bottom: 16px;
}

.toolbar-fields {
  align-items: end;
}

label,
.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  outline: none;
  padding: 8px 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--sand-500);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input[type="color"] {
  min-height: 38px;
  padding: 3px;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--gold);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--focus-ring);
}

.assignee-dropdown {
  position: relative;
  min-width: 0;
}

.assignee-dropdown-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.assignee-trigger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignee-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.18);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
}

.assignee-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gold);
  transition: transform 140ms ease;
}

.assignee-dropdown-trigger:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: var(--focus-ring);
}

.assignee-dropdown.is-open .assignee-dropdown-trigger {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--focus-ring);
}

.assignee-dropdown.is-open .assignee-caret {
  transform: rotate(180deg);
}

.assignee-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 35;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 6px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

.assignee-option {
  display: grid;
  grid-template-columns: 18px 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 8px;
  padding: 6px 7px;
  color: var(--sand-200);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.assignee-option:hover {
  background: rgba(187, 143, 97, 0.1);
}

.assignee-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.assignee-checkmark {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid var(--sand-500);
  border-radius: 4px;
  background: transparent;
}

.assignee-option input:checked + .assignee-checkmark {
  border-color: var(--gold);
  background: var(--gold);
}

.assignee-option input:checked + .assignee-checkmark::after {
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #1a1710;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.assignee-option:has(input:checked) {
  background: rgba(187, 143, 97, 0.16);
  color: var(--gold-soft);
}

.assignee-option .avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.assignee-option input {
  margin: 0;
}

.assignee-option span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignee-option.muted-option {
  display: block;
  color: var(--muted);
  padding: 9px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 700;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, filter 140ms ease;
}

.primary-button {
  border: 1px solid rgba(232, 210, 168, 0.5);
  background: var(--gold-grad);
  color: #17130c;
  padding: 8px 16px;
  box-shadow: 0 12px 26px -14px rgba(187, 143, 97, 0.8);
}

.primary-button:hover {
  filter: brightness(1.07);
}

.ghost-button {
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.02);
  color: var(--sand-200);
  padding: 8px 14px;
}

.ghost-button:hover {
  border-color: var(--gold);
  background: rgba(187, 143, 97, 0.1);
  color: var(--gold-soft);
}

.danger-button {
  border: 1px solid rgba(229, 131, 116, 0.42);
  background: rgba(229, 131, 116, 0.1);
  color: var(--danger);
  padding: 8px 14px;
}

.danger-button:hover {
  border-color: var(--danger);
  background: rgba(229, 131, 116, 0.18);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.02);
  color: var(--sand-200);
}

.icon-button:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.icon-button.danger {
  border-color: rgba(229, 131, 116, 0.42);
  color: var(--danger);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-strip article {
  position: relative;
  overflow: hidden;
  min-height: 84px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}

.metric-strip article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--gold-grad);
  opacity: 0.75;
}

.metric-strip strong {
  display: block;
  color: var(--gold-soft);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.metric-strip span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline-shell {
  overflow: auto;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.timeline-grid {
  position: relative;
  width: max-content;
  min-width: 100%;
}

/* Marcador da semana atual: faixa vertical dourada atravessando a grade,
   posicionada na coluna da semana corrente. Fica acima das barras mas abaixo
   da coluna fixa de projetos (que a cobre ao rolar) e do cabeçalho fixo. */
.current-week-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--project-col) + var(--week-index) * var(--week-width));
  width: var(--week-width);
  z-index: 3;
  background: rgba(187, 143, 97, 0.1);
  border-left: 2px solid var(--gold);
  box-shadow: 0 0 12px rgba(187, 143, 97, 0.25);
  pointer-events: none;
}

/* =========================================================================
   Mapa mental (2ª visão da tela Projetos)
   ========================================================================= */
.mindmap-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(187, 143, 97, 0.08), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mm-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.mm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.mm-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

.mm-dot-project { background: var(--gold); }
.mm-dot-partner { background: #9333ea; }
.mm-dot-stage { background: var(--sand-400); }
.mm-dot-task { background: #4b9fea; }

/* Nó de parceiro: agrupador (pai dos projetos do parceiro) */
.mm-node-partner .mm-node-title { font-size: 14px; }

.mm-legend-hint {
  margin-left: auto;
  font-weight: 600;
  color: var(--sand-500);
}

.mm-scroll {
  overflow: auto;
  min-height: 520px;
  max-height: calc(100vh - 260px);
  padding: 28px 32px;
}

.mm-canvas {
  position: relative;
  display: inline-block;
  min-width: 100%;
}

.mm-links {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

/* Cada ramo: nó à esquerda + coluna de filhos centralizada à direita. O
   align-items: center faz o pai alinhar ao bloco de filhos (visual de árvore). */
.mm-branch {
  display: flex;
  align-items: center;
  gap: 46px;
}

.mm-children {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.mm-node {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line-dark);
  border-left: 4px solid var(--mm-color, var(--gold));
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  transition: transform 130ms ease, box-shadow 130ms ease, border-color 130ms ease;
}

.mm-node:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(187, 143, 97, 0.25);
}

.mm-node-inner {
  display: grid;
  gap: 3px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  min-width: 120px;
  max-width: 240px;
}

.mm-node-inner:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 10px;
}

.mm-node-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sand-100);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mm-node-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.mm-node-sub-muted {
  font-size: 10px;
  font-weight: 600;
  color: var(--sand-500);
  letter-spacing: 0.02em;
}

.mm-avatars {
  margin-top: 4px;
}

.mm-toggle {
  flex: 0 0 auto;
  width: 26px;
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--line-dark);
  border-radius: 0 11px 11px 0;
  background: rgba(0, 0, 0, 0.25);
  color: var(--gold-soft);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 130ms ease, color 130ms ease;
}

.mm-toggle:hover {
  background: var(--gold-grad);
  color: #17130c;
}

/* Realce por nível */
.mm-node-root {
  border-left-width: 0;
  border: 1px solid var(--gold);
  background: var(--gold-grad);
}
.mm-node-root .mm-node-title { color: #17130c; font-size: 15px; }
.mm-node-root .mm-node-sub { color: rgba(23, 19, 12, 0.7); }
.mm-node-root .mm-toggle {
  color: #17130c;
  border-left-color: rgba(23, 19, 12, 0.25);
  background: rgba(23, 19, 12, 0.12);
}
.mm-node-root .mm-toggle:hover { background: rgba(23, 19, 12, 0.22); color: #17130c; }

.mm-node-project .mm-node-title { font-size: 14px; }
.mm-node-subtask .mm-node-inner { min-width: 110px; padding: 8px 12px; }
.mm-node-subtask .mm-node-title { font-size: 12px; font-weight: 600; }

/* Realce da semana atual no cabeçalho */
.week-cell.is-current-week {
  background: var(--gold);
  color: #17130c;
}

.date-cell.is-current-week {
  background: rgba(187, 143, 97, 0.18);
  color: var(--gold-soft);
}

.timeline-row {
  display: grid;
  grid-template-columns: var(--project-col) minmax(0, 1fr);
}

.timeline-row + .timeline-row {
  border-top: 1px solid var(--line);
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: var(--project-col) minmax(0, 1fr);
  border-bottom: 1px solid var(--line-dark);
}

.timeline-project-title {
  position: sticky;
  left: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  min-height: 152px;
  border-right: 1px solid var(--line-dark);
  background: linear-gradient(160deg, var(--surface-3), var(--surface-2));
  color: var(--gold-soft);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-header-main {
  min-width: max-content;
}

.project-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: var(--row-height);
  border-right: 1px solid var(--line-dark);
  background: var(--surface);
  padding: 10px 14px;
}

.project-cell button {
  width: fit-content;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--sand-100);
  font-weight: 800;
  text-align: left;
  padding: 0;
  transition: color 140ms ease;
}

.project-cell button:hover {
  color: var(--gold-soft);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.status-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(187, 143, 97, 0.12);
  color: var(--sand-200);
  font-size: 11px;
  font-weight: 700;
}

.status-pill {
  border: 1px solid color-mix(in srgb, var(--status-color, var(--gold)) 45%, transparent);
  background: color-mix(in srgb, var(--status-color, var(--gold)) 20%, var(--surface-2));
  color: color-mix(in srgb, var(--status-color, var(--gold)) 45%, var(--sand-100));
}

.category-dot,
.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--item-color);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}

/* Avatar com foto: usa background-image (cover) no lugar das iniciais. */
.avatar-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}

.avatar-stack {
  display: flex;
  align-items: center;
  min-width: 32px;
}

.avatar-stack .avatar {
  border: 2px solid var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.avatar-stack .avatar + .avatar {
  margin-left: -8px;
}

.muted-avatar {
  --item-color: #5b5445;
}

.header-project {
  z-index: 8;
  background: var(--surface-2);
  color: var(--gold-soft);
  font-weight: 800;
  text-transform: uppercase;
}

.year-cell {
  position: sticky;
  top: 0;
  left: var(--project-col);
  z-index: 13;
  display: grid;
  place-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line-dark);
  background: var(--surface-2);
  color: var(--gold-soft);
  font-size: 18px;
  font-weight: 800;
}

.months-row,
.weeks-row,
.dates-row,
.project-weeks {
  display: grid;
  grid-template-columns: repeat(var(--week-count), var(--week-width));
}

.month-cell,
.week-cell,
.date-cell {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.month-cell {
  background: var(--surface-2);
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 800;
}

.week-cell {
  background: var(--surface-3);
  color: var(--sand-300);
  font-size: 12px;
  font-weight: 700;
}

.date-cell {
  min-height: 42px;
  background: var(--surface);
  color: var(--sand-400);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
}

.project-weeks {
  position: relative;
  min-height: var(--row-height);
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--week-width) - 1px),
      var(--line) calc(var(--week-width) - 1px),
      var(--line) var(--week-width)
    );
}

.stage-bar {
  z-index: 2;
  align-self: center;
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  background: var(--stage-color);
  color: #ffffff;
  overflow: hidden;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
}

.stage-bar:hover {
  filter: brightness(1.08);
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  font-weight: 700;
}

/* ===== Mural de notícias ===== */
.mural-list {
  display: grid;
  gap: 14px;
  max-width: 860px;
}

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

.mural-card.is-pinned {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(187, 143, 97, 0.25), var(--shadow);
}

.mural-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.mural-card-head h3 {
  font-size: 17px;
}

.mural-pin {
  font-size: 14px;
}

.mural-body {
  color: var(--sand-200);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mural-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mural-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ===== Cofre de senhas ===== */
.vault-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.vault-search {
  flex: 1 1 260px;
  min-width: 200px;
  min-height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 13px;
}
.vault-filters select {
  min-height: 38px;
}
.vault-search:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: var(--focus-ring);
}
.vault-list {
  display: grid;
  gap: 12px;
}
.vault-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
.vault-card-main {
  min-width: 0;
  flex: 1 1 auto;
}
.vault-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.vault-card-head h3 {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.vault-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.vault-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sand-200);
  border: 1px solid var(--line);
}
.vault-badge-partner {
  background: rgba(187, 143, 97, 0.18);
  color: var(--gold-soft);
  border-color: var(--line-dark);
}
.vault-badge-cat {
  background: rgba(120, 160, 210, 0.14);
  color: #bcd3f0;
  border-color: rgba(120, 160, 210, 0.3);
}
.vault-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 20px;
  margin: 0;
}
.vault-fields > div {
  min-width: 0;
}
.vault-fields dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 1px;
}
.vault-fields dd {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--sand-100);
  overflow-wrap: anywhere;
}
.vault-url {
  color: var(--gold-soft);
  text-decoration: none;
}
.vault-url:hover {
  text-decoration: underline;
}
.vault-pass-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vault-dots {
  letter-spacing: 2px;
  color: var(--sand-400);
}
.vault-plain {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--gold-bright);
  background: rgba(187, 143, 97, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.vault-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--sand-200);
  cursor: pointer;
  font-size: 13px;
  transition: background 120ms ease, border-color 120ms ease;
}
.vault-icon-btn:hover {
  background: rgba(187, 143, 97, 0.16);
  border-color: var(--gold);
}
.vault-copy {
  cursor: pointer;
}
.vault-copy-ico {
  color: var(--muted);
  font-size: 11px;
}
.vault-copy:hover .vault-copy-ico {
  color: var(--gold-soft);
}
.vault-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.vault-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--sand-300);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
}
.vault-note-flag {
  font-size: 12px;
}
.vault-card-side {
  flex: 0 0 auto;
}

/* Campo de senha no modal (input + mostrar/ocultar + gerar) */
.vault-pass-input {
  display: flex;
  gap: 6px;
  align-items: center;
}
.vault-pass-input input {
  flex: 1 1 auto;
  min-width: 0;
}
.vault-pass-input .icon-button {
  flex: 0 0 auto;
}
.vault-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
}

/* Histórico de acessos */
.vault-log-list {
  display: grid;
  gap: 2px;
  max-height: 60vh;
  overflow: auto;
}
.vault-log-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1.4fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12.5px;
}
.vault-log-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}
.vault-log-who {
  font-weight: 800;
  color: var(--sand-100);
}
.vault-log-act {
  font-weight: 700;
  color: var(--gold-soft);
}
.vault-log-reveal .vault-log-act {
  color: #e6b45a;
}
.vault-log-delete .vault-log-act {
  color: #e07a7a;
}
.vault-log-what {
  color: var(--sand-200);
  overflow-wrap: anywhere;
}
.vault-log-when {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

/* Cofre bloqueado / setup: esconde filtros e ações, mostra a "cancela" */
#vaultView.vault-locked .vault-filters,
#vaultView.vault-locked .manager-actions {
  display: none;
}
.vault-gate {
  max-width: 440px;
  margin: 40px auto;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.vault-gate-ico {
  font-size: 40px;
  margin-bottom: 6px;
}
.vault-gate h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.vault-gate p {
  margin-bottom: 18px;
  line-height: 1.5;
}
.vault-gate-form {
  display: grid;
  gap: 10px;
  text-align: left;
}
.vault-gate-form input {
  min-height: 42px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
}
.vault-gate-form input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: var(--focus-ring);
}
.vault-gate-form .primary-button {
  min-height: 42px;
}

.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

/* Tarefas padrão: campo no cadastro de etapas + checklist no modal de etapa */
.stage-tpl-tasks-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stage-default-tasks {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.stage-dt-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.stage-dt-list {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow: auto;
}

.stage-dt-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--sand-100);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.stage-dt-item input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.project-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.project-topbar,
.project-summary,
.stage-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-topbar {
  padding: 16px;
}

.project-heading {
  min-width: 0;
  flex: 1;
}

.project-summary {
  align-self: start;
  padding: 18px;
}

.project-summary dl {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.project-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-summary dd {
  margin-top: 5px;
  color: var(--sand-100);
  font-size: 14px;
  line-height: 1.45;
}

.stage-list {
  display: grid;
  gap: 12px;
}

.stage-card {
  overflow: hidden;
}

.stage-card-header {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.stage-swatch {
  width: 10px;
  height: 44px;
  border-radius: 999px;
  background: var(--stage-color);
}

.stage-title {
  min-width: 0;
}

.stage-title h3 {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.stage-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--task-status-color, var(--gold));
  border-radius: 8px;
  background: var(--surface-2);
  transition: border-color 140ms ease, background 140ms ease;
}

.task-item:hover {
  border-color: var(--line-dark);
  border-left-color: var(--task-status-color, var(--gold));
  background: var(--surface-3);
}

.task-main {
  min-width: 0;
}

.task-main strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--sand-100);
  font-size: 14px;
}

.task-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tasks-shell {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: auto;
}

.tasks-board {
  min-width: 980px;
}

/* Mapa mental na tela de tarefas: usa o scroll do .tasks-shell (sem min-width) */
.tasks-board.tasks-mindmap {
  min-width: 0;
  padding: 28px 32px;
}

.tasks-board.cu-list,
.tasks-board.cu-board {
  min-width: 0;
}

/* ======================================================================= */
/* Tela de tarefas estilo ClickUp                                          */
/* ======================================================================= */

/* Abas de visualização (Lista / Quadro) */
.cu-view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.cu-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  transition: background 140ms ease, color 140ms ease;
}

.cu-view-tab:hover {
  color: var(--sand-200);
}

.cu-view-tab.is-active {
  background: var(--gold-grad);
  color: #17130c;
}

.cu-view-ico {
  font-size: 12px;
}

/* ---- Lista agrupada ---- */
.cu-list {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.cu-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.cu-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-left: 3px solid var(--g, var(--gold));
  background: var(--surface-2);
  color: var(--sand-100);
  padding: 10px 14px;
  text-align: left;
  transition: background 140ms ease;
}

.cu-group-header:hover {
  background: var(--surface-3);
}

.cu-caret {
  color: var(--muted);
  font-size: 11px;
  transition: transform 140ms ease;
}

.cu-group.is-collapsed .cu-caret {
  transform: rotate(-90deg);
}

.cu-group-name {
  border-radius: 999px;
  padding: 3px 12px;
  background: color-mix(in srgb, var(--g, var(--gold)) 22%, var(--surface-2));
  color: color-mix(in srgb, var(--g, var(--gold)) 52%, var(--sand-100));
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cu-group-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.16);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
}

.cu-group.is-collapsed .cu-group-body {
  display: none;
}

.cu-list-head,
.cu-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 148px 138px minmax(150px, 210px) 132px 78px;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
}

.cu-list-head {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cu-row {
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--status, var(--gold));
  background: var(--surface);
  transition: background 140ms ease;
}

.cu-row:last-child {
  border-bottom: 0;
}

.cu-row:hover {
  background: var(--surface-2);
}

.cu-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Bolinha de status / seta de expansão na linha da tarefa */
.cu-bullet {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
}

/* Bolinha na cor do status (tarefa com subtarefas, ou tarefa sem subtarefas p/
   quem não pode editar) */
.cu-bullet-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status, var(--gold));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status, var(--gold)) 22%, transparent);
}

/* Bolinha clicável (tarefa COM subtarefas): expande/recolhe ao clicar */
.cu-bullet-dot-btn {
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.cu-bullet-dot-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status, var(--gold)) 34%, transparent);
}

/* Tarefa com subtarefas: a bolinha vira uma seta (mesma cor) que expande */
.cu-bullet-toggle {
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--status, var(--gold)) 20%, transparent);
  color: var(--status, var(--gold));
  cursor: pointer;
  transition: background 140ms ease, transform 160ms ease;
}

.cu-bullet-toggle:hover {
  background: color-mix(in srgb, var(--status, var(--gold)) 34%, transparent);
}

.cu-bullet-chevron {
  font-size: 10px;
  line-height: 1;
  transition: transform 160ms ease;
}

.cu-bullet-toggle.is-open .cu-bullet-chevron {
  transform: rotate(180deg);
}

.cu-row-nameline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cu-subcount {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.14);
  color: var(--gold-soft);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cu-subcount:hover {
  background: rgba(187, 143, 97, 0.24);
}

/* "+ subtarefa" discreto na linha da tarefa: aparece só ao passar o mouse. */
.cu-subtask-add-inline {
  flex: 0 0 auto;
  border: 1px dashed var(--line-dark);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease, border-color 140ms ease;
}

.cu-row:hover .cu-subtask-add-inline,
.cu-subtask-add-inline:focus-visible {
  opacity: 1;
}

.cu-subtask-add-inline:hover {
  color: var(--gold-soft);
  border-color: var(--gold);
}

.cu-cell {
  min-width: 0;
}

.cu-expand {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  transition: transform 140ms ease, color 140ms ease, background 140ms ease;
}

.cu-expand:hover {
  background: rgba(187, 143, 97, 0.12);
  color: var(--gold-soft);
}

.cu-expand.is-open {
  transform: rotate(90deg);
  color: var(--gold-soft);
}

.cu-expand-spacer {
  flex: 0 0 auto;
  width: 20px;
}

.cu-row-name {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  color: var(--sand-100);
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.cu-row-name:hover {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cu-row-sub {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cu-cell-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.cu-status-select {
  width: 100%;
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--status, var(--gold)) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--status, var(--gold)) 20%, var(--surface-2));
  color: color-mix(in srgb, var(--status, var(--gold)) 52%, var(--sand-100));
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.cu-status-select:focus {
  box-shadow: var(--focus-ring);
}

.cu-priority {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cu-flag-ico {
  color: var(--flag, #6b7280);
  font-size: 13px;
  line-height: 1;
}

.cu-priority-select {
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--sand-200);
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.cu-due-input {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.cu-due-input.is-overdue {
  border-color: rgba(229, 131, 116, 0.6);
  color: #f0a0a0;
}

.cu-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.cu-icon-btn:hover {
  border-color: var(--line-dark);
  background: rgba(187, 143, 97, 0.08);
  color: var(--gold-soft);
}

.cu-empty-row {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* ---- Quadro (Board) ---- */
.cu-board {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  min-height: 520px;
}

.cu-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 300px;
  width: 300px;
  max-height: calc(100vh - 230px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.cu-col.drag-over {
  border-color: var(--gold);
  background: rgba(187, 143, 97, 0.05);
  box-shadow: inset 0 0 0 2px rgba(187, 143, 97, 0.24);
}

.cu-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.cu-col-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--g, var(--gold));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--g, var(--gold)) 22%, transparent);
}

.cu-col-head h3 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--g, var(--gold)) 52%, var(--sand-100));
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cu-col-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.16);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
}

.cu-col-cards {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 10px;
}

.cu-card {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--status, var(--gold));
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
  cursor: grab;
  transition: border-color 140ms ease, background 140ms ease;
}

.cu-card:hover {
  border-color: var(--line-dark);
  background: var(--surface-3);
}

.cu-card.dragging {
  opacity: 0.55;
}

.cu-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cu-card-sub {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cu-card-edit {
  width: 26px;
  height: 26px;
  font-size: 15px;
}

.cu-card-title {
  display: block;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  color: var(--sand-100);
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.cu-card-title:hover {
  color: var(--gold-soft);
}

.cu-card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.cu-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(187, 143, 97, 0.12);
  color: var(--sand-300);
  font-size: 11px;
  font-weight: 800;
}

.cu-chip-status {
  border-color: color-mix(in srgb, var(--status, var(--gold)) 45%, transparent);
  background: color-mix(in srgb, var(--status, var(--gold)) 20%, var(--surface-2));
  color: color-mix(in srgb, var(--status, var(--gold)) 52%, var(--sand-100));
}

.cu-due {
  color: var(--sand-400);
  font-size: 11px;
  font-weight: 700;
}

.cu-due.is-overdue {
  color: #f0a0a0;
}

.cu-card-avatars {
  margin-left: auto;
}

.cu-empty-col {
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ---- Botão de comentário + contador ---- */
.cu-comment-btn {
  position: relative;
}

.cu-comment-count {
  position: absolute;
  top: -3px;
  right: -3px;
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--gold);
  color: #17130c;
  font-size: 9px;
  font-weight: 800;
}

/* ---- Subtarefas na listagem (reveladas ao expandir a tarefa) ---- */
/* A guia vertical é desenhada com box-shadow inset para não deslocar a grade,
   mantendo as colunas alinhadas com as da tarefa. */
.cu-subtasks {
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 3px 0 0 rgba(187, 143, 97, 0.3);
}

.cu-subrow {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 148px 138px minmax(150px, 210px) 132px 78px;
  align-items: center;
  gap: 12px;
  padding: 5px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.cu-subrow:first-child {
  border-top: 0;
}

.cu-subrow:hover {
  background: rgba(187, 143, 97, 0.06);
}

.cu-subrow-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: 26px;
}

.cu-subrow-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status, var(--gold));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status, var(--gold)) 22%, transparent);
}

.cu-subrow-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--sand-100);
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.cu-subrow-name:hover {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cu-comment-tag {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.2);
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 800;
}
.cu-comment-tag::before {
  content: "💬";
  margin-right: 2px;
  font-size: 9px;
}

.cu-subtask-add {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px 7px 35px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.cu-subtask-add:hover {
  color: var(--gold-soft);
}

/* Lista de subtarefas dentro do modal da tarefa */
.subtask-listitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 9px 12px;
  color: var(--sand-100);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.subtask-listitem:hover {
  border-color: var(--gold);
  background: var(--surface-3);
}

.subtask-listitem-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Toolbar de filtros estilo ClickUp ---- */
#tasksView .view-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.cu-toolbar {
  display: grid;
  gap: 12px;
  width: 100%;
}

.cu-toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  min-height: 38px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0 12px;
}

.cu-search:focus-within {
  border-color: var(--gold);
  box-shadow: var(--focus-ring);
}

.cu-search-ico {
  font-size: 13px;
  opacity: 0.7;
}

.cu-search input {
  flex: 1;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  outline: none;
}

.cu-filters {
  align-items: flex-end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.cu-filters-label {
  align-self: center;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cu-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cu-filter select,
.cu-filter input {
  min-width: 130px;
}

.cu-filter > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* Multi-select de responsáveis no filtro */
.assignee-filter {
  min-width: 170px;
}

.assignee-filter .assignee-dropdown-trigger {
  min-height: 38px;
}

.assignee-filter .assignee-dropdown-menu {
  min-width: 220px;
}

/* Filtro de vencimento (operador + data) */
.cu-due-filter {
  display: flex;
  gap: 6px;
}

.cu-due-filter select {
  min-width: 108px;
}

.cu-due-filter input {
  min-width: 140px;
}

.cu-due-filter input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Comentários dentro do modal de tarefa */
.task-comments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.task-comments .comment-thread {
  max-height: 220px;
}

.task-comments .comment-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.task-comments .comment-form .ghost-button {
  justify-self: end;
}

.cu-clear-filters {
  align-self: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--danger);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.cu-clear-filters:hover {
  border-color: rgba(229, 131, 116, 0.42);
  background: rgba(229, 131, 116, 0.1);
}

/* ---- Modal de comentários ---- */
.comments-modal {
  width: min(520px, calc(100vw - 28px));
  padding: 20px;
}

.comments-modal .modal-header {
  margin-bottom: 6px;
}

#commentsContext {
  margin-bottom: 14px;
  color: var(--gold-soft);
  font-weight: 700;
}

.comment-thread {
  display: grid;
  gap: 12px;
  max-height: 46vh;
  overflow: auto;
  padding: 4px 2px;
}

.comment {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #17130c;
  font-size: 10px;
  font-weight: 800;
}

.comment-author {
  color: var(--sand-100);
  font-size: 13px;
  font-weight: 700;
}

.comment-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.comment-text {
  color: var(--sand-200);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

/* Histórico de atividades (timeline compacta) */
.activity-thread {
  display: grid;
  gap: 2px;
  max-height: 40vh;
  overflow: auto;
  padding: 4px 2px;
}

.activity-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 7px 4px;
  position: relative;
}

/* Linha da timeline conectando os pontos */
.activity-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.activity-item:first-child::before { top: 12px; }
.activity-item:last-child::before { bottom: calc(100% - 12px); }

.activity-dot {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--surface);
}

.activity-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.activity-text {
  margin: 0;
  color: var(--sand-100);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.activity-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.comment-form textarea {
  resize: vertical;
  min-height: 60px;
}

.comment-form .primary-button {
  justify-self: end;
}

.task-table {
  display: grid;
}

.task-table-header,
.task-table-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(140px, 0.8fr) 110px 126px 92px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.task-table-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 42px;
  background: var(--surface-3);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-table-row {
  background: var(--surface);
  border-left: 4px solid var(--task-status-color, var(--gold));
  transition: background 140ms ease;
}

.task-table-row:hover {
  background: var(--surface-2);
}

.task-name-cell {
  min-width: 0;
}

.task-name-cell strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--sand-100);
  font-size: 14px;
}

.task-name-cell span,
.task-table-row > span {
  color: var(--muted);
  font-size: 12px;
}

.task-name-cell small,
.kanban-card small {
  display: block;
  margin-top: 5px;
  color: var(--sand-300);
  font-size: 11px;
  font-weight: 700;
}

.inline-control {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

.assignee-dropdown-inline {
  min-width: 0;
}

.assignee-dropdown-inline .assignee-dropdown-menu {
  right: auto;
  width: min(260px, 78vw);
}

/* ===== Gatilho de responsáveis adaptativo (linha/modal) — avatar-âncora ===== */
/* Escopado em .assignee-trigger-row para NÃO afetar o trigger do filtro do topo,
   que continua usando a regra-base em grid com .assignee-trigger-text/.assignee-count. */
.assignee-trigger-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  overflow: hidden;
}
.assignee-trigger-row .asg-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.assignee-trigger-row .asg-faces {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.assignee-trigger-row .asg-face {
  width: 24px;
  height: 24px;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.assignee-trigger-row .asg-face + .asg-face,
.assignee-trigger-row .asg-faces .asg-more {
  margin-left: -8px;
}
.assignee-trigger-row .asg-more {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.2);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
  z-index: 1;
}
.assignee-trigger-row .asg-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--sand-100);
}
.assignee-trigger-row .asg-name[hidden] {
  display: none;
}
.assignee-trigger-row .asg-name-empty {
  color: var(--muted);
  font-weight: 600;
}
.assignee-trigger-row .asg-face-empty {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px dashed var(--sand-500);
  border-radius: 50%;
  color: var(--sand-400);
  font-weight: 800;
  background: transparent;
}
.assignee-trigger-row .assignee-caret {
  flex: 0 0 auto;
}
.assignee-trigger-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 12px;
  min-width: 960px;
  padding: 12px;
}

.kanban-column {
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.kanban-column.drag-over {
  border-color: var(--gold);
  background: rgba(187, 143, 97, 0.08);
  box-shadow: inset 0 0 0 2px rgba(187, 143, 97, 0.24);
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 12px;
}

.kanban-column h3 {
  font-size: 14px;
}

.kanban-column header span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  background: rgba(187, 143, 97, 0.16);
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
}

.kanban-cards {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
}

.kanban-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--task-status-color, var(--gold));
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.kanban-card:hover {
  border-color: var(--line-dark);
  background: var(--surface-3);
}

.kanban-card[draggable="true"] {
  cursor: grab;
}

.kanban-card.dragging {
  opacity: 0.58;
}

.kanban-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--sand-100);
  font-size: 14px;
}

.kanban-card span {
  color: var(--muted);
  font-size: 12px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.kanban-card-footer .ghost-button {
  margin-left: auto;
}

.kanban-empty {
  min-height: 48px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
  font-size: 13px;
  font-weight: 700;
}

.subtask-editor {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.status-builder {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.subtask-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subtask-editor-header h4 {
  margin: 0;
  color: var(--sand-100);
  font-size: 14px;
}

.subtask-list-editor {
  display: grid;
  gap: 8px;
}

.status-row-list {
  display: grid;
  gap: 8px;
}

.subtask-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(130px, 0.7fr) 132px 142px 38px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.subtask-row input,
.subtask-row select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 110px 130px 38px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.status-row input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.status-done {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
}

.status-done input {
  width: 15px;
  min-height: 15px;
}

.modal {
  width: min(720px, calc(100vw - 28px));
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), var(--shadow-gold);
  padding: 0;
}

.manager-modal {
  width: min(840px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(6, 5, 3, 0.72);
  backdrop-filter: blur(4px);
}

.modal form {
  padding: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.span-2 {
  grid-column: span 2;
}

.modal-actions {
  justify-content: end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modal-actions .danger-button {
  margin-right: auto;
}

.manager-form {
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  align-items: end;
}

#partnersModal .manager-form {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(190px, 1fr) 110px auto;
}

#peopleModal .manager-form {
  grid-template-columns: minmax(160px, 1fr) minmax(190px, 1fr) 110px auto;
}

/* Campo de foto do responsável */
.person-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.person-photo-preview {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line-dark);
  background: var(--surface-3);
  background-size: cover;
  background-position: center;
  color: var(--muted);
  font-size: 26px;
}

.person-photo-preview.has-photo {
  border-color: var(--gold);
}

.person-photo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.person-photo-pick {
  cursor: pointer;
}

.person-photo-hint {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* Garante que o avatar do cabeçalho com foto use a imagem (sobrepõe o gradiente
   do .user-avatar). A imagem em si vem do style inline (background-image). */
.user-avatar.avatar-photo {
  background-size: cover;
  background-position: center;
  color: transparent;
}

/* Bloco de senha (opcional) no modal de Perfil */
.profile-password {
  margin: 4px 0 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.profile-password legend {
  padding: 0 8px;
  color: var(--sand-200);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-optional {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.manager-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 16px 20px 20px;
}

/* Seções e link de convite no modal de usuários */
.manager-section {
  margin-top: 6px;
}

.manager-section h4 {
  margin: 0;
  padding: 14px 20px 0;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.manager-section .manager-list {
  max-height: 220px;
}

.invite-link-box {
  display: grid;
  gap: 8px;
  margin: 4px 20px 0;
  padding: 12px 14px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: rgba(187, 143, 97, 0.1);
}

.invite-link-label {
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
}

.invite-link-row {
  display: flex;
  gap: 8px;
}

.invite-link-row input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.manager-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.manager-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--sand-100);
}

.manager-item span {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  transform: translateY(20px);
  opacity: 0;
  max-width: 320px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--gold-soft);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow), var(--shadow-gold);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1000px) {
  :root {
    --project-col: 220px;
    --week-width: 64px;
  }

  .app-header,
  .view-toolbar,
  .project-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-fields {
    flex-wrap: wrap;
  }

  .project-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .view {
    padding: 16px 14px;
  }

  .header-actions,
  .toolbar-fields,
  .modal-actions,
  .stage-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .header-actions > *,
  .toolbar-fields > *,
  .modal-actions > *,
  .stage-actions > * {
    width: 100%;
  }

  .metric-strip,
  .form-grid,
  .manager-form {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .task-item,
  .task-table-header,
  .task-table-row,
  .subtask-row,
  .status-row,
  .manager-item {
    grid-template-columns: 1fr;
  }

  .task-table-header {
    display: none;
  }

  .tasks-board,
  .kanban-board {
    min-width: 0;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  /* ClickUp view no mobile: linhas empilhadas e colunas full-width */
  .cu-list-head {
    display: none;
  }

  .cu-list-head,
  .cu-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cu-row {
    row-gap: 6px;
    padding: 12px 14px;
  }

  .cu-cell-actions {
    justify-content: flex-start;
  }

  .cu-board {
    flex-direction: column;
  }

  .cu-col {
    flex: 1 1 auto;
    width: 100%;
    max-height: none;
  }
}
