/* ───────────────────────────────────────────────
   KASTOR — Design System (base original preservada)
   ─────────────────────────────────────────────── */
/* Usuários não-admin: oculta qualquer elemento marcado como admin-only.
   A classe é alternada em body via renderSidebarUser(). */
body.user-readonly .admin-only { display: none !important; }

/* Light mode — sobrescreve as variáveis quando :root tem data-theme="light".
   Mantém o accent #7A00FF como brand; ajusta contrastes para fundo claro (WCAG AA). */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --surface-2: #F0F0F0;
  --surface-3: #E5E5E5;
  --border: rgba(0,0,0,0.10);
  --border-active: rgba(122,0,255,0.55);
  --accent: #7A00FF;
  --accent-text: #5E00CC;     /* roxo mais escuro · AA vs #F5F5F5 (8.2:1) */
  --accent-dim: rgba(122,0,255,0.10);
  --success: #0E9968;         /* verde escuro · AA vs #F5F5F5 (4.7:1) */
  --success-dim: rgba(14,153,104,0.12);
  --warn: #B57100;            /* âmbar escuro · AA vs #F5F5F5 (4.9:1) */
  --warn-dim: rgba(181,113,0,0.12);
  --danger: #C03737;          /* vermelho escuro · AA vs #F5F5F5 (5.2:1) */
  --danger-dim: rgba(192,55,55,0.12);
  --sky: #0277B6;
  --sky-dim: rgba(2,119,182,0.12);
  --purple: #6D28D9;
  --purple-dim: rgba(109,40,217,0.12);
  --text: #1A1A1A;            /* AAA vs --bg (14.8:1) */
  --text-dim: #4A4A4A;        /* AAA vs --bg (8.1:1) */
  --text-muted: #6B6B6B;      /* AA vs --bg (4.8:1) */
}

:root {
  color-scheme: dark;
  --bg: #161616;
  --surface: #262626;
  --surface-2: #363636;
  --surface-3: #474747;
  --border: rgba(255,255,255,0.08);
  --border-active: rgba(122,0,255,0.5);
  --accent: #7A00FF;          /* brand: usado em background/border/box-shadow */
  --accent-text: #B380FF;     /* variante clara para uso COMO TEXTO em fundo escuro (WCAG AA) */
  --accent-dim: rgba(122,0,255,0.15);
  --success: #3CE3A0;         /* AAA vs --bg (10.6:1) */
  --success-dim: rgba(60,227,160,0.15);
  --warn: #F5A718;            /* AAA vs --bg (8.7:1) */
  --warn-dim: rgba(245,167,24,0.15);
  --danger: #EF5050;          /* AA vs --bg (5.0:1) */
  --danger-dim: rgba(239,80,80,0.15);
  --sky: #38BDF8;
  --sky-dim: rgba(56,189,248,0.15);
  --purple: #A78BFA;
  --purple-dim: rgba(167,139,250,0.15);
  --text: #ECECEC;            /* AAA vs --bg (14.8:1) */
  --text-dim: #B8B8B8;        /* cinza neutro · AAA vs --bg (8.8:1) · AA vs --surface-3 */
  --text-muted: #A3A3A3;      /* cinza neutro · AAA vs --bg (6.98:1) · AA vs --surface-2 */

  /* Raios — escala mais ampla, cantos mais contínuos (aproximação de squircle iOS) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Sombras suaves multi-camada (estilo iOS/macOS) */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.18);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.20), 0 1px 2px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.24), 0 2px 4px rgba(0,0,0,0.14);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.32), 0 4px 8px rgba(0,0,0,0.18);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.38), 0 8px 16px rgba(0,0,0,0.22);
  --shadow-focus: 0 0 0 4px var(--accent-dim);

  /* Glass (frosted) — sidebar, topbar, modais */
  --glass: rgba(22,22,22,0.72);
  --glass-strong: rgba(22,22,22,0.86);
  --surface-glass: rgba(38,38,38,0.78);     /* cards/painéis frosted: aurora vaza sutilmente */
  --hairline: rgba(255,255,255,0.06);

  /* Motion (curvas estilo Apple: spring suave) */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-w: 230px;
}

/* Light mode — sombras mais sutis, glass branco */
:root[data-theme="light"] {
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.08);
  --glass: rgba(255,255,255,0.72);
  --glass-strong: rgba(255,255,255,0.86);
  --surface-glass: rgba(255,255,255,0.78);
  --hairline: rgba(0,0,0,0.07);
  --hairline-strong: rgba(0,0,0,0.14);
}

/* ─── LIGHT MODE: revisão de campos e elementos que estavam destoando ─── */
/* Inputs/selects/textareas: fundo branco com borda visível em vez de cinza
   sobre cinza (que ficava praticamente invisível com --bg #F5F5F5). */
:root[data-theme="light"] .form-control {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.12);
}
:root[data-theme="light"] .form-control:hover {
  background: #FAFAFA;
  border-color: rgba(0,0,0,0.20);
}
:root[data-theme="light"] .form-control:focus {
  background: #FFFFFF;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122,0,255,0.12);
}
/* Trigger do cdrop (Prioridade, Workspace, etc) — bem o mesmo padrão */
:root[data-theme="light"] .filter-cdrop-trigger {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.12);
  color: var(--text-dim);
}
:root[data-theme="light"] .filter-cdrop-trigger:hover {
  background: #FAFAFA;
  border-color: rgba(0,0,0,0.20);
  color: var(--text);
}
:root[data-theme="light"] .filter-cdrop.filtering .filter-cdrop-trigger {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-text);
}
/* Menu de cdrop e demais painéis flutuantes — sombra leve + borda mais marcada */
:root[data-theme="light"] .filter-cdrop-menu,
:root[data-theme="light"] .user-select-menu {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.10);
  box-shadow: var(--shadow-md);
}
/* User-select (botão do responsável atual) */
:root[data-theme="light"] .user-select-btn {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.12);
}
:root[data-theme="light"] .user-select-btn:hover { border-color: rgba(0,0,0,0.22); }

/* Botões ghost (Anexos, navegação de semana, etc) — branco + borda em vez de
   cinza-sobre-cinza */
:root[data-theme="light"] .demand-att-btn,
:root[data-theme="light"] .btn-ghost {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.10);
  color: var(--text-dim);
}
:root[data-theme="light"] .demand-att-btn:hover,
:root[data-theme="light"] .btn-ghost:hover {
  background: #FAFAFA;
  border-color: rgba(0,0,0,0.18);
  color: var(--text);
}

/* Cards do flow-grid e clients-grid — fundo branco contrastando com o bg */
:root[data-theme="light"] .flow-card,
:root[data-theme="light"] .client-card {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.08);
  box-shadow: var(--shadow-xs);
}
:root[data-theme="light"] .flow-card:hover,
:root[data-theme="light"] .client-card:hover {
  border-color: rgba(0,0,0,0.16);
  box-shadow: var(--shadow-md);
}
/* Avatar/ícone dos cards de cliente com letra: usa accent-dim (suave) em
   vez do roxo solidão que ficava agressivo no light. */
:root[data-theme="light"] .flow-card-avatar:not([style*="background-image"]),
:root[data-theme="light"] .client-card-avatar:not([style*="background-image"]) {
  filter: saturate(0.9);
}

/* Toggle de view (1 semana / 2 semanas), chart toggle dots, etc — pílulas
   suaves em vez do cinza-escuro herdado */
:root[data-theme="light"] .agenda-view-toggle,
:root[data-theme="light"] .client-status-toggle {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.10);
}

/* Tabelas — fundo do thead um pouco mais quente (era invisível) */
:root[data-theme="light"] .table-wrap { background: #FFFFFF; border: 1px solid rgba(0,0,0,0.08); }
:root[data-theme="light"] table th { background: #FAFAFA; border-bottom-color: rgba(0,0,0,0.08); }
:root[data-theme="light"] table td { border-bottom-color: rgba(0,0,0,0.06); }
:root[data-theme="light"] tbody tr:hover { background: #F7F7FA; }

/* Sidebar / topbar nos tons certos do light mode (já fazem glass, mas reforçando) */
:root[data-theme="light"] .sidebar { background: rgba(255,255,255,0.78); border-right-color: rgba(0,0,0,0.08); }
:root[data-theme="light"] .topbar { background: rgba(255,255,255,0.78); border-bottom-color: rgba(0,0,0,0.08); }

/* Agenda: coluna de horários (HORÁRIO) e cabeçalho de dias ficam quase brancos
   no light mode pra não destoar do bg geral. O cinza padrão (--surface-2)
   ficava escurinho demais. */
:root[data-theme="light"] .agenda-cell.is-time,
:root[data-theme="light"] .agenda-cell.is-day-header,
:root[data-theme="light"] .agenda-corner {
  background: #FAFAFA;
}
:root[data-theme="light"] .agenda-cell.is-day-header.is-today {
  background: var(--accent-dim);
  color: var(--accent-text);
}
:root[data-theme="light"] .agenda-cell.is-day-header.is-week-gap { background: #F4F4F4; }

/* Garante que os pickers nativos (data, hora) usem o tema correto do sistema */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  color-scheme: dark;
}
:root[data-theme="light"] input[type="date"],
:root[data-theme="light"] input[type="time"],
:root[data-theme="light"] input[type="datetime-local"],
:root[data-theme="light"] input[type="month"],
:root[data-theme="light"] input[type="week"] {
  color-scheme: light;
}
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
:root[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: none;
}
/* Estiliza o ícone do picker para combinar com o tema */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.3) saturate(2) hue-rotate(220deg);
  opacity: 0.7;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  position: relative;
}

/* Ambient purple aurora — visível em todas as telas do app. Os fades ficam
   atrás do conteúdo. Os cards têm backdrop-blur, então a aurora "passa" por
   eles de forma frosted (sem alterar agressivamente a cor de pills/elementos
   pequenos por cima). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 60% at 12% 8%, rgba(122,0,255,0.10), transparent 60%),
    radial-gradient(ellipse 65% 55% at 92% 95%, rgba(122,0,255,0.06), transparent 65%);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 75% 60% at 12% 8%, rgba(122,0,255,0.08), transparent 60%),
    radial-gradient(ellipse 65% 55% at 92% 95%, rgba(122,0,255,0.05), transparent 65%);
}
/* Garante que o app fique acima da aurora (login/toast/modal já têm position: fixed
   com z-index alto, então já estão acima da aurora naturalmente) */
#app.active { position: relative; z-index: 1; }

/* ─── SKELETONS (loading shimmer) ─── */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
  animation: shimmer 1.6s ease-in-out infinite;
}
:root[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.04) 50%, transparent 100%);
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-line.lg { height: 28px; }
.skeleton-line.sm { height: 10px; }
.skeleton-line.xs { height: 8px; }
.skeleton-circle { border-radius: 50%; }

/* ─── PAGE TRANSITIONS ─── */
.page.active { animation: pageFadeIn .26s var(--ease-out); }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
  .skeleton::after { animation: none; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(160,160,160,0.25); border-radius: var(--radius-pill); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(160,160,160,0.4); background-clip: padding-box; border: 2px solid transparent; }

/* ── LOGIN ── */
#login-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
#login-screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 20% 20%, rgba(122,0,255,0.10), transparent 70%),
              radial-gradient(ellipse 50% 40% at 80% 80%, rgba(122,0,255,0.06), transparent 70%);
}
.login-box {
  position: relative;
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 380px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}
.login-logo { margin-bottom: 14px; display: flex; justify-content: center; }
.login-logo img { height: 40px; width: auto; display: block; }
.login-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 32px; }
.login-box input {
  width: 100%; background: var(--surface-2); border: 1px solid transparent;
  color: var(--text); padding: 13px 16px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; outline: none; margin-bottom: 12px;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s;
}
.login-box input:hover { background: var(--surface-3); }
.login-box input:focus { background: var(--surface-2); border-color: var(--accent); box-shadow: var(--shadow-focus); }
.login-box button {
  width: 100%; padding: 13px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm); font-family: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(122,0,255,0.18), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: transform .12s var(--ease-spring), filter .15s, box-shadow .15s;
  letter-spacing: -0.01em;
}
.login-box button:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(122,0,255,0.32), inset 0 1px 0 rgba(255,255,255,0.16); }
.login-box button:active { transform: scale(0.985); }
.login-error { color: var(--danger); font-size: 12px; min-height: 16px; margin-bottom: 10px; }
.login-hint { color: var(--text-muted); font-size: 11px; margin-top: 22px; line-height: 1.6; }
.login-forgot {
  display: inline-block;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: color .12s var(--ease-out);
}
.login-forgot:hover { color: var(--accent-text); text-decoration: underline; }
/* A tela de reset reaproveita o layout do login — mesma .login-box. */
#reset-screen {
  display: none;
  align-items: center; justify-content: center;
  min-height: 100vh;
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 10000;
}
#reset-screen.open { display: flex; }

/* ── APP SHELL ── */
#app { display: none; }
#app.active { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transform: translateZ(0);
  contain: layout paint;
}
.sidebar-brand {
  padding: 18px 20px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 10px;
  min-height: 76px;
}
/* 3 variantes do logo — CSS decide qual mostrar por (tema × collapse state).
   Todas default hidden; regras específicas revelam a certa. */
.sidebar-logo { height: 36px; width: auto; display: none; flex-shrink: 0; }
/* Expanded + dark (tema padrão): wordmark branco */
.sidebar-logo-full-white { display: block; }
/* Expanded + light: wordmark preto */
:root[data-theme="light"] .sidebar-logo-full-white { display: none; }
:root[data-theme="light"] .sidebar-logo-full-black { display: block; }
.sidebar-user {
  padding: 8px 10px; display: flex; align-items: center; gap: 11px;
  font-size: 12px; cursor: pointer; border-radius: var(--radius-sm);
  transition: background .15s var(--ease-out);
  flex: 1; min-width: 0;
}
.sidebar-user:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-dim), var(--accent-dim));
  border: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent-text); flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; font-size: 28px; }
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.sidebar-user-name {
  font-weight: 600; font-size: 13px; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  color: var(--text-dim); cursor: pointer; text-decoration: none;
  transition: background .15s var(--ease-out), color .15s var(--ease-out), transform .12s var(--ease-spring);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:active { transform: scale(0.98); }
.nav-item.active { background: var(--accent-dim); color: var(--accent-text); font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-section {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .1em;
  padding: 16px 12px 8px;
}
/* Linha sutil de separação acima de cada seção (exceto a primeira) */
.nav-section + .nav-section,
.sidebar-nav > .nav-section:not(:first-child) {
  border-top: 1px solid var(--hairline);
  margin-top: 4px;
}
.sidebar-footer {
  padding: 10px 14px; border-top: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 6px;
}
.sidebar-footer-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Icon button pra ações da sidebar (theme toggle, collapse) */
.sidebar-icon-btn {
  width: 30px; height: 30px; padding: 0;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
}
.sidebar-icon-btn:hover { color: var(--text); background: var(--surface-2); }
.sidebar-icon-btn svg { width: 16px; height: 16px; }

/* Toggle visibility dos ícones sun/moon baseado no tema */
.theme-icon-sun,
.theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-icon-moon { display: block; }
:root:not([data-theme="light"]) .theme-icon-sun { display: block; }

/* Toggle collapse/expand chevrons baseado no estado */
.collapse-icon-expand { display: none; }
body.sidebar-collapsed .collapse-icon-collapse { display: none; }
body.sidebar-collapsed .collapse-icon-expand { display: block; }

/* Letter tile do workspace — só visível no modo colapsado */
.ws-trigger-letter { display: none; }

/* ── ESTADO COLAPSADO ──
   Sidebar fica em 72px, mostra só ícones. Labels/wordmarks/textos escondidos. */
body.sidebar-collapsed .sidebar { width: 72px !important; }
body.sidebar-collapsed .main { margin-left: 72px !important; }

/* Brand: só o ícone K centralizado. Wordmark sumido. */
body.sidebar-collapsed .sidebar-brand {
  justify-content: center; padding: 18px 0;
  overflow: hidden;
}
/* Colapsado: esconde os wordmarks (branco + preto), mostra só o K icon
   (Kastor_logo.svg) — igual em ambos os temas (SVG tem gradient purple fixo). */
body.sidebar-collapsed .sidebar-logo-full-white,
body.sidebar-collapsed .sidebar-logo-full-black {
  display: none !important;
}
body.sidebar-collapsed .sidebar-logo-icon {
  display: block !important;
  height: 32px !important; width: auto !important;
  max-width: 40px;
}
:root[data-theme="light"] body.sidebar-collapsed .sidebar-logo-icon {
  display: block !important;
}

/* Nav items: perfeitamente centralizados, sem qualquer resquício de texto. */
body.sidebar-collapsed .sidebar-nav { padding: 8px 0; }
body.sidebar-collapsed .nav-item {
  justify-content: center; align-items: center;
  padding: 10px 0; margin: 0 auto; width: 40px;
  gap: 0; font-size: 0; line-height: 0;
  border-radius: var(--radius-sm);
}
body.sidebar-collapsed .nav-item svg { width: 18px; height: 18px; }

/* Section headers viram só linha divisória (mantém a separação visual). */
body.sidebar-collapsed .nav-section {
  padding: 0; margin: 8px 16px;
  height: 0; font-size: 0; line-height: 0;
  border-top: 1px solid var(--hairline);
  color: transparent;
}
body.sidebar-collapsed .sidebar-nav > .nav-section:first-child {
  border-top: none; margin-top: 0;
}

/* Nome do user sumido, avatar centralizado. */
body.sidebar-collapsed .sidebar-user-name { display: none !important; }
body.sidebar-collapsed .sidebar-footer {
  flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 8px;
}
body.sidebar-collapsed .sidebar-user {
  justify-content: center; padding: 4px 0;
}
body.sidebar-collapsed .sidebar-footer-actions { flex-direction: column; gap: 2px; }

/* Workspace switcher: no colapsado vira um pill quadrado com a letra inicial. */
body.sidebar-collapsed .ws-switch {
  padding: 12px 8px; border-bottom: 1px solid var(--hairline);
}
body.sidebar-collapsed .ws-switch .filter-label { display: none; }
/* Estas regras existem SÓ pra achatar o workspace-switcher da sidebar quando
   colapsada. Escopadas ao .ws-switch — sem isso vazam pros filter-cdrops do
   dashboard/list e apagam labels + fundos + bordas. */
body.sidebar-collapsed .ws-switch .ws-trigger-dot,
body.sidebar-collapsed .ws-switch .filter-cdrop-label,
body.sidebar-collapsed .ws-switch .ws-trigger-chevron { display: none !important; }
body.sidebar-collapsed .ws-switch .filter-cdrop-trigger {
  justify-content: center; padding: 0;
  background: transparent !important; border: none !important;
}
body.sidebar-collapsed .ws-trigger-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff; font-size: 16px; font-weight: 700;
  letter-spacing: -0.02em;
}
/* Menu do dropdown quando colapsado — abre pra direita com posição fixa.
   Precisa DESATIVAR o contain: layout paint do .sidebar pra o menu escapar. */
body.sidebar-collapsed .sidebar {
  contain: none;
  overflow: visible;
}
body.sidebar-collapsed .sidebar-nav { overflow: visible; }
body.sidebar-collapsed .ws-cdrop .filter-cdrop-menu {
  left: calc(100% + 8px); top: 0;
  min-width: 220px; z-index: 200;
  box-shadow: var(--shadow-xl);
}

/* ── MAIN ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  padding: 14px 28px;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 80;
  transform: translateZ(0);
  contain: layout;
}
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn {
  padding: 8px 16px; border-radius: var(--radius-sm); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: -0.005em;
  transition: transform .12s var(--ease-spring), filter .15s var(--ease-out), background .15s var(--ease-out), color .15s var(--ease-out), border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(122,0,255,0.20), inset 0 1px 0 rgba(255,255,255,0.14);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(122,0,255,0.32), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-active); }
.btn-ghost.active { background: var(--accent-dim); color: var(--accent-text); border-color: transparent; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger-dim); }
.btn-danger:hover { background: var(--danger-dim); }
.btn-sm { padding: 6px 11px; font-size: 11px; }

/* ── PAGE CONTENT ── */
.page { display: none; flex: 1; overflow: hidden; }
.page.active { display: flex; flex-direction: column; }
.page-body { padding: 24px 28px; flex: 1; overflow-y: auto; overflow-x: hidden; }

/* ── DASHBOARD ── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 28px; }
.metric-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease-spring), border-color .15s var(--ease-out);
}
.metric-card:hover { transform: translateY(-1px); border-color: var(--border-active); }
.metric-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.metric-value { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.metric-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.metric-spark { margin-top: 12px; opacity: 0.85; height: 24px; }
.metric-spark svg { width: 100%; max-width: 120px; height: 24px; }
.metric-accent { color: var(--accent-text); }
.metric-success { color: var(--success); }
.metric-warn { color: var(--warn); }
.metric-danger { color: var(--danger); }

.section-title { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head .section-title { margin-bottom: 0; }

/* PIPELINE CHART */
.dash-bar-chart {
  display: flex; gap: 6px; align-items: flex-end; justify-content: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 20px 14px; min-height: 200px; overflow-x: auto;
}
.dash-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 48px; flex: 1; max-width: 80px; }
.dash-bar-val { font-size: 12px; font-weight: 700; color: var(--text); }
.dash-bar { border-radius: 4px 4px 0 0; width: 100%; min-height: 4px; transition: height .4s ease; }
.dash-bar-label { font-size: 10px; color: var(--text-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.flow-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.flow-chip {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.flow-chip:hover { border-color: var(--accent-text); color: var(--accent-text); }
.flow-chip.active { background: var(--accent-dim); border-color: var(--accent-text); color: var(--accent-text); }

/* TABLES */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 18px; background: transparent; font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; text-align: left; border-bottom: 1px solid var(--hairline); }
td { padding: 13px 18px; border-top: 1px solid var(--hairline); font-size: 13px; transition: background .12s var(--ease-out); }
tr:first-child td { border-top: none; }
tr:hover td { background: var(--surface-2); }
.table-scroll { overflow-x: auto; }

/* ── STATUS PILLS ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; white-space: nowrap;
  letter-spacing: -0.005em;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pill-late { background: var(--danger-dim); color: var(--danger); }
.pill-muted { background: var(--surface-3); color: var(--text-dim); }
.pill-admin { background: var(--accent-dim); color: var(--accent-text); }
.pill-success { background: var(--success-dim); color: var(--success); }

/* ── FILTERS ── */
.filters-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: flex-end; }
/* Agrupa label+controles num cluster centrado verticalmente, evitando que
   o texto fique colado no fundo da filters-bar (que usa align-items: flex-end). */
.filter-group-label { display: inline-flex; align-items: center; gap: 8px; }
.filter-group-label-text { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ─── Tooltip + guide line nos gráficos (clientes + dashboard) ─── */
.chart-hover-host { position: relative; }
.chart-hover-host svg { cursor: crosshair; }
.chart-guide { transition: opacity .12s; }
.chart-tooltip {
  position: absolute; pointer-events: none;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 8px 10px; min-width: 130px; max-width: 240px;
  font-size: 12px; color: var(--text);
  opacity: 0; transition: opacity .12s, left .08s;
  z-index: 10;
}
.chart-tip-head {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding-bottom: 6px; margin-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}
.chart-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.4; padding: 2px 0; }
.chart-tip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chart-tip-label { flex: 1; color: var(--text-dim); font-size: 11.5px; }
.chart-tip-value { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.filter-select {
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text-dim);
  padding: 0 14px; height: 40px; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  cursor: pointer; outline: none;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out);
}
.filter-select:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.filter-select.filtering { border-color: var(--accent); color: var(--accent-text); background: var(--accent-dim); }
.filter-input {
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text);
  padding: 0 14px; height: 40px; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  outline: none; flex: 1 1 240px; min-width: 180px; max-width: 360px;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.filter-input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
/* Wrapper para search input com ícone interno (lupa à esquerda) */
.filter-input-wrap {
  position: relative;
  display: flex;
  flex: 1 1 240px;
  min-width: 180px;
  max-width: 360px;
}
.filter-input-wrap .filter-input--with-icon {
  padding-left: 38px;
  max-width: none; min-width: 0;
  flex: 1;
}
.filter-input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color .15s var(--ease-out);
}
.filter-input-wrap:focus-within .filter-input-icon { color: var(--accent-text); }
.filter-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 6px; }
.filter-group { display: flex; flex-direction: column; }
.filters-bar .btn { height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.filters-bar .btn-icon-only { width: 36px; padding: 0; }

/* ── Filter custom dropdown padronizado ── */
.filter-native-hidden { display: none !important; }
.filter-cdrop { position: relative; min-width: 160px; }
.filter-cdrop-trigger {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  cursor: pointer; width: 100%; min-width: 160px;
  font-size: 13px; color: var(--text-dim); font-family: inherit;
  outline: none;
  transition: border-color .15s var(--ease-out), background .15s var(--ease-out), color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
/* Chevron do trigger: respiro extra e tamanho/cor consistentes (não fica colado na borda) */
.filter-cdrop-trigger > i[data-lucide="chevron-down"] {
  margin-left: 6px; opacity: 0.65; flex-shrink: 0;
}
.filter-cdrop-trigger:hover { background: var(--surface-2); color: var(--text); }
.filter-cdrop.filtering .filter-cdrop-trigger { border-color: var(--accent); background: var(--accent-dim); color: var(--accent-text); }
.filter-cdrop-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-cdrop-avatar { width: 20px !important; height: 20px !important; font-size: 9px !important; flex-shrink: 0; }
.filter-cdrop-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset; }
.filter-cdrop-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; z-index: 60;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 320px; overflow-y: auto; display: none; white-space: nowrap;
}
.filter-cdrop.open .filter-cdrop-menu { display: block; animation: cdropIn .18s var(--ease-out); }
/* Drop-up: menu abre PRA CIMA quando não cabe abaixo (auto-aplicado em toggleFilterCdrop) */
.filter-cdrop.drop-up .filter-cdrop-menu { top: auto; bottom: calc(100% + 6px); }
.filter-cdrop.drop-up.open .filter-cdrop-menu { animation: cdropInUp .18s var(--ease-out); }
@keyframes cdropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cdropInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.filter-cdrop-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--text);
  transition: background .12s var(--ease-out);
}
.filter-cdrop-item:hover { background: var(--surface-2); }
.filter-cdrop-item.active { background: var(--accent-dim); color: var(--accent-text); }

.demand-row { cursor: pointer; }
.deadline-late { color: var(--danger); font-weight: 600; }
.demand-name { font-weight: 600; }

/* ── CALENDAR ── */
.calendar-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-title { font-size: 15px; font-weight: 700; flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 6px 0; text-transform: uppercase; }
.cal-day {
  min-height: 96px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 10px;
  transition: border-color .12s var(--ease-out);
}
.cal-day:hover { border-color: var(--border-active); }
.cal-day.today { border-color: var(--accent); }
.cal-day.other-month .cal-day-num { color: var(--text-muted); }
.cal-day-num { font-size: 12px; font-weight: 600; margin-bottom: 6px; min-height: 22px; }
/* Pill accent no número do dia quando é hoje */
.cal-today-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(122,0,255,0.4);
}
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-dim); }

/* Sábado e domingo aparecem com menos destaque — fundo levemente recuado,
   número/eventos com opacidade menor, hairline mais discreta. Visual de
   "fora do horário comercial" sem virar elemento desativado. */
.cal-day.weekend {
  background: transparent;
  border-color: color-mix(in srgb, var(--hairline) 60%, transparent);
}
.cal-day.weekend .cal-day-num { color: var(--text-muted); opacity: 0.65; }
.cal-day.weekend .cal-event   { opacity: 0.55; }
.cal-day.weekend:hover        { border-color: var(--hairline); }
.cal-day.weekend:hover .cal-event { opacity: 0.85; } /* hover restaura legibilidade */
.cal-day.weekend.today        { border-color: var(--accent); }
/* Cabeçalho da semana (Dom/Sáb) também atenuado */
.cal-dow.cal-dow--weekend { color: var(--text-muted); opacity: 0.6; }

/* Eventos do calendário: pill com mini-avatar do responsável + nome */
.cal-event {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 500;
  padding: 3px 8px 3px 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 3px;
  overflow: hidden; white-space: nowrap;
  cursor: pointer;
  transition: transform .1s var(--ease-spring), filter .15s var(--ease-out);
  letter-spacing: -0.005em;
}
.cal-event:hover { transform: translateX(1px); filter: brightness(1.12); }
.cal-event-avatar {
  width: 16px !important; height: 16px !important;
  font-size: 8px !important; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.cal-event-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0; margin-left: 3px;
}
.cal-event-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-day-more {
  font-size: 9.5px; color: var(--text-muted); font-weight: 600;
  padding: 1px 4px; margin-top: 2px; letter-spacing: -0.005em;
}

/* ── MINHAS DEMANDAS (lista + calendário lado a lado em telas largas) ── */
.mine-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1500px) {
  .mine-layout { grid-template-columns: minmax(480px, 5fr) 7fr; align-items: start; }
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease-out);
}
:root[data-theme="light"] .modal-overlay { background: rgba(0,0,0,.28); }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform .3s var(--ease-spring), opacity .25s var(--ease-out);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-header {
  padding: 22px 28px 18px; display: flex; align-items: flex-start; justify-content: space-between;
  position: sticky; top: 0; z-index: 1;
  /* Gradient sutil de accent — puxa o brand sem dominar */
  background:
    linear-gradient(to bottom, var(--accent-dim) 0%, transparent 80%),
    var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.modal-close {
  width: 30px; height: 30px; background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--radius-pill); color: var(--text-dim); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s var(--ease-out), color .15s var(--ease-out), transform .12s var(--ease-spring);
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-close:active { transform: scale(0.92); }
.modal-body { padding: 20px 28px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.form-label-hint { color: var(--text-muted); font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 4px; }
/* TODOS os campos de input/select usam altura fixa 40px para consistência visual.
   Textarea fica como exceção (altura segue rows + padding maior). */
.form-control {
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text);
  padding: 0 14px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px;
  outline: none;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s;
  width: 100%;
  line-height: 1.4;
}
textarea.form-control { height: auto; min-height: 80px; padding: 11px 14px; }
.form-control:hover { background: var(--surface-3); }
.form-control:focus { background: var(--surface-2); border-color: var(--accent); box-shadow: var(--shadow-focus); }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.form-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.modal-footer {
  padding: 0 28px 22px; display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--surface); padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

/* CARD DETAIL */
.card-detail-header { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.card-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.card-detail-body { padding: 20px 24px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item .label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.detail-item .value { font-size: 13px; font-weight: 500; }
.detail-item a.value { color: var(--accent-text); text-decoration: none; }
.detail-item a.value:hover { text-decoration: underline; }

/* PIPELINE — círculos numerados conectados por um traço (sem labels) */
.pipeline-bar {
  position: relative;
  height: 28px;
  margin: 18px 22px 8px;
}
.pipeline-bar-track {
  position: absolute; left: 0; right: 0; top: 50%; height: 3px;
  transform: translateY(-50%);
  background: var(--surface-3);
  border-radius: var(--radius-pill);
}
.pipeline-bar-fill {
  position: absolute; left: 0; top: 50%; height: 3px;
  transform: translateY(-50%);
  width: var(--fill, 0%);
  background: linear-gradient(90deg, var(--accent), var(--accent-text));
  border-radius: var(--radius-pill);
  transition: width .45s var(--ease-spring);
}
.pipeline-bar-steps {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 0;
}
.pipeline-bar-step {
  position: absolute;
  top: 0;
  transform: translate(-50%, -50%);
}
.pipeline-bar-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  transition: all .25s var(--ease-spring);
  cursor: default;
}
.pipeline-bar-step.done .pipeline-bar-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pipeline-bar-step.current .pipeline-bar-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-dim);
  animation: pipelinePulse 2.4s ease-in-out infinite;
}
@keyframes pipelinePulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-dim); }
  50%      { box-shadow: 0 0 0 8px rgba(122,0,255,0.08); }
}

/* STATUS CHANGE */
.status-change-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-top: 16px;
}
.status-change-title { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.status-row { display: flex; gap: 10px; align-items: flex-end; }

/* ── EDITOR DE FLUXOS ── */
.stage-list { display: flex; flex-direction: column; gap: 8px; }
.stage-row {
  display: grid;
  grid-template-columns: 24px 40px minmax(140px, 1fr) minmax(180px, 220px) auto auto auto;
  gap: 10px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.stage-handle { color: var(--text-muted); font-size: 14px; text-align: center; user-select: none; }
.stage-color { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; cursor: pointer; padding: 2px; }
.stage-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 26px; height: 26px; background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.icon-btn:hover { border-color: var(--accent-text); color: var(--accent-text); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.stage-done-toggle { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-muted); white-space: nowrap; cursor: pointer; }
.stage-done-toggle input { accent-color: var(--success); cursor: pointer; }

.flow-preview { display: flex; gap: 4px; flex-wrap: wrap; }
.flow-preview .pill { font-size: 10px; padding: 2px 8px; }

/* ── PERFIL ── */
.profile-layout { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 980px; }
@media (min-width: 1100px) { .profile-layout { grid-template-columns: 340px 1fr; align-items: start; } }
.profile-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.profile-card .avatar-lg { margin: 0 auto 14px; }
.profile-name { font-size: 17px; font-weight: 700; }
.profile-role { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.profile-username { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.upload-btn-wrap { margin-top: 18px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }
.panel-title { font-size: 13px; font-weight: 700; margin-bottom: 16px; }

/* COLOR DOT */
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
/* Ilustração maior (não é mais um ícone, é uma cena com accent + camadas).
   Não aplica opacity global pra preservar a cor do accent. */
.empty-state-icon {
  width: 200px; height: 150px;
  margin-bottom: 20px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.empty-state-icon svg { width: 100%; height: 100%; }

/* ─── Onboarding: barra de "começar a partir de modelo" no modal de cliente ─── */
.client-template-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 20px;
  background: var(--accent-dim);
  border: 1px solid rgba(122, 0, 255, 0.25);
  border-radius: var(--radius);
}
.client-template-bar-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--accent); color: #fff;
  border-radius: 50%; flex-shrink: 0;
}
.client-template-bar-text { flex: 1; min-width: 0; }
.client-template-bar-title { font-size: 13px; font-weight: 600; color: var(--text); }
.client-template-bar-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; letter-spacing: -0.005em; }
.empty-state-sub { font-size: 13px; max-width: 340px; line-height: 1.55; }
/* CTA opcional no empty state — botão pill accent, com micro-lift no hover.
   is-ghost: variante secundária pra quando o accent seria demais. */
.empty-state-cta {
  margin-top: 22px;
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 20px;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(122, 0, 255, 0.18);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out);
}
.empty-state-cta:hover {
  background: var(--accent-hover, var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(122, 0, 255, 0.28);
}
.empty-state-cta:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(122, 0, 255, 0.18); }
.empty-state-cta.is-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.empty-state-cta.is-ghost:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
  box-shadow: none;
}
.empty-state-cta svg { width: 16px; height: 16px; }

/* Fallback para "Nenhum cliente neste workspace" na coluna de recurring */
.rec-clients-empty {
  color: var(--text-muted); font-size: 12px;
  padding: 14px 12px; text-align: center;
  border: 1px dashed var(--hairline); border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* ─── RELATÓRIO MENSAL DO CLIENTE ─────────────────────────────────────
   Layout print-friendly. Todo o conteúdo fica dentro de #report-content
   pra que @media print consiga esconder o resto. */
.report-toolbar { padding-bottom: 4px; }
.report-header {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 28px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.report-header-brand {
  width: 60px; height: 60px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.report-header-logo { width: 100%; height: auto; }
.report-header-titles { flex: 1; min-width: 0; }
.report-header-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--accent-text); text-transform: uppercase; margin-bottom: 4px;
}
.report-header-title {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); line-height: 1.1;
}
.report-header-sub {
  font-size: 14px; color: var(--text-muted); margin-top: 4px;
  text-transform: capitalize;
}

.report-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 28px;
}
.report-kpi {
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.report-kpi-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.report-kpi-value {
  font-size: 30px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.report-kpi-value.report-kpi-danger { color: var(--danger, #EF4444); }

.report-section { margin-bottom: 28px; }
.report-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.report-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 900px) {
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .report-grid-2 { grid-template-columns: 1fr; }
}

/* Tabela de demandas entregues — clean, sem shadow */
.report-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.report-table th, .report-table td {
  padding: 10px 14px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--hairline);
}
.report-table th {
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--surface-3);
}
.report-table tr:last-child td { border-bottom: 0; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.report-td-name { font-weight: 600; }
.report-muted { color: var(--text-muted); }
.report-late { color: var(--danger, #EF4444); }
.report-late-tag {
  display: inline-block; margin-left: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(239, 68, 68, 0.12); color: var(--danger, #EF4444);
}

/* Barras de horas por função/responsável */
.report-bar-row {
  display: grid; grid-template-columns: 130px 1fr 70px;
  align-items: center; gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
}
.report-bar-row:last-child { border-bottom: 0; }
.report-bar-row--user { grid-template-columns: 180px 1fr 70px; }
.report-bar-label { font-size: 13px; font-weight: 600; color: var(--text); }
.report-bar-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
  min-width: 0;
}
.report-bar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track {
  height: 8px; background: var(--surface-3);
  border-radius: 4px; overflow: hidden;
}
.report-bar-fill {
  height: 100%; background: var(--accent);
  border-radius: 4px;
  transition: width .3s var(--ease-out);
}
.report-bar-value {
  font-size: 12.5px; font-weight: 700; text-align: right;
  color: var(--text); font-variant-numeric: tabular-nums;
}

.report-footer {
  margin-top: 40px; padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 11px; color: var(--text-muted); text-align: center;
}

/* ─── DASHBOARD REDESIGN ─────────────────────────────────────────────
   Row 1: filtros (mantido). Row 2: 4 KPIs. Row 3: grid 2/3 + 1/3.
   Widgets: Próximos 7 dias, Em atraso, Throughput, Radar, Top responsáveis. */

/* KPIs */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 4px;
}
@media (max-width: 900px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
}
/* KPI card — vertical stack: label · valor grande · sub. Sem border-left accent
   (limpeza visual — o wireframe não tem). Padding moderado. */
.dash-kpi {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.dash-kpi-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 6px;
}
.dash-kpi-value {
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.05;
  margin-bottom: 6px;
}
.dash-kpi.is-danger .dash-kpi-value { color: var(--danger, #EF4444); }
.dash-kpi-sub {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Grid principal */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1200px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Widget base */
.dash-widget {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.dash-widget-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.dash-widget-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
}
.dash-widget-sub { font-size: 12px; color: var(--text-muted); }

/* Próximos 7 dias — 7 pills escaláveis */
.dash-next7-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
}
.dash-next7-pill {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  cursor: pointer;
  transition: transform .15s var(--ease-spring), border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
  min-height: 84px;
}
.dash-next7-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent-text);
  box-shadow: 0 6px 18px rgba(122, 0, 255, 0.12);
}
.dash-next7-pill.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dash-next7-day {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px;
}
.dash-next7-date {
  font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; margin-bottom: 6px;
}
.dash-next7-count {
  font-size: 22px; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
/* Escala visual do fundo — 4 níveis (0=vazio até 3=alto) */
.dash-next7-lvl-0 .dash-next7-count { color: var(--text-muted); }
.dash-next7-lvl-1 { background: rgba(122, 0, 255, 0.05); }
.dash-next7-lvl-2 { background: rgba(122, 0, 255, 0.10); }
.dash-next7-lvl-3 { background: rgba(122, 0, 255, 0.16); }
:root[data-theme="light"] .dash-next7-lvl-1 { background: rgba(122, 0, 255, 0.07); }
:root[data-theme="light"] .dash-next7-lvl-2 { background: rgba(122, 0, 255, 0.13); }
:root[data-theme="light"] .dash-next7-lvl-3 { background: rgba(122, 0, 255, 0.20); }
.dash-next7-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 200px; max-width: 260px;
  background: var(--glass-strong, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 8px; z-index: 20;
  opacity: 0; pointer-events: none;
  transition: opacity .12s var(--ease-out);
}
.dash-next7-pill:hover .dash-next7-tooltip { opacity: 1; }
.dash-next7-item {
  font-size: 12px; padding: 4px 6px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-next7-item--more { color: var(--text-muted); font-style: italic; font-size: 11px; }

/* Em atraso — linha horizontal: [dias][nome + projeto][responsável]
   Blocos separados por gap generoso, cada um com propósito visual claro. */
.dash-overdue-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--surface);
  cursor: pointer; margin-bottom: 8px;
  transition: border-color .12s var(--ease-out), background .12s var(--ease-out), transform .15s var(--ease-spring);
}
.dash-overdue-row:hover {
  border-color: var(--danger, #EF4444);
  background: rgba(239, 68, 68, 0.06);
  transform: translateX(2px);
}
/* Bloco esquerdo — número grande em vermelho + label "dias" abaixo */
.dash-overdue-days {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 48px; flex-shrink: 0;
  padding: 4px 6px; border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  line-height: 1;
}
.dash-overdue-days strong {
  font-size: 22px; font-weight: 800;
  color: var(--danger, #EF4444);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.dash-overdue-days span {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--danger, #EF4444); opacity: .8;
  margin-top: 3px;
}
/* Bloco central — nome (bold) + chip do projeto abaixo */
.dash-overdue-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.dash-overdue-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  letter-spacing: -0.005em;
}
.dash-overdue-meta {
  font-size: 11.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Bloco direito — avatar + nome do responsável */
.dash-overdue-owner {
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0; max-width: 160px;
}
.dash-overdue-owner-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-overdue-owner--empty { color: var(--text-muted); font-style: italic; font-size: 12px; }
.dash-overdue-owner--empty svg { width: 12px; height: 12px; }

/* Radar de projetos — borda colorida indica status. Sem dot.
   Verde: 0 atrasadas. Amarelo: ≤ 20%. Vermelho: > 20%. */
.dash-radar-grid {
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
.dash-radar-card {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  cursor: pointer;
  transition: transform .12s var(--ease-spring), box-shadow .12s var(--ease-out), border-color .12s var(--ease-out);
}
.dash-radar-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.dash-radar-ok       { border-color: #10B981; }
.dash-radar-warn     { border-color: #FACC15; }
.dash-radar-critical { border-color: #EF4444; }
.dash-radar-body { min-width: 0; }
.dash-radar-name {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -0.005em;
}
.dash-radar-client {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-radar-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* Top responsáveis */
.dash-top-row {
  display: grid; grid-template-columns: 1fr 100px 32px;
  gap: 10px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid var(--hairline);
}
.dash-top-row:last-child { border-bottom: 0; }
.dash-top-user {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
.dash-top-user span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.dash-top-track {
  height: 6px; background: var(--surface-3);
  border-radius: 3px; overflow: hidden;
}
.dash-top-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px;
  transition: width .3s var(--ease-out);
}
.dash-top-value {
  font-size: 13px; font-weight: 700; text-align: right;
  color: var(--text); font-variant-numeric: tabular-nums;
}

/* Empty state inline (widgets pequenos) */
.dash-empty-inline {
  padding: 16px; text-align: center;
  font-size: 12.5px; color: var(--text-muted);
  border: 1px dashed var(--hairline); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Lightmode: cards do dashboard sobem pra branco puro pra separar visualmente
   do fundo cinza claro da página. Consistente com .lista-card e .rec-client-card. */
:root[data-theme="light"] .dash-kpi,
:root[data-theme="light"] .dash-widget {
  background: #FFFFFF;
}
:root[data-theme="light"] .dash-next7-pill,
:root[data-theme="light"] .dash-overdue-row,
:root[data-theme="light"] .dash-radar-card {
  background: #FAFAFA;
}

/* ── Month picker (popover com grid) ─────────────────────────────
   Usado no relatório mensal. Trigger igual ao btn-ghost, popover flutuante
   com nav de ano + 12 meses em grid 3×4. */
.month-picker { position: relative; }
.month-picker-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px; font-weight: 500; letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .12s var(--ease-out), border-color .12s var(--ease-out);
}
.month-picker-trigger:hover { background: var(--surface-3); border-color: var(--text-muted); }
.month-picker-trigger svg { width: 14px; height: 14px; color: var(--text-muted); }
.month-picker-label { min-width: 120px; text-align: left; }
.month-picker-chevron { transition: transform .15s var(--ease-out); }
.month-picker-popover {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 260px; padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  animation: mpFadeIn .16s var(--ease-out);
}
.month-picker-popover.open { display: block; }
@keyframes mpFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.month-picker-year-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.month-picker-year {
  flex: 1; text-align: center;
  font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.mp-year-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-muted);
  transition: background .12s var(--ease-out), color .12s var(--ease-out), border-color .12s var(--ease-out);
}
.mp-year-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--hairline); }
.mp-year-btn svg { width: 16px; height: 16px; }
.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.mp-month {
  padding: 10px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer;
  text-align: center;
  transition: background .12s var(--ease-out), color .12s var(--ease-out), border-color .12s var(--ease-out);
}
.mp-month:hover { background: var(--surface-2); border-color: var(--hairline); }
.mp-month.is-current {
  color: var(--accent-text);
  border-color: var(--accent-text);
}
.mp-month.is-selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.mp-month.is-selected:hover { background: var(--accent); }
.month-picker-actions {
  display: flex; justify-content: flex-end;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

/* ── Estilos de impressão / PDF (Ctrl+P nativo) ─────────────────────
   Esconde sidebar, topbar, toolbar; força fundo branco e texto preto pra
   PDF ficar legível. Não é 100% pixel-perfect, mas cobre 95% dos casos. */
@media print {
  .no-print, .sidebar, .topbar, #toast-container { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .main { margin-left: 0 !important; }
  .page-body { padding: 0 !important; max-width: none !important; }
  #client-report-view {
    background: #fff; color: #000;
    padding: 20px 24px;
  }
  .report-header, .report-kpi, .report-table, .client-info-card {
    background: #fff !important;
    border-color: #d4d4d8 !important;
    box-shadow: none !important;
  }
  .report-table th { background: #f4f4f5 !important; color: #52525b !important; }
  .report-header-title, .report-kpi-value, .report-bar-label, .report-bar-user, .report-bar-value, .report-td-name {
    color: #18181b !important;
  }
  .report-header-eyebrow { color: #7A00FF !important; }
  .report-bar-track { background: #e4e4e7 !important; }
  .report-bar-fill  { background: #7A00FF !important; }
  .report-section { page-break-inside: avoid; break-inside: avoid; }
  .report-table tr, .report-bar-row { page-break-inside: avoid; break-inside: avoid; }
  a { color: #7A00FF !important; text-decoration: none !important; }
}

/* TOAST */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 13px 18px; font-size: 13px; font-weight: 500; min-width: 240px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: toastIn .35s var(--ease-spring);
  letter-spacing: -0.005em;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-warn { border-left: 3px solid var(--warn); }
.toast-error { border-left: 3px solid var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: var(--danger); color: #fff; border-radius: var(--radius-pill); font-size: 10px; font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ───────────────────────────────────────────────
   v3 — Workspaces, horas, comentários, drag-stages
   ─────────────────────────────────────────────── */

/* Workspace switcher na sidebar */
.ws-switch { padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.ws-switch .filter-label { margin-bottom: 6px; }
.ws-switch.single { display: none; }
/* Workspace cdrop ocupa toda a largura disponível */
.ws-cdrop { min-width: 0; width: 100%; }
.ws-cdrop .filter-cdrop-trigger { width: 100%; min-width: 0; padding: 0 10px 0 12px; }
.ws-trigger-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Faixa colorida do workspace ativo no topo da sidebar (ambient awareness) */
.sidebar { border-top: 3px solid var(--current-ws-color, var(--accent)); }

/* Scroll fades — gradient de transparência nas bordas de containers scrolláveis,
   indica que tem mais conteúdo. Padrão Apple visto em macOS/iOS. */
.sidebar-nav,
.kanban-column-body,
.notif-list,
.comment-list {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
/* Em containers com scroll horizontal */
.kanban-board {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

/* Larguras de modal */
.modal-sm { max-width: 540px; }
.modal-md { max-width: 720px; }
.modal-lg { max-width: 960px; }
.modal-xl { max-width: 1100px; }

/* Checklist de workspaces (modal usuário) */
.ws-checklist { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-chip-check {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px;
  font-size: 12px; color: var(--text-dim); cursor: pointer; transition: all .15s; user-select: none;
}
.ws-chip-check:hover { border-color: var(--border-active); }
.ws-chip-check input { accent-color: var(--accent-text); cursor: pointer; }
.ws-chip-check.on { background: var(--accent-dim); border-color: var(--accent-text); color: var(--accent-text); }

/* Custom user-select (com avatar) */
.user-select { position: relative; }
.user-select-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 16px 8px 12px; border-radius: var(--radius-sm); font-family: inherit; font-size: 13px;
  transition: border-color .2s; text-align: left;
  min-height: 48px; box-sizing: border-box;
}
/* Chevron do user-select — empurrado pra direita pelo margin-left auto, com respiro do margin direito do botão */
.user-select-btn > i[data-lucide="chevron-down"] { margin-left: auto; opacity: 0.6; flex-shrink: 0; }
/* No modal de demanda, Prioridade (filter-cdrop) e Responsável (user-select)
   ficam lado a lado — alinhamos a altura visual pra evitar campos desencontrados. */
#demand-modal .filter-cdrop-trigger { height: 48px; }
.user-select-btn:hover { border-color: var(--border-active); }
.user-select-btn .chev { margin-left: auto; color: var(--text-muted); font-size: 10px; }
.user-select-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0,0,0,.5); max-height: 260px; overflow-y: auto; padding: 4px;
  display: none;
}
.user-select.open .user-select-menu { display: block; }
.user-select.drop-up .user-select-menu { top: auto; bottom: calc(100% + 4px); }
.user-select-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; transition: background .12s;
}
.user-select-opt:hover { background: var(--surface-2); }
.user-select-opt.sel { background: var(--accent-dim); }
.user-mini { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.user-mini-name { font-weight: 600; }
.user-mini-role { font-size: 11px; color: var(--text-muted); }

/* Avatar nas células */
.cell-user { display: flex; align-items: center; gap: 8px; }

/* Apontamento de horas — dashboard */
.hours-board { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) { .hours-board { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1700px) { .hours-board { grid-template-columns: 360px 1fr; } }
.hours-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.hours-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.hours-total-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.hours-total-label { font-size: 12px; color: var(--text-muted); }
.hours-stage-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.hours-stage-row:first-of-type { border-top: none; }
.hours-stage-name { font-size: 12px; flex: 1; display: flex; align-items: center; gap: 7px; }
.hours-stage-bar { flex: 1.4; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.hours-stage-fill { height: 100%; border-radius: 3px; }
.hours-stage-val { font-size: 12px; font-weight: 700; min-width: 48px; text-align: right; }
.hours-demand-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.hours-demand-row:first-of-type { border-top: none; }
.hours-demand-name { flex: 1; font-weight: 500; cursor: pointer; }
.hours-demand-name:hover { color: var(--accent-text); }
.hours-demand-user { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); }
.hours-demand-user .avatar { width: 22px; height: 22px; font-size: 9px; }
.hours-demand-val { font-weight: 700; }
.hours-empty { font-size: 12px; color: var(--text-muted); padding: 8px 0; }

/* Editor de fluxo — etapas arrastáveis */
.stage-row {
  /* grip | color | label | função | responsável | prazo | conclui | ações */
  display: grid; grid-template-columns: 22px 34px minmax(140px, 1.4fr) minmax(140px, 1fr) minmax(160px, 1.1fr) 78px auto auto;
  gap: 8px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition:
    opacity .18s var(--ease-out),
    border-color .15s var(--ease-out),
    box-shadow .18s var(--ease-out),
    transform .18s var(--ease-spring),
    background .15s var(--ease-out);
}
/* Inputs/selects dentro da row não participam do drag — evita roubar o
   mousedown de seleção de texto pro dragstart do row draggable=true. */
.stage-row input,
.stage-row select,
.stage-row textarea,
.stage-row button,
.stages-edit-row input,
.stages-edit-row select,
.stages-edit-row textarea,
.stages-edit-row button {
  -webkit-user-drag: none;
  user-select: text;
}
.stage-row.dragging {
  opacity: .5;
  border-color: var(--accent-text);
  transform: scale(.985);
  box-shadow: 0 8px 22px rgba(0,0,0,.10);
}
.stage-row.drag-over {
  border-color: var(--accent-text);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-dim), inset 0 2px 0 0 var(--accent-text);
}
.stage-grip {
  cursor: grab; color: var(--text-muted); text-align: center; font-size: 14px;
  user-select: none; line-height: 1;
  transition: color .12s var(--ease-out), transform .12s var(--ease-out);
}
.stage-grip:hover { color: var(--text); }
.stage-grip:active { cursor: grabbing; transform: scale(1.15); }
.stage-row .stage-mini-label { font-size: 9px; color: var(--text-muted); display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .04em; }
.stage-days-wrap { display: flex; flex-direction: column; }
.stage-days-wrap input { width: 90px; }
/* Editor de fluxo: native select fica oculto e o .filter-cdrop irmão assume.
   Garante que o cdrop ocupe espaço adequado no grid da stage-row. */
.stage-row .filter-cdrop { min-width: 200px; }

/* Detalhe — apontamentos e comentários */
.detail-section { margin-top: 20px; }
.detail-section-title { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.owner-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.owner-current { display: flex; align-items: center; gap: 10px; }
.owner-current .user-mini-name { font-size: 14px; }

.move-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.move-arrow { width: 40px; height: 40px; font-size: 16px; padding: 0; justify-content: center; }
.move-current { flex: 1; text-align: center; font-size: 12px; color: var(--text-dim); min-width: 120px; }
.move-current strong { display: block; font-size: 14px; color: var(--text); margin-top: 2px; }

.time-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.time-item {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px;
}
.time-item .ti-hours { font-weight: 700; color: var(--accent-text); }
.time-item .ti-meta { color: var(--text-muted); flex: 1; }
.time-item .ti-del { margin-left: auto; }
.time-form { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 640px) { .time-form { grid-template-columns: 1fr 1fr; } }

.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
}
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-author { font-size: 12px; font-weight: 700; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-actions { margin-left: auto; display: flex; gap: 2px; }
.comment-act { font-size: 13px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; opacity: .5; }
.comment:hover .comment-act { opacity: 1; }
.comment-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.comment-text a { color: var(--accent-text); }
.comment-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.comment-img-wrap { border-radius: var(--radius-sm); overflow: hidden; max-width: 320px; cursor: pointer; }
.comment-img { display: block; max-width: 100%; border-radius: var(--radius-sm); }
.comment-file {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: var(--surface-3); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--accent-text); text-decoration: none;
}
.comment-file:hover { background: var(--accent-dim); }
.mention { color: var(--accent-text); font-weight: 600; }
.comment-compose { position: relative; }
.comment-compose textarea { resize: vertical; min-height: 64px; }
.comment-compose-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.comment-attach-btns { display: flex; gap: 4px; }
.comment-pending-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pending-file {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  background: var(--surface-3); border-radius: var(--radius-sm); font-size: 11px;
}
.pending-thumb { height: 24px; border-radius: 3px; }
.mention-pop {
  position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(0,0,0,.5); padding: 4px;
  max-height: 200px; overflow-y: auto; min-width: 200px; display: none;
}
.mention-pop.open { display: block; }
.mention-opt { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; }
.mention-opt:hover, .mention-opt.active { background: var(--accent-dim); }

.detail-actions-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }

/* ─── NOTIFICAÇÕES ─── */
.notif-wrap { position: relative; }
/* Topbar: zen e notificações ficam com a mesma "caixa" 36x36 pra alinhar visualmente */
.topbar-actions .zen-toggle-btn,
.topbar-actions .notif-bell {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.notif-bell { transition: color .15s var(--ease-out); }
.notif-bell.has-unread { color: var(--accent-text); }
.notif-bell.pulse { animation: bellShake .55s var(--ease-spring); transform-origin: top center; }
@keyframes bellShake {
  0%   { transform: rotate(0); }
  20%  { transform: rotate(-14deg); }
  40%  { transform: rotate(10deg); }
  60%  { transform: rotate(-6deg); }
  80%  { transform: rotate(3deg); }
  100% { transform: rotate(0); }
}
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
  transition: box-shadow .2s var(--ease-out);
}
.notif-badge.has-unread {
  box-shadow: 0 0 0 2px var(--surface), 0 0 12px rgba(239,80,80,0.55);
}
.notif-badge.pop { animation: badgePop .35s var(--ease-spring); }
@keyframes badgePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.notif-panel {
  position: absolute; top: calc(100% + 6px); right: 0; width: 380px; max-height: 440px;
  /* Frost panel: surface sólido (escapa do quirk de backdrop-filter aninhado dentro
     da topbar que também tem backdrop-filter — Chromium ignora o do filho), com
     highlight sutil no topo pra dar a sensação de "vidro fosco capturando luz". */
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0) 40%),
    var(--surface);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  z-index: 200; display: none;
  flex-direction: column; overflow: hidden;
  isolation: isolate;
}
:root[data-theme="light"] .notif-panel {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0) 40%),
    var(--surface);
}
.notif-panel.open { display: flex; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.notif-panel-title { font-size: 14px; font-weight: 700; }
.notif-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.notif-item {
  display: flex; gap: 10px; padding: 12px 18px; cursor: pointer;
  transition: background .15s;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-dim); }
.notif-item.unread:hover { background: rgba(122,0,255,.22); }
.notif-dot-wrap { width: 10px; flex-shrink: 0; padding-top: 6px; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: block;
}
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; line-height: 1.5; color: var(--text); }
.notif-text strong { font-weight: 600; }
.notif-comment {
  margin-top: 4px; font-size: 11px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-empty { padding: 32px 18px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ── DETALHE DA DEMANDA (novo layout) ── */
.detail-modal-shell { display: flex; flex-direction: column; padding: 0; max-height: 92vh; }
.detail-modal-shell .detail-content { flex: 1; overflow-y: auto; }
.detail-head {
  position: sticky; top: 0; background: var(--surface); z-index: 2;
  padding: 22px 28px 16px; border-bottom: 1px solid var(--border);
}
.detail-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.detail-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.detail-head-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.detail-head-meta .meta-sep { color: var(--text-muted); }
.detail-head-actions { display: flex; gap: 4px; }
.detail-icon-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.detail-icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.detail-icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: rgba(239,68,68,.08); }
.detail-icon-btn.on { background: var(--accent-dim); color: var(--accent-text); border-color: var(--accent); }

/* Editor de etapas por instância (sub-view do modal de demanda) */
.stages-edit-hint {
  font-size: 12.5px; line-height: 1.6; color: var(--text-dim);
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 18px; border-left: 3px solid var(--accent);
}
.stages-edit-list { display: flex; flex-direction: column; gap: 6px; }
.stages-edit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  user-select: none;
  transition:
    background .12s var(--ease-out),
    border-color .12s var(--ease-out),
    opacity .15s var(--ease-out),
    box-shadow .18s var(--ease-out),
    transform .18s var(--ease-spring);
}
.stages-edit-row:hover { background: var(--surface-3); }
.stages-edit-row.off { opacity: 0.55; }
.stages-edit-row.off .stages-edit-label-input { text-decoration: line-through; color: var(--text-muted); }
.stages-edit-row.locked { background: var(--surface); }
.stages-edit-row.locked:hover { background: var(--surface); }
.stages-edit-row.dragging {
  opacity: .45;
  border-color: var(--accent);
  transform: scale(.985);
  box-shadow: 0 8px 22px rgba(0,0,0,.10);
}
.stages-edit-row.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-dim), inset 0 2px 0 0 var(--accent);
}
.stages-edit-grip {
  cursor: grab; color: var(--text-muted); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 32px;
  transition: color .12s var(--ease-out), transform .12s var(--ease-out);
}
.stages-edit-grip:hover { color: var(--text); }
.stages-edit-grip:active { cursor: grabbing; transform: scale(1.15); }
.stages-edit-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}
.stages-edit-row input[type="checkbox"]:disabled { cursor: not-allowed; }
.stages-edit-num {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  width: 24px; text-align: center; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.stages-edit-label-input {
  flex: 1; min-width: 120px;
  height: 36px; padding: 0 10px; font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid transparent;
}
.stages-edit-label-input:hover { background: var(--surface-3); border-color: var(--hairline); }
.stages-edit-label-input:focus { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-focus); }
.stages-edit-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; flex-shrink: 0; }
.stages-edit-resp-wrap { width: 220px; flex-shrink: 0; }
.stages-edit-resp-wrap .filter-cdrop { min-width: 100%; }
.stages-edit-resp-wrap .filter-cdrop-trigger { height: 36px; }
.stages-edit-row.off .stages-edit-resp-wrap { pointer-events: none; opacity: 0.6; }
@media (max-width: 900px) {
  .stages-edit-row { flex-wrap: wrap; }
  .stages-edit-label-input { flex-basis: 100%; order: -1; }
  .stages-edit-resp-wrap { width: 100%; }
}

.detail-body { padding: 22px 28px 28px; }

.detail-pipeline-wrap { padding: 16px 4px 22px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }

.detail-fields-row {
  display: grid; gap: 18px;
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 22px;
  align-items: end;
}
@media (max-width: 760px) { .detail-fields-row { grid-template-columns: 1fr; } }
.detail-field { display: flex; flex-direction: column; gap: 8px; }
.detail-field-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.detail-field-value { font-size: 14px; font-weight: 600; color: var(--text); }

.owner-picker {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color .15s; height: 48px;
}
.owner-picker:hover { border-color: var(--accent-text); }
.owner-picker .avatar { width: 28px; height: 28px; font-size: 11px; flex-shrink: 0; }
.owner-picker .owner-name { flex: 1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text); }
.owner-picker .caret { color: var(--text-muted); display: flex; align-items: center; }

.date-input-wrap { position: relative; display: flex; align-items: center; }
.date-input-wrap input[type="date"],
.date-input-wrap input[type="datetime-local"] {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 38px 10px 14px; border-radius: 10px; font-size: 13px; color: var(--text); width: 100%;
  height: 48px; box-sizing: border-box;
  font-family: inherit;
}
.date-input-wrap input:focus { border-color: var(--accent-text); outline: none; }
.date-input-icon {
  position: absolute; right: 12px; color: var(--text-muted); pointer-events: none;
}
.date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator,
.date-input-wrap input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 0; position: absolute; right: 0; width: 38px; height: 100%; cursor: pointer;
}

.detail-meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-bottom: 22px;
}
@media (max-width: 760px) { .detail-meta-grid { grid-template-columns: repeat(2, 1fr); } }

.detail-section-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 22px; margin-bottom: 22px;
}
.detail-section-block .field-head { display: flex; justify-content: space-between; align-items: flex-start; }
.detail-section-block .field-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.detail-briefing-link { font-size: 14px; color: var(--text); }
.detail-description { font-size: 13px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }

.detail-section-divider { margin: 28px 0 18px; height: 1px; background: var(--border); }

.detail-section-heading { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.detail-section-heading-total { color: var(--text-dim); font-size: 11px; }

/* Apontamentos rows — espaçamento balanceado entre início/fim */
.appt-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px;
}
.appt-row .appt-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; min-width: 130px; }
.appt-row .appt-hours { color: var(--accent-text); font-weight: 700; font-size: 13px; min-width: 56px; }
.appt-row .appt-time-range { display: flex; align-items: center; gap: 14px; flex: 1; justify-content: center; }
.appt-row .appt-range { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.appt-row .appt-arrow { color: var(--text-muted); }
.appt-row .appt-actions { display: flex; gap: 4px; margin-left: auto; }
.appt-row .pill { white-space: nowrap; }

/* Sticky footer com início/término/horas | etapa — duas seções equilibradas */
.detail-footer {
  position: sticky; bottom: 0; background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 28px; z-index: 2;
  display: grid; grid-template-columns: 1fr 1px 1fr; gap: 24px; align-items: stretch;
}
.detail-footer-section { display: flex; gap: 14px; align-items: end; }
.detail-footer-section:first-of-type { grid-column: 1; }
.detail-footer-section.detail-footer-stage { grid-column: 3; }
.detail-footer-sep { width: 1px; background: var(--border); align-self: stretch; grid-column: 2; }
@media (max-width: 880px) {
  .detail-footer { display: flex; flex-direction: column; }
  .detail-footer-sep { width: 100%; height: 1px; }
}
.detail-footer-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.detail-footer-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.detail-footer-stage-controls { display: flex; align-items: center; gap: 8px; }

/* Grupo Horas: input + cronômetro (juntos). Botão + fica separado como
   ação independente (visualmente destacado do timer). */
.hours-input-group {
  display: flex; align-items: stretch; height: 48px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.hours-input-group input {
  width: 70px; background: transparent; border: 0; padding: 0 12px;
  font-size: 13px; color: var(--text); height: 100%;
}
.hours-input-group input:focus { outline: none; }
/* Botão de apontar horas (check) — standalone, mesmo tamanho dos outros elementos */
.hours-add-btn {
  height: 48px; width: 48px; padding: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hours-timer-btn {
  border-radius: 0; border: 0; border-left: 1px solid var(--border);
  height: 100%; padding: 0; min-width: 44px;
  background: transparent; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.hours-timer-btn:hover { background: var(--surface-3); color: var(--text); }
.hours-timer-btn.running {
  background: var(--danger-dim); color: var(--danger);
}
.timer-display {
  margin-top: 6px; font-family: 'SF Mono', ui-monospace, 'Roboto Mono', monospace;
  font-size: 13px; font-weight: 600; color: var(--accent-text);
  text-align: center; letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.timer-display::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); display: inline-block;
  animation: timerpulse 1.4s ease-in-out infinite;
}
@keyframes timerpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.detail-footer-arrow {
  width: 44px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-dim); font-size: 14px; cursor: pointer; transition: all .15s;
  flex-shrink: 0;
}
.detail-footer-arrow:hover:not(:disabled) { background: var(--accent-dim); color: var(--accent-text); border-color: var(--accent-text); }
.detail-footer-arrow.primary { background: var(--accent); border-color: var(--accent-text); color: #fff; }
.detail-footer-arrow.primary:hover:not(:disabled) { background: #5b53d9; }
.detail-footer-arrow:disabled { opacity: .35; cursor: not-allowed; }

/* Custom dropdown padronizado */
.cdrop { position: relative; }
.cdrop-trigger {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color .15s; width: 100%; height: 48px;
  font-size: 13px; color: var(--text); box-sizing: border-box;
}
.cdrop-trigger:hover { border-color: var(--accent-text); }
.cdrop-trigger .cdrop-label { flex: 1; text-align: left; font-weight: 600; }
.cdrop-trigger .cdrop-caret { color: var(--text-muted); font-size: 10px; }
.cdrop-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.55); padding: 6px;
  max-height: 320px; overflow-y: auto; display: none;
}
.cdrop.open .cdrop-menu { display: block; }
.cdrop-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: 7px; cursor: pointer; font-size: 13px;
}
.cdrop-item:hover { background: var(--surface-2); }
.cdrop-item.active { background: var(--accent-dim); color: var(--accent-text); }
.cdrop-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Confirm modal danger style */
.modal.modal-danger .modal-title { color: var(--danger); }
#confirm-modal .modal-body { padding-top: 14px; padding-bottom: 22px; }

/* ── LUCIDE ICONS ── */
[data-lucide] { display: inline-block; vertical-align: middle; }
i.ic-xs [data-lucide],
i.ic-xs { width: 12px; height: 12px; stroke-width: 2.5; }
/* Cabeçalhos sortáveis: ícone padrão 16px + opacity baixa pra não competir
   com o título. O <i> é substituído por <svg.lucide-chevrons-up-down> depois
   do lucide.createIcons(), por isso miramos AMBOS pra cobrir os 2 estados. */
th i[data-lucide="chevrons-up-down"],
th svg.lucide-chevrons-up-down {
  width: 16px !important; height: 16px !important;
  opacity: 0.45; margin-left: 6px; vertical-align: middle; flex-shrink: 0;
}
th:hover i[data-lucide="chevrons-up-down"],
th:hover svg.lucide-chevrons-up-down { opacity: 0.85; }
i.ic-sm [data-lucide],
i.ic-sm { width: 16px; height: 16px; stroke-width: 2; }
i.ic-md [data-lucide],
i.ic-md { width: 20px; height: 20px; stroke-width: 2; }
i.ic-lg [data-lucide],
i.ic-lg { width: 24px; height: 24px; stroke-width: 2; }
i[data-lucide]:not([class*=ic-]) { width: 16px; height: 16px; stroke-width: 2; }
.modal-close i, .detail-icon-btn i { width: 16px; height: 16px; }
.detail-footer-arrow i { width: 18px; height: 18px; stroke-width: 2.5; }

/* ── DASHBOARD CHART SVG ── */
.dash-chart-svg { width: 100%; height: auto; display: block; }

/* ── ANEXOS DE DEMANDA ── */
.demand-att-wrap { display: flex; flex-direction: column; gap: 10px; }
.demand-att-list { display: flex; flex-direction: column; gap: 6px; }
.demand-att-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  transition: border-color .15s;
}
.demand-att-item:hover { border-color: var(--text-dim); }
.demand-att-name {
  flex: 1; color: var(--text); text-decoration: none; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.demand-att-name:hover { color: var(--accent-text); text-decoration: underline; }
.demand-att-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; cursor: pointer; }
.demand-att-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Botões de anexo do modal de demanda — caixas paralelas (Arquivo / Imagem / Link) */
.demand-att-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.demand-att-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.demand-att-btn:hover { border-color: var(--accent-text); background: var(--surface-3, var(--surface-2)); }
.demand-att-btn i,
.demand-att-btn svg { color: var(--text-muted); width: 16px !important; height: 16px !important; flex-shrink: 0; }

/* ─── Color picker custom (substitui input[type=color] nativo) ───
   Trigger é um botão quadrado com a cor de fundo; popover abre um grid 4x4
   de swatches da paleta do design system. Hidden input mantém compat com JS
   que lê .value e escuta 'input'. */
.color-swatch-trigger {
  width: 40px; height: 40px; flex-shrink: 0;
  border: 2px solid var(--hairline); border-radius: var(--radius-sm);
  cursor: pointer; padding: 0; position: relative;
  transition: border-color .12s, transform .1s var(--ease-spring);
  background-clip: padding-box;
}
.color-swatch-trigger:hover { border-color: var(--text-muted); transform: scale(1.04); }
.color-swatch-trigger:active { transform: scale(0.96); }
.color-swatch-trigger.is-open { border-color: var(--accent); }

.color-picker-popover {
  position: fixed; z-index: 9999;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xl);
  padding: 12px;
  display: none;
}
.color-picker-popover.open { display: block; }
.color-picker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.color-swatch {
  width: 32px; height: 32px;
  border: none; border-radius: var(--radius-sm); cursor: pointer; padding: 0;
  position: relative;
  transition: transform .1s var(--ease-spring);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch svg { display: none; }
.color-swatch.is-selected::after {
  content: ''; position: absolute; inset: -4px;
  border: 2px solid var(--accent); border-radius: calc(var(--radius-sm) + 3px);
}
.color-swatch.is-selected svg {
  display: block;
  position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px; color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

/* ─── Modal Nova Demanda Personalizada (wizard 2 steps) ───
   Step 1: flow picker (Recentes + Todos os fluxos + search)
   Step 2: form (nome, descrição, briefing, anexos, checklist, prioridade, resp)
   Pill FLUXO no topo direito volta pro picker. Breadcrumb no step 2. */
.persona-header { align-items: center; }
.persona-header-left {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap; flex: 1; min-width: 0;
}
.persona-header-right { display: flex; align-items: center; gap: 12px; }
.persona-subtitle {
  font-size: 14px; color: var(--text-muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 400px;
}
.persona-flow-pill {
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer;
  max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .12s, border-color .12s;
}
.persona-flow-pill:hover { background: var(--surface-3); border-color: var(--accent); }
.persona-step { min-height: 400px; }
.persona-step-title {
  text-align: center; font-size: 22px; font-weight: 700;
  color: var(--text); margin: 8px 0 24px;
  letter-spacing: -0.01em;
}
.persona-flow-section { margin-bottom: 18px; }
.persona-flow-section-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.persona-flow-section-title {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.persona-flow-section-sep {
  flex: 1; height: 1px; background: var(--hairline);
}
.persona-breadcrumb {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}

/* ─── Lucide icon picker (biblioteca de ícones) ─────────────
   Grid denso de ícones com hover state. Search filtra por nome. */
.lucide-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  max-height: 60vh; overflow-y: auto;
  padding: 4px;
  contain: layout paint;
}
.lucide-picker-item {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; padding: 12px;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-dim);
  transition: background .12s, color .12s, border-color .12s, transform .1s var(--ease-spring);
}
.lucide-picker-item:hover {
  background: var(--surface-3); color: var(--text);
  border-color: var(--hairline); transform: scale(1.08);
}
.lucide-picker-item.is-selected {
  background: var(--accent-dim); color: var(--accent-text);
  border-color: var(--accent);
}
.lucide-picker-item svg { width: 22px; height: 22px; }
.lucide-picker-item.hidden { display: none; }
:root[data-theme="light"] .lucide-picker-item { background: #FAFAFA; }
:root[data-theme="light"] .lucide-picker-item:hover { background: #F0F0F0; }

/* ─── Entregáveis (3 contagens) ───
   Modal: grid de 3 inputs com label embaixo + tooltip "?". Tabelas: pill compacta. */
.qty-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
/* 3 contadores estreitos + 1 select largo (cabe nome do user inteiro) */
.qty-grid-4 { grid-template-columns: 0.6fr 0.6fr 0.6fr 2fr; }
.qty-cell { display: flex; flex-direction: column; gap: 4px; }
.qty-cell .form-control { font-variant-numeric: tabular-nums; font-weight: 600; }
.qty-cell input.form-control[type="number"] { text-align: center; }
.qty-cell select.form-control { font-weight: 500; padding: 0 14px; }
.qty-cell-label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.04em; text-align: center; display: inline-flex;
  align-items: center; justify-content: center; gap: 5px;
}
.qty-cell-hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-muted);
  font-size: 9px; font-weight: 700; cursor: help;
}
.qty-cell-hint:hover { background: var(--accent-dim); color: var(--accent-text); }

/* Célula compacta nas tabelas: 3 números separados por · */
.qty-cell-compact {
  display: inline-flex; align-items: center; gap: 4px;
  font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-dim);
  white-space: nowrap;
}
.qty-cell-compact .qty-num { color: var(--text); font-weight: 600; min-width: 16px; text-align: center; }
.qty-cell-compact .qty-sep { color: var(--text-muted); opacity: 0.6; }
.qty-cell-empty { color: var(--text-muted); }

/* Tabelas com a coluna extra ficam apertadas — reduz 1px na fonte das células */
.table-wrap table td { font-size: 12.5px; }
.table-wrap table th { font-size: 11px; }

/* ─── AGENDA ───────────────────────────────────────────
   Grade tipo planilha: HORÁRIO (1 col fixa) × N dias úteis.
   Cada linha = 30min. Blocos posicionados absolutamente sobre as células.
   2 semanas lado a lado mostra 10 colunas de dia. */
.agenda-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.agenda-toolbar .form-label { margin: 0; }
.agenda-user-pick { display: flex; align-items: center; gap: 8px; }
.agenda-user-pick select { min-width: 220px; }
.agenda-week-nav { display: flex; align-items: center; gap: 6px; }
.agenda-week-label { font-size: 13px; color: var(--text); font-weight: 600; min-width: 220px; text-align: center; }
.agenda-spacer { flex: 1; }
.agenda-view-toggle { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: var(--radius-sm); }
.agenda-view-btn { font-size: 12px !important; padding: 5px 11px !important; }
.agenda-view-btn.active { background: var(--accent-dim) !important; color: var(--accent-text) !important; }
.agenda-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.6; }

.agenda-grid-wrap { width: 100%; overflow-x: auto; }
.agenda-grid {
  display: grid;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  user-select: none;
}
.agenda-cell {
  border-right: 1px solid var(--hairline);
  /* Subdivisão de 15min — borda inferior visível em TODAS as células (cada
     linha é 15min). As intensidades sobem em :30 (is-half-hour) e :00 (is-hour). */
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: var(--surface);
  position: relative;
  min-height: 26px;
}
:root[data-theme="light"] .agenda-cell { border-bottom-color: rgba(0,0,0,0.04); }
.agenda-cell.is-time {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 8px;
  display: flex; align-items: flex-start; justify-content: flex-end;
  font-family: 'JetBrains Mono', monospace;
  position: sticky; left: 0; z-index: 2;
}
.agenda-cell.is-half { background: var(--surface-2); opacity: 0.5; }
/* Granularidade de 15min: hora cheia ganha borda superior mais forte;
   :30 fica intermediário; :15/:45 mantêm a borda fina padrão. */
/* Hierarquia visual da grade — 3 níveis pra dar ritmo temporal sem poluir.
   Aplicam-se na border-TOP (topo do slot que cruza o limite). */
.agenda-cell.is-half-hour { border-top: 1px solid rgba(255,255,255,0.07); }
.agenda-cell.is-hour      { border-top: 1px solid rgba(255,255,255,0.18); }
:root[data-theme="light"] .agenda-cell.is-half-hour { border-top-color: rgba(0,0,0,0.07); }
:root[data-theme="light"] .agenda-cell.is-hour      { border-top-color: rgba(0,0,0,0.16); }
/* Almoço — removido o destaque listrado (poluía a grade). Mantemos o
   horário marcável normalmente, sem cor especial. */
.agenda-cell.is-lunch { background: var(--surface); }
.agenda-cell.is-day-header {
  background: var(--surface-2); color: var(--text); font-weight: 600;
  font-size: 11px; padding: 8px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-transform: uppercase; letter-spacing: 0.05em;
  position: sticky; top: 0; z-index: 3;
  border-bottom: 1px solid var(--border);
}
.agenda-cell.is-day-header.is-today { background: var(--accent-dim); color: var(--accent-text); }
.agenda-cell.is-day-header .day-date { font-size: 13px; font-weight: 700; letter-spacing: 0; }
.agenda-cell.is-day-header .day-cap {
  font-size: 9.5px; font-weight: 500; color: var(--text-muted); margin-top: 2px;
  letter-spacing: 0;
}
.agenda-cell.is-day-header .day-cap.over { color: var(--danger); }
.agenda-cell.is-day-header .day-cap.high { color: var(--warn, #F59E0B); }

.agenda-corner {
  background: var(--surface-2);
  position: sticky; top: 0; left: 0; z-index: 4;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--hairline);
}

.agenda-cell.drop-target { background: var(--accent-dim); }
/* Divisória entre semanas — coluna estreita com listras pra deixar claro o corte */
.agenda-cell.is-week-gap {
  background: repeating-linear-gradient(180deg, var(--surface-2), var(--surface-2) 4px, var(--surface) 4px, var(--surface) 8px);
  pointer-events: none;
}
.agenda-cell.is-day-header.is-week-gap { background: var(--surface-2); }

/* Bloco posicionado sobre as células do grid.
   IMPORTANTE: posicionado como item de grid (sem `position: absolute`), pra que
   `grid-row: start / end` realmente determine a ALTURA do bloco. Antes, com
   position:absolute sem top/bottom, o bloco caía pra altura natural do conteúdo
   (texto), independente de quanto tempo a demanda durava — bug do "card só
   mostra 30 min mesmo agendado das 10:30 às 18:00". */
.agenda-block {
  border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 11px; margin: 0 2px;
  color: #fff; cursor: grab; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: box-shadow .12s;
  position: relative; /* base pros filhos absolutos (actions, resize) */
  z-index: 5;
}
.agenda-block:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.15); }
/* Durante o drag, o bloco precisa ser TRANSPARENTE a eventos de mouse pra que
   `document.elementFromPoint` enxergue a célula embaixo (em vez do próprio
   bloco). Sem isso, o resize só "subia" — não tinha como encolher porque o
   cursor passava por cima do bloco e nunca achava o slot alvo. */
.agenda-block.dragging { cursor: grabbing; opacity: 0.6; z-index: 20; pointer-events: none; }
.agenda-block-name { font-weight: 600; line-height: 1.25; word-break: break-word; }
.agenda-block-project { font-size: 10px; opacity: 0.85; line-height: 1.2; margin-top: 1px; }
/* Handle de redimensionar — sempre visível, mais alto e descoberta clara */
.agenda-block-resize {
  position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  cursor: ns-resize; z-index: 5;
  background: linear-gradient(0deg, rgba(0,0,0,0.18), rgba(0,0,0,0));
}
.agenda-block-resize::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; width: 28px; height: 3px;
  transform: translateX(-50%); background: rgba(255,255,255,0.55); border-radius: 2px;
  opacity: 0; transition: opacity .12s, background .12s, width .12s;
}
/* Só aparece quando o usuário passa o mouse sobre o bloco */
.agenda-block:hover .agenda-block-resize::after { opacity: 1; }
.agenda-block-resize:hover::after { background: rgba(255,255,255,1); width: 36px; opacity: 1; }
/* Ações do bloco (editar/excluir) — aparecem no hover, top-right */
.agenda-block-actions {
  position: absolute; top: 3px; right: 3px;
  display: flex; gap: 2px;
  opacity: 0; transition: opacity .12s;
  z-index: 2;
}
.agenda-block:hover .agenda-block-actions { opacity: 1; }
.agenda-block-action {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); color: rgba(255,255,255,0.95);
  border: none; border-radius: 4px; cursor: pointer; padding: 0;
}
.agenda-block-action:hover { background: rgba(0,0,0,0.6); }
.agenda-block-action.danger:hover { background: var(--danger); }

/* Ghost durante drag-to-create */
.agenda-ghost {
  position: absolute; left: 2px; right: 2px;
  background: var(--accent-dim);
  border: 1px dashed var(--accent-text);
  border-radius: var(--radius-sm);
  z-index: 6; pointer-events: none;
}

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

/* ── AUTO-LINKS dentro de texto ── */
.auto-link { color: var(--accent-text); text-decoration: underline; word-break: break-all; }
.auto-link:hover { color: #fff; }

/* ── Modal de Projeto: avatar centralizado ── */
.project-avatar-wrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 20px; gap: 4px;
}
.project-avatar-wrap .avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.project-avatar-wrap .avatar-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── Divider entre ações do header do detalhe ── */
.detail-head-divider {
  width: 1px; height: 22px; background: var(--border); margin: 0 2px;
}

/* ── HISTÓRICO DA DEMANDA ── */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.history-item .avatar { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; }
.history-body { flex: 1; min-width: 0; }
.history-text { font-size: 13px; line-height: 1.55; color: var(--text); }
.history-text strong { font-weight: 600; }
.history-text em { color: var(--text-dim); font-style: italic; }
.history-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Row actions com fade no hover ── */
.row-actions {
  display: flex; gap: 4px; justify-content: flex-end;
  opacity: 0; transition: opacity .15s ease;
}
tr.row-hover-actions:hover .row-actions { opacity: 1; }


/* ── CAPACIDADE ── */
.capacity-hint { color: var(--text-muted); font-size: 12px; margin-bottom: 16px; line-height: 1.5; }
.capacity-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px;
}
@media (max-width: 760px) { .capacity-summary { grid-template-columns: 1fr; } }
.capacity-summary-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px;
}
.capacity-summary-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.capacity-summary-value { font-size: 24px; font-weight: 700; margin: 4px 0; }
.capacity-summary-sub { font-size: 11px; color: var(--text-muted); }
.capacity-rows { display: flex; flex-direction: column; gap: 10px; }
.capacity-row {
  display: grid; grid-template-columns: minmax(180px, 1.5fr) 2fr 1.5fr; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px;
}
@media (max-width: 880px) {
  .capacity-row { grid-template-columns: 1fr; gap: 12px; }
}
.capacity-user { display: flex; align-items: center; gap: 10px; }
.capacity-user .avatar { width: 36px; height: 36px; font-size: 13px; }
.capacity-user-name { font-size: 13px; font-weight: 600; }
.capacity-user-role { font-size: 11px; color: var(--text-muted); }
.capacity-stats { display: flex; gap: 18px; flex-wrap: wrap; align-items: stretch; }
.capacity-stat { display: flex; flex-direction: column; }
.capacity-stat-value { font-size: 16px; font-weight: 700; }
.capacity-stat.late .capacity-stat-value { color: var(--danger); }
/* Separador vertical entre operacional (atrasadas/apontadas) e produção (entregáveis) */
.capacity-stat-divider {
  width: 1px; align-self: stretch; min-height: 32px;
  background: var(--hairline-strong, rgba(255,255,255,0.18));
  margin: 0 4px;
}

/* Banner global de produção no workspace — soma de todas as pessoas no período */
.capacity-prod-banner {
  margin: 14px 0 22px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  border: 1px solid rgba(122, 0, 255, 0.25);
  border-radius: var(--radius);
}
.capacity-prod-title {
  font-size: 11px; font-weight: 700; color: var(--accent-text);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.capacity-prod-stats { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.capacity-prod-stat { display: flex; flex-direction: column; gap: 2px; }
.capacity-prod-value { font-size: 24px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.capacity-prod-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.capacity-prod-divider {
  width: 1px; align-self: stretch; min-height: 40px;
  background: rgba(122, 0, 255, 0.3);
  margin: 0 4px;
}

/* Linha "Atribuir a" no painel de entregáveis do detail */
.detail-deliverable-attr {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--hairline);
}
.detail-deliverable-attr .form-label { white-space: nowrap; }
.capacity-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.capacity-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.capacity-bar-track {
  position: relative; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden;
  display: flex;
}
.capacity-bar-fill { height: 100%; border-radius: 4px; transition: width .3s ease; }
.capacity-bar-fill.low { background: var(--success); }
.capacity-bar-fill.medium { background: #7A00FF; }
.capacity-bar-fill.high { background: #f59e0b; }
.capacity-bar-fill.overload { background: var(--danger); }
.capacity-bar-over { height: 100%; background: repeating-linear-gradient(45deg, var(--danger) 0 4px, #b91c1c 4px 8px); border-radius: 0 4px 4px 0; }
.capacity-bar-label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-align: right; }
.capacity-bar-sub { color: var(--text-muted); font-weight: 400; }
.capacity-row.overload { border-color: var(--danger); }

/* ── RECORRÊNCIA ── */
.rec-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (max-width: 760px) { .rec-grid { grid-template-columns: 1fr; } }
.rec-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
}

/* ── Stage dropdown no footer: abre para cima ── */
.detail-footer .cdrop-menu {
  top: auto; bottom: calc(100% + 6px);
}

/* ── Textarea resize somente vertical ── */
textarea.form-control { resize: vertical; }

/* ── Detail modal: ícones de ação via hover ── */
.detail-section-block .field-head .detail-icon-btn,
.comment-act {
  opacity: 0; transition: opacity .15s;
}
.detail-section-block:hover .field-head .detail-icon-btn,
.comment:hover .comment-act {
  opacity: 1;
}


/* ── Capacity view toggle ── */
.capacity-view-toggle {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px; border-radius: 10px; width: fit-content;
}
.capacity-view-toggle .btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
}
.capacity-view-toggle .btn.active {
  background: var(--accent); color: #fff;
}
.capacity-view-toggle .btn.active:hover {
  background: var(--accent);
}
.capacity-color-dot {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: inline-block;
}

/* ─────────── CUSTOM DATE PICKER ───────────
   Calendário customizado que substitui o nativo do navegador.
   Segue o design system: superfície, borda, accent, fonte Inter. */
.fdp {
  position: absolute; z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02);
  padding: 14px;
  width: 280px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
}
.fdp.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Cabeçalho */
.fdp-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.fdp-title {
  flex: 1; background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 8px 10px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s;
}
.fdp-title:hover { background: var(--surface-2); }
.fdp-nav {
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.fdp-nav:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-active); }

/* Cabeçalho de dias da semana */
.fdp-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; margin-bottom: 4px;
}
.fdp-dow span {
  text-align: center; font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 6px 0;
}

/* Grid de dias */
.fdp-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.fdp-day {
  background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 12px; font-weight: 500;
  height: 32px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all .12s; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.fdp-day:hover { background: var(--surface-2); }
.fdp-day.other { color: var(--text-muted); }
.fdp-day.today {
  color: var(--accent-text); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--border-active);
}
.fdp-day.selected {
  background: var(--accent); color: #fff; font-weight: 700;
  box-shadow: 0 4px 12px rgba(122,0,255,0.35);
}
.fdp-day.selected:hover { background: var(--accent); }
.fdp-day.selected.today { box-shadow: 0 4px 12px rgba(122,0,255,0.35); }

/* Seletor de anos */
.fdp-years {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px;
}
.fdp-year {
  background: transparent; border: 0; color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 12px 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: all .12s;
}
.fdp-year:hover { background: var(--surface-2); }
.fdp-year.today { color: var(--accent-text); font-weight: 700; box-shadow: inset 0 0 0 1px var(--border-active); }
.fdp-year.selected { background: var(--accent); color: #fff; font-weight: 700; }
.fdp-year.selected:hover { background: var(--accent); }

/* Rodapé */
.fdp-foot {
  display: flex; justify-content: space-between; gap: 6px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.fdp-foot-btn {
  background: transparent; border: 0; color: var(--text-dim);
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all .12s;
}
.fdp-foot-btn:hover { background: var(--surface-2); color: var(--text); }
.fdp-foot-btn.primary { color: var(--accent-text); font-weight: 600; }
.fdp-foot-btn.primary:hover { background: var(--accent-dim); }

/* Esconde o ícone nativo do picker, já que vamos abrir nosso popup */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

/* ── Time selector dentro do picker (arrows nas laterais) ── */
.fdp-time {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.fdp-time-label {
  font-size: 10px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.fdp-time-row {
  display: flex; align-items: center; gap: 10px;
}
.fdp-time-unit {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px;
}
.fdp-time-unit input {
  width: 36px; height: 28px;
  text-align: center; font-family: 'SF Mono', ui-monospace, monospace;
  font-size: 14px; font-weight: 700; color: var(--text);
  background: transparent; border: 0;
  transition: color .12s;
}
.fdp-time-unit input:focus {
  outline: none; color: var(--accent-text);
}
.fdp-time-sep { font-size: 16px; font-weight: 700; color: var(--text-dim); }
.fdp-time-step {
  width: 22px; height: 22px; padding: 0;
  background: transparent; border: 0;
  color: var(--text-dim); border-radius: 4px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.fdp-time-step:hover { background: var(--surface-3); color: var(--accent-text); }
.fdp-foot-right { display: flex; gap: 4px; }
.fdp-foot-btn.primary {
  background: var(--accent); color: #fff; font-weight: 600;
  padding: 8px 16px;
}
.fdp-foot-btn.primary:hover { background: var(--accent); opacity: 0.9; }
.fdp:has(#fdp-time:not([style*="display: none"])) { width: 300px; }

/* ── Esconde o ícone de calendário redundante (o input em si abre o picker) ── */
.date-input-icon { display: none !important; }

/* ── Footer de apontamento: todos os campos com mesma altura (48px) ── */
.detail-footer .form-control.footer-date {
  height: 48px; border-radius: 10px;
  background: var(--surface);
  padding: 0 14px;
  font-size: 13px;
}
.detail-footer .form-control.footer-date:focus {
  outline: none; border-color: var(--border-active);
  background: var(--surface);
}

/* ── Inputs de data dentro do detail-field: altura uniforme com o cdrop (48px) ── */
.detail-field input.form-control[type="text"][data-fdp],
.detail-field input.form-control[type="date"],
.detail-field input.form-control[type="datetime-local"] {
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s;
}
.detail-field input.form-control[type="text"][data-fdp]:focus,
.detail-field input.form-control[type="date"]:focus,
.detail-field input.form-control[type="datetime-local"]:focus {
  outline: none; border-color: var(--accent-text);
}

/* ─── CHECKLIST ─── */
.checklist-bar {
  height: 4px; background: var(--surface-3); border-radius: 2px;
  margin: 10px 0; overflow: hidden;
}
.checklist-bar-fill {
  height: 100%; background: var(--success);
  transition: width .3s ease;
}
.checklist-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; transition: opacity .2s, border-color .2s;
}
.checklist-item.done { opacity: 0.55; }
.checklist-item.done .checklist-text { text-decoration: line-through; color: var(--text-dim); }
.checklist-check {
  width: 20px; height: 20px; flex-shrink: 0;
  background: transparent; border: 1.5px solid var(--text-muted); border-radius: 4px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; transition: all .12s;
}
.checklist-check:hover { border-color: var(--accent-text); }
.checklist-item.done .checklist-check { background: var(--success); border-color: var(--success); }
.checklist-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.4; }
.checklist-meta { font-size: 11px; color: var(--text-muted); font-style: italic; }
.checklist-del {
  opacity: 0; transition: opacity .15s;
  width: 24px; height: 24px;
}
.checklist-item:hover .checklist-del { opacity: 1; }
.checklist-add {
  display: flex; gap: 8px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.checklist-add .form-control { flex: 1; height: 36px; }

/* ─── REAÇÕES EM COMENTÁRIOS ─── */
.reactions-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-top: 8px;
}
.reaction-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer; font-size: 12px;
  transition: all .12s;
}
.reaction-chip:hover { border-color: var(--accent-text); transform: translateY(-1px); }
.reaction-chip.mine { background: var(--accent-dim); border-color: var(--border-active); }
.reaction-emoji { font-size: 14px; line-height: 1; }
.reaction-count { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.reaction-chip.mine .reaction-count { color: var(--accent-text); }
.reaction-picker-wrap { position: relative; display: inline-block; }
.reaction-add {
  width: 24px; height: 24px; padding: 0;
  background: transparent; border: 1px dashed var(--border);
  border-radius: 12px; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all .15s;
}
.comment:hover .reaction-add { opacity: 1; }
.reaction-add:hover { background: var(--surface-2); color: var(--accent-text); border-style: solid; }
.reaction-picker {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
  display: none; gap: 2px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.reaction-picker.open { display: flex; }
.reaction-opt {
  width: 30px; height: 30px; padding: 0;
  background: transparent; border: 0; border-radius: 6px;
  cursor: pointer; font-size: 18px; transition: all .12s;
}
.reaction-opt:hover { background: var(--surface-2); transform: scale(1.15); }

/* ─── DRAG-AND-DROP DE ANEXOS ─── */
.drag-over {
  position: relative;
}
.drag-over::after {
  content: '⬇';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(122,0,255,0.12); border: 2px dashed var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: var(--accent-text);
  z-index: 9999;
  pointer-events: none; backdrop-filter: blur(2px);
}
/* No kanban o overlay de arquivos não faz sentido — placeholder próprio cuida do visual */
.kanban-column-body.drag-over::after { content: none; }

/* ─── GOOGLE CALENDAR (perfil) ─── */
.google-account {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.google-account-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--hairline);
}
.google-account-avatar--fallback {
  display: flex; align-items: center; justify-content: center;
  background: #4285F4; color: #fff;
  font-size: 15px; font-weight: 700;
}
.google-account-info { flex: 1; min-width: 0; }
.google-account-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.google-account-email {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.google-cals-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px;
}
.google-cals-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 320px; overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  background: var(--surface);
}
.google-cal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 4px;
  cursor: pointer; user-select: none;
  transition: background .1s var(--ease-out);
}
.google-cal-row:hover { background: var(--surface-2); }
.google-cal-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent);
  cursor: pointer; flex-shrink: 0;
}
.google-cal-swatch {
  width: 12px; height: 12px; border-radius: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.google-cal-name {
  font-size: 13px; color: var(--text); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.google-cal-primary-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-text);
  padding: 1px 5px; border-radius: 3px;
  background: var(--accent-dim);
  margin-left: 4px;
}

/* Barra "última sincronização + botões" no painel do Google */
.google-sync-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 14px; flex-wrap: wrap;
}
.google-sync-info { font-size: 12px; color: var(--text-muted); }

/* Modal enxuto do evento Google — badge accent + título + horário */
.gcal-modal-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(66, 133, 244, 0.12);
  color: #4285F4;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.gcal-modal-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  word-break: break-word;
}
.gcal-modal-time {
  font-size: 14px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Bloco Google na agenda — read-only, azul, cursor pointer sem drag.
   `is-laned` = tem overlap com outros → posicionamento absoluto + width%. */
.agenda-block--google {
  cursor: pointer;
  color: #fff;
  border-left: 3px solid rgba(255,255,255,0.4);
}
.agenda-block--google:hover { box-shadow: 0 4px 12px rgba(66, 133, 244, 0.35); }
.agenda-block--google .agenda-block-name {
  display: flex; align-items: center; gap: 5px;
  font-weight: 600; font-size: 11px;
}
.agenda-block-google-icon { flex-shrink: 0; }
/* Google e schedule laned: usam position absolute pra dividir espaço horizontal.
   O grid ainda controla altura (via grid-row) porque o item filho herda o cell. */
.agenda-block.is-laned {
  position: absolute;
  top: 0; bottom: 0;
  margin: 0 2px;
}
/* A cell precisa virar position:relative pra os laned blocks se ancorarem nela.
   Como blocks ficam por CIMA da agenda-cell no mesmo grid-row/column, isso
   funciona sem quebrar o layout dos blocos normais (que continuam usando
   grid-row/column diretamente sem absolute). */
.agenda-grid > .agenda-block.is-laned {
  /* fallback: mantém o grid-column/row do container, mas com left/width override */
  position: relative;
}

/* ─── INTEGRAÇÕES (WEBHOOKS) ─── */
.webhook-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 6px;
  background: var(--surface-2); padding: 8px 10px; border-radius: 6px;
  line-height: 1.5;
}
.webhook-hint strong { color: var(--text-dim); }
.wh-events {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.wh-event-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; transition: all .12s;
  font-size: 12px;
}
.wh-event-row:hover { border-color: var(--border-active); }
.wh-event-row input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--accent-text);
}
@media (max-width: 600px) { .wh-events { grid-template-columns: 1fr; } }

/* Atalhos de teclado — overlay (apertar `?` abre) */
.shortcuts-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s var(--ease-out);
}
.shortcuts-overlay.open { display: flex; opacity: 1; }
.shortcuts-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 460px; max-height: 80vh;
  overflow-y: auto;
  animation: shortcutsIn .28s var(--ease-spring);
}
@keyframes shortcutsIn { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.shortcuts-head {
  padding: 18px 22px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
}
.shortcuts-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.shortcuts-list { padding: 14px 22px; display: flex; flex-direction: column; gap: 4px; }
.shortcuts-row { display: flex; align-items: center; gap: 16px; padding: 8px 4px; }
.shortcuts-keys { display: flex; align-items: center; gap: 6px; flex: 0 0 130px; }
.shortcuts-plus { font-size: 10px; color: var(--text-muted); margin: 0 2px; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 8px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', Menlo, monospace;
  font-size: 12px; font-weight: 600;
  color: var(--text); letter-spacing: -0.005em;
}
.shortcuts-label { font-size: 13px; color: var(--text-dim); }
.shortcuts-hint { padding: 12px 22px 18px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--hairline); }

/* Tooltips customizados — substituem o tooltip nativo do navegador */
.tt {
  position: fixed;
  pointer-events: none;
  padding: 6px 10px;
  background: rgba(20, 20, 22, 0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  z-index: 99999;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity .15s var(--ease-out), transform .15s var(--ease-out);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  max-width: 280px;
  white-space: normal;
  text-align: center;
}
.tt.open { opacity: 1; transform: translate(-50%, 0); }
.tt.above { transform: translate(-50%, calc(-100% + 4px)); }
.tt.above.open { transform: translate(-50%, -100%); }

/* Toggle de visualização (Lista / Kanban / Calendário) — fica inline ao lado dos
   filtros, empurrado para a direita via margin-left: auto. */
.list-view-toggle {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  align-self: flex-end;
}
.list-view-toggle .btn {
  border-radius: 6px;
  height: 30px;
  width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.list-view-toggle .btn.active {
  background: var(--accent-dim);
  color: var(--accent-text);
}

/* ─── KANBAN (página Demandas) ─── */
/* Layout da página Demandas: page-body vira flex column. A barra de filtros + toggle
   (altura natural, fica no topo) e o container de views (preenche o resto). O
   overflow: hidden em cada nível garante que filhos não estiquem o pai. */
#page-list > .page-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}
#page-list > .page-body > .filters-bar {
  flex-shrink: 0;
  width: 100%;
  margin-bottom: 0;
  min-width: 0;
}
.list-views-container {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.list-views-container > div {
  min-width: 0;
  width: 100%;
}

#list-table-view,
#list-cal-view { overflow-y: auto; max-height: 100%; }

/* #list-kanban-view é a "moldura" relativa. .kanban-board fica absolute dentro dela,
   ocupando exatamente as 4 bordas — assim não há como o board crescer com o conteúdo;
   a única saída para mais colunas é o overflow-x: auto dele mesmo. */
#list-kanban-view {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}
.kanban-board {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  align-items: stretch;
}

/* Responsivo: em telas estreitas, os filtros e o toggle se adaptam */
@media (max-width: 900px) {
  .filter-cdrop { min-width: 140px; }
  .filter-input { max-width: none; flex: 1 1 100%; }
}
@media (max-width: 600px) {
  .filter-cdrop { min-width: 100%; flex: 1 1 100%; }
}

/* Compositor de comentário com drag-and-drop ativo */
.comment-compose { position: relative; border-radius: var(--radius-sm); transition: outline 0.12s, background 0.12s; }
.comment-compose.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  background: var(--accent-dim);
}
.comment-compose.drag-over::after {
  content: 'Solte para anexar ao comentário';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  pointer-events: none;
  background: rgba(122, 0, 255, 0.05);
  border-radius: var(--radius-sm);
}

/* Preferências de e-mail (Meu Perfil) */
.email-prefs { display: flex; flex-direction: column; gap: 8px; }
.email-prefs .form-check { padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* Drag & drop no kanban */
.kanban-card { user-select: none; }
.kanban-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.kanban-column-body.drag-over {
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
}
.kanban-column.drop-disabled .kanban-column-body.drag-over {
  background: var(--danger-dim);
  cursor: not-allowed;
}
.kanban-empty { width: 100%; }
.kanban-column {
  flex: 0 0 288px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.kanban-column-head {
  padding: 13px 16px;
  border-top: 2.5px solid var(--accent);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.kanban-column-title { flex: 1; color: var(--text); text-transform: uppercase; letter-spacing: .05em; }
.kanban-column-count {
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  min-width: 22px;
  text-align: center;
}
.kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.kanban-column-empty {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 22px 10px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: transform .15s var(--ease-spring), border-color .15s var(--ease-out);
}
.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}
.kanban-card:active { transform: translateY(0) scale(0.99); }
.kanban-card-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kanban-card-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.kanban-card-meta { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.kanban-card-owner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  min-width: 0;
}
.kanban-card-owner .avatar { width: 22px; height: 22px; font-size: 10px; flex-shrink: 0; }
.kanban-card-owner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card-owner-empty { font-size: 11px; color: var(--text-muted); font-style: italic; }
.kanban-card-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}
.kanban-card-due.late { color: var(--danger); }

/* ─── Avatars empilhados nos cards do kanban ───
   Owner + colaboradores (autores de comentário, etc) com sobreposição
   e ring sólido do surface para criar separação visual. */
.kanban-card-avatars {
  display: flex; align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  min-width: 0;
}
.avatar-stack { display: inline-flex; align-items: center; flex-shrink: 0; }
.avatar-stack-item { position: relative; display: inline-flex; }
.avatar-stack-item + .avatar-stack-item { margin-left: -8px; }
.avatar-stack-avatar {
  width: 22px !important; height: 22px !important; font-size: 10px !important;
  box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.avatar-stack-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: var(--surface-2);
  border-radius: 50%;
  font-size: 9.5px; font-weight: 700;
  color: var(--text-dim);
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--surface);
  letter-spacing: -0.02em;
}
.kanban-card-owner-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ─── Animação de drop no kanban ───
   .just-landed pulsa o card que acabou de cair na coluna;
   .flash-drop aplica um halo curto na coluna alvo. */
@keyframes cardLand {
  0%   { transform: scale(.92); box-shadow: 0 0 0 0 rgba(122,0,255,0); }
  35%  { transform: scale(1.04); box-shadow: 0 0 0 5px rgba(122,0,255,0.22); }
  100% { transform: scale(1);    box-shadow: var(--shadow-xs); }
}
.kanban-card.just-landed { animation: cardLand .65s var(--ease-spring); }
@keyframes columnFlashBg {
  0%   { background: transparent; }
  35%  { background: rgba(122,0,255,0.10); }
  100% { background: transparent; }
}
.kanban-column.flash-drop .kanban-column-body { animation: columnFlashBg .7s var(--ease-out); }

/* ─── Toast com ação embutida ───
   Mantém o pill ao lado da mensagem. Cor roxa sutil destaca sem competir. */
.toast { display: flex; align-items: center; gap: 14px; }
.toast-msg { flex: 1 1 auto; min-width: 0; }
.toast-action {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--accent-text);
  font-weight: 600; font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: background .15s var(--ease-out), border-color .15s var(--ease-out), transform .12s var(--ease-spring);
}
.toast-action:hover {
  background: var(--surface-2);
  border-color: var(--accent-text);
  transform: translateY(-1px);
}
.toast-action:active { transform: translateY(0); }

/* ─── Edição inline do título da demanda no modal de detalhe ─── */
.detail-title {
  cursor: text;
  padding: 2px 6px;
  margin: -2px -6px 0;
  border-radius: 6px;
  transition: background .15s var(--ease-out);
}
.detail-title:hover { background: var(--surface-2); }
.detail-title-input {
  display: block;
  width: 100%;
  max-width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--accent-text);
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  font-family: inherit;
  letter-spacing: -0.01em;
  outline: none;
  box-shadow: 0 0 0 3px rgba(122,0,255,0.18);
}

/* ─── Paleta de comandos (⌘K) ─── */
.cmdk-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10001;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  transition: opacity .18s var(--ease-out);
}
.cmdk-overlay.open { display: flex; opacity: 1; }
.cmdk-card {
  width: 100%;
  max-width: 600px;
  max-height: 64vh;
  margin: 0 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cmdkIn .25s var(--ease-spring);
}
@keyframes cmdkIn { from { transform: translateY(-12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cmdk-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
}
.cmdk-input-icon { color: var(--text-muted); flex-shrink: 0; }
.cmdk-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  letter-spacing: -0.01em;
  min-width: 0;
}
.cmdk-input::placeholder { color: var(--text-muted); }
.cmdk-hint-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 22px; padding: 0 7px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-size: 10.5px; font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', Menlo, monospace;
}
.cmdk-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 8px;
  min-height: 80px;
}
.cmdk-section {
  padding: 10px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .1s var(--ease-out);
}
.cmdk-item.active {
  background: var(--surface-2);
}
.cmdk-item-icon { color: var(--text-muted); flex-shrink: 0; transition: color .1s var(--ease-out); }
.cmdk-item.active .cmdk-item-icon { color: var(--accent-text); }
.cmdk-item-label {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-item-sub { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.cmdk-item-kind {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  flex-shrink: 0;
}
.cmdk-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
}
.cmdk-foot kbd {
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10px;
  margin-right: 5px;
  border-bottom-width: 1.5px;
}

/* ─── BULK ACTIONS — barra acima da tabela quando há seleção ─── */
.col-bulk-check { width: 32px; text-align: center; padding-right: 0 !important; }
.bulk-check-all, .bulk-check-row {
  width: 16px; height: 16px;
  accent-color: var(--accent-text);
  cursor: pointer;
  margin: 0;
}
.demand-row.selected {
  background: linear-gradient(90deg, rgba(122,0,255,0.10), transparent 60%);
  box-shadow: inset 3px 0 0 var(--accent-text);
}

/* Chip do deep-link ?due=YYYY-MM-DD — pill accent com botão X pra remover */
.due-filter-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(122, 0, 255, 0.3);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text);
}
.due-filter-chip svg { width: 14px; height: 14px; color: var(--accent-text); }
.due-filter-chip strong { font-weight: 700; text-transform: capitalize; }
.due-filter-chip-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0;
  background: transparent; border: 0; border-radius: 50%;
  color: var(--text-muted); cursor: pointer;
  transition: background .12s var(--ease-out), color .12s var(--ease-out);
}
.due-filter-chip-close:hover { background: rgba(0,0,0,0.08); color: var(--text); }
.due-filter-chip-close svg { width: 12px; height: 12px; }

.bulk-actions-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 0 14px;
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--accent-text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: bulkBarIn .25s var(--ease-spring);
}
.bulk-actions-bar.open { display: flex; }
@keyframes bulkBarIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.bulk-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  letter-spacing: -0.005em;
  padding: 0 6px;
  margin-right: 4px;
}
.bulk-actions-bar .btn {
  font-size: 12.5px;
  padding: 6px 11px;
}
.bulk-actions-bar .btn.bulk-danger { color: var(--danger); }
.bulk-actions-bar .btn.bulk-danger:hover { background: rgba(239,80,80,0.08); }

/* Picker (escolher entre N opções) — usado por bulk actions */
.picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.picker-item {
  display: block; width: 100%;
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s var(--ease-out), border-color .12s var(--ease-out), transform .12s var(--ease-spring);
}
.picker-item:hover {
  background: var(--surface-3);
  border-color: var(--accent-text);
  transform: translateX(2px);
}

/* ─── MARKDOWN — descrição e comentários ─── */
.md-body { line-height: 1.55; font-size: 13.5px; color: var(--text); }
.md-body strong { color: var(--text); font-weight: 700; }
.md-body em { color: var(--text); font-style: italic; }
.md-code, .comment-text .md-code, .detail-description .md-code {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', Menlo, 'Cascadia Code', monospace;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent-text);
}
.md-list {
  margin: 6px 0 6px 22px;
  padding: 0;
  list-style: disc;
}
.md-list li { margin: 2px 0; }
/* Aplica markdown também em comentários sem precisar de classe extra */
.comment-text strong { font-weight: 700; }
.comment-text em { font-style: italic; }
.comment-text .md-list { margin: 4px 0 4px 22px; }

/* ─── KANBAN: GHOST PLACEHOLDER ─── */
.kanban-card.dragging {
  opacity: 0.35;
  filter: grayscale(0.3);
  transform: scale(0.97);
}
.kanban-drop-placeholder {
  height: 64px;
  margin: 6px 0;
  border: 2px dashed var(--accent-text);
  border-radius: var(--radius-sm);
  background: rgba(122,0,255,0.08);
  animation: phPulse 1.4s ease-in-out infinite;
}
@keyframes phPulse {
  0%, 100% { background: rgba(122,0,255,0.06); }
  50%      { background: rgba(122,0,255,0.14); }
}
.kanban-column-body { min-height: 30px; }

/* ─── MODO ZEN (FOCAR) ─── */
.zen-toggle-btn { /* sem nada especial — herda btn-ghost */ }
body.zen-mode .sidebar,
body.zen-mode .topbar { display: none !important; }
body.zen-mode .main { margin-left: 0 !important; }
body.zen-mode .page-body { padding-top: 20px; }
body.zen-mode #app { padding: 0; }
.zen-exit-floating {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 9998;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hairline);
  color: var(--text);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0.3;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-spring);
}
.zen-exit-floating:hover { opacity: 1; transform: scale(1.05); }

/* ─── PRESENCE RING — anel ao redor da foto ─── */
.avatar { position: relative; }
.avatar.presence-online {
  outline: 2px solid #3CE3A0;
  outline-offset: 1.5px;
}
.avatar.presence-away {
  outline: 2px solid #F5A718;
  outline-offset: 1.5px;
}
/* Em avatares pequenos (kanban stack, calendário) o anel encosta mais pra não engordar muito */
.avatar-stack-avatar.presence-online,
.avatar-stack-avatar.presence-away,
.cal-event-avatar.presence-online,
.cal-event-avatar.presence-away {
  outline-width: 1.5px;
  outline-offset: 1px;
}

/* Footer do inline edit (descrição/briefing) com indicador de auto-save. */
.inline-edit-foot {
  display: flex; align-items: center; gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}
.inline-edit-status {
  margin-right: auto;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: opacity .2s var(--ease-out), color .2s var(--ease-out);
  min-height: 16px;
}
.inline-edit-status.ok  { color: var(--success); }
.inline-edit-status.err { color: var(--danger); }

/* ─── COMBOBOX HÍBRIDO (input livre + dropdown rico) ───
   Usado no campo "Cliente" do modal de Projeto. Permite digitar um valor
   novo OU escolher um existente do dropdown — com avatar dos projetos
   já vinculados àquele cliente. */
.combobox {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}
.combobox-input {
  flex: 1;
  padding-right: 38px !important; /* abre espaço pro chevron */
}
.combobox-toggle {
  position: absolute;
  right: 1px; top: 1px; bottom: 1px;
  width: 36px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background .12s var(--ease-out), color .12s var(--ease-out);
}
.combobox-toggle:hover { background: var(--surface-2); color: var(--text); }
.combobox.open .combobox-toggle { color: var(--accent-text); }
.combobox.open .combobox-toggle i { transform: rotate(180deg); }
.combobox-toggle i { transition: transform .15s var(--ease-spring); }

.combobox-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px 0;
}
.combobox.open .combobox-menu { display: block; animation: comboIn .15s var(--ease-spring); }
@keyframes comboIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.combobox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s var(--ease-out);
}
.combobox-item:hover, .combobox-item.active {
  background: var(--surface-2);
}
.combobox-item.active {
  background: linear-gradient(90deg, var(--accent-dim), transparent 80%);
}
.combobox-item-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.combobox-empty {
  padding: 14px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.combobox-empty strong {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent-text);
  font-weight: 600;
}

/* ─── MOBILE — sidebar off-canvas + ajustes gerais ───
   Em desktop: hamburger escondido, sidebar fixa de 240px, margin-left no .main.
   Em mobile (<= 880px): hamburger visível no topbar, sidebar deslizando da
   esquerda, backdrop intercepta cliques, .main sem margin. */

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  cursor: pointer;
  margin-right: 8px;
  transition: background .12s var(--ease-out);
}
.menu-toggle:hover { background: var(--surface-2); }
.menu-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 89;
  opacity: 0;
  transition: opacity .2s var(--ease-out);
}

@media (max-width: 880px) {
  /* Hamburger aparece, sidebar vira off-canvas */
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 260px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform .26s var(--ease-spring);
    box-shadow: 4px 0 24px rgba(0,0,0,0.35);
  }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .menu-backdrop { display: block; opacity: 1; }
  .main { margin-left: 0 !important; }
  /* Topbar mais compacto */
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-title { font-size: 15px; }
  /* Bell + nova demanda: nova demanda fica só com ícone (texto cabe muito mal) */
  .topbar-actions .btn-primary { padding-left: 12px; padding-right: 12px; }
  .topbar-actions .btn-primary span { display: none; }
  /* Filtros: já são flex-wrap por padrão; garantir que cada cdrop não ocupe tudo */
  .filters-bar { padding: 12px; gap: 8px; }
  .filter-input-wrap { max-width: none; flex: 1 1 100%; }
  .list-view-toggle { margin-left: 0; }
  /* Tabelas com scroll horizontal pra não quebrar layout */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 720px; }
  /* Modais: ocupam quase a tela inteira */
  .modal { width: calc(100vw - 24px) !important; max-width: 100% !important; max-height: calc(100vh - 32px); }
  .modal-content { padding: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  /* Dashboard: cards de métrica viram coluna única */
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  /* Pipeline da demanda com texto menor */
  .pipeline-bar-step { font-size: 10px; }
  /* Página: respiração lateral menor */
  .page-body { padding: 16px; }
  /* Notif panel: assume largura quase total da tela */
  .notif-panel { width: calc(100vw - 24px); right: -12px; }
  /* Cmdk e shortcuts: padding-top menor pra subir o modal */
  .cmdk-overlay { padding-top: 6vh; }
  /* Kanban: colunas mais estreitas pra caber 1.5 na tela */
  .kanban-column { flex: 0 0 260px; }
}

@media (max-width: 520px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .topbar-title { display: none; } /* libera espaço; o context vem do menu */
  .topbar-actions .btn-primary { width: 36px; padding: 0; }
  .saved-views-bar { display: none; }
  .bulk-actions-bar { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .bulk-actions-bar .btn { font-size: 11.5px; padding: 5px 9px; }
  .filter-input-wrap { min-width: 0; }
  .filter-cdrop { width: 100%; }
  .list-view-toggle { width: 100%; justify-content: center; }
  /* Detalhe da demanda: header mais condensado */
  .detail-head-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .detail-head-actions { flex-wrap: wrap; }
}

/* ─── FLUXOS — Cards de cliente e cards de fluxo ─── */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.flow-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px 18px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transition:
    border-color .15s var(--ease-out),
    transform .18s var(--ease-spring),
    background .15s var(--ease-out),
    box-shadow .18s var(--ease-out);
  min-height: 200px;
}
.flow-card:hover {
  border-color: var(--accent-text);
  transform: translateY(-2px);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(122, 0, 255, 0.14);
}
.flow-card:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(122, 0, 255, 0.10); }
.flow-card-avatar,
.flow-card-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  flex-shrink: 0;
  background: var(--surface-3);
}
.flow-card-icon--placeholder { color: var(--text-muted); }
.flow-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: -0.01em;
  word-break: break-word;
  max-width: 100%;
}
.flow-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -4px;
}
.flow-card-actions {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity .12s var(--ease-out);
}
.flow-card:hover .flow-card-actions { opacity: 1; }
.flow-sort-btn.active {
  background: var(--accent-dim);
  color: var(--accent-text);
}

/* ─── FLOW MODAL — Layout novo ─── */
.flow-modal-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between;
  gap: 16px;
}
.flow-modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: -0.005em;
}
.flow-modal-head-right {
  display: flex; align-items: center; gap: 12px;
}
.flow-icon-picker {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.flow-icon-preview {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--hairline-strong);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: border-color .12s var(--ease-out), background .12s var(--ease-out);
  overflow: hidden;
}
.flow-icon-picker:hover .flow-icon-preview {
  border-color: var(--accent-text);
  color: var(--accent-text);
}
.flow-icon-preview.has-icon {
  border-style: solid;
  border-color: var(--hairline);
}
.flow-icon-preview.has-icon .flow-icon-label { display: none; }
.flow-icon-label { user-select: none; }

/* Botão "Adicionar nova etapa" — full-width pra parecer com o mockup */
.flow-add-stage-btn {
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  color: var(--text-dim);
  font-weight: 600;
}
.flow-add-stage-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent-text);
  color: var(--accent-text);
}

/* Footer do modal de fluxo com toggle à esquerda + ações à direita */
.flow-modal-foot {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.flow-modal-foot-right {
  display: flex; gap: 10px; align-items: center; margin-left: auto;
}

/* Toggle estilizado pro "Aplicar a todos os projetos" */
.flow-apply-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.flow-apply-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.flow-toggle-track {
  position: relative;
  display: inline-block;
  width: 36px; height: 20px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  transition: background .15s var(--ease-out);
}
.flow-toggle-thumb {
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform .18s var(--ease-spring), background .15s var(--ease-out);
}
.flow-apply-toggle input:checked + .flow-toggle-track {
  background: var(--accent);
}
.flow-apply-toggle input:checked + .flow-toggle-track .flow-toggle-thumb {
  transform: translateX(16px);
  background: #fff;
}
.flow-apply-toggle:hover .flow-toggle-track { filter: brightness(1.1); }
.flow-apply-toggle input:focus-visible + .flow-toggle-track {
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ─── CLIENTES — cards, status, detalhe ─── */
.client-card { position: relative; }
.client-card-avatar {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; flex-shrink: 0;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.client-card.is-archived { opacity: 0.55; }
.client-card.is-archived:hover { opacity: 1; }
.client-card-status {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.client-card-status--active   { background: rgba(60,227,160,0.18); color: var(--success); }
.client-card-status--archived { background: var(--surface-3); color: var(--text-muted); }

/* Toggle de Situação (Todos / Ativos / Arquivados) */
.client-status-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.client-status-btn { font-size: 12px !important; padding: 5px 12px !important; border-radius: 5px !important; }
.client-status-btn.active { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-xs); }

/* Detalhe do cliente — seções */
.client-detail-section { margin-bottom: 8px; }
.client-detail-section-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
/* Layout 2 colunas: Pessoas | Tempo dedicado.
   Colapsa pra 1 coluna em telas mais estreitas — abaixo de 1200px a leitura
   fica prejudicada com dois cards altos lado a lado. */
.client-detail-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.client-detail-two-col > .client-detail-section { margin-bottom: 0; }
@media (max-width: 1200px) {
  .client-detail-two-col { grid-template-columns: 1fr; gap: 32px; }
}

/* Card "Sobre" — descrição + link do drive + link de ativos */
.client-info-card {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 18px;
}
.client-info-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 760px) {
  .client-info-grid-2 { grid-template-columns: 1fr; gap: 14px; }
}
.client-info-field { min-width: 0; }
.client-info-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.client-info-value { font-size: 13px; line-height: 1.55; color: var(--text); min-width: 0; }
.client-info-text { white-space: normal; word-wrap: break-word; }
.client-info-empty { color: var(--text-muted); font-style: italic; font-size: 12.5px; }
.client-info-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent-text);
  text-decoration: none; font-weight: 500;
  max-width: 100%; min-width: 0;
  transition: color .12s var(--ease-out);
}
.client-info-link:hover { text-decoration: underline; }
.client-info-link svg { flex-shrink: 0; width: 16px; height: 16px; }
.client-info-link span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
/* Aviso curto acima de PESSOAS no detalhe de projeto — explica que a herança
   do cliente aconteceu na criação e edições daqui não voltam pro pai. */
.client-info-hint {
  font-size: 12px; color: var(--text-muted);
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}
/* Período do TEMPO DEDICADO no detalhe de projeto — mesmo estilo do cliente. */
.project-time-period { font-size: 12px !important; padding: 6px 12px !important; }
.project-time-period.active { background: var(--accent-dim); color: var(--accent-text); border-color: transparent; }

/* Pessoas */
.client-person-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 40px minmax(140px, 1fr);
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  align-items: center;
}
/* Side-by-side com Tempo dedicado — aperta a coluna da função. */
.client-detail-two-col .client-person-row {
  grid-template-columns: minmax(110px, 1.2fr) 34px minmax(120px, 1.6fr);
  gap: 10px;
  padding: 8px 12px;
}
.client-person-role {
  font-size: 12.5px; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.client-person-name {
  display: flex; align-items: center; justify-content: center;
}
.client-person-row select.form-control {
  height: 36px; font-size: 13px;
}
.client-people-empty {
  padding: 24px 16px;
  background: var(--surface-2);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Tempo dedicado */
.client-time-head {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.client-time-total {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
}
.client-time-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted);
}
.client-time-value {
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.client-time-periods { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.client-time-period { font-size: 12px !important; padding: 6px 12px !important; }
.client-time-period.active { background: var(--accent-dim); color: var(--accent-text); border-color: transparent; }

.client-time-row {
  display: grid;
  grid-template-columns: minmax(160px, 260px) minmax(120px, 160px) minmax(80px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
/* Dentro do layout side-by-side, aperta ainda mais pra evitar overflow. */
.client-detail-two-col .client-time-row {
  grid-template-columns: minmax(140px, 1.4fr) auto minmax(60px, 1fr);
  gap: 10px;
  padding: 8px 12px;
}
.client-detail-two-col .client-time-user-name { font-size: 12.5px; }
.client-detail-two-col .client-time-user-role { font-size: 10.5px; }
.client-detail-two-col .client-time-meta { gap: 6px; }
.client-detail-two-col .client-time-hh { font-size: 10.5px; }
.client-time-user { display: flex; align-items: center; gap: 10px; }
.client-time-user-name { font-size: 13px; font-weight: 600; }
.client-time-user-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.client-time-meta { display: inline-flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.client-time-pct { font-size: 13px; font-weight: 700; }
.client-time-hh { font-size: 11.5px; color: var(--text-muted); }

.client-chart-wrap {
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
/* Sem apontamentos → empty state ocupa o slot do gráfico. Ilustração menor
   pra não competir com o restante da página (o empty state padrão é grande). */
.client-chart-wrap--empty { padding: 0; }
.client-chart-wrap--empty .empty-state { padding: 32px 20px; }
.client-chart-wrap--empty .empty-state-icon { width: 140px; height: 105px; margin-bottom: 14px; }
.client-chart-wrap--empty .empty-state-title { font-size: 14px; }
.client-chart-wrap--empty .empty-state-sub { font-size: 12.5px; max-width: 320px; }
.client-chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.client-chart-title { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.client-chart-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.client-chart-delta { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }

/* Modal Cliente — layout 2 colunas (avatar + campos) */
.client-modal-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
.client-avatar-col { display: flex; flex-direction: column; align-items: stretch; }
.client-avatar-big {
  width: 100%; aspect-ratio: 1;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background-position: center;
  background-size: cover;
}
.client-fields-col { display: flex; flex-direction: column; gap: 14px; }

/* Footer do modal Cliente — split entre ações destrutivas e save */
.client-modal-foot {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.client-modal-foot-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.client-modal-foot-right { display: flex; gap: 10px; }
.client-modal-delete {
  color: var(--danger) !important;
  border: 1px solid var(--danger) !important;
  background: transparent !important;
}
.client-modal-delete:hover { background: rgba(239,80,80,0.10) !important; }
.client-status-group { display: inline-flex; align-items: center; gap: 4px; padding-left: 4px; }
.client-status-pick { font-size: 12px !important; padding: 5px 12px !important; }
.client-status-pick.active { background: var(--accent-dim); color: var(--accent-text); }

/* Botão btn-danger (usado no modal de confirmação) */
.btn-danger {
  background: var(--danger); color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { filter: brightness(1.08); }
.btn-danger:disabled {
  background: var(--surface-3); color: var(--text-muted); border-color: var(--hairline);
  cursor: not-allowed; opacity: 0.7;
}

@media (max-width: 760px) {
  .client-modal-grid { grid-template-columns: 1fr; }
  .client-time-row { grid-template-columns: 1fr; gap: 8px; }
  .client-person-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   ─── POLIMENTO VISUAL GLOBAL ─────────────────────────────────
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Number inputs sem setinhas ─────────────────────────── */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ── 2. Scrollbar customizada — discreta, segue o tema ───── */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
:root[data-theme="light"] * { scrollbar-color: rgba(0,0,0,0.18) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14); border-radius: 6px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); background-clip: padding-box; border: 2px solid transparent; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); background-clip: padding-box; border: 2px solid transparent; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.32); background-clip: padding-box; border: 2px solid transparent; }

/* ── 3. Tooltips customizados — substitui title="" nativo ─── */
.k-tooltip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: rgba(20,20,20,0.95); color: #fff;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  max-width: 280px; line-height: 1.4;
  white-space: pre-wrap; word-wrap: break-word;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  opacity: 0; transform: translate(-50%, -100%) translateY(-6px);
  transition: opacity .12s var(--ease-out), transform .12s var(--ease-out);
  letter-spacing: -0.005em;
}
.k-tooltip.show { opacity: 1; transform: translate(-50%, -100%) translateY(-10px); }
.k-tooltip::after {
  content: ''; position: absolute; left: 50%; bottom: -4px;
  width: 8px; height: 8px; background: rgba(20,20,20,0.95);
  transform: translateX(-50%) rotate(45deg);
}
:root[data-theme="light"] .k-tooltip { background: #1A1A1A; color: #fff; }
:root[data-theme="light"] .k-tooltip::after { background: #1A1A1A; }

/* ── 4. Loading state em botões — spinner inline ─────────── */
.btn.is-loading,
button.is-loading {
  pointer-events: none; color: transparent !important; position: relative;
}
.btn.is-loading::after,
button.is-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; color: rgba(255,255,255,0.85);
  animation: btnSpin .6s linear infinite;
}
.btn.is-loading.btn-ghost::after,
.btn.is-loading.btn-secondary::after { color: var(--text-dim); }
:root[data-theme="light"] .btn.is-loading::after { color: rgba(255,255,255,0.9); }
@keyframes btnSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ── 5. Floating labels (opt-in via .form-group-float) ─────
   HTML: <div class="form-group form-group-float">
           <input class="form-control" id="x" placeholder=" ">
           <label for="x">Nome do campo</label>
         </div>
   Note o placeholder=" " (espaço) — necessário pro :placeholder-shown funcionar. */
.form-group-float { position: relative; }
.form-group-float > label.form-label,
.form-group-float > label {
  position: absolute; top: 50%; left: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px; font-weight: 400;
  text-transform: none; letter-spacing: 0;
  transition: all .15s var(--ease-out);
  padding: 0 4px; line-height: 1;
  z-index: 1;
}
.form-group-float > .form-control:focus + label,
.form-group-float > .form-control:not(:placeholder-shown) + label {
  top: 0;
  transform: translateY(-50%);
  font-size: 11px; font-weight: 600;
  color: var(--accent-text);
  background: var(--surface);
  letter-spacing: 0.02em;
}
:root[data-theme="light"] .form-group-float > .form-control:focus + label,
:root[data-theme="light"] .form-group-float > .form-control:not(:placeholder-shown) + label {
  background: #FFFFFF;
}
/* Esconde placeholder visual quando label estiver "lá em cima" */
.form-group-float > .form-control::placeholder { color: transparent; }
.form-group-float > .form-control:not(:focus)::placeholder { color: transparent; }

/* ─── Wizard de Nova Demanda (4 steps) ─────────────────────── */
/* min-height fixa pra modal não pular de tamanho ao avançar/voltar
   entre steps com quantidades diferentes de conteúdo. */
.demand-wizard-modal .modal-body { padding-bottom: 24px; min-height: 70vh; }
.demand-wizard-modal .wizard-step { min-height: calc(70vh - 48px); }
.wizard-step-title {
  text-align: center; font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim);
  margin: 6px 0 18px;
}
/* Pesquisa do wizard ocupa toda a largura — sobrescreve max-width do filter-input padrão */
.wizard-search {
  margin-bottom: 18px;
  max-width: none !important; width: 100%; flex: 1 1 100% !important;
}
.wizard-search .filter-input { max-width: none !important; flex: 1 1 100%; }
.wizard-search-row { display: flex; gap: 10px; margin-bottom: 18px; }
.wizard-search-row .filter-select { max-width: 160px; }
.wizard-search-row .wizard-search { margin-bottom: 0; }
.wizard-card-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-height: 60vh; overflow-y: auto; padding: 4px;
}
@media (max-width: 720px) { .wizard-card-grid { grid-template-columns: repeat(2, 1fr); } }
.wizard-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 14px 18px;
  background: var(--surface-2); border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer; user-select: none;
  transition: border-color .12s, transform .1s, background .12s;
  min-height: 110px;
}
.wizard-card:hover { background: var(--surface-3); }
.wizard-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}
:root[data-theme="light"] .wizard-card { background: #FFFFFF; border-color: rgba(0,0,0,0.08); }
:root[data-theme="light"] .wizard-card:hover { background: #FAFAFA; border-color: rgba(0,0,0,0.18); }
:root[data-theme="light"] .wizard-card.is-selected { background: var(--accent-dim); border-color: var(--accent); }
.wizard-card-avatar {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  background: var(--surface-3);
  color: var(--text-muted);
}
.wizard-card-avatar--icon { background: var(--surface-3); color: var(--text-muted); }
.wizard-card-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  text-align: center; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.wizard-card-sub {
  font-size: 11px; color: var(--text-muted);
  text-align: center;
}

/* Breadcrumb do step 4 */
.wizard-breadcrumb {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}

/* Footer fica colado embaixo, layout esquerda/direita já existe */
.demand-wizard-footer { padding-top: 14px; }

/* Checklist editável (modal de fluxo e nova demanda) — lista vertical com
   input + botão de remover por linha. */
.flow-checklist-list { display: flex; flex-direction: column; gap: 6px; }
.flow-checklist-item { display: flex; align-items: center; gap: 6px; }
.flow-checklist-item .form-control { flex: 1; }
.flow-checklist-item .icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); color: var(--text-muted);
  cursor: pointer; flex-shrink: 0;
}
.flow-checklist-item .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.flow-checklist-item .icon-btn.danger:hover { background: rgba(239,80,80,0.12); color: var(--danger); border-color: var(--danger); }

/* ─── Painel Recorrentes v2 — layout 2-col (clientes + conteúdo) ───
   Estrutura:
     .rec-tabs                 (DEMANDAS | LISTAS)
     .rec-layout
       .rec-clients-col        (cards de cliente c/ contagem de projetos)
       .rec-content-col
         .rec-controls-bar     (search + segmented group-by)
         .rec-client-header    (nome + status counters)
         .rec-group[]          (por Projeto/Função/Responsável, colapsável)
           .rec-sublist[]      (Lista X / Personalizada, colapsável)
             .rec-item[]       (recorrente com checkbox + meta + status + ações)
           .rec-add-row[]      (Adicionar lista / Adicionar recorrente personalizada) */

/* Tabs no topo (DEMANDAS / LISTAS) */
.rec-tabs {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--hairline);
  padding: 0 24px; gap: 0;
}
.rec-tab {
  flex: 1; padding: 16px 20px;
  background: transparent; border: none; border-bottom: 3px solid transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; transition: color .12s, border-color .12s;
}
.rec-tab:hover { color: var(--text); }
.rec-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

/* Layout 2 colunas */
.rec-layout {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 0; min-height: calc(100vh - 130px);
}
.rec-clients-col {
  padding: 20px 14px; border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
}
.rec-content-col { padding: 20px 24px; overflow-x: hidden; }

/* "Todos os clientes" — pill destacada no topo da coluna */
.rec-clients-all {
  padding: 12px; margin-bottom: 4px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent-text);
  font-size: 13px; font-weight: 600;
  text-align: center;
  cursor: pointer; user-select: none;
  transition: background .12s, color .12s, transform .1s var(--ease-spring);
  border: 1px solid transparent;
}
.rec-clients-all:hover { background: var(--accent-dim); border-color: var(--accent); }
.rec-clients-all.is-selected {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}

/* Card de cliente na coluna esquerda */
.rec-client-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--hairline);
  cursor: pointer;
  transition:
    background .12s var(--ease-out),
    border-color .12s var(--ease-out),
    transform .15s var(--ease-spring),
    box-shadow .15s var(--ease-out);
}
.rec-client-card:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--border);
}
.rec-client-card.is-selected {
  background: var(--surface-3); border-color: var(--text);
}
.rec-client-card-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background-size: cover; background-position: center;
}
.rec-client-card-body { flex: 1; min-width: 0; }
.rec-client-card-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-client-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
:root[data-theme="light"] .rec-client-card { background: #FFFFFF; }
:root[data-theme="light"] .rec-client-card:hover { background: #FAFAFA; }
:root[data-theme="light"] .rec-client-card.is-selected { background: #F0F0F0; border-color: #0F172A; }

/* Barra de controles: search + segmented group-by */
.rec-controls-bar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.rec-search-wrap { flex: 1; min-width: 200px; max-width: none; }
.rec-search-wrap .filter-input { max-width: none !important; width: 100%; }
.rec-groupby {
  display: inline-flex; gap: 4px;
  padding: 4px; background: var(--surface-2);
  border: 1px solid var(--hairline); border-radius: var(--radius-pill);
}
.rec-groupby-btn {
  padding: 6px 14px; background: transparent; border: none;
  border-radius: var(--radius-pill); color: var(--text-muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .12s, color .12s;
}
.rec-groupby-btn:hover { color: var(--text); }
.rec-groupby-btn.is-active { background: var(--accent); color: #fff; }

/* Header do cliente com contadores de status */
.rec-client-header {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.rec-client-header-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.rec-client-header-name { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; }
.rec-status-counts { display: flex; gap: 20px; align-items: center; }
.rec-status-count {
  display: inline-flex; gap: 6px; align-items: baseline;
  font-size: 12px; color: var(--text-muted);
}
.rec-status-count b { font-weight: 700; color: var(--text); font-size: 13px; }
.rec-status-count.is-progress b { color: var(--warn); }
.rec-status-count.is-pending b { color: var(--warn); }
.rec-status-count.is-done b { color: var(--success); }

/* Grupo (Projeto/Função/Responsável) — card colapsável */
.rec-group {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 14px;
}
.rec-group-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--hairline);
}
.rec-group-head .rec-chevron {
  color: var(--text-muted); transition: transform .15s; flex-shrink: 0;
}
.rec-group.is-collapsed .rec-chevron { transform: rotate(-90deg); }
.rec-group.is-collapsed .rec-group-body { display: none; }
.rec-group.is-collapsed .rec-group-head { border-bottom: none; }
.rec-group-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.rec-group-body { padding: 12px 18px 16px; }

/* Sub-lista dentro de um grupo (Lista X / Personalizada) */
.rec-sublist {
  display: flex; flex-direction: column;
  margin-bottom: 6px;
}
.rec-sublist-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; cursor: pointer; user-select: none;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
}
.rec-sublist-head:hover { color: var(--text); }
.rec-sublist-head .rec-chevron-sm {
  transition: transform .15s; color: var(--text-muted); flex-shrink: 0;
}
.rec-sublist.is-collapsed .rec-chevron-sm { transform: rotate(-90deg); }
.rec-sublist.is-collapsed .rec-sublist-body { display: none; }
.rec-sublist-body { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.rec-sublist-empty {
  font-size: 12px; color: var(--text-muted); font-style: italic;
  padding: 8px 12px;
}
.rec-sublist-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: transparent; border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  cursor: pointer; align-self: flex-start;
  transition: color .12s, border-color .12s, background .12s;
}
.rec-sublist-add:hover {
  color: var(--accent); border-color: var(--accent); background: var(--accent-dim);
}
.rec-sublist-delete {
  background: transparent; border: none; padding: 4px;
  color: var(--text-muted); cursor: pointer; border-radius: 4px;
  opacity: 0; transition: opacity .15s, color .12s, background .12s;
}
.rec-sublist:hover .rec-sublist-delete { opacity: 1; }
.rec-sublist-delete:hover { color: var(--danger); background: rgba(239,80,80,0.1); }

/* Item (recorrente) */
.rec-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  transition: background .12s, border-color .12s;
}
.rec-item:hover { background: var(--surface-3); border-color: var(--border-active, var(--hairline)); }
.rec-item.is-inactive { opacity: 0.5; }
:root[data-theme="light"] .rec-item { background: #FAFAFA; }
:root[data-theme="light"] .rec-item:hover { background: #F0F0F0; }

.rec-check {
  width: 20px; height: 20px; flex-shrink: 0;
  background: transparent; border: 1.5px solid var(--text-muted);
  border-radius: 5px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; transition: all .12s var(--ease-spring);
}
.rec-check:hover { border-color: var(--accent); transform: scale(1.08); }
.rec-check.is-done { background: var(--success); border-color: var(--success); }
.rec-check.is-done svg { display: block; }
.rec-check svg { display: none; }
.rec-check[disabled] { cursor: not-allowed; opacity: 0.5; }

.rec-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rec-item-name-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.rec-item-prio-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.rec-item-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-item-meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.rec-meta-chip { display: inline-flex; align-items: center; gap: 4px; }
/* Ícones dos meta chips forçados em 16×16 (o `class="ic-xs"` no <i> se perde
   após o lucide substituir pelo <svg>, então a regra segue no SVG resultante) */
.rec-item-meta svg,
.rec-item-meta i,
.rec-item-meta i svg,
.rec-meta-chip svg,
.rec-meta-chip i,
.rec-meta-chip i svg,
.lista-item-meta svg,
.lista-item-meta i,
.lista-item-meta i svg { width: 16px !important; height: 16px !important; }

/* Status badge (EM ANDAMENTO / PENDENTE / CONCLUÍDA) */
.rec-status-pill {
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; flex-shrink: 0;
}
.rec-status-pill.is-progress { color: #fff; background: var(--warn, #F59E0B); }
.rec-status-pill.is-pending  { color: var(--warn); background: rgba(245,158,11,0.12); }
.rec-status-pill.is-done     { color: var(--success); background: rgba(34,197,94,0.12); }
.rec-status-pill.is-inactive { color: var(--text-muted); background: var(--surface-3); }

/* Ações inline (⚡ editar × 🗑) — visual unificado com o notification bell da topbar */
.rec-item-actions,
.lista-card-actions,
.lista-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.rec-action-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer;
  transition: color .15s var(--ease-out), background .15s var(--ease-out), border-color .15s var(--ease-out);
}
.rec-action-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-active); }
.rec-action-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: transparent; }
.rec-action-btn svg,
.rec-action-btn i,
.rec-action-btn i svg { width: 16px !important; height: 16px !important; }

/* Linha "Adicionar lista" / "Adicionar demanda personalizada" */
.rec-add-row-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 14px;
}
.rec-add-row {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px;
  background: transparent; border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: color .12s, border-color .12s, background .12s;
}
.rec-add-row:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim);
}
.rec-add-row-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-dim);
  flex-shrink: 0;
}
.rec-add-row:hover .rec-add-row-icon { background: var(--accent); color: #fff; }

/* Card grande de cliente no modo "Todos + agrupado por Cliente" */
.rec-client-top {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 22px;
}
.rec-client-top-head {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--hairline);
}
.rec-client-top.is-collapsed .rec-client-top-head { border-bottom: none; }
.rec-client-top.is-collapsed .rec-chevron { transform: rotate(-90deg); }
.rec-client-top.is-collapsed .rec-client-top-body { display: none; }
.rec-client-top-body { padding: 14px 22px 18px; }
:root[data-theme="light"] .rec-client-top { background: #FFFFFF; }

/* Add-row full-width quando não há botão de Lista */
.rec-add-row.full-width { grid-column: 1 / -1; }

/* ── Aba LISTAS — cards de listas ──
   Estrutura: header (nome + cliente/projeto + ações) + body (itens + add-row).
   Colapsável — chevron gira quando fechado. */
.lista-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 14px;
  transition:
    border-color .15s var(--ease-out),
    box-shadow .18s var(--ease-out);
}
.lista-card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .lista-card { background: #FFFFFF; }
.lista-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--hairline);
}
.lista-card.is-collapsed .lista-card-head { border-bottom: none; }
.lista-card.is-collapsed .lista-card-body { display: none; }
.lista-card.is-collapsed .lista-chevron { transform: rotate(-90deg); }
.lista-chevron {
  color: var(--text-muted); flex-shrink: 0;
  transition: transform .15s;
}
.lista-card-title {
  font-size: 15px; font-weight: 700; color: var(--text); flex: 0 0 auto;
}
.lista-card-context {
  font-size: 13px; color: var(--text-muted);
  padding-left: 12px; border-left: 1px solid var(--hairline);
  margin-left: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
/* Layout de lista-card-actions consolidado no seletor unificado acima */
.lista-card-body {
  padding: 14px 20px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.lista-empty-msg {
  padding: 24px; text-align: center;
  color: var(--text-muted); font-size: 13px; font-style: italic;
}
/* Item dentro da Lista — reusa muito do .rec-item mas com estilos próprios */
.lista-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  transition: background .12s, border-color .12s;
}
.lista-item:hover { background: var(--surface-3); }
:root[data-theme="light"] .lista-item { background: #FAFAFA; }
:root[data-theme="light"] .lista-item:hover { background: #F0F0F0; }
.lista-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lista-item-name-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.lista-item-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lista-item-meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
/* Layout de lista-item-actions consolidado no seletor unificado acima */
/* Botão de adicionar demanda à lista */
.lista-add-demand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 16px;
  background: transparent; border: 1px dashed var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: color .12s, border-color .12s, background .12s;
  margin-top: 4px;
}
.lista-add-demand:hover {
  color: var(--accent); border-color: var(--accent); background: var(--accent-dim);
}
.lista-add-demand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-dim);
  flex-shrink: 0;
}
.lista-add-demand:hover .lista-add-demand-icon { background: var(--accent); color: #fff; }

/* Esconder coluna de clientes quando aba Listas ativa */
body.rec-tab-listas-active .rec-clients-col { display: none; }
body.rec-tab-listas-active .rec-layout { grid-template-columns: 1fr; }

/* ── Combo de opções (Adicionar Lista modal) ──
   Input + lista de resultados abaixo, filtra em tempo real. */
.al-options {
  margin-top: 10px;
  max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.al-option {
  padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.al-option:hover { background: var(--surface-3); border-color: var(--text-muted); }
.al-option.is-selected {
  background: var(--accent-dim); border-color: var(--accent);
}
.al-option-title { font-size: 13px; font-weight: 600; color: var(--text); }
.al-option-sub {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
:root[data-theme="light"] .al-option { background: #FAFAFA; }
:root[data-theme="light"] .al-option:hover { background: #F0F0F0; }

@media (max-width: 900px) {
  .rec-layout { grid-template-columns: 1fr; }
  .rec-clients-col { border-right: none; border-bottom: 1px solid var(--hairline); max-height: 260px; }
  .rec-add-row-wrap { grid-template-columns: 1fr; }
}

/* ── 6. Confirm modal com ícone tematizado ──────────────── */
.confirm-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px; flex-shrink: 0;
}
.confirm-icon.is-danger  { background: rgba(239,80,80,0.15); color: var(--danger); }
.confirm-icon.is-warn    { background: rgba(245,167,24,0.15); color: var(--warn); }
.confirm-icon.is-info    { background: var(--accent-dim); color: var(--accent-text); }
.confirm-icon.is-success { background: rgba(60,227,160,0.15); color: var(--success); }
.confirm-icon svg, .confirm-icon i { width: 24px; height: 24px; stroke-width: 2; }
@keyframes confirmIconPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
.confirm-icon { animation: confirmIconPop .26s var(--ease-spring); }

