/* =========================================================
   PRONTIM! Design System
   Fase 1: tokens, botões, seletores, campos e badges. Fase 2: shell e cabeçalho.
   Fase 3: lista do setor. Fase 4: Minhas tarefas, Caixa, Projetos e Agenda.
   Fase 5: configurações, modais, popovers e painel da tarefa.
   Carregado depois de app.css. O escopo :is(#app-view, body > section:not(#auth-view))
   cobre a aplicação, o painel da tarefa e os modais, e deixa o login de fora.
   Regra nova de componente compartilhado entra aqui, não no fim de app.css.
   Referência: docs/DESIGN-SYSTEM.md
   ========================================================= */

:root {
  /* Marca */
  --brand: #5d5cfc;
  --brand-dark: #4b4ae6;
  --brand-soft: #f0f0ff;
  --brand-rgb: 93, 92, 252;
  --focus-outline: 2px solid rgba(93, 92, 252, .45);

  /* Superfícies e texto */
  --background: #f7f7f8;
  --surface: #ffffff;
  --surface-muted: #f6f6f7;
  --foreground: #1d1d1f;
  --line: #e8e8eb;

  /* Neutros de controle */
  --head-primary-bg: #303030;
  --head-primary-hover: #1a1a1a;
  --secondary-border: #d4d4d8;
  --secondary-hover: #f3f3f4;
  --segment-bg: #ededf0;
  --segment-item: #6b6b73;
  --segment-item-hover: #3f3f46;
  --search-border: #dcdce0;

  /* Tons semânticos: todo badge de estado usa um destes pares. */
  --tone-success-fg: #17704a;  --tone-success-bg: #e5f5ec;
  --tone-info-fg: #245fa3;     --tone-info-bg: #e8f1fd;
  --tone-warning-fg: #8a5a0b;  --tone-warning-bg: #fff3d6;
  --tone-attention-fg: #a1461a; --tone-attention-bg: #ffede3;
  --tone-critical-fg: #a33434; --tone-critical-bg: #fdeaea;
  --tone-neutral-fg: #5f5f68;  --tone-neutral-bg: #ededf0;

  /* Raios */
  --radius-pill: 999px;
  --radius-panel: 16px;
  --radius-card: 12px;
  --control-radius: 11px;
  --radius-thumb: 8px;
  --radius-row-action: 6px;

  /* Alturas */
  --button-height: 28px;
  --segment-height: 34px;
  --segment-item-height: 26px;
  --toolbar-height: 34px;

  /* Tipografia */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;

  /* Legado de app.css apontando para os tokens */
  --orange: var(--brand) !important;
  --orange-hover: var(--brand-dark);
  --orange-soft: var(--brand-soft);
  --orange-line: #d9d9fe;
  --focus-ring: 0 0 0 3px rgba(93, 92, 252, .18);
  --danger: #c43d3d;
  --success: #20865b;
  --warning: #b7791f;

  font-family: var(--font-sans);
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

/* ---------- Botões ---------- */
:is(#app-view, body > section:not(#auth-view)) .btn {
  min-height: var(--button-height);
  height: auto;
  padding: 0 11px;
  gap: 5px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}
:is(#app-view, body > section:not(#auth-view)) .btn .icon-svg { width: 13px; height: 13px; }

/* Secundário: base e "ghost" de cabeçalho */
:is(#app-view, body > section:not(#auth-view)) .btn:not(.primary):not(.dark):not(.ghost):not(.danger-outline),
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.ghost,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.ghost {
  background: var(--surface);
  border: 1px solid var(--secondary-border);
  color: var(--foreground);
  box-shadow: 0 1px 0 rgb(0 0 0 / 5%);
}
:is(#app-view, body > section:not(#auth-view)) .btn:not(.primary):not(.dark):not(.ghost):not(.danger-outline):hover,
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.ghost:hover,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.ghost:hover {
  background: var(--secondary-hover);
}

:is(#app-view, body > section:not(#auth-view)) .btn.ghost {
  border-color: transparent;
  color: #52525b;
}
:is(#app-view, body > section:not(#auth-view)) .btn.ghost:hover { background: #ececef; color: var(--foreground); }

/* Primário fora do cabeçalho (modais, formulários, barras): marca */
:is(#app-view, body > section:not(#auth-view)) .btn.primary {
  background: var(--brand) !important;
  border: 1px solid var(--brand) !important;
  color: #fff !important;
}
:is(#app-view, body > section:not(#auth-view)) .btn.primary:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}

/* Primário do cabeçalho de página: escuro */
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.primary,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.primary,
:is(#app-view, body > section:not(#auth-view)) .project-detail-actions .btn.primary,
:is(#app-view, body > section:not(#auth-view)) .btn.dark {
  background: var(--head-primary-bg) !important;
  border-color: var(--head-primary-bg) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 1px 2px rgb(0 0 0 / 22%) !important;
}
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.primary:hover,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.primary:hover,
:is(#app-view, body > section:not(#auth-view)) .project-detail-actions .btn.primary:hover,
:is(#app-view, body > section:not(#auth-view)) .btn.dark:hover {
  background: var(--head-primary-hover) !important;
  border-color: var(--head-primary-hover) !important;
}

:is(#app-view, body > section:not(#auth-view)) .btn.danger-outline {
  border: 1px solid #f1c9c9;
  color: var(--tone-critical-fg);
  background: var(--surface);
}
:is(#app-view, body > section:not(#auth-view)) .btn.danger-outline:hover { background: var(--tone-critical-bg); }

/* Contextos que tinham altura e corpo próprios seguem os mesmos 28px/12px. */
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn,
:is(#app-view, body > section:not(#auth-view)) .project-detail-actions .btn,
:is(#app-view, body > section:not(#auth-view)) .project-create-actions .btn,
:is(#app-view, body > section:not(#auth-view)) .bulk-action-bar .btn,
:is(#app-view, body > section:not(#auth-view)) .btn.compact-btn,
:is(#app-view, body > section:not(#auth-view)) .btn.large {
  height: auto !important;
  min-height: var(--button-height) !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  border-radius: var(--radius-pill) !important;
}

/* O botão "Nova tarefa" da sidebar é revisto na fase do shell. */
:is(#app-view, body > section:not(#auth-view)) .sidebar .btn.primary {
  min-height: 34px;
  padding: 0 12px;
}

/* Foco visível */
:is(#app-view, body > section:not(#auth-view)) .btn:focus-visible,
:is(#app-view, body > section:not(#auth-view)) .icon-btn:focus-visible,
:is(#app-view, body > section:not(#auth-view)) .segmented button:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* ---------- Botões de ícone ---------- */
:is(#app-view, body > section:not(#auth-view)) .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  color: #71717a;
}
:is(#app-view, body > section:not(#auth-view)) .icon-btn .icon-svg { width: 15px; height: 15px; }
:is(#app-view, body > section:not(#auth-view)) .icon-btn:hover { background: #ececef; color: var(--foreground); }
:is(#app-view, body > section:not(#auth-view)) .page-head .icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
}
:is(#app-view, body > section:not(#auth-view)) .page-head .icon-btn:hover { background: var(--secondary-hover); }

/* ---------- Seletor segmentado ---------- */
:is(#app-view, body > section:not(#auth-view)) .segmented {
  height: var(--segment-height);
  padding: 3px;
  gap: 2px;
  align-items: stretch;
  background: var(--segment-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
:is(#app-view, body > section:not(#auth-view)) .segmented button {
  height: var(--segment-item-height);
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--segment-item);
}
:is(#app-view, body > section:not(#auth-view)) .segmented button:hover:not(.active) { color: var(--segment-item-hover); }
:is(#app-view, body > section:not(#auth-view)) .segmented button.active {
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 0 0 .5px rgb(0 0 0 / 4%);
}

/* ---------- Campos ---------- */
:is(#app-view, body > section:not(#auth-view)) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
:is(#app-view, body > section:not(#auth-view)) select,
:is(#app-view, body > section:not(#auth-view)) textarea,
:is(#app-view, body > section:not(#auth-view)) .custom-select-trigger {
  border-color: var(--line);
  border-radius: var(--control-radius);
}
:is(#app-view, body > section:not(#auth-view)) input:focus,
:is(#app-view, body > section:not(#auth-view)) select:focus,
:is(#app-view, body > section:not(#auth-view)) textarea:focus,
:is(#app-view, body > section:not(#auth-view)) .custom-select.open .custom-select-trigger,
:is(#app-view, body > section:not(#auth-view)) .custom-select-trigger:focus {
  border-color: rgba(var(--brand-rgb), .55) !important;
  box-shadow: var(--focus-ring) !important;
}
:is(#app-view, body > section:not(#auth-view)) input[type="checkbox"],
:is(#app-view, body > section:not(#auth-view)) input[type="radio"] { accent-color: var(--brand); }

/* Seletores compactos de filtro: pill de 34px, como a busca. */
:is(#app-view, body > section:not(#auth-view)) .select-compact,
:is(#app-view, body > section:not(#auth-view)) .custom-select.is-compact .custom-select-trigger {
  min-height: var(--toolbar-height) !important;
  height: var(--toolbar-height);
  padding-top: 0;
  padding-bottom: 0;
  border: 1px solid var(--search-border);
  border-radius: var(--radius-pill);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Badges: prioridade ---------- */
:is(#app-view, body > section:not(#auth-view)) .priority-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px !important;
  border-radius: var(--radius-pill);
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  line-height: 1;
  white-space: nowrap;
  border: 0;
  background: var(--tone-neutral-bg);
  color: var(--tone-neutral-fg);
}
:is(#app-view, body > section:not(#auth-view)) .priority-pill.priority-urgent { background: var(--tone-critical-bg); color: var(--tone-critical-fg); }
:is(#app-view, body > section:not(#auth-view)) .priority-pill.priority-high { background: var(--tone-attention-bg); color: var(--tone-attention-fg); }
:is(#app-view, body > section:not(#auth-view)) .priority-pill.priority-medium { background: var(--tone-info-bg); color: var(--tone-info-fg); }
:is(#app-view, body > section:not(#auth-view)) .priority-pill.priority-low { background: var(--tone-neutral-bg); color: var(--tone-neutral-fg); }

/* ---------- Badges: status ----------
   O status tem cor configurável por setor. O badge usa essa cor
   como tom: fundo claro e texto escurecido, no mesmo formato dos
   tons semânticos. */
:is(#app-view, body > section:not(#auth-view)) .status-pill {
  height: 22px;
  min-height: 22px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  background: color-mix(in srgb, var(--status-color, #8e8e93) 14%, #fff);
  color: color-mix(in srgb, var(--status-color, #8e8e93) 62%, #000);
  box-shadow: none;
}
:is(#app-view, body > section:not(#auth-view)) .status-pill.is-neutral {
  background: var(--tone-neutral-bg);
  color: var(--tone-neutral-fg);
}

/* Atrasada: mesmo tom crítico. */
:is(#app-view, body > section:not(#auth-view)) .overdue-pill { color: var(--tone-critical-fg); font-size: 11.5px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  :is(#app-view, body > section:not(#auth-view)) .btn,
  :is(#app-view, body > section:not(#auth-view)) .segmented button { transition: none; }
}

/* =========================================================
   Fase 2 — Shell, sidebar e cabeçalho de página
   ========================================================= */

:root {
  --sidebar-bg: #202021;
  --sidebar-text: #aaaab0;
  --sidebar-text-strong: #f4f4f5;
  --sidebar-heading: #6f7075;
  --sidebar-hover: #2b2b2d;
  --sidebar-active: #343436;
  --sidebar-divider: #343437;
  --sidebar-badge: #373739;
  --sidebar-accent: #8d8cff;
  --shell-gap: 6px;
  --page-padding-x: 20px;
  --page-padding-top: 14px;
  --page-padding-bottom: 26px;
  --page-head-gap: 12px;
  --page-section-gap: 10px;
  --page-title-size: 16px;
}

/* ---------- Sidebar escura (desktop e drawer) ---------- */
#app-view .sidebar {
  background: var(--sidebar-bg) !important;
  border-right: 0 !important;
  color: var(--sidebar-text);
}
#app-view .sidebar .sidebar-logo { content: url("../assets/prontim-logo-light.svg"); }
body.sidebar-collapsed #app-view .sidebar .sidebar-logo { content: url("../assets/prontim-favicon.svg") !important; }
#app-view .sidebar .sidebar-toggle { color: var(--sidebar-heading); }
#app-view .sidebar .sidebar-toggle:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }

#app-view .sidebar .new-task-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill) !important;
  box-shadow: none !important;
  font-size: 12px;
  font-weight: 600;
}

#app-view .sidebar .nav-item,
#app-view .sidebar .sector-nav-item {
  color: var(--sidebar-text) !important;
  font-size: 13px;
  font-weight: 500 !important;
  border-radius: 9px !important;
  background: transparent;
  box-shadow: none !important;
}
#app-view .sidebar .nav-item .icon-svg { color: currentColor; }
#app-view .sidebar .nav-item:hover,
#app-view .sidebar .sector-nav-item:hover,
#app-view .sidebar .sector-nav-parent-row:hover,
#app-view .sidebar .sector-nav-child-row:hover {
  background: var(--sidebar-hover) !important;
  color: var(--sidebar-text-strong) !important;
}
#app-view .sidebar .nav-item.active,
#app-view .sidebar .sector-nav-item.active {
  background: var(--sidebar-active) !important;
  color: var(--sidebar-text-strong) !important;
  font-weight: 600 !important;
}
#app-view .sidebar .nav-item.active .icon-svg { color: var(--sidebar-accent); }
#app-view .sidebar .sector-nav-group.has-active-child > .sector-nav-parent-row { background: transparent !important; }
#app-view .sidebar .sector-nav-parent-row:has(.sector-nav-item.active),
#app-view .sidebar .sector-nav-child-row:has(.sector-nav-item.active) { background: var(--sidebar-active) !important; }
#app-view .sidebar .sector-nav-parent-row:has(.sector-nav-item.active) .sector-nav-item,
#app-view .sidebar .sector-nav-child-row:has(.sector-nav-item.active) .sector-nav-item { background: transparent !important; }

#app-view .sidebar .nav-section-title,
#app-view .sidebar .sector-sidebar-title {
  color: var(--sidebar-heading) !important;
  font-size: 10px !important;
  font-weight: 650 !important;
  letter-spacing: .08em;
}
#app-view .sidebar .sector-collapse-btn,
#app-view .sidebar .sector-more-btn,
#app-view .sidebar .sector-parent-add-btn,
#app-view .sidebar .sidebar-quick-add,
#app-view .sidebar .sector-drag-handle { color: var(--sidebar-heading) !important; background: transparent !important; }
#app-view .sidebar .sector-collapse-btn:hover,
#app-view .sidebar .sector-more-btn:hover,
#app-view .sidebar .sector-parent-add-btn:hover,
#app-view .sidebar .sidebar-quick-add:hover { color: var(--sidebar-text-strong) !important; background: var(--sidebar-active) !important; }
#app-view .sidebar .sector-drag-handle span { background: var(--sidebar-heading) !important; }
#app-view .sidebar .sector-nav-children { border-color: var(--sidebar-divider) !important; }

#app-view .sidebar .nav-unread-badge {
  background: var(--sidebar-badge) !important;
  color: var(--sidebar-text-strong) !important;
}

#app-view .sidebar .sidebar-user {
  border-top: 1px solid var(--sidebar-divider) !important;
  background: transparent !important;
}
#app-view .sidebar .profile-trigger:hover { background: var(--sidebar-hover) !important; }
#app-view .sidebar .user-copy strong { color: var(--sidebar-text-strong) !important; }
#app-view .sidebar .user-copy span { color: var(--sidebar-heading) !important; }
#app-view .sidebar .avatar { background: var(--sidebar-active); color: var(--sidebar-text-strong); border-color: transparent; }
#app-view .sidebar .sidebar-user .icon-btn { color: var(--sidebar-heading); border: 0; }
#app-view .sidebar .sidebar-user .icon-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
/* Rolagem da sidebar: fina e escura, sem trilho branco nem setas (Windows). */
@supports not selector(::-webkit-scrollbar) {
  #app-view .sidebar, #app-view .sidebar * { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  #app-view .sidebar:hover, #app-view .sidebar:hover * { scrollbar-color: rgb(255 255 255 / 18%) transparent; }
}
#app-view .sidebar ::-webkit-scrollbar { width: 6px; height: 6px; }
#app-view .sidebar ::-webkit-scrollbar-track { background: transparent; }
#app-view .sidebar ::-webkit-scrollbar-button { display: none; }
#app-view .sidebar ::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
#app-view .sidebar:hover ::-webkit-scrollbar-thumb { background: rgb(255 255 255 / 18%); }
#app-view .sidebar ::-webkit-scrollbar-thumb:hover { background: rgb(255 255 255 / 30%); }

/* ---------- Painel principal (desktop) ---------- */
@media (min-width: 901px) {
  #app-view.app-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: var(--sidebar-bg);
  }
  #app-view .sidebar { height: 100dvh; }
  #app-view .workspace {
    height: calc(100dvh - var(--shell-gap) * 2);
    min-height: 0 !important;
    margin: var(--shell-gap) var(--shell-gap) var(--shell-gap) 0;
    border-radius: var(--radius-panel);
    background: var(--background);
    box-shadow: 0 0 0 1px rgb(0 0 0 / 22%), 0 8px 28px rgb(0 0 0 / 14%);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    min-width: 0;
  }
  #app-view .workspace::-webkit-scrollbar { width: 10px; }
  #app-view .workspace::-webkit-scrollbar-track { background: transparent; margin: 12px 0; }
  #app-view .workspace::-webkit-scrollbar-thumb {
    background: rgb(0 0 0 / 18%);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
  }
  #app-view .workspace::-webkit-scrollbar-thumb:hover { background-color: rgb(0 0 0 / 32%); }
  @supports not selector(::-webkit-scrollbar) {
    #app-view .workspace { scrollbar-width: thin; }
  }
  body.modal-open #app-view .workspace,
  body.drawer-open #app-view .workspace { overflow: hidden; }
}

/* ---------- Barra superior ---------- */
#app-view .topbar {
  height: 48px;
  flex: none; /* v1.52.0: sem isso a barra encolhia em páginas longas (Caixa, Agenda, Projetos) */
  padding: 0 var(--page-padding-x);
  background: rgb(247 247 248 / 88%) !important;
  border-bottom: 1px solid var(--line) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#app-view .search-box {
  height: var(--toolbar-height);
  padding: 0 12px;
  gap: 8px;
  border: 1px solid var(--search-border) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}
#app-view .search-box input {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0;
  font-size: 13px;
}
#app-view .search-box .icon-svg { width: 15px; height: 15px; color: #71717a; }
#app-view .search-shortcut {
  font-family: var(--font-sans);
  font-size: 11px;
  color: #8a8a93;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
#app-view .topbar-actions { gap: 6px; }
#app-view .topbar .sync-status { font-size: 12px; color: var(--muted); }

/* ---------- Conteúdo e cabeçalho de página ---------- */
#app-view .content {
  padding: var(--page-padding-top) var(--page-padding-x) var(--page-padding-bottom);
}
#app-view .content > .view { padding-top: 0 !important; margin-top: 0 !important; }

#app-view .page-head,
#app-view .mine-hub-head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center !important;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin: 0 0 var(--page-head-gap) !important;
  padding: 0 !important;
}
#app-view .page-head h1,
#app-view .mine-hub-head h1 {
  font-size: var(--page-title-size) !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: -.01em !important;
  margin: 0 !important;
  color: var(--foreground);
}
/* Sem eyebrow nem subtítulo que repete o título. */
#app-view .page-head .eyebrow,
#app-view .mine-hub-head .eyebrow,
#app-view .page-head > div > p:not(#sector-subtitle),
#app-view .mine-hub-head p { display: none !important; }
/* Descrição do setor, quando existe: uma linha discreta. */
#app-view #sector-subtitle {
  margin: 2px 0 0 !important;
  font-size: 12px !important;
  color: var(--muted) !important;
}
#app-view #sector-subtitle:empty { display: none; }

#app-view .page-head .view-actions,
#app-view .page-head-actions,
#app-view .agenda-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: auto;
  justify-content: flex-end;
}

/* Nível 2: busca à esquerda, filtros e seletores à direita. */
#app-view .page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--page-section-gap);
}
#app-view .page-toolbar > * { flex: 0 0 auto; }
#app-view .page-toolbar > .toolbar-spacer { flex: 1 1 auto; }
#app-view .page-toolbar .custom-select.is-compact { width: 200px; min-width: 0; }

/* ---------- Drawer da navegação (≤ 900px) ---------- */
#mobile-menu-btn,
.mobile-drawer-backdrop { display: none; }

@media (max-width: 900px) {
  #app-view.app-shell,
  body.sidebar-collapsed #app-view.app-shell { display: block !important; }

  #app-view .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 250px !important;
    height: 100dvh !important;
    padding: 12px 10px !important;
    z-index: 1300 !important;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    border-top: 0 !important;
    backdrop-filter: none !important;
    transform: translateX(-100%);
    transition: transform var(--motion-base, 240ms) var(--motion-ease-out, ease);
    box-shadow: none;
  }
  #app-view .sidebar::after { content: none !important; display: none !important; }
  body.mobile-drawer-open #app-view .sidebar {
    transform: none;
    box-shadow: 0 0 40px rgb(0 0 0 / 30%);
  }
  #app-view .sidebar .sidebar-top,
  #app-view .sidebar .nav-section,
  #app-view .sidebar .sidebar-user { display: flex !important; }
  #app-view .sidebar .sidebar-top { flex-direction: column; }
  #app-view .sidebar .nav-section { flex-direction: column; }
  #app-view .sidebar .sidebar-user { flex-direction: row; align-items: center; }
  #app-view .sidebar .main-nav { display: grid !important; margin-top: 14px; }
  #app-view .sidebar .nav-item {
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    font-size: 13px !important;
    padding: 0 10px !important;
    min-height: 36px !important;
  }
  #app-view .sidebar .nav-label { display: inline !important; }
  #app-view .sidebar .sidebar-toggle { display: none !important; }
  #app-view .sidebar .sidebar-logo { content: url("../assets/prontim-logo-light.svg") !important; width: 116px !important; height: auto !important; }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1299;
    background: rgb(0 0 0 / 32%);
  }
  body.mobile-drawer-open .mobile-drawer-backdrop { display: block; }
  body.mobile-drawer-open { overflow: hidden; }

  #mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--foreground);
  }
  #mobile-menu-btn .icon-svg { width: 18px; height: 18px; }

  #app-view .workspace { min-height: 100dvh; margin: 0; border-radius: 0; }
  #app-view .topbar { padding: 0 14px; gap: 8px; }
  #app-view .content {
    --page-padding-x: 14px;
    padding: 14px 14px 28px !important;
  }
}

@media (max-width: 760px) {
  #app-view .page-toolbar > * { flex: 1 1 100%; }
  #app-view .page-toolbar .custom-select.is-compact { width: 100%; }
  #app-view .page-toolbar .segmented { overflow-x: auto; scrollbar-width: none; }
  #app-view .page-toolbar .segmented::-webkit-scrollbar { display: none; }
  #app-view .page-toolbar .segmented button { flex: 1 0 auto; }
}

@media (max-width: 520px) {
  #app-view .page-head .view-actions,
  #app-view .page-head-actions,
  #app-view .agenda-head-actions { width: 100%; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  #app-view .sidebar { transition: none; }
}

/* =========================================================
   Fase 3 — Lista do setor e visão por etiquetas
   ========================================================= */

:root {
  --dl-border: #e3e3e7;
  --dl-divider: #ebebee;
  --dl-head-bg: #f7f7f8;
  --dl-head-color: #616169;
  --dl-hover: #f7f7f8;
  --dl-group-bg: #f3f3f5;
  --dl-text: #303036;
  --dl-muted: #71717a;
  --dl-radius: 12px;
  --dl-head-height: 36px;
  --dl-row-height: 52px;
  --dl-pad-x: 12px;
}

#app-view .list-order-hint {
  justify-content: flex-end;
  margin: 0 0 var(--page-section-gap);
}

#app-view :is(.status-list-groups, .label-list-groups) { gap: 10px; }

#app-view :is(.status-list-group, .label-list-group) {
  border: 1px solid var(--dl-border) !important;
  border-radius: var(--dl-radius) !important;
  background: var(--surface) !important;
  box-shadow: 0 1px 2px rgba(24, 24, 27, .03) !important;
  overflow: hidden;
}
#app-view :is(.status-list-group-head, .label-list-group-head) {
  min-height: 40px !important;
  padding: 0 var(--dl-pad-x) !important;
  background: var(--dl-group-bg) !important;
  border-bottom: 1px solid var(--dl-border) !important;
}
#app-view :is(.status-list-group-title, .label-list-group-title) strong {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--foreground);
}
#app-view :is(.status-list-group-count, .label-list-group-count) {
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--dl-muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

/* Colunas com largura fixa: o nome é a única coluna flexível, e as colunas
   ficam alinhadas entre os grupos. */
#app-view :is(.status-list-table, .label-list-table) {
  width: 100% !important;
  min-width: max(640px, var(--list-min-width, 640px)) !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}
#app-view :is(.status-list-table, .label-list-table) .col-select { width: 40px; }
#app-view :is(.status-list-table, .label-list-table) .col-title { width: auto; }
/* v1.57.2: larguras calculadas pelo conteúdo em app.js (computeListLayout). */
#app-view :is(.status-list-table, .label-list-table) .col-status { width: var(--list-w-status, 148px); }
#app-view :is(.status-list-table, .label-list-table) .col-priority { width: var(--list-w-priority, 108px); }
#app-view :is(.status-list-table, .label-list-table) .col-assignees { width: var(--list-w-assignees, 128px); }
#app-view :is(.status-list-table, .label-list-table) .col-due { width: var(--list-w-due, 104px); }
#app-view :is(.status-list-table, .label-list-table) th.custom-field-head .table-sort-btn { max-width: 100%; }
#app-view :is(.status-list-table, .label-list-table) th.custom-field-head .table-sort-btn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app-view :is(.status-list-table, .label-list-table) .col-add { width: 44px; }

#app-view :is(.status-list-table, .label-list-table) thead { background: var(--dl-head-bg) !important; }
#app-view :is(.status-list-table, .label-list-table) th {
  height: var(--dl-head-height) !important;
  padding: 0 var(--dl-pad-x) !important;
  border-bottom: 1px solid var(--dl-border) !important;
  background: var(--dl-head-bg) !important;
  color: var(--dl-head-color) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-align: left;
}
#app-view :is(.status-list-table, .label-list-table) .table-sort-btn {
  min-height: var(--dl-head-height) !important;
  height: var(--dl-head-height);
  padding: 0 !important;
  color: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
#app-view :is(.status-list-table, .label-list-table) .table-sort-btn span {
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
#app-view :is(.status-list-table, .label-list-table) .table-sort-btn.is-active { color: var(--foreground) !important; }

#app-view :is(.status-list-table, .label-list-table) td {
  height: var(--dl-row-height) !important;
  padding: 8px var(--dl-pad-x) !important;
  border-bottom: 1px solid var(--dl-divider) !important;
  color: var(--dl-text) !important;
  font-size: 13px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#app-view :is(.status-list-table, .label-list-table) tbody tr { background: var(--surface) !important; }
#app-view :is(.status-list-table, .label-list-table) tbody tr:hover { background: var(--dl-hover) !important; }
#app-view :is(.status-list-table, .label-list-table) tbody tr.is-selected { background: var(--brand-soft) !important; }
#app-view :is(.status-list-table, .label-list-table) tbody tr:last-child td { border-bottom: 0 !important; }
#app-view :is(.status-list-table, .label-list-table) td.is-overdue { color: var(--tone-critical-fg) !important; font-weight: 600 !important; }

#app-view :is(.status-list-table, .label-list-table) .col-title { overflow: hidden; }
#app-view :is(.status-list-table, .label-list-table) .col-select { overflow: visible; text-overflow: clip; padding-right: 0 !important; }
#app-view :is(.status-list-table, .label-list-table) .task-title-with-labels {
  max-width: 100% !important;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
#app-view :is(.status-list-table, .label-list-table) .task-title-with-labels > strong {
  min-width: 0;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
}
#app-view .list-row-drag-handle {
  width: 16px;
  margin-right: 4px;
  color: #b4b4bb !important;
  font-size: 14px !important;
  vertical-align: middle;
}
#app-view .list-row-drag-handle:hover { color: var(--dl-muted) !important; }

/* Etiqueta na linha: badge pequeno no tom da etiqueta. */
#app-view .task-label-chip {
  height: 20px;
  padding: 0 7px !important;
  border-radius: var(--radius-pill) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 20px;
  background: color-mix(in srgb, var(--label-color, #8e8e93) 14%, #fff) !important;
  color: color-mix(in srgb, var(--label-color, #8e8e93) 62%, #000) !important;
  box-shadow: none !important;
  border: 0 !important;
}

#app-view .table-add-column-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-row-action) !important;
  color: var(--dl-muted);
  border: 0 !important;
  background: transparent !important;
}
#app-view .table-add-column-btn:hover { background: #ececef !important; color: var(--dl-text); }

#app-view .mini-avatar { box-shadow: 0 0 0 2px var(--surface); }
#app-view :is(.status-list-table, .label-list-table) .col-assignees .avatar-stack { justify-content: flex-start !important; }

/* v1.57.1: o nome não some mais em "...". O bloco do título é inline-flex (caixa
   atômica): se passasse da célula, o navegador trocava a caixa inteira por
   reticências. Agora ele cabe na célula e o próprio texto é que corta. */
#app-view :is(.status-list-table, .label-list-table) td.col-title { text-overflow: clip; }
#app-view :is(.status-list-table, .label-list-table) .list-row-drag-handle ~ .task-title-with-labels { max-width: calc(100% - 24px) !important; }
#app-view :is(.status-list-table, .label-list-table) .task-title-with-labels > strong { white-space: nowrap; }
/* v1.57.2: o nome tem prioridade sobre as etiquetas. As etiquetas encolhem
   primeiro, e a que não cabe inteira some (quebra para uma linha escondida)
   em vez de aparecer cortada ("Sho", "Vazan"). */
#app-view :is(.status-list-table, .label-list-table) .task-title-with-labels > strong { flex: 0 1 auto; }
#app-view :is(.status-list-table, .label-list-table) .task-title-with-labels > .task-labels {
  flex: 1 1 0;
  min-width: 18px;
  max-width: none;
  height: 20px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}
#app-view :is(.status-list-table, .label-list-table) .task-title-with-labels > .task-labels .task-label-chip {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: none;
}
#app-view :is(.status-list-table, .label-list-table) .task-title-with-labels > .task-labels:has(.task-label-chip) { min-width: 64px; }

/* Colunas personalizadas: o campo ocupa a célula sem transbordar, e o texto
   do campo fica alinhado ao título da coluna. */
#app-view :is(.status-list-table, .label-list-table) td.col-custom {
  padding-inline: max(2px, calc(var(--dl-pad-x) - 8px)) !important;
  text-overflow: clip;
}
#app-view :is(.status-list-table, .label-list-table) td.col-custom :is(.custom-field-input, .custom-money, .custom-link-cell, .custom-date-cell, .custom-date-trigger) {
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}
#app-view :is(.status-list-table, .label-list-table) td.col-custom .custom-date-trigger > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Até 760px: cada tarefa vira um cartão, sem rolagem horizontal. */
@media (max-width: 760px) {
  #app-view :is(.status-list-table-wrap, .label-list-table-wrap) { overflow: visible !important; }
  #app-view :is(.status-list-table, .label-list-table) { min-width: 0 !important; table-layout: auto !important; }
  #app-view :is(.status-list-table, .label-list-table) thead { display: none !important; }
  #app-view :is(.status-list-table, .label-list-table) tbody,
  #app-view :is(.status-list-table, .label-list-table) tbody tr { display: block; }
  #app-view :is(.status-list-table, .label-list-table) tbody tr {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 10px var(--dl-pad-x) 10px 0;
    border-bottom: 1px solid var(--dl-divider);
  }
  #app-view :is(.status-list-table, .label-list-table) tbody tr:last-child { border-bottom: 0; }
  #app-view :is(.status-list-table, .label-list-table) td {
    display: block;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
  }
  #app-view :is(.status-list-table, .label-list-table) td.col-select { width: 36px; display: grid; place-items: center; }
  #app-view :is(.status-list-table, .label-list-table) td.col-title { flex: 1 1 calc(100% - 52px); min-width: 0; }
  #app-view :is(.status-list-table, .label-list-table) td:is(.col-status, .col-priority, .col-assignees, .col-due, .col-custom) { flex: 0 0 auto; width: auto !important; min-width: 0 !important; max-width: none !important; }
  #app-view :is(.status-list-table, .label-list-table) td.col-status { margin-left: 36px; }
  #app-view :is(.status-list-table, .label-list-table) td.col-due { font-size: 12px !important; color: var(--dl-muted) !important; }
  #app-view :is(.status-list-table, .label-list-table) td.col-due.is-overdue { color: var(--tone-critical-fg) !important; }
  #app-view :is(.status-list-table, .label-list-table) td.col-add,
  #app-view :is(.status-list-table, .label-list-table) td:empty:not(.col-select) { display: none; }
}

@media (max-width: 520px) {
  /* No setor as ações são só ícones: cabem na linha do título. */
  #app-view .sector-head .view-actions { width: auto; }
}

/* =========================================================
   Fase 4 — Minhas tarefas, Caixa de entrada, Projetos e Agenda
   ========================================================= */

/* Card de lista compartilhado (padrão .data-list) */
#app-view :is(#mine-list, .inbox-list, .projects-catalog-panel, .project-detail-panel, .project-task-table, .agenda-calendar-card, .agenda-events-card) {
  border: 1px solid var(--dl-border) !important;
  border-radius: var(--dl-radius) !important;
  background: var(--surface) !important;
  box-shadow: 0 1px 2px rgba(24, 24, 27, .03) !important;
}

/* ---------- Minhas tarefas ---------- */
#app-view .task-mascot-grid { gap: 10px; margin: 0 0 18px !important; }
#app-view .task-mascot-card {
  border-radius: var(--dl-radius) !important;
  border: 1px solid var(--dl-border) !important;
  box-shadow: 0 1px 2px rgba(24, 24, 27, .03) !important;
}
#app-view .task-mascot-copy small { font-size: 13px !important; font-weight: 600 !important; color: var(--foreground) !important; }
#app-view .task-mascot-copy strong { font-variant-numeric: tabular-nums; }

#app-view .mine-task-section-head {
  align-items: center !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 8px !important;
  margin: 0 0 var(--page-section-gap) !important;
}
#app-view .mine-task-section-head h2 { margin: 0 !important; font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0 !important; }
#app-view .mine-task-section-head p { display: none !important; }

/* Linha: nome e contexto à esquerda; prioridade, pessoas e prazo em colunas fixas. */
#app-view .my-task-row {
  min-height: var(--dl-row-height) !important;
  grid-template-columns: minmax(0, 1fr) 96px 72px 96px 16px !important;
  grid-template-rows: auto auto;
  grid-template-areas: "title priority people date arrow" "context priority people date arrow";
  gap: 2px 12px !important;
  padding: 8px var(--dl-pad-x) !important;
  border-bottom: 1px solid var(--dl-divider) !important;
  background: var(--surface) !important;
  transform: none !important;
}
#app-view .my-task-row:last-child { border-bottom: 0 !important; }
#app-view .my-task-row:hover { background: var(--dl-hover) !important; }
#app-view .my-task-row:focus-visible { outline: var(--focus-outline); outline-offset: -2px; }
#app-view .my-task-row > .my-task-title { grid-area: title; align-self: end; }
#app-view .my-task-row > .my-task-context { grid-area: context; align-self: start; }
#app-view .my-task-row > .my-task-priority { grid-area: priority; }
#app-view .my-task-row > .my-task-people { grid-area: people; justify-content: flex-start !important; }
#app-view .my-task-row > .my-task-date { grid-area: date; text-align: right; }
#app-view .my-task-row > :last-child:not(.my-task-date) { grid-area: arrow; }
#app-view .my-task-row .my-task-title strong { font-size: 13px !important; font-weight: 600 !important; color: var(--foreground); }
#app-view .my-task-row .my-task-context,
#app-view .my-task-row .my-task-context span { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view .my-task-row .my-task-date { font-size: 13px !important; color: var(--dl-text) !important; font-variant-numeric: tabular-nums; }
#app-view .my-task-row .my-task-date.is-overdue { color: var(--tone-critical-fg) !important; font-weight: 600; }
/* O prazo em vermelho já diz que está atrasada. */
#app-view .my-task-row .overdue-pill { display: none !important; }
#app-view .my-task-row .priority-pill { height: 22px !important; min-height: 22px !important; padding: 0 8px !important; font-size: 11.5px !important; }

@media (max-width: 760px) {
  #app-view .my-task-row {
    grid-template-columns: minmax(0, 1fr) auto 16px !important;
    grid-template-areas: "title date arrow" "context priority arrow";
    row-gap: 4px !important;
  }
  #app-view .my-task-row > .my-task-people { display: none !important; }
  #app-view .my-task-row > .my-task-priority { display: inline-flex !important; justify-self: end; }
  #app-view .my-task-row > .my-task-context { display: flex !important; }
}

/* ---------- Caixa de entrada ---------- */
#app-view .inbox-unread-count { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view .inbox-list { overflow: hidden; gap: 0 !important; }
#app-view .inbox-item {
  min-height: var(--dl-row-height);
  padding: 0 var(--dl-pad-x) 0 0 !important;
  border-bottom: 1px solid var(--dl-divider) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
}
#app-view .inbox-item:last-child { border-bottom: 0 !important; }
#app-view .inbox-item:hover { background: var(--dl-hover) !important; }
#app-view .inbox-item.unread { background: color-mix(in srgb, var(--brand) 4%, #fff) !important; }
#app-view .inbox-item-open { padding: 10px var(--dl-pad-x) !important; gap: 10px !important; }
#app-view .inbox-item .notification-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--radius-thumb) !important;
  background: var(--surface-muted) !important;
  color: #a1a1aa;
}
#app-view .inbox-item-title strong { font-size: 13px !important; font-weight: 600 !important; color: var(--foreground); }
#app-view .inbox-item-content small { font-size: 12px !important; color: var(--dl-text) !important; }
#app-view .inbox-item-content em { font-size: 12px !important; color: var(--dl-muted) !important; font-style: normal; }
#app-view .notification-unread-dot { background: var(--brand) !important; }
#app-view .inbox-delete-btn {
  width: 28px !important;
  height: 28px !important;
  border-radius: var(--radius-row-action) !important;
  color: var(--dl-muted) !important;
  opacity: 1 !important;
}
#app-view .inbox-delete-btn:hover { background: #ececef !important; color: var(--tone-critical-fg) !important; }

/* ---------- Gestão de projetos ---------- */
#app-view .project-overview-strip { gap: 6px !important; margin: 0 0 var(--page-section-gap) !important; }
#app-view .project-overview-strip > span {
  height: 24px;
  padding: 0 9px !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  background: var(--tone-neutral-bg) !important;
  color: var(--tone-neutral-fg) !important;
  font-size: 12px !important;
}
#app-view .project-overview-strip > span strong { color: var(--foreground); font-variant-numeric: tabular-nums; }
#app-view .project-overview-strip > span.is-risk { background: var(--tone-critical-bg) !important; color: var(--tone-critical-fg) !important; }
#app-view .project-overview-strip > span.is-risk strong { color: inherit; }

#app-view .projects-catalog-head strong { font-size: 13px !important; font-weight: 600 !important; }
#app-view .projects-catalog-head span { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view .project-search {
  height: var(--toolbar-height) !important;
  padding: 0 12px !important;
  border: 1px solid var(--search-border) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}
#app-view .project-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 13px !important; padding: 0 !important; }
#app-view :is(.project-tool-button, .project-list-tools .custom-select-trigger) {
  height: var(--toolbar-height) !important;
  min-height: var(--toolbar-height) !important;
  padding: 0 12px !important;
  border: 1px solid var(--search-border) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
#app-view .project-list-item {
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  border: 1px solid var(--dl-divider) !important;
  box-shadow: none !important;
}
#app-view .project-list-item:hover { background: var(--dl-hover) !important; }
#app-view .project-list-item.is-selected {
  border-color: color-mix(in srgb, var(--brand) 35%, #fff) !important;
  background: var(--brand-soft) !important;
  box-shadow: none !important;
}
#app-view .project-list-title strong { font-size: 13px !important; font-weight: 600 !important; }
#app-view :is(.project-list-meta, .project-list-owner b, .project-list-progress > strong) { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view .project-list-progress > strong { font-variant-numeric: tabular-nums; }
#app-view .project-list-progress > i > b,
#app-view .project-progress-track > i { background: var(--brand) !important; }

#app-view .project-detail-panel { padding: 16px !important; }
#app-view .project-detail-head { padding: 0 0 12px !important; border-bottom: 1px solid var(--dl-divider) !important; align-items: center !important; }
#app-view .project-detail-head .eyebrow { display: none !important; }
#app-view .project-detail-head h2 { margin: 0 !important; font-size: var(--page-title-size) !important; font-weight: 600 !important; letter-spacing: -.01em !important; }
#app-view .project-detail-head p { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view .project-detail-actions { gap: 6px !important; }
#app-view .project-more-button {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: var(--radius-pill) !important;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
}
#app-view :is(.project-health-pill, .project-state-pill) {
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px !important;
  border-radius: var(--radius-pill) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  background: var(--tone-neutral-bg) !important;
  color: var(--tone-neutral-fg) !important;
}
#app-view :is(.project-health-pill.is-healthy, .project-health-pill.is-complete, .project-state-pill.is-complete) { background: var(--tone-success-bg) !important; color: var(--tone-success-fg) !important; }
#app-view .project-health-pill.is-attention { background: var(--tone-warning-bg) !important; color: var(--tone-warning-fg) !important; }
#app-view .project-health-pill.is-risk { background: var(--tone-critical-bg) !important; color: var(--tone-critical-fg) !important; }
#app-view .project-state-pill:not(.is-complete) { background: var(--tone-info-bg) !important; color: var(--tone-info-fg) !important; }

#app-view .project-quick-summary,
#app-view .project-executive-line {
  border: 1px solid var(--dl-divider) !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
}
#app-view :is(.project-quick-summary, .project-executive-line) small { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view :is(.project-quick-summary, .project-executive-line) strong { font-size: 13px !important; font-weight: 600 !important; }

/* Abas e filtros do projeto no padrão do seletor segmentado */
#app-view :is(.project-detail-tabs, .project-task-filters) {
  height: var(--segment-height) !important;
  padding: 3px !important;
  gap: 2px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--segment-bg) !important;
  display: inline-flex !important;
  width: auto !important;
}
#app-view :is(.project-detail-tabs, .project-task-filters) button {
  height: var(--segment-item-height) !important;
  min-height: 0 !important;
  padding: 0 10px !important;
  border-radius: var(--radius-pill) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--segment-item) !important;
  background: transparent !important;
  box-shadow: none !important;
}
#app-view :is(.project-detail-tabs, .project-task-filters) button:hover:not(.is-active) { color: var(--segment-item-hover) !important; }
#app-view :is(.project-detail-tabs, .project-task-filters) button.is-active {
  background: var(--surface) !important;
  color: var(--foreground) !important;
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 0 0 .5px rgb(0 0 0 / 4%) !important;
}
#app-view :is(.project-detail-tabs, .project-task-filters) button span { color: var(--dl-muted); font-weight: 500; }

#app-view .project-task-table { overflow: hidden; }
#app-view .project-task-table-head {
  min-height: var(--dl-head-height) !important;
  padding: 0 var(--dl-pad-x) !important;
  background: var(--dl-head-bg) !important;
  border-bottom: 1px solid var(--dl-border) !important;
  color: var(--dl-head-color) !important;
}
#app-view .project-task-table-head span { font-size: 12px !important; font-weight: 600 !important; color: var(--dl-head-color) !important; text-transform: none !important; letter-spacing: 0 !important; }
#app-view .project-task-row {
  min-height: var(--dl-row-height) !important;
  padding: 8px var(--dl-pad-x) !important;
  border-bottom: 1px solid var(--dl-divider) !important;
  font-size: 13px !important;
  color: var(--dl-text);
}
#app-view .project-task-row:last-child { border-bottom: 0 !important; }
#app-view .project-task-row:hover { background: var(--dl-hover) !important; }
#app-view .project-task-row strong { font-size: 13px !important; font-weight: 600 !important; }
#app-view .project-task-row small { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view .project-secondary-details { border-color: var(--dl-divider) !important; border-radius: 10px !important; }
#app-view .project-secondary-details summary { font-size: 12px !important; font-weight: 600 !important; }

/* ---------- Agenda ---------- */
#app-view .agenda-connect-card,
#app-view #agenda-connect-card {
  border: 1px solid var(--dl-border) !important;
  border-radius: var(--dl-radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

/* =========================================================
   Fase 5 — Configurações, modais, popovers e painel da tarefa
   ========================================================= */

/* ---------- Configurações ---------- */
#app-view .settings-tab {
  min-height: 32px;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #52525b !important;
  box-shadow: none !important;
  border: 0 !important;
}
#app-view .settings-tab:hover { background: #ececef !important; color: var(--foreground) !important; }
#app-view .settings-tab.active { background: var(--surface) !important; color: var(--foreground) !important; font-weight: 600 !important; box-shadow: 0 0 0 1px var(--dl-border) !important; }
#app-view .settings-tab.active .icon-svg { color: var(--brand); }

#app-view .settings-panel {
  border: 1px solid var(--dl-border) !important;
  border-radius: var(--dl-radius) !important;
  box-shadow: 0 1px 2px rgba(24, 24, 27, .03) !important;
}
#app-view .settings-panel-head { padding: 12px var(--dl-pad-x) !important; align-items: center !important; }
#app-view .settings-panel-head h2 { margin: 0 !important; font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0 !important; }
#app-view .settings-panel-head p { display: none !important; }
/* Ação principal da seção: mesma regra do cabeçalho de página. */
#app-view .settings-panel-head .btn.primary {
  background: var(--head-primary-bg) !important;
  border-color: var(--head-primary-bg) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 1px 2px rgb(0 0 0 / 22%) !important;
}
#app-view .settings-panel-head .btn.primary:hover { background: var(--head-primary-hover) !important; border-color: var(--head-primary-hover) !important; }
#app-view :is(.section-head, .compact-head) h3 { font-size: 13px !important; font-weight: 600 !important; }
#app-view :is(.section-head, .compact-head) p { font-size: 12px !important; color: var(--dl-muted) !important; }

#app-view .settings-search {
  height: var(--toolbar-height) !important;
  padding: 0 12px !important;
  border: 1px solid var(--search-border) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}
#app-view .settings-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; font-size: 13px !important; }

#app-view .user-admin-row { min-height: var(--dl-row-height); border-color: var(--dl-divider) !important; }
#app-view .user-admin-row:hover { background: var(--dl-hover); }
#app-view .user-admin-avatar { width: 32px !important; height: 32px !important; border-radius: var(--radius-thumb) !important; }
#app-view .user-admin-row strong { font-size: 13px !important; font-weight: 600 !important; }
#app-view .user-admin-row :is(small, .user-admin-email) { font-size: 12px !important; color: var(--dl-muted) !important; }
#app-view .system-admin-badge {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  background: var(--tone-info-bg) !important;
  color: var(--tone-info-fg) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
#app-view .membership-chip {
  height: 24px;
  padding: 0 9px !important;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  background: #f3f3f5 !important;
  color: #52525b !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
#app-view .membership-chip-inherited { background: var(--surface) !important; color: var(--dl-muted) !important; }
#app-view .user-edit-btn { border-radius: var(--radius-row-action) !important; }

/* ---------- Modais e painel da tarefa ---------- */
:is(#app-view, body > section:not(#auth-view)) :is(.user-modal-card, .project-create-card, .agenda-event-modal-card, .google-event-modal-card, .global-search-card, .mini-modal, .drawer-inner) {
  border: 1px solid rgb(0 0 0 / 8%) !important;
  border-radius: var(--radius-panel) !important;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 4%), 0 24px 64px rgb(0 0 0 / 18%) !important;
}
:is(.modal-backdrop, .drawer-backdrop, .project-create-backdrop, .mini-modal-backdrop) {
  background: rgb(24 24 27 / 36%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

:is(#app-view, body > section:not(#auth-view)) :is(.user-modal-head, .mini-modal-head, .agenda-event-modal-head, .google-event-modal-head, .drawer-head) h2,
:is(#app-view, body > section:not(#auth-view)) .project-create-card h2,
:is(#app-view, body > section:not(#auth-view)) .mini-modal-head strong {
  margin: 0 !important;
  font-size: var(--page-title-size) !important;
  font-weight: 600 !important;
  letter-spacing: -.01em !important;
  line-height: 1.3 !important;
}
:is(#app-view, body > section:not(#auth-view)) :is(.user-modal-head, .mini-modal-head, .agenda-event-modal-head) p,
:is(#app-view, body > section:not(#auth-view)) .project-create-card > p,
:is(#app-view, body > section:not(#auth-view)) .mini-modal-head span {
  margin: 2px 0 0 !important;
  font-size: 12px !important;
  color: var(--dl-muted) !important;
}
:is(#app-view, body > section:not(#auth-view)) .project-create-card > p { margin-bottom: 14px !important; line-height: 1.45; }
:is(#app-view, body > section:not(#auth-view)) .project-create-icon { display: none !important; }
:is(#app-view, body > section:not(#auth-view)) .project-create-card .eyebrow { display: none !important; }
:is(#app-view, body > section:not(#auth-view)) .project-create-card label { font-size: 12px !important; font-weight: 500 !important; color: #52525b; }
:is(#app-view, body > section:not(#auth-view)) .project-create-card input { height: 42px !important; border-radius: var(--control-radius) !important; font-size: 13px !important; }

/* Rodapé de modal: ação à direita, separada da área rolável. */
:is(#app-view, body > section:not(#auth-view)) :is(.user-modal-footer, .mini-modal-footer, .drawer-footer, .google-event-modal-footer, .project-create-actions) {
  gap: 8px !important;
  border-top-color: var(--line) !important;
}

/* Campos de formulário em modais: 42px, raio 11px */
:is(#app-view, body > section:not(#auth-view)) :is(.user-modal-body, .mini-modal-body, .drawer-body) label {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #52525b !important;
}

/* Painel da tarefa */
#task-drawer .drawer-head .eyebrow,
#task-drawer .drawer-head .soft-label { font-size: 12px !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--dl-muted) !important; }
#task-drawer .comments-pane-head span { display: none !important; }
#task-drawer .comments-pane-head strong { font-size: 13px !important; font-weight: 600 !important; }
#task-drawer .comment-send-btn {
  min-height: var(--button-height) !important;
  height: var(--button-height) !important;
  padding: 0 11px !important;
  border-radius: var(--radius-pill) !important;
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
#task-drawer .comment-send-btn:hover { background: var(--brand-dark) !important; }
#task-drawer .priority-control {
  padding: 3px !important;
  gap: 2px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--segment-bg) !important;
}
#task-drawer .priority-control button.active { background: var(--surface) !important; box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 0 0 .5px rgb(0 0 0 / 4%) !important; }
#task-drawer .priority-control button {
  min-height: var(--segment-item-height) !important;
  box-shadow: none !important;
  border-radius: var(--radius-pill) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
#task-drawer :is(.task-form-section, .task-planning-card, .planning-field) { border-color: var(--dl-divider) !important; }

/* ---------- Popovers e menus ---------- */
:is(.notification-popover, .header-quick-popover, .quick-label-popover, .quick-sector-popover, .sector-action-menu, .priority-quick-popover, .status-quick-popover, .planning-date-popover, .system-time-popover, .custom-select-menu, .custom-select-dropdown) {
  border: 1px solid rgb(0 0 0 / 8%) !important;
  border-radius: var(--dl-radius) !important;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 3%), 0 12px 32px rgb(0 0 0 / 14%) !important;
}
.custom-select-option { font-size: 13px !important; border-radius: 8px !important; }
.custom-select-option[aria-selected="true"] { background: var(--brand-soft) !important; color: var(--foreground) !important; }

/* =========================================================
   Barra de salvar flutuante (js/save-island.js)
   Edição de algo que já existe: sem Cancelar/Salvar no rodapé.
   ========================================================= */
.save-island {
  position: fixed;
  top: 10px;
  left: 0;
  right: 0;
  z-index: 1450;
  width: max-content;
  max-width: calc(100vw - 24px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #fff;
  font-family: var(--font-sans);
  box-shadow: 0 12px 32px rgb(0 0 0 / 28%), 0 0 0 1px rgb(255 255 255 / 6%) inset;
  animation: save-island-in 240ms cubic-bezier(.34, 1.56, .64, 1) both;
}
.save-island[hidden] { display: none; }
.save-island-text { margin-right: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.save-island button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font: 600 12px/1 var(--font-sans);
  cursor: pointer;
}
.save-island-discard { background: #3a3a3c; color: #fff; }
.save-island-discard:hover { background: #4a4a4d; }
.save-island-save { background: #fff; color: #1a1a1a; }
.save-island-save:hover { background: #ececef; }
.save-island button:disabled { opacity: .6; cursor: default; }
.save-island button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.save-island.is-leaving { animation: save-island-out 170ms ease-in both; }
.save-island.is-nudged {
  box-shadow: 0 12px 32px rgb(0 0 0 / 28%), 0 0 0 3px var(--brand);
  animation: save-island-shake 360ms ease-in-out;
}
@keyframes save-island-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes save-island-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes save-island-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
@media (max-width: 520px) {
  .save-island { width: auto; max-width: none; margin-inline: 12px; padding-left: 14px; }
  .save-island-text { flex: 1; margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .save-island, .save-island.is-leaving, .save-island.is-nudged { animation: none; }
}

:is(#task-form, #user-form, #profile-form, #project-settings-form, #agenda-event-form).has-save-island
  :is(#cancel-task-btn, #save-task-btn, #cancel-user-btn, #save-user-btn, #cancel-profile-btn, #save-profile-btn, #project-settings-cancel, #project-settings-submit, #cancel-agenda-event-btn, #save-agenda-event-btn) {
  display: none !important;
}
:is(#user-form, #profile-form).has-save-island .user-modal-footer,
#project-settings-form.has-save-island .project-create-actions,
#agenda-event-form.has-save-island .agenda-event-modal-footer:has(#delete-agenda-event-btn[hidden]),
#task-form.has-save-island .drawer-footer:not(:has(> .btn:not([hidden]):not(#cancel-task-btn):not(#save-task-btn))) {
  display: none !important;
}

/* ---------- v1.56.0: custom select com grupos e menu flutuante ---------- */
.custom-select[hidden] { display: none !important; }
.custom-select-group-label {
  padding: 8px 11px 4px; font-size: 11px; font-weight: 600; letter-spacing: .01em; color: var(--muted-foreground, #6b6b73);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.custom-select-group + .custom-select-group,
.custom-select-option + .custom-select-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--dl-divider, #ebebee); }
.custom-select-option.is-grouped { padding-left: 20px; }
.custom-select-menu.is-floating { display: block; z-index: 2000; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; }

/* =========================================================
   Efeito vidro (v1.59.0): botões e itens selecionados
   Gradiente suave, luz fina no topo, sombra curta embaixo.
   Claro: segmentados, abas, botões secundários.
   Escuro: item ativo da sidebar. Marca: primários roxos.
   ========================================================= */

:root {
  /* Claro (sobre fundo claro) */
  --glass-light-bg: linear-gradient(180deg, #ffffff 0%, #f6f6f8 100%);
  --glass-light-bg-hover: linear-gradient(180deg, #fbfbfc 0%, #efeff2 100%);
  --glass-light-shadow:
    inset 0 1px 0 rgb(255 255 255 / 95%),
    inset 0 -1px 0 rgb(0 0 0 / 6%),
    0 0 0 .5px rgb(0 0 0 / 10%),
    0 1px 2px rgb(0 0 0 / 10%);
  /* Escuro (sidebar) */
  --glass-dark-bg: linear-gradient(180deg, rgb(255 255 255 / 13%) 0%, rgb(255 255 255 / 6%) 100%);
  --glass-dark-shadow:
    inset 0 1px 0 rgb(255 255 255 / 14%),
    inset 0 0 0 1px rgb(255 255 255 / 5%),
    0 1px 2px rgb(0 0 0 / 45%),
    0 2px 6px rgb(0 0 0 / 22%);
  /* Marca */
  --glass-brand-bg: linear-gradient(180deg, #7372ff 0%, #5958f4 55%, #4f4eea 100%);
  --glass-brand-bg-hover: linear-gradient(180deg, #6968fb 0%, #504fea 55%, #4746de 100%);
  --glass-brand-shadow:
    inset 0 1px 0 rgb(255 255 255 / 30%),
    inset 0 -1px 0 rgb(0 0 0 / 16%),
    0 1px 2px rgb(40 39 160 / 35%),
    0 2px 6px rgb(93 92 252 / 22%);
  /* Escuro do cabeçalho */
  --glass-ink-bg: linear-gradient(180deg, #48484b 0%, #303031 55%, #262627 100%);
  --glass-ink-bg-hover: linear-gradient(180deg, #3d3d40 0%, #262627 55%, #1d1d1e 100%);
  --glass-ink-shadow:
    inset 0 1px 0 rgb(255 255 255 / 20%),
    inset 0 -1px 0 rgb(0 0 0 / 30%),
    0 1px 2px rgb(0 0 0 / 28%);
  --glass-pressed-shadow: inset 0 1px 2px rgb(0 0 0 / 18%);
}

/* ---------- Botões secundários ---------- */
:is(#app-view, body > section:not(#auth-view)) .btn:not(.primary):not(.dark):not(.ghost):not(.danger-outline),
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.ghost,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.ghost {
  background: var(--glass-light-bg);
  border-color: transparent;
  box-shadow: var(--glass-light-shadow);
}
:is(#app-view, body > section:not(#auth-view)) .btn:not(.primary):not(.dark):not(.ghost):not(.danger-outline):hover,
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.ghost:hover,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.ghost:hover {
  background: var(--glass-light-bg-hover);
}
:is(#app-view, body > section:not(#auth-view)) .page-head .icon-btn {
  background: var(--glass-light-bg);
  border-color: transparent;
  box-shadow: var(--glass-light-shadow);
}
:is(#app-view, body > section:not(#auth-view)) .page-head .icon-btn:hover { background: var(--glass-light-bg-hover); }

/* ---------- Primários roxos ---------- */
:is(#app-view, body > section:not(#auth-view)) .btn.primary,
#app-view .sidebar .new-task-btn,
#new-task-btn {
  background: var(--glass-brand-bg) !important;
  border-color: transparent !important;
  box-shadow: var(--glass-brand-shadow) !important;
  text-shadow: 0 -.5px 0 rgb(0 0 0 / 15%);
}
:is(#app-view, body > section:not(#auth-view)) .btn.primary:hover,
#app-view .sidebar .new-task-btn:hover,
#new-task-btn:hover {
  background: var(--glass-brand-bg-hover) !important;
  border-color: transparent !important;
}

/* ---------- Primários escuros do cabeçalho ---------- */
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.primary,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.primary,
:is(#app-view, body > section:not(#auth-view)) .project-detail-actions .btn.primary,
:is(#app-view, body > section:not(#auth-view)) .btn.dark,
#app-view .settings-panel-head .btn.primary {
  background: var(--glass-ink-bg) !important;
  border-color: transparent !important;
  box-shadow: var(--glass-ink-shadow) !important;
  text-shadow: none;
}
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.primary:hover,
:is(#app-view, body > section:not(#auth-view)) .projects-page-head .btn.primary:hover,
:is(#app-view, body > section:not(#auth-view)) .project-detail-actions .btn.primary:hover,
:is(#app-view, body > section:not(#auth-view)) .btn.dark:hover,
#app-view .settings-panel-head .btn.primary:hover {
  background: var(--glass-ink-bg-hover) !important;
  border-color: transparent !important;
}

/* Clique: afunda e perde o brilho do topo. */
:is(#app-view, body > section:not(#auth-view)) .btn:not(.ghost):not(.danger-outline):active,
#app-view .sidebar .new-task-btn:active,
:is(#app-view, body > section:not(#auth-view)) .page-head .btn.ghost:active {
  box-shadow: var(--glass-pressed-shadow) !important;
}

/* ---------- Abas e segmentados selecionados ---------- */
:is(#app-view, body > section:not(#auth-view)) .segmented button.active,
#app-view :is(.project-detail-tabs, .project-task-filters) button.is-active,
#task-drawer .priority-control button.active {
  background: var(--glass-light-bg) !important;
  box-shadow: var(--glass-light-shadow) !important;
}
#app-view .settings-tab.active {
  background: var(--glass-light-bg) !important;
  box-shadow: var(--glass-light-shadow) !important;
}

/* ---------- Sidebar: item ativo ---------- */
#app-view .sidebar .nav-item.active,
#app-view .sidebar .sector-nav-item.active,
#app-view .sidebar .sector-nav-parent-row:has(.sector-nav-item.active),
#app-view .sidebar .sector-nav-child-row:has(.sector-nav-item.active) {
  background: var(--glass-dark-bg) !important;
  box-shadow: var(--glass-dark-shadow) !important;
}
#app-view .sidebar .sector-nav-parent-row:has(.sector-nav-item.active),
#app-view .sidebar .sector-nav-child-row:has(.sector-nav-item.active) { border-radius: 9px !important; }
#app-view .sidebar .sector-nav-parent-row:has(.sector-nav-item.active) .sector-nav-item,
#app-view .sidebar .sector-nav-child-row:has(.sector-nav-item.active) .sector-nav-item {
  background: transparent !important;
  box-shadow: none !important;
}

/* =========================================================
   v1.60.1 — Minhas tarefas: cards vitrine (direção A, achatada)
   Cartão claro com acabamento de vidro, aura da cor do status
   atrás do mascote e o mascote passando pela borda de cima.
   --mascot-accent = cor do status.
   ========================================================= */
#app-view .task-mascot-card.is-today    { --mascot-accent: #5d5cfc; }
#app-view .task-mascot-card.is-overdue  { --mascot-accent: #e5484d; }
#app-view .task-mascot-card.is-progress { --mascot-accent: #e08a1e; }
#app-view .task-mascot-card.is-done     { --mascot-accent: #2f9e5e; }

#app-view .task-mascot-grid { gap: 12px; padding-top: 18px; }
#app-view .task-mascot-card {
  min-height: 96px;
  overflow: visible;
  padding: 13px 16px 14px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background:
    radial-gradient(150px 120px at calc(100% - 70px) 100%, color-mix(in srgb, var(--mascot-accent) 20%, transparent) 0%, color-mix(in srgb, var(--mascot-accent) 7%, transparent) 50%, transparent 75%),
    linear-gradient(180deg, #fff 0%, #fafafb 100%) !important;
  box-shadow:
    0 0 0 1px rgb(24 24 27 / 7%),
    0 1px 2px rgb(24 24 27 / 4%),
    0 8px 24px -10px rgb(24 24 27 / 10%),
    inset 0 1px 0 #fff !important;
}
/* sombra no chão sob o mascote */
#app-view .task-mascot-card::before {
  inset: auto 34px 8px auto;
  width: 96px;
  height: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--mascot-accent) 20%, transparent);
  opacity: 1;
  filter: blur(6px);
}
#app-view .task-mascot-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgb(24 24 27 / 9%),
    0 1px 2px rgb(24 24 27 / 5%),
    0 12px 28px -10px rgb(24 24 27 / 14%),
    inset 0 1px 0 #fff !important;
}
#app-view .task-mascot-card.is-selected {
  box-shadow:
    0 0 0 1.5px var(--mascot-accent),
    0 8px 24px -8px color-mix(in srgb, var(--mascot-accent) 35%, transparent),
    inset 0 1px 0 #fff !important;
}
#app-view .task-mascot-card:focus-visible { outline: 2px solid var(--mascot-accent); outline-offset: 2px; }

#app-view .task-mascot-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  align-items: end;
  column-gap: 8px;
  height: 100%;
  min-height: 69px;
}
#app-view .task-mascot-copy small {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 12px !important;
  color: #3a3a40 !important;
  background: linear-gradient(180deg, #fff, #f4f4f6);
  box-shadow: 0 0 0 1px rgb(24 24 27 / 8%), 0 1px 2px rgb(24 24 27 / 6%), inset 0 1px 0 #fff;
}
#app-view .task-mascot-copy small::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mascot-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mascot-accent) 18%, transparent);
}
#app-view .task-mascot-copy strong {
  font-family: var(--font-sans);
  font-size: 32px;
  letter-spacing: -.04em;
  color: #18181b;
}
#app-view .task-mascot-sub {
  padding-bottom: 4px;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 500;
  color: #8a8a92;
  white-space: nowrap;
}
#app-view .task-mascot-card img {
  right: 14px;
  bottom: 6px;
  width: auto;
  height: 116px;
  opacity: 1;
  object-position: center bottom;
  filter: drop-shadow(0 6px 8px rgb(24 24 27 / 12%));
}
@media (max-width: 1250px) {
  #app-view .task-mascot-sub { display: none; }
  #app-view .task-mascot-card img { right: 8px; height: 104px; }
}
@media (max-width: 1050px) {
  #app-view .task-mascot-grid { row-gap: 30px; }
  #app-view .task-mascot-sub { display: block; }
}
@media (max-width: 700px) {
  #app-view .task-mascot-grid { row-gap: 20px; padding-top: 14px; }
  #app-view .task-mascot-card { min-height: 88px; padding: 11px 12px 12px !important; }
  #app-view .task-mascot-copy { min-height: 65px; }
  #app-view .task-mascot-copy small { font-size: 11px !important; padding: 2px 8px 2px 7px; }
  #app-view .task-mascot-copy strong { font-size: 28px; }
  #app-view .task-mascot-sub { display: none; }
  #app-view .task-mascot-card img { right: 0; bottom: 6px; height: 86px; }
  #app-view .task-mascot-card::before { right: 18px; width: 70px; }
}

/* =========================================================
   Gestão de projetos simplificada (v1.61.0)
   Lista de cards com anel de progresso, detalhe com etapas
   agrupadas por situação, adicionar etapa na própria tela.
   ========================================================= */
:root {
  --pj-risk: #d64545;
  --pj-attention: #d9921a;
  --pj-planning: #a1a1aa;
  --pj-healthy: #22a06b;
  --pj-complete: #5d5cfc;
  --pj-progress: #5d5cfc;
  --pj-todo: #d4d4d8;
}
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#app-view .pj-view svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Barra de filtros */
#app-view .pj-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
#app-view .pj-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
#app-view .pj-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface);
  color: #52525b; font: 600 12px var(--font-sans); cursor: pointer; white-space: nowrap;
}
#app-view .pj-chip b { font-weight: 600; color: var(--dl-muted); font-variant-numeric: tabular-nums; }
#app-view .pj-chip:hover { background: var(--secondary-hover); }
#app-view .pj-chip.is-zero:not(.is-active) { color: #a1a1aa; }
#app-view .pj-chip.is-risk:not(.is-zero) b { color: var(--pj-risk); }
#app-view .pj-chip.is-attention:not(.is-zero) b { color: #b7791f; }
#app-view .pj-chip.is-complete:not(.is-zero) b { color: var(--pj-healthy); }
#app-view .pj-chip.is-active { border-color: transparent; background: var(--glass-ink-bg); box-shadow: var(--glass-ink-shadow); color: #fff; }
#app-view .pj-chip.is-active b { color: rgb(255 255 255 / 72%) !important; }
#app-view .pj-search { width: 260px; max-width: 100%; margin: 0 !important; }

/* Estrutura */
#app-view .pj-workspace { display: grid !important; grid-template-columns: 300px minmax(0, 1fr) !important; gap: 14px !important; align-items: start; }
#app-view #projects-view .pj-catalog-panel {
  position: sticky !important; top: 12px !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; background: transparent !important; box-shadow: none !important; max-height: none !important;
}
#app-view .pj-catalog { display: grid !important; gap: 8px; max-height: calc(100vh - 190px); overflow: auto; padding: 1px 4px 4px 1px; }

/* Card de projeto */
#app-view .pj-card {
  --pj-tone: var(--pj-planning);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; padding: 12px 12px 12px 15px; border: 1px solid var(--dl-border); border-radius: 12px;
  background: var(--surface); text-align: left; cursor: pointer; overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
#app-view .pj-card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pj-tone); }
#app-view .pj-card:hover { border-color: #d4d4d8; box-shadow: 0 2px 8px rgb(24 24 27 / 6%); }
#app-view .pj-card.is-selected { border-color: rgba(var(--brand-rgb), .45); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .10), var(--glass-light-shadow); background: var(--glass-light-bg); }
#app-view .pj-card.is-risk { --pj-tone: var(--pj-risk); }
#app-view .pj-card.is-attention { --pj-tone: var(--pj-attention); }
#app-view .pj-card.is-healthy { --pj-tone: var(--pj-healthy); }
#app-view .pj-card.is-complete { --pj-tone: var(--pj-complete); }
#app-view .pj-card-main { display: grid; gap: 5px; min-width: 0; }
#app-view .pj-card-main > strong { font-size: 13.5px; font-weight: 600; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app-view .pj-card-meta { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--dl-muted); white-space: nowrap; overflow: hidden; }
#app-view .pj-card-meta b { font-weight: 400; color: #c4c4c8; }
#app-view .pj-card-meta .is-late { color: var(--pj-risk); font-weight: 600; }
#app-view .pj-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pj-tone); flex: none; }
#app-view .pj-card-owner { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #52525b; min-width: 0; }
#app-view .pj-card-owner > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Anel de progresso */
#app-view .pj-ring { position: relative; width: 42px; height: 42px; display: grid; place-items: center; flex: none; }
#app-view .pj-ring svg { position: absolute; inset: 0; width: 42px; height: 42px; transform: rotate(-90deg); stroke-width: 3.2; }
#app-view .pj-ring circle { fill: none; stroke: #ececef; }
#app-view .pj-ring .pj-ring-value { stroke: var(--pj-progress); stroke-linecap: round; }
#app-view .pj-ring.is-complete .pj-ring-value, #app-view .pj-ring.is-healthy .pj-ring-value { stroke: var(--pj-healthy); }
#app-view .pj-ring.is-risk .pj-ring-value { stroke: var(--pj-risk); }
#app-view .pj-ring.is-attention .pj-ring-value { stroke: var(--pj-attention); }
#app-view .pj-ring b { position: relative; font-size: 11px; font-weight: 700; color: #3f3f46; font-variant-numeric: tabular-nums; }

/* Avatares */
#app-view .pj-av {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  background: #ebebff; color: #4b4ae6; font-size: 9px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--surface);
}
#app-view .pj-av img { width: 100%; height: 100%; object-fit: cover; }
#app-view .pj-av.is-empty { background: #f1f1f3; color: #a1a1aa; }
#app-view .pj-av.is-more { background: #f1f1f3; color: #52525b; }
#app-view .pj-av.is-lg { width: 32px; height: 32px; font-size: 11px; }
#app-view .pj-people { display: inline-flex; align-items: center; }
#app-view .pj-people .pj-av + .pj-av { margin-left: -6px; }
#app-view .pj-people.is-empty { font-size: 12px; color: #a1a1aa; white-space: nowrap; }

/* Detalhe */
#app-view .pj-detail { padding: 18px 20px 20px !important; min-height: 420px; }
#app-view .pj-back { display: none; }
#app-view .pj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
#app-view .pj-title { display: grid; gap: 7px; min-width: 0; }
#app-view .pj-title h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.02em; color: var(--foreground); }
#app-view .pj-health {
  --pj-tone: var(--pj-planning);
  display: inline-flex; align-items: center; gap: 7px; width: max-content; max-width: 100%;
  padding: 4px 10px 4px 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--pj-tone) 11%, white);
  color: color-mix(in srgb, var(--pj-tone) 80%, black); font-size: 12px; font-weight: 650;
}
#app-view .pj-health i { width: 7px; height: 7px; border-radius: 50%; background: var(--pj-tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pj-tone) 20%, transparent); }
#app-view .pj-health b { font-weight: 500; opacity: .85; }
#app-view .pj-health b::before { content: "·"; margin-right: 6px; }
#app-view .pj-health.is-risk { --pj-tone: var(--pj-risk); }
#app-view .pj-health.is-attention { --pj-tone: var(--pj-attention); }
#app-view .pj-health.is-healthy { --pj-tone: var(--pj-healthy); }
#app-view .pj-health.is-complete { --pj-tone: var(--pj-complete); }
#app-view .pj-actions { display: flex; align-items: center; gap: 6px; flex: none; }
#app-view .pj-icon-btn { display: inline-flex !important; align-items: center; gap: 6px; }
#app-view .pj-actions .project-actions-overflow { position: relative; }

#app-view .pj-meta {
  display: grid; grid-template-columns: auto auto auto minmax(220px, 1fr); align-items: center; gap: 8px 26px;
  margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--dl-divider); border-radius: 12px; background: #fafafb;
}
#app-view .pj-meta-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
#app-view .pj-meta-item > span { display: grid; gap: 2px; }
#app-view .pj-meta small, #app-view .pj-progress-head small { font-size: 11.5px; color: var(--dl-muted); }
#app-view .pj-meta strong { font-size: 13.5px; font-weight: 600; color: var(--foreground); white-space: nowrap; }
#app-view .pj-meta em { font-style: normal; font-size: 11.5px; color: var(--dl-muted); }
#app-view .pj-meta em.is-late { color: var(--pj-risk); font-weight: 600; }
#app-view .pj-meta em.is-warn { color: #b7791f; font-weight: 600; }
#app-view .pj-meta em.is-ok { color: var(--pj-healthy); }
#app-view .pj-meta-progress { display: grid; gap: 6px; min-width: 0; }
#app-view .pj-progress-head { display: flex; align-items: baseline; gap: 8px; }
#app-view .pj-progress-head strong { font-size: 15px; }
#app-view .pj-progress-head span { margin-left: auto; font-size: 11.5px; color: var(--dl-muted); }
#app-view .pj-seg { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: #ececef; }
#app-view .pj-seg i { display: block; height: 100%; border-radius: 99px; }
#app-view .pj-seg i[style*="width:0.00%"] { display: none; }
#app-view .pj-seg .is-done { background: var(--pj-healthy); }
#app-view .pj-seg .is-progress { background: var(--pj-progress); }
#app-view .pj-seg .is-todo { background: var(--pj-todo); }
#app-view .pj-seg-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--dl-muted); }
#app-view .pj-seg-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--pj-todo); }
#app-view .pj-seg-legend .is-done::before { background: var(--pj-healthy); }
#app-view .pj-seg-legend .is-progress::before { background: var(--pj-progress); }

#app-view .pj-banner {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  margin: 12px 0 0; padding: 10px 14px 10px 10px; border-radius: 12px;
  background: linear-gradient(90deg, #eefaf3, #f6fbf8); border: 1px solid #cdeedb;
}
#app-view .pj-banner img { width: 54px; height: 54px; object-fit: contain; }
#app-view .pj-banner div { display: grid; gap: 2px; }
#app-view .pj-banner strong { font-size: 13.5px; color: #17704a; }
#app-view .pj-banner span { font-size: 12px; color: #4b6b5a; }

#app-view .pj-tabs {
  display: inline-flex; gap: 2px; height: var(--segment-height); padding: 3px; margin: 16px 0 0;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--segment-bg);
}
#app-view .pj-tabs button {
  height: var(--segment-item-height); padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--segment-item); font: 600 12.5px var(--font-sans); cursor: pointer;
}
#app-view .pj-tabs button:hover:not(.is-active) { color: var(--segment-item-hover); }
#app-view .pj-tabs button.is-active { background: var(--glass-light-bg); box-shadow: var(--glass-light-shadow); color: var(--foreground); }
#app-view .pj-tabs button span { margin-left: 3px; color: var(--dl-muted); font-weight: 500; }
#app-view .pj-tab-body { padding-top: 14px; }
#app-view .pj-muted { font-size: 12.5px; color: var(--dl-muted); margin: 6px 0; }

/* Etapas */
#app-view .pj-steps-bar { display: grid; gap: 10px; margin-bottom: 12px; }
#app-view .pj-quick-add {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 200px 140px auto; align-items: center; gap: 8px;
  padding: 6px 6px 6px 12px; border: 1px dashed #c9c9f7; border-radius: 12px; background: #fafaff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
#app-view .pj-quick-add:focus-within { border-style: solid; border-color: rgba(var(--brand-rgb), .55); background: var(--surface); box-shadow: var(--focus-ring); }
#app-view .pj-quick-icon { display: grid; place-items: center; color: var(--brand); }
#app-view .pj-quick-add input#project-quick-title { height: 32px; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 13.5px; outline: none; padding: 0; min-width: 0; }
#app-view .pj-quick-add .custom-select-trigger { height: 32px !important; min-height: 32px !important; font-size: 12.5px !important; }
#app-view .pj-quick-due input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font: 12.5px var(--font-sans); color: #52525b; }
#app-view .pj-steps-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#app-view .pj-steps-person { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dl-muted); }
#app-view .pj-steps-person .custom-select { min-width: 180px; }
#app-view .pj-steps-person .custom-select-trigger { height: 30px !important; min-height: 30px !important; }
#app-view .pj-link-btn { display: inline-flex !important; align-items: center; gap: 6px; }

#app-view .pj-steps { display: grid; gap: 14px; }
#app-view .pj-group { border: 1px solid var(--dl-border); border-radius: 12px; overflow: hidden; background: var(--surface); }
#app-view .pj-group-head {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 12px; border: 0;
  border-bottom: 1px solid var(--dl-divider); background: var(--dl-head-bg); font: 600 12px var(--font-sans); color: var(--dl-head-color); text-align: left;
}
#app-view .pj-group-head b { min-width: 20px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: #e9e9ec; font-size: 11px; color: #52525b; }
#app-view .pj-group-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pj-todo); }
#app-view .pj-group.is-late .pj-group-head { color: #a33434; background: #fdf3f3; }
#app-view .pj-group.is-late .pj-group-head::before { background: var(--pj-risk); }
#app-view .pj-group.is-late .pj-group-head b { background: #fbdede; color: #a33434; }
#app-view .pj-group.is-progress .pj-group-head::before { background: var(--pj-progress); }
#app-view .pj-group.is-done .pj-group-head::before { background: var(--pj-healthy); }
#app-view button.pj-group-head { cursor: pointer; }
#app-view button.pj-group-head svg { margin-left: auto; transition: transform .15s; }
#app-view .pj-group.is-collapsed .pj-group-head { border-bottom: 0; }
#app-view .pj-group.is-collapsed .pj-group-head svg { transform: rotate(-90deg); }

#app-view .pj-row {
  display: grid; grid-template-columns: 12px 22px minmax(0, 1fr) 120px 76px 108px 22px; align-items: center; gap: 10px;
  min-height: 50px; padding: 6px 10px 6px 6px; border-bottom: 1px solid var(--dl-divider); cursor: pointer; background: var(--surface);
}
#app-view .pj-row:last-child { border-bottom: 0; }
#app-view .pj-row:hover { background: var(--dl-hover); }
#app-view .pj-row:focus-visible { outline: var(--focus-outline); outline-offset: -2px; }
#app-view .pj-row.is-dragging { opacity: .45; }
#app-view .pj-row.is-drop-target { box-shadow: inset 0 2px 0 var(--brand); }
#app-view .pj-grip { color: #c4c4c8; font-size: 12px; cursor: grab; opacity: 0; transition: opacity .15s; }
#app-view .pj-row:hover .pj-grip { opacity: 1; }
#app-view .pj-check {
  width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 1.6px solid #c4c4c8; border-radius: 50%;
  background: var(--surface); color: transparent; cursor: pointer; transition: color .15s, background-color .15s, border-color .15s, opacity .15s;
}
#app-view .pj-check svg { width: 12px; height: 12px; stroke-width: 2.2; }
#app-view .pj-check:not(:disabled):hover { border-color: var(--pj-healthy); color: var(--pj-healthy); background: #eefaf3; }
#app-view .pj-check:disabled { cursor: default; opacity: .55; }
#app-view .pj-row.is-done .pj-check { border-color: var(--pj-healthy); background: var(--pj-healthy); color: #fff; opacity: 1; }
#app-view .pj-row-title { display: grid; gap: 2px; min-width: 0; }
#app-view .pj-row-title strong { font-size: 13.5px; font-weight: 550; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app-view .pj-row.is-done .pj-row-title strong { color: #8a8a92; text-decoration: line-through; text-decoration-color: #c4c4c8; }
#app-view .pj-row-title small { font-size: 11.5px; color: var(--dl-muted); display: inline-flex; align-items: center; gap: 4px; }
#app-view .pj-row-title .pj-lock svg { width: 11px; height: 11px; }
#app-view .pj-sector {
  justify-self: start; max-width: 100%; padding: 2px 8px; border-radius: 6px; background: #f3f3f5; color: #52525b;
  font-size: 11.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#app-view .pj-due { display: grid; gap: 1px; font-size: 12px; text-align: right; }
#app-view .pj-due strong { font-weight: 550; color: #3f3f46; }
#app-view .pj-due em { font-style: normal; font-size: 11px; color: var(--dl-muted); }
#app-view .pj-due.is-late strong, #app-view .pj-due.is-late em { color: var(--pj-risk); }
#app-view .pj-due.is-empty { color: #a1a1aa; }
#app-view .pj-unlink { width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: #a1a1aa; font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; }
#app-view .pj-row:hover .pj-unlink { opacity: 1; }
#app-view .pj-unlink:hover { background: #fdeaea; color: var(--pj-risk); }
#app-view .pj-row.is-locked .pj-row-title strong { color: #52525b; }

#app-view .pj-empty, #app-view .pj-empty-steps { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; }
#app-view .pj-empty img, #app-view .pj-empty-steps img { height: 84px; margin-bottom: 4px; }
#app-view .pj-empty strong, #app-view .pj-empty-steps strong { font-size: 14px; color: var(--foreground); }
#app-view .pj-empty p, #app-view .pj-empty-steps p { max-width: 320px; margin: 0 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--dl-muted); }
#app-view .pj-empty-steps { border: 1px dashed var(--dl-border); border-radius: 12px; }

/* Cronograma */
#app-view .pj-gantt { border: 1px solid var(--dl-border); border-radius: 12px; overflow: hidden; }
#app-view .pj-gantt-head, #app-view .pj-gantt-row, #app-view .pj-gantt-overlay { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
#app-view .pj-gantt-head { height: 34px; background: var(--dl-head-bg); border-bottom: 1px solid var(--dl-divider); }
#app-view .pj-gantt-label { display: grid; align-content: center; gap: 1px; padding: 0 12px; border-right: 1px solid var(--dl-divider); min-width: 0; background: var(--surface); position: relative; z-index: 2; }
#app-view .pj-gantt-label.is-head { background: var(--dl-head-bg); font-size: 12px; font-weight: 600; color: var(--dl-head-color); }
#app-view .pj-gantt-label strong { font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app-view .pj-gantt-label span { font-size: 11px; color: var(--dl-muted); }
#app-view .pj-gantt-track { position: relative; min-width: 0; }
#app-view .pj-gantt-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #e4e4e7; }
#app-view .pj-gantt-tick b { position: absolute; top: 9px; left: 5px; font-size: 11px; font-weight: 500; color: var(--dl-muted); white-space: nowrap; }
#app-view .pj-gantt-body { position: relative; }
#app-view .pj-gantt-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
#app-view .pj-gantt-row { height: 44px; border-bottom: 1px solid var(--dl-divider); }
#app-view .pj-gantt-row:last-child { border-bottom: 0; }
#app-view .pj-gantt-row .pj-gantt-track { background-image: linear-gradient(90deg, transparent calc(100% - 1px), transparent 0); }
#app-view .pj-gantt-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--brand); }
#app-view .pj-gantt-line span { position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 600; font-style: normal; }
#app-view .pj-gantt-line.is-due { border-left: 2px dashed #3f3f46; }
#app-view .pj-gantt-line.is-due span { background: #3f3f46; top: auto; bottom: 4px; }
#app-view .pj-gantt-bar, #app-view .pj-gantt-point { position: absolute; top: 50%; padding: 0; border: 0; cursor: pointer; z-index: 2; }
#app-view .pj-gantt-bar { height: 14px; margin-top: -7px; border-radius: 99px; background: var(--pj-todo); }
#app-view .pj-gantt-point { width: 12px; height: 12px; margin: -6px 0 0 -6px; transform: rotate(45deg); border-radius: 3px; background: #a1a1aa; }
#app-view :is(.pj-gantt-bar, .pj-gantt-point).is-done { background: #9fdcbf; }
#app-view :is(.pj-gantt-bar, .pj-gantt-point).is-progress { background: var(--pj-progress); }
#app-view :is(.pj-gantt-bar, .pj-gantt-point).is-late { background: var(--pj-risk); }
#app-view :is(.pj-gantt-bar, .pj-gantt-point):hover { filter: brightness(.93); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }
#app-view .pj-gantt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--dl-muted); }
#app-view .pj-gantt-legend span::before { content: ""; display: inline-block; width: 10px; height: 8px; margin-right: 5px; border-radius: 99px; background: var(--pj-todo); }
#app-view .pj-gantt-legend .is-done::before { background: #9fdcbf; }
#app-view .pj-gantt-legend .is-progress::before { background: var(--pj-progress); }
#app-view .pj-gantt-legend .is-late::before { background: var(--pj-risk); }
#app-view .pj-gantt-legend em { margin-left: auto; font-style: normal; }

/* Atividades */
#app-view .pj-composer { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px; border: 1px solid var(--dl-border); border-radius: 12px; background: var(--surface); }
#app-view .pj-composer .pj-av { width: 32px; height: 32px; font-size: 11px; }
#app-view .pj-composer-input { position: relative; }
#app-view .pj-composer textarea { width: 100%; min-height: 32px; height: 32px; padding: 7px 2px; border: 0 !important; box-shadow: none !important; resize: none; font: 13.5px/1.4 var(--font-sans); outline: none; background: transparent; transition: height .15s; }
#app-view .pj-composer:focus-within textarea, #app-view .pj-composer textarea:not(:placeholder-shown) { height: 84px; }
#app-view .pj-composer:focus-within { border-color: rgba(var(--brand-rgb), .45); box-shadow: var(--focus-ring); }
#app-view .pj-feed { display: grid; margin-top: 14px; }
#app-view .pj-feed-item.is-update { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; margin: 4px 0 10px; padding: 12px; border: 1px solid var(--dl-border); border-radius: 12px; background: var(--surface); }
#app-view .pj-feed-item.is-update .pj-av { width: 32px; height: 32px; font-size: 11px; }
#app-view .pj-feed-item header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
#app-view .pj-feed-item header strong { font-size: 13px; }
#app-view .pj-feed-item time { font-size: 11.5px; color: var(--dl-muted); white-space: nowrap; }
#app-view .pj-feed-item p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #3f3f46; }
#app-view .pj-feed-item.is-event { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 12px 7px 0; font-size: 12.5px; color: #52525b; }
#app-view .pj-feed-item.is-event i { justify-self: center; width: 7px; height: 7px; border-radius: 50%; background: #d4d4d8; }
#app-view .pj-feed-item.is-event strong { font-weight: 600; color: #3f3f46; }

/* Modal de criação e de vincular */
:is(#app-view, body > section:not(#auth-view)) .pj-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
:is(#app-view, body > section:not(#auth-view)) .pj-create-grid label { display: grid; gap: 6px; }
body > section.pj-link-modal .pj-link-card { width: min(100%, 560px); max-height: min(720px, calc(100vh - 36px)); display: flex; flex-direction: column; }
body > section.pj-link-modal .pj-link-tools { display: flex; align-items: center; gap: 10px; }
body > section.pj-link-modal .pj-link-tools .pj-search { flex: 1; width: auto; }
body > section.pj-link-modal .pj-link-toggle { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; white-space: nowrap; }
body > section.pj-link-modal .pj-link-toggle input { width: 15px !important; height: 15px !important; accent-color: var(--brand); }
body > section.pj-link-modal .pj-link-list { flex: 1; min-height: 160px; margin-top: 12px; overflow: auto; border: 1px solid var(--dl-border); border-radius: 12px; }
body > section.pj-link-modal .pj-link-list h4 { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; margin: 0; padding: 8px 12px; background: var(--dl-head-bg); border-bottom: 1px solid var(--dl-divider); font-size: 12px; font-weight: 600; color: var(--dl-head-color); }
body > section.pj-link-modal .pj-link-list h4 span { font-weight: 500; color: var(--dl-muted); }
body > section.pj-link-modal .pj-link-item { display: grid !important; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 !important; padding: 9px 12px; border-bottom: 1px solid var(--dl-divider); cursor: pointer; }
body > section.pj-link-modal .pj-link-item:hover { background: var(--dl-hover); }
body > section.pj-link-modal .pj-link-item.is-checked { background: #f5f5ff; }
body > section.pj-link-modal .pj-link-item input { width: 16px !important; height: 16px !important; accent-color: var(--brand); }
body > section.pj-link-modal .pj-link-item span { display: grid; gap: 2px; min-width: 0; }
body > section.pj-link-modal .pj-link-item strong { font-size: 13px; font-weight: 550; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body > section.pj-link-modal .pj-link-item small { font-size: 11.5px; color: var(--dl-muted); }
body > section.pj-link-modal .pj-link-item em { font-style: normal; color: #b7791f; }
body > section.pj-link-modal .pj-muted { padding: 16px; font-size: 12.5px; color: var(--dl-muted); }

/* Telas menores */
@media (max-width: 1250px) {
  #app-view .pj-meta { grid-template-columns: repeat(3, auto); }
  #app-view .pj-meta-progress { grid-column: 1 / -1; }
  #app-view .pj-row { grid-template-columns: 12px 22px minmax(0, 1fr) 110px 70px 96px 22px; }
}
@media (max-width: 1050px) {
  #app-view .pj-workspace { grid-template-columns: 250px minmax(0, 1fr) !important; }
  #app-view .pj-quick-add { grid-template-columns: 20px minmax(0, 1fr) 160px auto; }
  #app-view .pj-quick-due { display: none; }
  #app-view .pj-row { grid-template-columns: 12px 22px minmax(0, 1fr) 70px 96px 22px; }
  #app-view .pj-sector { display: none; }
}
@media (max-width: 760px) {
  #app-view .pj-toolbar { flex-direction: column; align-items: stretch; }
  #app-view .pj-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  #app-view .pj-search { width: 100%; }
  #app-view .pj-workspace { display: block !important; }
  #app-view .pj-catalog-panel { position: static !important; }
  #app-view .pj-catalog { max-height: none; overflow: visible; padding: 0; }
  #app-view .pj-view:not(.is-detail-open) .pj-detail { display: none; }
  #app-view .pj-view.is-detail-open .pj-catalog-panel,
  #app-view .pj-view.is-detail-open .pj-toolbar { display: none; }
  #app-view .pj-detail { padding: 14px !important; min-height: 0; }
  #app-view .pj-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px; padding: 0; border: 0; background: none; color: var(--brand); font: 600 13px var(--font-sans); cursor: pointer; }
  #app-view .pj-head { flex-direction: column; gap: 10px; }
  #app-view .pj-actions .pj-icon-btn span { display: none; }
  #app-view .pj-meta { grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 12px; }
  #app-view .pj-meta-owner { grid-column: 1 / -1; }
  #app-view .pj-tabs { display: flex; width: 100%; }
  #app-view .pj-tabs button { flex: 1; padding: 0 6px; }
  #app-view .pj-banner { grid-template-columns: 40px minmax(0, 1fr); }
  #app-view .pj-banner img { width: 40px; height: 40px; }
  #app-view .pj-banner .btn { grid-column: 1 / -1; }
  #app-view .pj-quick-add { grid-template-columns: 20px minmax(0, 1fr) auto; padding-left: 10px; }
  #app-view .pj-quick-sector { grid-column: 2 / -1; grid-row: 2; }
  #app-view .pj-steps-tools { flex-wrap: wrap; }
  #app-view .pj-steps-person .custom-select { min-width: 140px; }
  #app-view .pj-row { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "check title due" "check meta people"; row-gap: 3px; padding: 9px 10px; }
  #app-view .pj-grip, #app-view .pj-unlink, #app-view .pj-unlink-space { display: none; }
  #app-view .pj-check { grid-area: check; }
  #app-view .pj-row-title { grid-area: title; }
  #app-view .pj-due { grid-area: due; }
  #app-view .pj-people { grid-area: people; justify-self: end; }
  #app-view .pj-sector { display: inline-block; grid-area: meta; }
  #app-view .pj-gantt-head, #app-view .pj-gantt-row, #app-view .pj-gantt-overlay { grid-template-columns: 130px minmax(0, 1fr); }
  #app-view .pj-composer { grid-template-columns: minmax(0, 1fr) auto; }
  #app-view .pj-composer > .pj-av { display: none; }
  :is(#app-view, body > section:not(#auth-view)) .pj-create-grid { grid-template-columns: 1fr; }
}
#app-view .pj-gantt-overlay .pj-gantt-tick { border-left-color: #f0f0f2; }
#app-view .pj-gantt-line.is-due span { top: 4px; bottom: auto; left: auto; right: 4px; }
body > section.pj-link-modal .pj-search { display: flex !important; align-items: center; gap: 8px; height: 38px; margin: 0 !important; padding: 0 12px; border: 1px solid var(--search-border); border-radius: var(--control-radius); background: var(--surface); color: #a1a1aa; }
body > section.pj-link-modal .pj-search:focus-within { border-color: rgba(var(--brand-rgb), .55); box-shadow: var(--focus-ring); }
body > section.pj-link-modal .pj-search input { flex: 1; min-width: 0; height: 36px !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 13px !important; outline: none; }
body > section.pj-link-modal .pj-search input:focus { box-shadow: none !important; outline: none !important; }
#app-view .pj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
#app-view .pj-meta-progress { flex: 1 1 260px; }
