/* Sirius Hub Dash — v7 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Sirius design system v1 — aplicado 2026-05-19
     Referência: /marca/design-guide.md */

  /* Background hierárquico (preto profundo Sirius) */
  --bg: #040C13;
  --surface: #0E1318;
  --surface-2: #141A24;
  --surface-3: #1A2030;

  /* Largura do painel Meu Dia — fonte única (painel + reflow do #app usam a mesma). */
  --myday-w: 360px;
  /* Folga entre o conteúdo e o painel, pra nada (ex: chip do responsável) ficar colado/coberto. */
  --myday-gutter: 20px;

  /* Bordas (cyan baixo opacity — identidade do hub) */
  --border: rgba(7, 239, 245, 0.15);
  --border-hover: rgba(7, 239, 245, 0.30);

  /* Texto */
  --text: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.45);

  /* Accent principal (cyan Sirius) */
  --accent: #00F6F5;
  --accent-light: rgba(0, 246, 245, 0.6);

  /* Cores de assinatura (gradient + destaques pontuais) */
  --magenta: #D24EFF;
  --lilas: #B66FFF;
  --gradient-primary: linear-gradient(135deg, #D24EFF 0%, #00F6F5 50%, #B66FFF 100%);
  /* gradient-soft v2 (2026-05-20): cyan e lilás puxados pra zona escura
     pra garantir legibilidade de texto claro OU escuro nos botões/tabs */
  --gradient-soft: linear-gradient(120deg, #0EAFAF 0%, #2A8FB8 50%, #7B5AD8 100%);
  /* gradient-btn (2026-06-03): versão dark/sutil pros botões — mesma direção
     ciano→índigo da marca, mas na zona escura. Texto branco. */
  --gradient-btn:  linear-gradient(135deg, #18424F 0%, #1A2740 55%, #2A2050 100%);

  /* Status (semáforo funcional — recalibrado pra paleta Sirius) */
  --green: #00F6F5;
  --green-bg: rgba(0, 246, 245, 0.12);
  --yellow: #FFB84D;
  --yellow-bg: rgba(255, 184, 77, 0.12);
  --orange: #FFB84D;
  --orange-bg: rgba(255, 184, 77, 0.12);
  --red: #FF3366;
  --red-bg: rgba(255, 51, 102, 0.12);
  --blue: #00F6F5;
  --blue-bg: rgba(0, 246, 245, 0.12);

  /* Radius (mantido) */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(at 0% 0%, rgba(23, 17, 56, 0.35) 0%, var(--bg) 70%);
  color: var(--text);
  min-height: 100vh;
}

/* Space Grotesk pra display/headings/CTAs/KPIs — identidade Sirius v1 */
h1, h2, h3, h4,
.section-title, .card-title, .panel-title,
.kpi-value, .stat-value,
button.btn-primary, .btn-primary, .cta {
  font-family: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  letter-spacing: -0.015em;
}

/* ==========================================================================
   Sirius identity touches — gradient como assinatura pontual
   Conforme design-guide.md §7: painel = funcional, gradient só em destaques.
   ========================================================================== */

/* KPI hero (card Total) com gradient text */
.stat-hero .stat-value {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Nav tab active com gradient suave (cyan → lilás) + texto escuro */
.nav-tab.active {
  background: var(--gradient-soft);
  color: #040C13;
  font-weight: 700;
}

/* Botões primários com gradient suave + texto escuro + Space Grotesk */
.btn-new-task,
.btn-create-task,
button.btn-primary,
.btn-primary,
.cta {
  background: var(--gradient-btn);
  color: #FFFFFF;
  font-weight: 700;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: 0.01em;
}
.btn-new-task:hover,
.btn-create-task:hover {
  background: var(--gradient-btn);
  color: #FFFFFF;
  filter: brightness(1.18);
}

/* Card hero (detalhe cliente) — border-left gradient */
.cd-hero {
  border-left: 4px solid transparent !important;
  border-image: var(--gradient-primary) 1 !important;
  border-image-slice: 1 !important;
}

.header {
  position: relative;
}

#app {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* ---- Header ---- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.header-spacer { flex: 1; }
.header-center { display: flex; align-items: center; gap: 12px; }
/* Logo do header — símbolo Sirius gradient + wordmark Orbitron */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}
.logo-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-symbol svg { display: block; }
.logo-wordmark {
  font-family: 'Orbitron', sans-serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0;
  color: var(--text);
  line-height: 1;
}
/* manter compat com refs antigas a .logo-star (caso ainda exista em algum lugar) */
.logo-star { color: var(--accent); font-style: normal; }

.badge {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.header-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.last-update { color: var(--text-secondary); font-size: 12px; }

.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--surface-2); border-color: var(--accent); }
.btn-icon.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Banner de status de dados (offline / desatualizado) ---- */
.data-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.data-banner[hidden] { display: none; }
.data-banner-stale { background: rgba(255, 196, 0, 0.10); color: #ffd266; border-bottom-color: rgba(255, 196, 0, 0.30); }
.data-banner-error { background: rgba(255, 51, 102, 0.10); color: #ff7a99; border-bottom-color: rgba(255, 51, 102, 0.30); }
.data-banner-retry {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.data-banner-retry:hover { background: rgba(255,255,255,0.08); }
.data-banner-retry:disabled { opacity: 0.5; cursor: default; }

/* ---- User select (Eu sou) ---- */
.user-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.user-select:hover { border-color: var(--accent); }
.user-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(108,92,231,0.15); }
/* Destaca quando ninguém foi selecionado — força o time a escolher o nome ao abrir.
   Sem animação pulsante (poluía o topo): só uma borda âmbar discreta. */
.user-select:has(option[value=""]:checked) {
  border-color: var(--yellow);
  color: var(--yellow);
  font-weight: 600;
}

/* ---- Notification Bell ---- */
.notif-wrap { position: relative; }
.btn-notif { position: relative; }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg, #040C13);
  animation: notifPulse 2s ease-in-out infinite;
}
.notif-badge[hidden] { display: none; }
@keyframes notifPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 2px var(--bg, #040C13), 0 0 0 0 var(--red-bg); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 2px var(--bg, #040C13), 0 0 0 6px rgba(255,51,102,0); }
}
.btn-notif.has-unread { color: var(--red); }

/* ---- Notification Popover ---- */
.notif-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--surface, #0E1318);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}
.notif-popover[hidden] { display: none; }
.notif-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2, rgba(255,255,255,0.03));
  font-size: 13px;
}
.notif-link {
  background: none;
  border: none;
  color: var(--accent, var(--magenta));
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.notif-link:hover { text-decoration: underline; }
.notif-list {
  overflow-y: auto;
  flex: 1;
  max-height: 380px;
}
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted, #888);
  font-size: 12px;
}
.notif-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2, rgba(255,255,255,0.04)); }
.notif-item.is-read { opacity: 0.55; }
.notif-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted, #888);
}
.notif-item-proj { font-weight: 600; color: var(--accent, var(--magenta)); }
.notif-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}
.notif-item-meta { font-size: 11px; color: var(--text-secondary, #aaa); }
.notif-item-meta strong { color: var(--text); }
.notif-item.kind-mention { border-left: 3px solid var(--yellow); padding-left: 11px; }
.notif-item.kind-mention .notif-item-proj { color: var(--yellow); }
.notif-item.kind-assigned { border-left: 3px solid var(--accent); padding-left: 11px; }
.notif-item.kind-assigned .notif-item-proj { color: var(--accent); }
.notif-item-excerpt {
  font-size: 11px;
  font-style: italic;
  color: var(--text-secondary, #aaa);
  background: var(--surface-2, rgba(255,255,255,0.03));
  padding: 6px 8px;
  border-radius: 6px;
  margin-top: 2px;
  line-height: 1.4;
}

/* @menções — chip dentro de comentário */
.mention-chip {
  display: inline-block;
  background: var(--yellow-bg);
  color: var(--yellow);
  border-radius: 4px;
  padding: 0 5px;
  font-weight: 600;
  font-size: 0.92em;
}

/* Autocomplete @nome — dropdown flutuante */
.mention-suggest {
  position: absolute;
  z-index: 9999;
  background: var(--surface, #0E1318);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  padding: 4px;
  min-width: 180px;
  max-width: 260px;
  font-size: 13px;
}
.mention-suggest[hidden] { display: none; }
.mention-item {
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
}
.mention-item.is-active,
.mention-item:hover { background: var(--yellow-bg); color: var(--yellow); font-weight: 600; }
.notif-pop-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted, #888);
  text-align: center;
}

/* ---- Executive Summary ---- */
.summary { margin-bottom: 20px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}

/* Clickable stat cards */
.stat-clickable {
  cursor: pointer;
  transition: all 0.2s;
}
.stat-clickable:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.stat-clickable.stat-active {
  border-color: var(--accent);
  background: rgba(0,246,245,0.12);
  box-shadow: 0 0 0 1px var(--accent);
}

.stat-value { font-size: 26px; font-weight: 700; margin-bottom: 2px; }
.stat-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.stat-done .stat-value { color: var(--green); }
.stat-progress .stat-value { color: var(--blue); }
.stat-pending .stat-value { color: var(--text-muted); }
.stat-overdue .stat-value { color: var(--text-muted); }
.stat-overdue-active .stat-value { color: var(--red) !important; }
.stat-overdue-active { border-color: var(--red-bg) !important; background: var(--red-bg) !important; }
.stat-percent { position: relative; }

.stat-progress-ring {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 52px;
}
.stat-progress-ring .stat-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
}
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 3; }
.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 0, 100;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

/* Alerts */
.alerts { display: flex; gap: 8px; flex-wrap: wrap; }
.alert {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}
.alert-red { background: var(--red-bg); color: var(--red); }
.alert-orange { background: var(--orange-bg); color: var(--orange); }
.alert-yellow { background: var(--yellow-bg); color: var(--yellow); }

/* Alert buttons (clickable) */
.alert-btn {
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
}
.alert-btn:hover { opacity: 0.8; transform: translateY(-1px); }
.alert-btn.alert-active {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ---- Controls ---- */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.controls-left { display: flex; align-items: center; gap: 12px; }
.controls-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Task date filter bar ---- */
.controls-left { position: relative; }
.task-date-filter-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  position: relative;
}
.task-date-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.task-date-btn:hover { color: var(--text); background: var(--surface-2); }
.task-date-btn.active { background: var(--accent); color: white; }
.task-date-custom-btn { font-size: 13px; padding: 3px 6px; }

/* Custom date picker dropdown */
.task-date-custom-picker {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.task-date-sep { color: var(--text-muted); font-size: 12px; }
.task-date-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.task-date-input:focus { outline: none; border-color: var(--accent); }
.task-date-apply {
  background: var(--accent);
  border: none;
  color: white;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
}
.task-date-apply:hover { opacity: 0.9; }
.task-date-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.task-date-clear:hover { border-color: var(--red); color: var(--red); }

.nav-tabs { display: flex; gap: 2px; background: var(--surface); padding: 3px; border-radius: var(--radius); }
.nav-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { background: var(--accent); color: white; }

.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface);
  padding: 3px;
  border-radius: var(--radius-sm);
}
.view-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  transition: all 0.2s;
}
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--surface-3); color: var(--accent-light); }

.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

/* Search input */
.search-input {
  width: 150px;
  min-width: 120px;
  transition: width 0.2s, border-color 0.2s;
  cursor: text;
}
.search-input:focus { width: 200px; }
.search-input::placeholder { color: var(--text-muted); }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.toggle-label input { accent-color: var(--accent); }

/* ---- Content ---- */
.content { min-height: 400px; }

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-secondary);
  gap: 16px;
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- Kanban Board ---- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  min-height: 500px;
  overflow-x: auto;
}

.kanban-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 300px;
  transition: border-color 0.2s, background 0.2s;
}
.kanban-column.drag-over {
  border-color: var(--accent);
  background: rgba(0,246,245,0.12);
}

/* Coluna Foco do Dia — destaque visual */
.kanban-column-foco {
  border-left: 3px solid rgba(108,92,231,0.5);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-pendente { background: var(--text-muted); }
.dot-andamento { background: var(--blue); }
.dot-emaprovacao { background: var(--yellow); }
.dot-feito { background: var(--green); }
.dot-foco { background: var(--magenta); }

.kanban-col-title { font-size: 13px; font-weight: 600; flex: 1; }
.kanban-col-count {
  background: var(--surface-2);
  color: var(--text-secondary);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ---- Foco do Dia: toggle de período ---- */
.foco-period-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.foco-period-btn {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.foco-period-btn:hover { border-color: var(--magenta); color: var(--lilas); }
.foco-period-btn.active {
  background: rgba(108,92,231,0.15);
  border-color: var(--magenta);
  color: var(--lilas);
}
.foco-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  padding: 6px 4px 4px;
  margin-top: 4px;
}
.foco-label-overdue { color: var(--red); }
.foco-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 24px 8px;
  opacity: 0.7;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 50px;
}

/* ---- Kanban Card ---- */
.kanban-card {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: grab;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}
.kanban-card.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}

/* Cores por status — fundo completo do card */
.kanban-card.card-status-pendente {
  background: rgba(107, 114, 128, 0.20);
  border: 1px solid rgba(107, 114, 128, 0.42);
}
.kanban-card.card-status-pendente:hover {
  background: rgba(107, 114, 128, 0.27);
  border-color: rgba(107, 114, 128, 0.65);
}

.kanban-card.card-status-andamento {
  background: var(--blue-bg);
  border: 1px solid var(--blue-bg);
}
.kanban-card.card-status-andamento:hover {
  background: var(--blue-bg);
  border-color: var(--blue-bg);
}

.kanban-card.card-status-emaprovacao {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-bg);
}
.kanban-card.card-status-emaprovacao:hover {
  background: var(--yellow-bg);
  border-color: var(--yellow-bg);
}

.kanban-card.card-status-feito {
  background: var(--green-bg);
  border: 1px solid var(--green-bg);
}
.kanban-card.card-status-feito:hover {
  background: var(--green-bg);
  border-color: var(--green-bg);
}

.kanban-card.card-status-travado {
  background: var(--red-bg);
  border: 1px solid var(--red-bg);
}
.kanban-card.card-status-travado:hover {
  background: var(--red-bg);
  border-color: var(--red-bg);
}

.card-project {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
}
.project-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.project-name {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
}
.card-title.card-done {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-avatars {
  display: flex;
  flex-direction: row;
}
.card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
  border: 2px solid var(--surface);
}
.card-avatars .card-avatar + .card-avatar {
  margin-left: -8px;
}
.card-avatar-empty {
  background: var(--surface-3) !important;
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.card-deadline {
  font-size: 11px;
  color: var(--text-secondary);
}
.deadline-overdue {
  color: var(--red) !important;
  font-weight: 600;
}

/* ===== Tarefas atrasadas — destaque vermelho ===== */
/* List view (tabela) */
.task-row-overdue td {
  background: var(--red-bg) !important;
  border-top: 1px solid var(--red-bg);
  border-bottom: 1px solid var(--red-bg);
}
.task-row-overdue td:first-child {
  border-left: 3px solid var(--red);
}
.task-row-overdue:hover td {
  background: var(--red-bg) !important;
}
.task-row-overdue .col-task,
.task-row-overdue .clickable-task {
  color: var(--red);
  font-weight: 600;
}

/* Kanban card */
.kanban-card-overdue {
  border-left: 3px solid var(--red) !important;
  box-shadow: 0 0 0 1px var(--red-bg), 0 4px 12px var(--red-bg);
  background: linear-gradient(135deg, var(--red-bg), var(--red-bg) 60%) !important;
}
.kanban-card-overdue:hover {
  box-shadow: 0 0 0 1px var(--red-bg), 0 8px 18px var(--red-bg);
}

/* Lista de tarefas em módulos (cd-task-row) */
.cd-task-row.cd-task-overdue {
  background: var(--red-bg);
  border-left: 3px solid var(--red);
  padding-left: 9px;
}
.cd-task-row.cd-task-overdue:hover {
  background: var(--red-bg);
}
.cd-task-row.cd-task-overdue .cd-t-name {
  color: var(--red);
  font-weight: 600;
}

/* ===== Tarefas que vencem hoje — destaque amarelo ===== */
.task-row-duetoday td {
  background: rgba(241, 196, 15, 0.10) !important;
  border-top: 1px solid rgba(241, 196, 15, 0.30);
  border-bottom: 1px solid rgba(241, 196, 15, 0.30);
}
.task-row-duetoday td:first-child { border-left: 3px solid var(--yellow); }
.task-row-duetoday:hover td { background: rgba(241, 196, 15, 0.18) !important; }
.task-row-duetoday .col-task,
.task-row-duetoday .clickable-task { color: #b8860b; font-weight: 600; }

.kanban-card-duetoday {
  border-left: 3px solid var(--yellow) !important;
  box-shadow: 0 0 0 1px rgba(241, 196, 15, 0.35), 0 4px 12px rgba(241, 196, 15, 0.12);
  background: linear-gradient(135deg, rgba(241,196,15,0.10), rgba(241,196,15,0.02) 60%) !important;
}
.kanban-card-duetoday:hover {
  box-shadow: 0 0 0 1px rgba(241, 196, 15, 0.55), 0 8px 18px rgba(241, 196, 15, 0.25);
}

.cd-task-row.cd-task-duetoday {
  background: rgba(241, 196, 15, 0.10);
  border-left: 3px solid var(--yellow);
  padding-left: 9px;
}
.cd-task-row.cd-task-duetoday:hover { background: rgba(241, 196, 15, 0.18); }
.cd-task-row.cd-task-duetoday .cd-t-name { color: #b8860b; font-weight: 600; }

.deadline-duetoday { color: #b8860b !important; font-weight: 600; }
.cd-t-deadline.duetoday { color: #b8860b; font-weight: 700; }

/* ===== Tarefas em andamento — destaque azul ===== */
.cd-task-row.cd-task-doing {
  background: var(--blue-bg);
  border-left: 3px solid var(--blue);
  padding-left: 9px;
}
.cd-task-row.cd-task-doing:hover { background: var(--blue-bg); }
.cd-task-row.cd-task-doing .cd-t-name { color: var(--accent); font-weight: 600; }

/* ===== Checkbox custom — usado em bulk-select e similares ===== */
.tm-task-check,
.tm-select-all,
.cd-task-check input[type="checkbox"],
input.tm-task-check[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  margin: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.tm-task-check:hover,
.tm-select-all:hover,
.cd-task-check input[type="checkbox"]:hover {
  border-color: var(--lilas);
  background: rgba(162, 155, 254, 0.08);
}
.tm-task-check:checked,
.tm-select-all:checked,
.cd-task-check input[type="checkbox"]:checked {
  background: var(--lilas);
  border-color: var(--lilas);
}
.tm-task-check:checked::after,
.tm-select-all:checked::after,
.cd-task-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.tm-task-check:focus-visible,
.cd-task-check input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(162, 155, 254, 0.5);
  outline-offset: 2px;
}
.tm-task-check:indeterminate,
.tm-select-all:indeterminate {
  background: var(--lilas);
  border-color: var(--lilas);
}
.tm-task-check:indeterminate::after,
.tm-select-all:indeterminate::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 7px;
  width: 10px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* ---- List View ---- */
.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.task-table thead th {
  background: var(--surface);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
  cursor: pointer;
  user-select: none;
}
.task-table thead th:hover { color: var(--text); }
.sortable.sort-asc::after { content: ' ↑'; }
.sortable.sort-desc::after { content: ' ↓'; }

.list-group-header td {
  padding: 12px 14px 8px;
  font-size: 13px;
  color: var(--text);
  border-top: 1px solid var(--border);
}
.list-group-count {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 400;
  margin-left: 8px;
}

.task-row td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(45, 49, 64, 0.5);
  vertical-align: middle;
}
.task-row:hover td {
  background: var(--surface);
}

.row-done td { opacity: 0.5; }
.row-done .col-task { text-decoration: line-through; }

.col-task { max-width: 400px; }
.col-status { width: 160px; }
.col-person { width: 150px; white-space: nowrap; }
.col-deadline { width: 100px; }
.col-project { width: 150px; white-space: nowrap; }

.inline-status {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}
.inline-status:focus { outline: none; border-color: var(--accent); }

.list-avatar {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
  margin-right: 6px;
  vertical-align: middle;
}

.project-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

.text-muted { color: var(--text-muted); }

/* ---- Coming Soon ---- */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-secondary);
}
.coming-soon-icon { font-size: 48px; margin-bottom: 16px; }
.coming-soon h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.coming-soon p { font-size: 14px; line-height: 1.6; }

/* ---- Task Detail Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.task-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 720px;
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100vh - 48px);
  /* fields below are overridden no breakpoint largo (≥980px) p/ layout 2 colunas */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 950;
  transform: translate(-50%, -50%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.task-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-project {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.modal-close-btn {
  padding: 6px;
}

.modal-nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-modal-nav {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  line-height: 1;
}
.btn-modal-nav:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-modal-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.modal-nav-counter {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}

.modal-body {
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.modal-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-textarea {
  resize: vertical;
  min-height: 40px;
  line-height: 1.5;
}

#modalTaskName {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 56px;
  padding: 14px 14px;
}
@media (max-width: 768px) {
  #modalTaskName { font-size: 18px; min-height: 48px; }
}

.modal-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238b8fa3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.modal-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Solicitante read-only display */
.modal-requester-value {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  min-height: 38px;
}

/* Date input styling */
input[type="date"].modal-input {
  color-scheme: dark;
}

/* Notes display with clickable links */
.notes-display {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text);
  min-height: 80px;
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
  transition: border-color 0.2s;
}
.notes-display:hover {
  border-color: var(--border-hover);
}
.notes-display a {
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}
.notes-display a:hover {
  color: var(--accent-light);
}

/* Clickable task name in list view */
.clickable-task {
  cursor: pointer;
  transition: color 0.15s;
}
.clickable-task:hover {
  color: var(--accent-light);
}

/* ---- New Task Button ---- */
.btn-new-task {
  background: var(--accent);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-new-task:hover {
  background: var(--accent-light);
  color: var(--bg);
}

/* ---- Create Task Button (modal) ---- */
.btn-create-task {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 4px;
}
.btn-create-task:hover {
  background: var(--accent-light);
  color: var(--bg);
}
.btn-create-task:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Título no topo (compacto, sem chrome de card) ---- */
.modal-top-id {
  padding: 8px 20px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.modal-top-id #modalProjectField { margin-bottom: 8px; }
.modal-title-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.3;
  padding: 4px 0;
  resize: none;
  outline: none;
  min-height: 28px;
  overflow: hidden;
}
.modal-title-input::placeholder { color: var(--text-secondary); font-weight: 400; }
.modal-title-input:focus {
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
}
@media (max-width: 560px) {
  .modal-top-id { padding: 8px 14px 10px; }
  .modal-title-input { font-size: 16px; }
}

/* ---- Quick Actions (topo do modal — Concluir + status) ---- */
.modal-quick-actions {
  display: flex;
  gap: 8px;
  padding: 8px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  align-items: stretch;
}
.btn-quick-complete {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  color: var(--bg);
  border: 1px solid var(--green);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.2;
}
.btn-quick-complete:hover {
  background: var(--accent-light, var(--green));
  filter: brightness(1.08);
}
.btn-quick-complete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-quick-complete.is-reopen {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-quick-complete.is-reopen:hover {
  background: var(--green-bg);
}
.btn-quick-status {
  flex: 0 0 auto;
  min-width: 150px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-quick-status:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-quick-status:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,246,245,0.18);
}
@media (max-width: 560px) {
  .modal-quick-actions { padding: 10px 14px; flex-wrap: wrap; }
  .btn-quick-complete { flex: 1 1 100%; }
  .btn-quick-status { flex: 1 1 100%; min-width: 0; }
}

/* ---- Barra de tags de execução (glance: prioridade, prazo, responsáveis, subprojeto) ---- */
.modal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-meta-bar:empty { display: none !important; }
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.35;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.meta-pill:hover { border-color: var(--green); color: var(--green); }
.meta-pill .meta-pill-label { color: var(--text-secondary); font-weight: 500; }
.meta-pill.meta-pill-empty { border-style: dashed; color: var(--text-secondary); font-weight: 500; }
.meta-pill-prio-alta { border-color: var(--red); color: var(--red); }
.meta-pill-prio-media { border-color: var(--orange); color: var(--orange); }
.meta-pill-prio-baixa { border-color: var(--green); color: var(--green); }
.meta-pill-deadline.is-overdue { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.meta-pill-deadline.is-today { border-color: var(--orange); color: var(--orange); background: var(--orange-bg); }
.meta-pill-person .meta-pill-ava {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
/* Destaque suave do campo ao clicar na tag correspondente */
.modal-field.field-flash {
  animation: fieldFlash 1.2s ease;
  border-radius: var(--radius-sm);
}
@keyframes fieldFlash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  20% { box-shadow: 0 0 0 2px var(--green-bg); }
}
@media (max-width: 560px) {
  .modal-meta-bar { padding: 8px 14px; }
}

/* ---- Status Rápido (acima do excluir) ---- */
.modal-status-quick-row {
  margin-top: 12px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
}
.modal-status-quick-select {
  width: 100%;
  font-weight: 600;
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent-light);
  padding: 10px 12px;
}
.modal-status-quick-select:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(0,246,245,0.12);
}

/* ---- Modal Actions Row ---- */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* ---- Delete Task Button (modal) ---- */
.btn-delete-task {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}
.btn-delete-task:hover {
  background: var(--red);
  color: white;
}
.btn-delete-task:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Delete Confirm Dialog ---- */
.delete-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.delete-confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
}
.delete-confirm-box h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.delete-confirm-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.delete-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-confirm-delete {
  background: var(--red);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-confirm-delete:hover {
  background: var(--red);
}
.btn-cancel-delete {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel-delete:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--green); color: white; }
.toast-error { background: var(--red); color: white; }

/* ---- Back Button (mobile) ---- */
.btn-modal-back {
  display: none; /* Hidden on desktop */
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 10px 6px 4px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.btn-modal-back:hover {
  background: var(--surface-2);
}
.btn-modal-back svg {
  flex-shrink: 0;
}

/* ---- Financial Tab ---- */
.fin-period-filter {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--radius);
  width: fit-content;
  margin-bottom: 20px;
}
.period-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s;
}
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--accent); color: white; }

.fin-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.fin-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.fin-kpi-card:hover { border-color: var(--border-hover); }

.fin-kpi-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.fin-kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fin-kpi-highlight .fin-kpi-value { color: var(--green); }

.platform-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-eduzz { background: rgba(0,246,245,0.12); color: var(--accent-light); }
.badge-hotmart { background: var(--orange-bg); color: var(--orange); }
.badge-curseduca { background: var(--green-bg); color: var(--green); }
.badge-ghl { background: var(--blue-bg); color: var(--blue); }

.sale-status-approved { color: var(--green); }
.sale-status-pending { color: var(--yellow); }
.sale-status-refunded { color: var(--red); }
.sale-status-cancelled { color: var(--text-muted); }

.fin-table-wrapper { overflow-x: auto; margin-bottom: 24px; }
.fin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin-table thead th {
  background: var(--surface);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.fin-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(45, 49, 64, 0.5);
}
.fin-table tbody tr:hover td { background: var(--surface); }

/* ---- Responsive ---- */

/* Tablet landscape + desktop médio */
@media (max-width: 1200px) {
  .kanban-board { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .summary-grid { grid-template-columns: repeat(6, 1fr); }
  .kanban-column { padding: 10px; }
  .kanban-col-title { font-size: 12px; }

  /* Filtros com wrap para caber em telas menores */
  .controls-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-input {
    flex: 1 1 140px;
    width: auto;
  }
  .filter-select {
    flex: 1 1 120px;
    min-width: 100px;
  }
  .toggle-label { flex-shrink: 0; }
  .btn-metas { flex-shrink: 0; }
  .btn-new-task { flex-shrink: 0; }
}

/* Tablet portrait */
@media (max-width: 1000px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile kanban: horizontal scroll with snap */
@media (max-width: 768px) {
  #app { padding: 0 12px 32px; }

  /* Kanban: horizontal scroll */
  .kanban-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 8px;
    min-height: auto;
  }
  .kanban-board::-webkit-scrollbar { height: 4px; }
  .kanban-board::-webkit-scrollbar-track { background: var(--surface); border-radius: 2px; }
  .kanban-board::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }

  .kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
    scroll-snap-align: start;
    min-height: 200px;
  }

  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .fin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-table { min-width: 600px; }
  .controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .controls-left { flex-wrap: wrap; gap: 8px; }
  .controls-right { flex-wrap: wrap; gap: 8px; justify-content: space-between; }
  .header { flex-wrap: wrap; gap: 8px; }

  /* Filters full width */
  .filter-select { flex: 1; min-width: 120px; }

  /* List scroll horizontal */
  .list-view { overflow-x: auto; }
  .task-table { min-width: 700px; }

  /* Modal: full screen slide-up on mobile */
  .task-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh; /* iOS Safari: dynamic viewport height (exclui barra do browser) */
    max-height: 100vh;
    max-height: 100dvh;
    top: 0;
    left: 0;
    right: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transform: translate(0, 100%) scale(1);
    opacity: 1;
  }
  .task-modal.open {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  .modal-row { grid-template-columns: 1fr; }

  /* Show back button, hide X button on mobile */
  .btn-modal-back { display: flex; }
  .modal-close-btn { display: none; }

  /* Modal header more spacious */
  .modal-header {
    padding: 12px 16px;
    gap: 8px;
  }

  /* Modal body: scroll interno + espaço suficiente para o conteúdo final */
  .modal-body {
    padding: 16px;
    padding-bottom: max(100px, env(safe-area-inset-bottom, 100px));
  }

  /* Kanban cards: improve touch targets */
  .kanban-card {
    padding: 12px 14px;
  }
}

/* ---- Related Tasks (Session C) ---- */
.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 24px;
}

.related-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--accent-light);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
  font-family: inherit;
  font-weight: 500;
}

.related-chip:hover {
  background: rgba(0,246,245,0.12);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.related-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 24px;
}

.related-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.related-add-input {
  flex: 1;
  font-size: 13px;
}

.btn-related-add {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-related-add:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Dependência entre tarefas (bloqueio) ── */
.depends-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.depends-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.depends-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  max-width: 100%;
}
.depends-chip.is-open  { border-color: rgba(255,184,77,0.5); }
.depends-chip.is-done  { opacity: 0.6; }
.depends-chip-open {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.depends-chip-open:hover { color: var(--accent); }
.depends-chip-state {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--yellow);
}
.depends-chip.is-done .depends-chip-state { background: var(--green, #2ecc71); }
.depends-chip-remove {
  padding: 5px 9px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.depends-chip-remove:hover { color: var(--red); background: var(--red-bg); }

/* Card/linha bloqueada por dependência */
.card-blocked-hint {
  font-size: 11px;
  color: var(--yellow);
  margin-bottom: 6px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card.task-blocked { border-left: 3px solid var(--yellow); }
.task-row.task-blocked .col-task { color: var(--text-muted); }
.list-lock { font-size: 11px; }
.myday-item-chip.dep-chip {
  background: var(--yellow-bg);
  color: var(--yellow);
  --chip-color: var(--yellow);
}
.myday-item.is-dep-blocked { opacity: 0.85; }
.cal6-event-blocked { outline: 1px solid var(--yellow); outline-offset: -1px; }

/* ── Histórico / Comentários ── */
.comments-log {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 6px;
  min-height: 32px;
  max-height: 140px;
  overflow-y: auto;
  font-size: 13px;
}
.comment-entry {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}
.comment-entry:last-child { border-bottom: none; }
.comment-entry strong { color: var(--text); }
.comment-link {
  color: var(--accent, #6c5ce7);
  text-decoration: underline;
  word-break: break-all;
}
.comment-link:hover { opacity: 0.8; }
.comment-empty {
  color: var(--text-muted, #666);
  font-style: italic;
  font-size: 12px;
}
.comment-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.comment-person-sel {
  width: 130px;
  flex-shrink: 0;
}
.comment-text-input {
  flex: 1;
  min-width: 0;
}
.btn-add-comment {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.btn-add-comment:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- Botão Metas da Semana ---- */
.btn-metas {
  padding: 6px 14px;
  background: rgba(0,246,245,0.12);
  color: var(--accent-light);
  border: 1px solid rgba(0,246,245,0.12);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-metas:hover {
  background: rgba(0,246,245,0.12);
  border-color: rgba(0,246,245,0.12);
}

/* ---- Metas Modal ---- */
.metas-modal {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%) translateX(120%);
  width: 480px;
  max-width: calc(100vw - 2rem);
  max-height: 84vh;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  overflow: hidden; /* child handles scroll */
}
.metas-modal.open { transform: translateY(-50%) translateX(0); }

/* Filter tabs */
.metas-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.metas-tab {
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
}
.metas-tab:hover { background: var(--surface-2); color: var(--text-primary); }
.metas-tab.active {
  background: rgba(0,246,245,0.12);
  border-color: rgba(0,246,245,0.12);
  color: var(--accent-light);
}

/* Scrollable list area */
.metas-list-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  min-height: 80px;
}

/* Group label (Gerais / Por Projeto) */
.metas-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 12px 0 6px;
}
.metas-group-label:first-child { margin-top: 0; }

/* Meta item */
.meta-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 6px;
  transition: background 0.12s;
}
.meta-item:hover { background: rgba(255,255,255,0.06); }

.meta-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.meta-remove-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.meta-remove-btn:hover {
  background: var(--red-bg);
  color: var(--red);
}

.meta-item-notes {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.45;
  padding-left: 2px;
}

.metas-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  line-height: 1.7;
  font-size: 0.85rem;
}

/* Add section (sticky bottom) */
.metas-add-section {
  flex-shrink: 0;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-1);
}

.btn-add-meta {
  width: 100%;
  padding: 9px 0;
  border: 1px dashed rgba(0,246,245,0.12);
  border-radius: 10px;
  background: rgba(0,246,245,0.12);
  color: var(--accent-light);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-add-meta:hover {
  background: rgba(0,246,245,0.12);
  border-color: rgba(0,246,245,0.12);
}

/* Add form */
.metas-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metas-form-row { display: flex; flex-direction: column; }
.metas-form-2col {
  flex-direction: row !important;
  gap: 8px;
}
.metas-form-2col .modal-select { flex: 1; min-width: 0; }

.metas-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}

.btn-cancel-meta {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-cancel-meta:hover { background: var(--surface-2); color: var(--text-primary); }

.btn-save-meta {
  padding: 7px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-save-meta:hover { opacity: 0.88; }

/* ---- Status badges (usados no modal Metas e outros lugares) ---- */
.badge-pendente   { background: rgba(107,114,128,0.18); color: var(--text-muted); border-radius: 6px; padding: 2px 9px; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-andamento  { background: var(--blue-bg); color: var(--blue); border-radius: 6px; padding: 2px 9px; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-emaprovacao{ background: var(--yellow-bg); color: var(--yellow); border-radius: 6px; padding: 2px 9px; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-feito      { background: var(--green-bg);   color: var(--green); border-radius: 6px; padding: 2px 9px; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.02em; }
.badge-travado    { background: var(--red-bg);   color: var(--orange); border-radius: 6px; padding: 2px 9px; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.02em; }

@media (max-width: 480px) {
  #app { padding: 0 10px 24px; }

  /* Header compact */
  .header { padding: 12px 0; margin-bottom: 12px; }
  .logo { font-size: 17px; }
  .badge { font-size: 9px; padding: 2px 8px; }
  .last-update { font-size: 10px; }

  /* Summary: 3 cols compact */
  .summary-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-card { padding: 8px 6px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 9px; }
  .stat-progress-ring { width: 40px; height: 40px; }
  .stat-progress-ring .stat-value { font-size: 11px; }
  .summary { margin-bottom: 12px; }

  /* Alerts compact */
  .alert { font-size: 11px; padding: 4px 8px; }

  /* Controls compact */
  .controls { margin-bottom: 10px; }
  .nav-tab { font-size: 12px; padding: 6px 10px; }
  .btn-new-task { font-size: 11px; padding: 6px 10px; }
  .toggle-label { font-size: 11px; }
  .filter-select { font-size: 11px; padding: 6px 8px; }

  /* Financial compact */
  .fin-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .fin-kpi-card { padding: 10px 8px; }
  .fin-kpi-value { font-size: 18px; }
  .period-btn { padding: 6px 10px; font-size: 12px; }

  /* Kanban columns narrower on small phones */
  .kanban-column {
    flex: 0 0 260px;
    min-width: 260px;
  }

  /* Cards compact but readable */
  .card-title { font-size: 12px; }
  .project-name { font-size: 9px; }
  .card-deadline { font-size: 10px; }

  /* Modal: full screen */
  .task-modal { width: 100vw; }

  /* Modal fields compact */
  .modal-input { font-size: 14px; padding: 10px; }
  .modal-label { font-size: 10px; }
  .modal-textarea { min-height: 36px; }
  .btn-delete-task { padding: 12px; font-size: 14px; }
  .btn-create-task { padding: 12px; font-size: 14px; }

  /* Back button bigger touch target */
  .btn-modal-back {
    padding: 8px 12px 8px 4px;
    font-size: 15px;
  }
}

/* ===== FINANCIAL DASHBOARD ENHANCEMENTS ===== */

/* Toolbar: label de período + botão gráficos */
.fin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 16px;
}
.period-label {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}
.btn-charts {
  background: transparent;
  border: 1.5px solid var(--blue);
  color: #0984e3;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-charts:hover { background: var(--blue-bg); }
.btn-charts.active { background: var(--blue-bg); border-color: var(--lilas); color: var(--lilas); }

/* Debug panel */
.debug-summary-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.debug-summary-item { background: #0f3460; border-radius: 6px; padding: 8px 12px; font-size: 12px; color: #dfe6e9; }
.debug-period { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }

/* Month picker dropdown */
.month-picker-dropdown {
  position: absolute;
  background: #fff;
  border: 1px solid #dfe6e9;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
  z-index: 100;
  padding: 6px 0;
  min-width: 190px;
}
.month-option {
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  color: #2d3436;
}
.month-option:hover { background: #f1f3f4; }

/* Campaign filter box */
.campaign-filter {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 16px;
}
.filter-header {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}
.campaign-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 13px;
  color: #2d3436;
}
.campaign-checkbox input[type="checkbox"] {
  accent-color: #0984e3;
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.camp-name { flex: 1; }
.camp-spend {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Charts modal */
.charts-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}
.charts-overlay {
  background: rgba(0,0,0,0.55);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.charts-panel {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 940px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.charts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.charts-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #2d3436;
  margin: 0;
}
.btn-close-charts {
  background: transparent;
  border: 1px solid #dfe6e9;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.btn-close-charts:hover { background: #f1f3f4; }
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.chart-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  position: relative;
}
@media (max-width: 640px) {
  .charts-grid { grid-template-columns: 1fr; }
  .fin-period-filter { flex-wrap: wrap; gap: 4px; }
}

/* ===== NOVOS ESTILOS v7 ===== */

/* ---- Grupos de Projeto no Kanban ---- */
.project-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.project-group:last-child { margin-bottom: 0; }

.project-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.project-group-header:hover { background: var(--surface-3); }

.project-group-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-group-count {
  background: var(--surface-3);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.group-toggle {
  color: var(--text-muted);
  font-size: 9px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}
.project-group-header:hover .group-toggle { color: var(--text); }

.project-group-tasks {
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Kanban cards dentro dos grupos não têm mais a seção .card-project */
.project-group .kanban-card {
  margin: 0;
}

/* Estado colapsado: ocultar tarefas */
.project-group-collapsed .project-group-tasks { display: none; }
.project-group-collapsed .project-group-header { border-bottom: none; }

/* ---- Grupos de Subprojeto ---- */
.subproject-group { margin-bottom: 4px; }
.subproject-group:last-child { margin-bottom: 0; }

.subproject-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  border-left: 3px solid var(--accent);
  margin: 8px 0 6px;
}

.subproject-tasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 4px;
}

/* ---- Card: meta-right (recorrência + prazo) ---- */
.card-meta-right {
  display: flex;
  align-items: center;
  gap: 5px;
}
.card-recurrence {
  font-size: 11px;
  opacity: 0.65;
  line-height: 1;
}

/* ---- Modal: label opcional ---- */
.modal-label-opt {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: lowercase;
  letter-spacing: 0;
}

/* ---- Modal: label obrigatório ---- */
.modal-label-req {
  color: var(--red);
  font-size: 11px;
}

/* ---- Modal: ID da tarefa no header ---- */
.modal-task-id {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
  font-family: 'Courier New', monospace;
}

/* ---- Modal: Seções com título ---- */
.modal-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px 8px;
  margin-bottom: 8px;
}

.modal-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.modal-section-collapsible .modal-section-title {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
  user-select: none;
}

.modal-section-collapsible .modal-section-title:hover {
  color: var(--text);
}

.modal-section-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.modal-section-content {
  padding-top: 12px;
}

/* ════════════════════════════════════════════════════════════════
   Modal de tarefa — layout 2 colunas em tela larga (≥980px)
   Coluna principal: Detalhamento (escopo) + Atualizações  → o que fazer
   Coluna lateral:   Execução + Controle                   → metadados
   Em telas estreitas tudo empilha (principal em cima, lateral embaixo).
   ════════════════════════════════════════════════════════════════ */
.modal-main, .modal-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

@media (min-width: 980px) {
  .task-modal {
    width: min(1180px, calc(100vw - 48px));
    max-height: calc(100vh - 40px);
  }
  .modal-body {
    display: grid;
    /* Execução (lateral estreita) à esquerda · Detalhamento (foco) à direita */
    grid-template-columns: minmax(330px, 0.92fr) minmax(0, 1.55fr);
    gap: 0;
    align-items: start;
  }
  .modal-side {
    order: 1;
    padding-right: 24px;
  }
  /* divisória entre as duas colunas */
  .modal-main {
    order: 2;
    border-left: 1px solid var(--border);
    padding-left: 24px;
  }
  /* o escopo é o foco: bastante área de leitura/escrita (só o campo de notas) */
  .modal-section-scope #modalNotes,
  .modal-section-scope #modalNotesDisplay { min-height: 240px; }
  /* na lateral estreita, os campos de execução empilham (mais legíveis) */
  .modal-side .modal-row,
  .modal-side .modal-row-3 { grid-template-columns: 1fr; gap: 12px; }
  /* título com mais presença, à altura do quadro */
  #modalTaskName { font-size: 26px; min-height: 60px; }
}

/* ---- Card: linha de meta-info no topo ---- */
.card-meta-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  flex-wrap: wrap;
  min-height: 14px;
}

/* ── Botão de edição inline no card ── */
.card-edit-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.kanban-card:hover .card-edit-btn { opacity: 1; }
.card-edit-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ── Card em modo edição inline ── */
.kanban-card-editing {
  cursor: default;
  transform: none !important;
}
.kanban-card-editing:hover { transform: none !important; box-shadow: none !important; }
.card-edit-form { display: flex; flex-direction: column; gap: 6px; }
.card-edit-f {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  box-sizing: border-box;
}
.card-edit-f:focus { outline: none; border-color: var(--accent); }
.card-edit-title { resize: none; line-height: 1.4; }
.card-edit-row { display: flex; gap: 5px; }
.card-edit-row .card-edit-f { flex: 1; min-width: 0; }
.card-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.card-edit-save {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.card-edit-save:hover { opacity: 0.85; }
.card-edit-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s;
}
.card-edit-cancel:hover { color: var(--text); }

/* ---- Card: ID ---- */
.card-id {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ---- Card: badge de prioridade ---- */
.card-priority {
  font-size: 11px;
  line-height: 1;
}

/* Borda superior para prioridade alta */
.card-priority-alta-border {
  border-top: 2px solid var(--red) !important;
}

/* ---- Card: tag de subprojeto ---- */
.card-subtag {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Card: botão Miro ---- */
.card-miro-link {
  font-size: 13px;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s;
  line-height: 1;
}
.card-miro-link:hover { opacity: 1; }

/* ---- Person chips (modal de responsáveis) ---- */
.person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  margin-bottom: 6px;
}
.person-chips:empty { margin-bottom: 0; }
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 8px 3px 4px;
  font-size: 12px;
  color: var(--text);
}
.chip-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: white;
}
.chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
}
.chip-remove:hover { color: var(--orange); }
.modal-person-adder { margin-top: 0; }

/* ---- List view: múltiplos avatares ---- */
.list-person-names { vertical-align: middle; font-size: 12px; }

/* ---- Card: próxima ação ---- */
.card-next-action {
  font-size: 11px;
  color: var(--accent-light);
  font-style: italic;
  margin-bottom: 6px;
  line-height: 1.35;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Card: bloqueio visível quando travado ---- */
.card-blocker-hint {
  font-size: 11px;
  color: var(--red);
  margin-bottom: 6px;
  line-height: 1.35;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- List view: colunas novas ---- */
.col-id {
  width: 90px;
  white-space: nowrap;
}

.col-priority {
  width: 60px;
  text-align: center;
}

.list-task-id {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* ---- Mobile Kanban Tabs ---- */
.mobile-kanban-tabs { display: none; }

@media (max-width: 768px) {
  /* Abas de status — seletor horizontal */
  .mobile-kanban-tabs {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 0 0 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .mobile-kanban-tabs::-webkit-scrollbar { display: none; }

  .mobile-status-tab {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .mobile-status-tab:hover { border-color: var(--accent); color: var(--text); }
  .mobile-status-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }

  /* Kanban board com scroll suave entre colunas */
  .kanban-board { scroll-behavior: smooth; }

  /* Colunas ocupam quase toda a largura → uma visível por vez */
  .kanban-column {
    flex: 0 0 calc(100vw - 48px);
    min-width: calc(100vw - 48px);
    scroll-snap-align: start;
  }

  /* Cards com toque generoso */
  .kanban-card { padding: 12px 14px; min-height: 56px; }
  .card-title { font-size: 13px; line-height: 1.5; }

  /* Grupos de projeto mais compactos no mobile */
  .project-group-header { padding: 8px 10px; }
  .project-group-tasks { padding: 6px 8px 10px; gap: 8px; }
}

@media (max-width: 480px) {
  /* Sobrescreve o valor antigo de 260px */
  .kanban-column {
    flex: 0 0 calc(100vw - 32px) !important;
    min-width: calc(100vw - 32px) !important;
  }
}

/* ---- Botão KPI Sala Secreta ---- */
.btn-kpi-ss {
  background: linear-gradient(135deg, var(--green), #00cec9);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-kpi-ss:hover { opacity: 0.85; }

/* ---- Modal KPI Sala Secreta ---- */
.kpi-ss-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.kpi-ss-modal {
  background: var(--surface-2, #0E1318);
  border: 1px solid var(--border, #2d2d44);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.kpi-ss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #2d2d44);
  gap: 12px;
}

.kpi-ss-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #e0e0e0);
  flex: 1;
}

.kpi-ss-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-ss-period-select {
  background: var(--surface, #111122);
  border: 1px solid var(--border, #2d2d44);
  color: var(--text, #e0e0e0);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.kpi-ss-icon-btn {
  background: var(--surface, #111122);
  border: 1px solid var(--border, #2d2d44);
  color: var(--text-secondary, #aaa);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.kpi-ss-icon-btn:hover { color: var(--text, #e0e0e0); }
.kpi-ss-close-btn:hover { color: var(--red); }

.kpi-ss-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-secondary, #aaa);
  font-size: 13px;
}

.kpi-ss-content {
  padding: 20px;
}

/* Grid de cards de semáforo */
.kpi-ss-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .kpi-ss-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-ss-grid .kpi-ss-card:last-child { grid-column: 1 / -1; }
}

.kpi-ss-card {
  background: var(--surface, #111122);
  border: 1px solid var(--border, #2d2d44);
  border-radius: 10px;
  padding: 14px 10px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: border-color 0.2s;
}

/* Indicador de semáforo (barra superior colorida) */
.kpi-ss-indicator {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 8px;
  background: var(--border, #2d2d44);
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 10px 10px 0 0;
}
.kpi-ss-ind-green  { background: var(--green); }
.kpi-ss-ind-yellow { background: var(--yellow); }
.kpi-ss-ind-red    { background: var(--red); }
.kpi-ss-ind-grey   { background: var(--border, #2d2d44); }

.kpi-ss-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #e0e0e0);
  line-height: 1.1;
  margin-top: 4px;
}

.kpi-ss-metric {
  font-size: 10px;
  color: var(--text-secondary, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.kpi-ss-refs {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.kpi-ref-green, .kpi-ref-yellow, .kpi-ref-red {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.kpi-ref-green  { background: var(--green-bg); color: var(--green); }
.kpi-ref-yellow { background: var(--yellow-bg); color: var(--yellow); }
.kpi-ref-red    { background: var(--red-bg);  color: var(--red); }

/* Borda colorida no card conforme semáforo */
.kpi-ss-card:has(.kpi-ss-ind-green)  { border-color: var(--green-bg); }
.kpi-ss-card:has(.kpi-ss-ind-yellow) { border-color: var(--yellow-bg); }
.kpi-ss-card:has(.kpi-ss-ind-red)    { border-color: var(--red-bg); }

/* Seção de campanhas ativas */
.kpi-ss-campaigns {
  margin-top: 18px;
  border-top: 1px solid var(--border, #2d2d44);
  padding-top: 14px;
}

.kpi-ss-camps-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #aaa);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.kpi-ss-camps-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-ss-camp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text, #e0e0e0);
}

.kpi-camp-dot { font-size: 10px; flex-shrink: 0; }
.kpi-camp-active { color: var(--green); }

.kpi-ss-camp-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
  font-size: 11px;
}

.kpi-ss-camp-budget {
  color: var(--text-secondary, #aaa);
  font-size: 11px;
  white-space: nowrap;
}

.kpi-ss-error {
  color: var(--red);
  padding: 20px;
  text-align: center;
  font-size: 13px;
}

/* ============================================================
   Hub de Contexto Operacional — Grid de Clientes
   Estética: densa, escura, material. Sem cara de SaaS genérico.
   ============================================================ */

.ch-loading, .ch-empty {
  color: var(--text-muted);
  padding: 60px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Cabeçalho da seção */
.ch-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.ch-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ch-section-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* Grid */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding-bottom: 32px;
}

/* ---- Card ---- */
.ch-card {
  position: relative;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--card-accent, var(--magenta)) 18%, transparent) 0%,
      color-mix(in srgb, var(--card-accent, var(--magenta)) 6%,  transparent) 35%,
      var(--surface) 75%);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--magenta)) 25%, var(--border));
  border-left: 5px solid var(--card-accent, var(--magenta));
  border-radius: var(--radius-sm);
  padding: 20px 20px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.ch-card[data-slug] { cursor: grab; }
.ch-card--dragging   { opacity: 0.35 !important; box-shadow: none !important; }
.ch-card--drag-active { cursor: grabbing !important; transform: rotate(1.5deg) scale(1.02); box-shadow: 0 12px 32px rgba(0,0,0,0.4) !important; z-index: 999; }
.ch-card--chosen     { outline: 2px dashed var(--card-accent, var(--accent)); outline-offset: 3px; }

/* Faixa colorida no topo do card — assina visualmente a identidade */
.ch-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--card-accent, var(--magenta)),
    color-mix(in srgb, var(--card-accent, var(--magenta)) 40%, transparent));
  opacity: 0.9;
}

/* Brilho na borda esquerda ao hover */
.ch-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 -5px;
  width: 5px;
  background: var(--card-accent, var(--magenta));
  filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s;
}
.ch-card:hover::before { opacity: 0.7; }
.ch-card:hover {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--card-accent, var(--magenta)) 28%, transparent) 0%,
      color-mix(in srgb, var(--card-accent, var(--magenta)) 10%, transparent) 40%,
      var(--surface-2) 80%);
  border-color: color-mix(in srgb, var(--card-accent, var(--magenta)) 50%, var(--border));
  box-shadow:
    0 12px 36px rgba(0,0,0,0.45),
    0 0 0 1px color-mix(in srgb, var(--card-accent, var(--magenta)) 35%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--card-accent, var(--magenta)) 10%, transparent);
  transform: translateY(-1px);
}

/* ---- Topo do card: logo + nome ---- */
.ch-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.ch-logo-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.ch-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
}
.ch-logo-fallback {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.5px;
}
.ch-card-meta { flex: 1; min-width: 0; }
.ch-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ch-stale-badge {
  font-size: 11px;
  color: var(--yellow);
  opacity: 0.8;
}
.ch-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Status badge — sem borda arredondada genérica */
.ch-status-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.status-ativo      { background: var(--green-bg);  color: var(--green); }
.status-pausa      { background: rgba(99,110,114,0.25); color: #95a5a6; }
.status-atencao    { background: var(--yellow-bg);color: var(--yellow); }
.status-critico    { background: var(--red-bg);   color: #e55039; }
.status-onboarding { background: rgba(0,206,201,0.18);  color: #00cec9; }
.status-negociacao { background: var(--blue-bg);color: var(--blue); }
.status-em-estruturacao { background: rgba(178,123,255,0.18); color: #b27bff; }

/* Grupo badge — sinaliza família de cards (ex: Comport Presencial/Ensino/Comercial) */
.ch-group-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  cursor: pointer;
  background: color-mix(in srgb, var(--group-accent, var(--magenta)) 18%, transparent);
  color: var(--group-accent, var(--magenta));
  border: 1px solid color-mix(in srgb, var(--group-accent, var(--magenta)) 28%, transparent);
  transition: background 0.15s, transform 0.1s;
}
.ch-group-badge::before {
  content: "⌘ ";
  opacity: 0.6;
  font-weight: 700;
}
.ch-group-badge:hover {
  background: color-mix(in srgb, var(--group-accent, var(--magenta)) 32%, transparent);
  transform: translateY(-1px);
}

.ch-nivel-badge {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--border);
  letter-spacing: 0.3px;
}

/* ---- Divider ---- */
.ch-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 14px;
}

/* ---- Nicho + dono ---- */
.ch-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
}
.ch-card-nicho {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}
.ch-card-owner {
  font-size: 11px;
  color: var(--text-muted);
}
.ch-card-owner strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---- Stats ---- */
.ch-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin-bottom: 12px;
}
.ch-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  gap: 3px;
  border-right: 1px solid var(--border);
}
.ch-stat:last-child { border-right: none; }
.ch-stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ch-stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ---- Alertas ---- */
.ch-card-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
.ch-alert-tag {
  font-size: 10px;
  background: var(--red-bg);
  color: #e07070;
  border: 1px solid var(--red-bg);
  padding: 3px 8px;
  border-radius: 2px;
  font-weight: 500;
}

/* ---- Footer ---- */
.ch-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 2px;
}
.ch-drive-btn {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 7px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ch-drive-btn:hover {
  color: #fff;
  border-color: var(--card-accent, var(--magenta));
  background: rgba(255,255,255,0.06);
}

/* ---- Atalhos pra plataformas externas ---- */
.ch-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.06);
}
.ch-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #cfd2dc;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.ch-shortcut:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  transform: translateY(-1px);
}
.ch-shortcut-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.ch-shortcut-text {
  display: inline-block;
  line-height: 1;
}

/* Pills internas Sirius — ferramentas próprias do hub (Financeiro, Zé Bot) */
.ch-shortcut-internal {
  background: rgba(108,92,231,0.12);
  border-color: rgba(108,92,231,0.35);
  color: #c9c1ff;
}
.ch-shortcut-internal:hover {
  background: rgba(108,92,231,0.22);
  border-color: rgba(108,92,231,0.55);
  color: #fff;
}
.ch-shortcut-internal .ch-shortcut-icon {
  background: rgba(108,92,231,0.35);
  font-size: 11px;
}

/* Cores por plataforma — borda e ícone com identidade */
.ch-shortcut[data-key="drive"]         { border-color: rgba(251,188,4,0.4); }
.ch-shortcut[data-key="drive"]         .ch-shortcut-icon { background: #fbbc04; color: #0E1318; }
.ch-shortcut[data-key="meta"]          { border-color: rgba(24,119,242,0.5); }
.ch-shortcut[data-key="meta"]          .ch-shortcut-icon { background: #1877F2; color: #fff; }
.ch-shortcut[data-key="google"]        { border-color: rgba(66,133,244,0.5); }
.ch-shortcut[data-key="google"]        .ch-shortcut-icon { background: #4285F4; color: #fff; }
.ch-shortcut[data-key="instagram"]     { border-color: rgba(225,48,108,0.5); }
.ch-shortcut[data-key="instagram"]     .ch-shortcut-icon { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.ch-shortcut[data-key="site"]          { border-color: var(--blue-bg); }
.ch-shortcut[data-key="site"]          .ch-shortcut-icon { background: var(--blue); color: #0E1318; }
.ch-shortcut[data-key="crm"],
.ch-shortcut[data-key="crmCleber"]     { border-color: rgba(108,92,231,0.5); }
.ch-shortcut[data-key="crm"]           .ch-shortcut-icon,
.ch-shortcut[data-key="crmCleber"]     .ch-shortcut-icon { background: var(--magenta); color: #fff; }
.ch-shortcut[data-key="planner"],
.ch-shortcut[data-key="plannerCleber"] { border-color: var(--green-bg); }
.ch-shortcut[data-key="planner"]       .ch-shortcut-icon,
.ch-shortcut[data-key="plannerCleber"] .ch-shortcut-icon { background: var(--green); color: #fff; }
.ch-shortcut[data-key="tiktok"]        { border-color: rgba(255,255,255,0.3); }
.ch-shortcut[data-key="tiktok"]        .ch-shortcut-icon { background: #000; color: #25F4EE; border: 1px solid #25F4EE; }
.ch-shortcut[data-key="youtube"]       { border-color: rgba(255,0,0,0.4); }
.ch-shortcut[data-key="youtube"]       .ch-shortcut-icon { background: #FF0000; color: #fff; }
.ch-shortcut[data-key="facebook"]      { border-color: rgba(24,119,242,0.5); }
.ch-shortcut[data-key="facebook"]      .ch-shortcut-icon { background: #1877F2; color: #fff; }
.ch-shortcut[data-key="linkedin"]      { border-color: rgba(10,102,194,0.5); }
.ch-shortcut[data-key="linkedin"]      .ch-shortcut-icon { background: #0a66c2; color: #fff; }
.ch-cta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.15s;
}
.ch-card:hover .ch-cta {
  color: var(--card-accent, var(--accent-light));
}

/* Botão Contexto Vivo no card fechado */
.ch-vivo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--card-accent, var(--magenta)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--magenta)) 45%, transparent);
  color: color-mix(in srgb, var(--card-accent, var(--magenta)) 80%, #fff);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  line-height: 1;
}
.ch-vivo-btn:hover {
  background: color-mix(in srgb, var(--card-accent, var(--magenta)) 26%, transparent);
  border-color: color-mix(in srgb, var(--card-accent, var(--magenta)) 70%, transparent);
  color: #fff;
  transform: translateY(-1px);
}
.ch-vivo-btn:active { transform: translateY(0); }
.ch-vivo-btn-icon {
  font-size: 8px;
  line-height: 1;
  color: color-mix(in srgb, var(--card-accent, var(--magenta)) 90%, #fff);
  animation: chVivoPulse 1.8s ease-in-out infinite;
}
@keyframes chVivoPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 680px) {
  .ch-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CLIENT DETAIL PAGE (cd-*)
   ============================================================ */

#clientDetailContent {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 100px);
}

/* Hero */
.cd-hero {
  border-left: 4px solid var(--hero-accent, var(--magenta));
  background: var(--surface-1);
  padding: 0;
  flex-shrink: 0;
}
.cd-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 24px;
}
/* Tier 1: navegação à esquerda, ações à direita */
.cd-hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.cd-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* Tier 2: identidade à esquerda, métricas à direita */
.cd-hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cd-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.cd-back:hover { color: var(--text); border-color: var(--text-muted); }

.cd-back-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cd-client-nav { display: flex; gap: 4px; }
.cd-nav-prev, .cd-nav-next {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cd-nav-prev:hover, .cd-nav-next:hover {
  color: #fff;
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.06);
}
.cd-nav-prev:disabled, .cd-nav-next:disabled { opacity: 0.25; cursor: default; }

.cd-hero-id {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}
.cd-hero-logo-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cd-hero-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}
.cd-hero-logo-fb {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
}
.cd-hero-text { flex: 1; min-width: 0; }
.cd-hero-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 5px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-hero-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cd-nicho {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Stats bar no hero */
.cd-hero-stats {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}
.cd-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  min-width: 72px;
}
.cd-hs-val {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 3px;
}
.cd-hs-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Body */
.cd-body {
  display: grid;
  /* minmax(0,1fr) em vez de 1fr: sem isso, uma URL/palavra longa numa tarefa estoura
     o min-content da coluna (grid blowout) e alarga o detalhe inteiro pra baixo do
     painel Meu Dia, escondendo o responsável. minmax(0,...) deixa a coluna encolher. */
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  border-top: 1px solid var(--border);
}

/* Column label (sticky header de seção) */
.cd-col-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 2;
}
.cd-lbl-alert { color: var(--yellow); }

/* Tasks column */
.cd-tasks-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

/* Filter tabs */
.cd-filter-tabs {
  display: flex;
  padding: 8px 20px;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  flex-shrink: 0;
}
.cd-filter-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.1s, color 0.1s;
}
.cd-filter-tab:hover  { background: var(--surface-2); color: var(--text); }
.cd-filter-tab.active { background: var(--surface-2); color: var(--text); }
.cd-filter-count {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
}
.cd-filter-tab.active .cd-filter-count {
  background: var(--hero-accent, var(--accent));
  color: #fff;
}
/* Filtros de higiene (Sem prazo / Sem dono) — destaque âmbar discreto */
.cd-filter-tab.cd-filter-clean { color: var(--yellow); }
.cd-filter-tab.cd-filter-clean .cd-filter-count { background: rgba(255,196,0,0.16); color: var(--yellow); }
.cd-filter-tab.cd-filter-clean.active { background: rgba(255,196,0,0.12); color: var(--yellow); }
.cd-filter-tab.cd-filter-clean.active .cd-filter-count { background: var(--yellow); color: #1a1500; }

/* Task list */
.cd-task-list { flex: 1; overflow-y: auto; }

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

.cd-task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}
.cd-task-row:hover { background: var(--surface-2); }

.cd-t-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 5px;
}
.cd-t-info  { flex: 1; min-width: 0; }
.cd-t-name  {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: block;
  /* Quebra URL/string longa em vez de empurrar a linha (mantém o responsável visível). */
  overflow-wrap: anywhere;
}
.cd-t-name.done {
  color: var(--text-muted);
  text-decoration: line-through;
}
.cd-t-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}
.cd-t-blocker {
  font-size: 11px;
  color: #f39c12;
  margin-top: 3px;
}
.cd-t-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cd-t-owner {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.07);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.cd-t-deadline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.cd-t-deadline.overdue {
  color: var(--red);
  font-weight: 700;
}

/* Context column */
.cd-context-col {
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}
.cd-ctx-section {
  border-bottom: 1px solid var(--border);
}
.cd-ctx-section .cd-col-label {
  border-bottom: none;
  padding-bottom: 6px;
}
.cd-ctx-row {
  padding: 4px 20px 4px 20px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.cd-ctx-section .cd-ctx-row:last-child { padding-bottom: 10px; }

.cd-icon-check { color: var(--green); font-weight: 700; font-size: 11px; flex-shrink: 0; margin-top: 2px; }
.cd-icon-cross  { color: var(--text-muted); font-weight: 700; font-size: 11px; flex-shrink: 0; margin-top: 2px; }
.cd-ctx-out { color: var(--text-muted); opacity: 0.7; }

.cd-ctx-alerts .cd-col-label { color: var(--yellow); }
.cd-alert-row {
  color: var(--yellow);
  font-size: 12px;
  line-height: 1.4;
}

.cd-resp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 20px;
}
.cd-resp-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 68px;
  flex-shrink: 0;
}
.cd-resp-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.cd-oferta {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  padding-bottom: 10px;
}

.cd-not-found {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================================
   TEAM VIEW (tm-*)
   ============================================================ */

/* Home: grid de membros */
.tm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.tm-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tm-section-count {
  font-size: 11px;
  color: var(--text-muted);
}
.tm-section-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tm-ranking-btn {
  background: rgba(108,92,231,0.12);
  border: 1px solid rgba(108,92,231,0.3);
  color: var(--lilas);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.tm-ranking-btn:hover { background: rgba(108,92,231,0.22); }

/* Modal overlay */
.tm-ranking-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tm-ranking-panel {
  background: #1a1d2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.tm-ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.tm-ranking-title { font-size: 16px; font-weight: 700; color: #fff; }
.tm-ranking-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 20px 4px;
}
.tm-ranking-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.tm-ranking-close:hover { color: #b2bec3; }
.tm-ranking-list { padding: 8px 0 12px; }

/* Linha de cada membro */
.tm-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tm-rank-row:last-child { border-bottom: none; }
.tm-rank-medal { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.tm-rank-num { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.tm-rank-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.tm-rank-info { flex: 1; min-width: 0; }
.tm-rank-name { font-size: 13px; font-weight: 600; color: #dfe6e9; margin-bottom: 5px; }
.tm-rank-role { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.tm-rank-bar-wrap {
  height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden;
}
.tm-rank-bar { height: 100%; border-radius: 3px; transition: width 0.4s ease; min-width: 4px; }
.tm-rank-stats { text-align: right; flex-shrink: 0; }
.tm-rank-pct { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; }
.tm-rank-detail { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.tm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
}

/* Card de membro */
.tm-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tm-accent, var(--magenta));
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  position: relative;
}
.tm-card:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.tm-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}
.tm-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: rgba(0,0,0,0.7);
  flex-shrink: 0;
}
.tm-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
  border-radius: 50%;
}
.tm-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.tm-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tm-divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}

.tm-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 10px 16px;
  gap: 0;
}
.tm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  border-right: 1px solid var(--border);
}
.tm-stat:last-child { border-right: none; }
.tm-stat-val {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
}
.tm-stat-lbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.7;
}

.tm-clientes {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 16px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Preview inline do último feedback no card ──────────────────────────── */
.tm-fb-preview { display: none; }
.tm-fb-preview.tm-fb-preview-on {
  display: block;
  margin: 2px 16px 8px;
  padding: 8px 10px;
  background: var(--bg-elevated, rgba(255,255,255,0.03));
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  border-left: 3px solid var(--tm-accent, var(--accent-light));
  border-radius: 8px;
}
.tm-fb-preview-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tm-fb-preview-line {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary, var(--text-muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-fb-preview-more {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Visão 360 · botão admin + gate de senha + quadro fullscreen ────────── */
.tm-admin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: #fff; border: 1px solid var(--border); background: var(--gradient-btn);
}
.tm-admin-btn:hover { filter: brightness(1.18); }

.tm-admin-gate {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,12,19,0.78); backdrop-filter: blur(4px);
}
.tm-admin-gate-box {
  width: min(360px, 90vw); padding: 24px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
}
.tm-admin-gate-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.tm-admin-gate-sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.tm-admin-gate-input {
  width: 100%; padding: 10px 12px; font-size: 14px; box-sizing: border-box;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); outline: none;
}
.tm-admin-gate-input:focus { border-color: var(--accent); }
.tm-admin-gate-err { color: var(--red); font-size: 12px; margin-top: 8px; }
.tm-admin-gate-actions { display: flex; gap: 8px; margin-top: 16px; }
.tm-admin-gate-actions button { flex: 1; padding: 10px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; border: none; }
.tm-admin-gate-cancel { background: var(--surface-3); color: var(--text-secondary); }
.tm-admin-gate-ok     { background: var(--gradient-btn); color: #fff; }

body.tm-admin-open { overflow: hidden; }
.tm-admin-board {
  position: fixed; inset: 0; z-index: 9990;
  background: var(--bg); overflow-y: auto;
}
.tm-admin-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tm-admin-h-title { font-size: 20px; font-weight: 800; color: var(--text); }
.tm-admin-h-right { display: flex; align-items: center; gap: 16px; }
.tm-admin-h-sub   { font-size: 12px; color: var(--text-muted); }
.tm-admin-close {
  font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2);
}
.tm-admin-close:hover { border-color: var(--accent); }
.tm-admin-body { padding: 24px; max-width: 1440px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.tm-admin-loading { color: var(--text-muted); text-align: center; padding: 60px 0; }

.tm-admin-summary { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.tm-admin-stat {
  flex: 1; min-width: 140px; padding: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); text-align: center;
}
.tm-admin-stat-v { display: block; font-size: 28px; font-weight: 800; color: var(--text); }
.tm-admin-stat-l { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.tm-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.tm-admin-card {
  padding: 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column;
  cursor: grab;
}
.tm-admin-card:active { cursor: grabbing; }
.tm-admin-card .tm-admin-detail { cursor: pointer; }
.tm-admin-card--ghost  { opacity: .4; }
.tm-admin-card--chosen { box-shadow: 0 0 0 2px var(--accent); }
.tm-admin-card-head { display: flex; align-items: center; gap: 12px; }
.tm-admin-card-id   { flex: 1; min-width: 0; }
.tm-admin-card-name { font-size: 15px; font-weight: 800; color: var(--text); }
.tm-admin-card-role { font-size: 11px; color: var(--text-muted); }
.tm-admin-card-att  { font-size: 16px; }
.tm-admin-card.sem-r { border-left: 3px solid var(--red); }
.tm-admin-card.sem-y { border-left: 3px solid var(--yellow); }
.tm-admin-card.sem-g { border-left: 3px solid var(--accent); }
.tm-admin-narrative {
  margin: 12px 0 12px; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary);
}

/* projetos tocados + cruzamento com tarefas */
.tm-admin-proj { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tm-admin-proj-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-secondary); border: 1px solid var(--border);
}
.tm-admin-proj-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.tm-admin-taskline {
  font-size: 12px; color: var(--text-secondary); padding: 9px 0;
  border-top: 1px solid var(--border); display: flex; gap: 14px; flex-wrap: wrap;
}
.tm-admin-taskline b { color: var(--text); font-weight: 800; }
.tm-admin-taskline .late b { color: var(--red); }
.tm-admin-late { margin: 4px 0 12px; }
.tm-admin-late-h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--red); margin-bottom: 5px; font-weight: 700; }
.tm-admin-late-item {
  font-size: 12px; color: var(--text-secondary); padding: 2px 0; line-height: 1.4;
  display: flex; gap: 6px; align-items: baseline;
}
.tm-admin-late-item .dot { color: var(--red); flex: none; }
.tm-admin-late-item .txt { flex: 1; min-width: 0; }
.tm-admin-late-proj { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-xs); background: var(--surface-3); color: var(--text-muted); white-space: nowrap; flex: none; }
.tm-admin-more { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.tm-admin-insights { padding: 10px; border-radius: var(--radius-sm); background: var(--green-bg); border: 1px solid var(--accent-light); margin: 2px 0 12px; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.tm-admin-insights b { color: var(--accent); }
.tm-admin-ai-soon  { font-size: 11px; color: var(--accent); }
.tm-admin-ai-badge {
  display: inline-block; vertical-align: middle; margin-left: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em;
  padding: 1px 5px; border-radius: var(--radius-xs);
  background: var(--gradient-primary); color: #fff;
}
.tm-admin-detail {
  margin-top: auto; width: 100%; padding: 8px; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--accent); background: var(--green-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.tm-admin-detail:hover { border-color: var(--accent); }
.tm-admin-foot { margin-top: 22px; font-size: 11px; color: var(--text-muted); text-align: center; }
.tm-admin-foot-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.tm-admin-foot-link:hover { text-decoration: underline; }

.tm-card-footer {
  padding: 8px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tm-cta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.15s;
}
.tm-card:hover .tm-cta { color: var(--tm-accent, var(--accent-light)); }

/* ─── Botão Feedback no card + pulso ─────────────────────────────────────── */
.tm-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tm-feedback-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: var(--tm-accent, rgba(255,255,255,0.25));
}
.tm-fb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5a5e70; flex: 0 0 auto;
}
.tm-fb-dot-on { background: #2ecc71; box-shadow: 0 0 0 2px rgba(46,204,113,0.25); }

/* ─── Modal de Feedback (mesma família do ranking) ───────────────────────── */
.tm-fb-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000; /* acima do quadro Visão 360 (9990) e do gate (9998) */
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.tm-fb-panel {
  background: #1a1d2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 100%; max-width: 560px; max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.tm-fb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 0; background: #1a1d2e; z-index: 1;
}
.tm-fb-title { font-size: 16px; font-weight: 700; color: #fff; }
.tm-fb-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 4px;
}
.tm-fb-close:hover { color: #fff; }
.tm-fb-empty { padding: 32px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.tm-fb-pulse {
  display: flex; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.tm-fb-pulse-stat {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px; padding: 8px 14px; min-width: 80px;
}
.tm-fb-pulse-val { font-size: 18px; font-weight: 700; color: #fff; }
.tm-fb-pulse-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tm-fb-list { padding: 8px 20px 20px; }
.tm-fb-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tm-fb-item:last-child { border-bottom: none; }
.tm-fb-item-date { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.tm-fb-proj { color: var(--accent-light, #74b9ff); font-weight: 600; }
.tm-fb-oque { font-size: 13.5px; color: #e8e8ee; line-height: 1.4; margin-bottom: 6px; }
.tm-fb-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tm-fb-tag {
  font-size: 11px; color: #cfd2dc;
  background: rgba(255,255,255,0.05);
  border-radius: 6px; padding: 3px 8px;
}
.tm-fb-tag-warn { background: rgba(214,48,49,0.15); color: #ff8a8a; }
.tm-fb-link { font-size: 11px; color: var(--accent-light, #74b9ff); text-decoration: none; padding: 3px 4px; }
.tm-fb-link:hover { text-decoration: underline; }

/* Hero do membro */
.tm-hero {
  border-left: 4px solid var(--tm-accent, var(--magenta));
  background: var(--surface-1);
  flex-shrink: 0;
}
.tm-hero-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  flex-wrap: wrap;
}
.tm-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.tm-back:hover { color: var(--text); border-color: var(--text-muted); }
.tm-hero-actions { display: flex; align-items: center; gap: 8px; }
.tm-back-nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tm-member-nav { display: flex; gap: 4px; }
.tm-btn-new-task {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.tm-btn-new-task:hover { opacity: 0.85; }

/* Filter bar */
.tm-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: rgba(0,0,0,0.18);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.tm-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tm-filter-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}
.tm-filter-btn-active {
  background: var(--tm-accent, var(--magenta));
  color: #fff;
  border-color: transparent;
}
.tm-filter-count {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: inherit;
  border-radius: 10px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  min-width: 18px;
  text-align: center;
}
.tm-filter-btn-active .tm-filter-count {
  background: rgba(255,255,255,0.25);
}
.tm-show-done-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.tm-show-done-toggle input[type="checkbox"] {
  accent-color: var(--tm-accent, var(--magenta));
  cursor: pointer;
  width: 14px;
  height: 14px;
}

/* ─── Toggle Prioridade + Filtro de Data (time + cliente) ─────────────────── */
.tm-prio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.tm-prio-toggle:hover { background: var(--surface-2); color: var(--text); }
.tm-prio-toggle-active {
  background: linear-gradient(135deg, var(--red) 0%, #f39c12 50%, var(--green) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tm-prio-toggle-icon { font-size: 13px; line-height: 1; }

.tm-date-filter {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease;
}
.tm-date-filter:hover  { border-color: var(--accent, var(--magenta)); }
.tm-date-filter:focus  { border-color: var(--accent, var(--magenta)); }

/* ─── Vista Priorizada — grupos + linhas ──────────────────────────────────── */
.tm-prio-group {
  margin-bottom: 18px;
  border-left: 3px solid var(--tm-prio-color, var(--text-muted));
  border-radius: 4px;
  background: color-mix(in srgb, var(--tm-prio-color, var(--text-muted)) 4%, transparent);
}
.tm-prio-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
}
.tm-prio-group-badge {
  color: var(--tm-prio-color, var(--text-muted));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}
.tm-prio-group-count {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}
.tm-prio-list { padding: 0 8px 8px; }

.tm-prio-row {
  align-items: center;
  gap: 10px;
}
.tm-prio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 14px;
  flex-shrink: 0;
}
.tm-prio-client-chip {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--chip-color, var(--magenta)) 18%, transparent);
  color: var(--chip-color, var(--magenta));
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--magenta)) 30%, transparent);
  vertical-align: middle;
}
.tm-prio-range {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.tm-prio-range.overdue {
  color: #fff;
  background: var(--red);
}
.tm-prio-range.duetoday {
  color: #fff;
  background: #f39c12;
}
.tm-hero-id {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}
.tm-hero-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.tm-hero-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.tm-hero-stats {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--border);
}

/* Corpo do membro: grupos por cliente */
.tm-member-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tm-client-group {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tm-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-left: 4px solid var(--magenta);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tm-group-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.tm-group-count {
  font-size: 11px;
  color: var(--text-muted);
}
.tm-client-group .cd-task-row {
  padding: 8px 16px;
}
.tm-not-found, .tm-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Checkboxes por linha — team view (estilização principal em .tm-task-check no topo do arquivo) */
.cd-t-check { display:flex; align-items:center; flex-shrink:0; padding-right:8px; cursor:pointer; }
.tm-check-all-label { display:flex; align-items:center; margin-right:8px; cursor:pointer; flex-shrink:0; }

/* ===== Time view: client group com paleta do cliente ===== */
.tm-client-group {
  --tm-group-accent: var(--magenta);
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--tm-group-accent) 18%, var(--border));
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--tm-group-accent) 10%, transparent) 0%,
    color-mix(in srgb, var(--tm-group-accent) 4%, transparent) 60%,
    transparent 100%);
  margin-bottom: 14px;
  overflow: hidden;
}
.tm-client-group .tm-group-header {
  border-left: 4px solid var(--tm-group-accent);
  background: color-mix(in srgb, var(--tm-group-accent) 14%, transparent);
}
.tm-client-group .cd-task-list { padding: 0 6px 6px; }
.tm-client-group .cd-task-row {
  background: color-mix(in srgb, var(--tm-group-accent) 4%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--tm-group-accent) 8%, var(--border));
}
.tm-client-group .cd-task-row:hover {
  background: color-mix(in srgb, var(--tm-group-accent) 10%, transparent);
}
.tm-client-group .cd-task-row:last-child { border-bottom: none; }
/* Status colors override accent tint where set (overdue red, doing blue, due-today yellow) */
.tm-client-group .cd-task-row.cd-task-overdue,
.tm-client-group .cd-task-row.cd-task-duetoday,
.tm-client-group .cd-task-row.cd-task-doing {
  background: inherit;
}

/* ===== Status popover (click no dot) ===== */
.cd-t-dot-clickable { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.cd-t-dot-clickable:hover { transform: scale(1.25); box-shadow: 0 0 0 2px rgba(255,255,255,0.15); }
.cd-status-popover {
  position: fixed;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  padding: 4px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cd-status-popover-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.12s ease;
}
.cd-status-popover-item:hover { background: rgba(162, 155, 254, 0.14); }
.cd-status-popover-item.is-current { background: rgba(162, 155, 254, 0.22); font-weight: 600; }
.cd-status-popover-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cd-status-popover-label { flex: 1; }

/* ===== Bulk bar no client-detail ===== */
.cd-bulk-bar { margin-top: 6px; }
.cd-tasks-col-label { display: flex; align-items: center; gap: 8px; }
.cd-tasks-select-all { margin: 0; }

/* ===== Contexto Vivo — grid 2 colunas ===== */
.cd-form-grid-top,
.cd-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 720px) {
  .cd-form-grid-top, .cd-form-grid-2 { grid-template-columns: 1fr; }
}
.cd-form-grid-top .cd-form-row,
.cd-form-grid-2 .cd-form-row { margin: 0; }

/* Barra de ações em lote — sticky no fundo do container */
.tm-bulk-bar {
  position: sticky;
  bottom: 0;
  background: #1b1b2e;
  border-top: 1px solid rgba(108,92,231,0.4);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 25;
  border-radius: 0 0 12px 12px;
}
.tm-bulk-count { color: var(--lilas); font-size: 13px; font-weight: 600; flex: 1; }
.tm-bulk-status {
  background: #2d2d44;
  border: 1px solid rgba(255,255,255,0.15);
  color: #e0e0e0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
}
.tm-bulk-apply {
  background: var(--magenta);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.tm-bulk-apply:hover { background: #7d6ff0; }
.tm-bulk-apply:disabled { opacity: 0.5; cursor: not-allowed; }
.tm-bulk-cancel {
  background: transparent;
  color: #aaa;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tm-bulk-cancel:hover { color: #fff; border-color: rgba(255,255,255,0.3); }

@media (max-width: 680px) {
  .tm-grid { grid-template-columns: 1fr; }
}

/* Task rows clicáveis */
.cd-task-clickable { cursor: pointer; }

/* ─── Contexto Vivo ──────────────────────────────────────────────────────── */
.cd-ctx-vivo {
  border-left: 2px solid var(--magenta);
  background: rgba(108,92,231,0.04);
}
.cd-lbl-vivo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lilas);
}
.cd-vivo-date {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: auto;
}
.cd-vivo-resumo {
  font-size: 13px;
  line-height: 1.5;
  color: #b2bec3;
  padding: 6px 0 4px;
}
.cd-vivo-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
.cd-vivo-item {
  font-size: 13px;
  padding: 3px 0;
  line-height: 1.4;
}
.cd-vivo-acao   { color: var(--blue); }
.cd-vivo-decisao{ color: #55efc4; }
.cd-vivo-blocker{ color: var(--yellow); }

/* ===== Botão CONTEXTO GERAL no hero (paleta do cliente, sutil) ===== */
.cd-ctx-vivo-btn {
  align-self: center;
  background: color-mix(in srgb, var(--hero-accent, var(--magenta)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--hero-accent, var(--magenta)) 45%, transparent);
  color: color-mix(in srgb, var(--hero-accent, var(--magenta)) 75%, #fff);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
  line-height: 1.3;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cd-ctx-vivo-btn::before {
  content: '●';
  font-size: 9px;
  color: color-mix(in srgb, var(--hero-accent, var(--magenta)) 90%, #fff);
  animation: cdVivoPulse 1.8s ease-in-out infinite;
}
@keyframes cdVivoPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.cd-ctx-vivo-btn:hover {
  background: color-mix(in srgb, var(--hero-accent, var(--magenta)) 22%, transparent);
  border-color: color-mix(in srgb, var(--hero-accent, var(--magenta)) 70%, transparent);
  color: #fff;
  transform: translateY(-1px);
}
.cd-ctx-vivo-btn:active { transform: translateY(0); }

.cd-plan-btn {
  align-self: center;
  background: color-mix(in srgb, var(--hero-accent, var(--magenta)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--hero-accent, var(--magenta)) 45%, transparent);
  color: color-mix(in srgb, var(--hero-accent, var(--magenta)) 75%, #fff);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
  line-height: 1.3;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.cd-plan-btn::before {
  content: '📋';
  font-size: 12px;
  opacity: 0.85;
}
.cd-plan-btn:hover {
  background: color-mix(in srgb, var(--hero-accent, var(--magenta)) 22%, transparent);
  border-color: color-mix(in srgb, var(--hero-accent, var(--magenta)) 70%, transparent);
  color: #fff;
  transform: translateY(-1px);
}
.cd-plan-btn:active { transform: translateY(0); }
.cd-plan-btn--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cd-plan-btn--disabled:hover { transform: none; background: color-mix(in srgb, var(--hero-accent, var(--magenta)) 12%, transparent); color: color-mix(in srgb, var(--hero-accent, var(--magenta)) 75%, #fff); border-color: color-mix(in srgb, var(--hero-accent, var(--magenta)) 45%, transparent); }

.cd-btn-new-task {
  align-self: center;
  background: color-mix(in srgb, var(--hero-accent, var(--magenta)) 85%, transparent);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cd-btn-new-task:hover { opacity: 0.88; transform: translateY(-1px); }
.cd-btn-new-task:active { transform: translateY(0); }
.cd-ctxg-label br { display: none; }

/* ===== Modal Contexto Geral ===== */
.cd-ctxg-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 9998;
  animation: cdCtxgBdIn 0.18s ease-out;
}
@keyframes cdCtxgBdIn { from { opacity: 0; } to { opacity: 1; } }

.cd-ctxg-modal {
  position: fixed;
  top: 4vh; left: 50%;
  transform: translateX(-50%);
  width: min(900px, 94vw);
  max-height: 92vh;
  z-index: 9999;
  background: var(--surface, #1e272e);
  border: 1px solid rgba(108, 92, 231, 0.35);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  animation: cdCtxgIn 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes cdCtxgIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.cd-ctxg-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, rgba(108,92,231,0.12), transparent 70%);
  border-radius: 12px 12px 0 0;
  gap: 16px;
}
.cd-ctxg-title {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--lilas);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cd-ctxg-slug { color: #fff; font-weight: 800; }
.cd-ctxg-source-tag {
  font-size: 9px; font-weight: 600; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
}
.cd-ctxg-source-tag.tag-saved { background: var(--green-bg); color: var(--green); }
.cd-ctxg-source-tag.tag-static { background: var(--blue-bg); color: var(--blue); }

.cd-ctxg-actions { display: flex; gap: 8px; align-items: center; }
.cd-ctxg-edit, .cd-ctxg-save, .cd-ctxg-cancel {
  background: rgba(108,92,231,0.15); border: 1px solid rgba(108,92,231,0.4);
  color: var(--lilas); padding: 7px 14px; border-radius: 5px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all 0.15s;
}
.cd-ctxg-edit:hover, .cd-ctxg-cancel:hover { background: rgba(108,92,231,0.28); color: #fff; }
.cd-ctxg-save { background: var(--green-bg); border-color: var(--green-bg); color: var(--green); }
.cd-ctxg-save:hover { background: var(--green-bg); color: #fff; }
.cd-ctxg-save:disabled { opacity: 0.5; cursor: default; }

.cd-ctxg-close {
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: #dfe6e9; width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cd-ctxg-close:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); color: #fff; }

/* Textarea de edição */
.cd-ctxg-textarea {
  width: 100%; min-height: 60vh;
  background: #0f1419; color: #dfe6e9;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
  padding: 16px 18px; font-family: 'Monaco','Menlo','Courier New',monospace;
  font-size: 13px; line-height: 1.55; resize: vertical;
  box-sizing: border-box;
}
.cd-ctxg-textarea:focus { outline: none; border-color: rgba(108,92,231,0.5); }
.cd-ctxg-edit-hint {
  margin-top: 8px; font-size: 11px; color: var(--text-muted);
}
.cd-ctxg-edit-hint code {
  background: rgba(108,92,231,0.12); color: var(--lilas);
  padding: 1px 5px; border-radius: 3px; font-size: 11px;
}

.cd-ctxg-body {
  padding: 24px 32px 32px;
  overflow-y: auto;
  flex: 1;
}
.cd-ctxg-loading, .cd-ctxg-error {
  text-align: center; color: var(--text-muted); padding: 40px 0;
}
.cd-ctxg-error { color: var(--red); }
.cd-ctxg-error small { display: block; margin-top: 8px; opacity: 0.7; font-family: monospace; }

/* Markdown rendering inside modal */
.cd-md { color: #dfe6e9; font-size: 14px; line-height: 1.65; }
.cd-md h1 { font-size: 22px; font-weight: 800; margin: 4px 0 14px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); color: #fff; }
.cd-md h2 { font-size: 17px; font-weight: 700; margin: 22px 0 10px; color: var(--lilas); }
.cd-md h3 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; color: var(--blue); text-transform: uppercase; letter-spacing: 0.5px; }
.cd-md h4, .cd-md h5, .cd-md h6 { font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: #b2bec3; }
.cd-md p  { margin: 8px 0; }
.cd-md ul { margin: 8px 0 8px 22px; padding: 0; }
.cd-md li { margin: 4px 0; padding-left: 4px; }
.cd-md li::marker { color: var(--blue); }
.cd-md a  { color: var(--blue); text-decoration: none; border-bottom: 1px dotted var(--blue-bg); }
.cd-md a:hover { color: var(--lilas); border-bottom-color: var(--lilas); }
.cd-md strong { color: #fff; font-weight: 700; }
.cd-md em { color: #b2bec3; }
.cd-md code { background: rgba(108,92,231,0.15); color: var(--lilas); padding: 2px 6px; border-radius: 3px; font-size: 12px; font-family: 'Monaco','Menlo',monospace; }
.cd-md pre { background: #0f1419; border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.5; margin: 12px 0; }
.cd-md hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 18px 0; }
.cd-md blockquote { border-left: 3px solid var(--magenta); padding: 4px 0 4px 14px; margin: 10px 0; color: #b2bec3; font-style: italic; background: rgba(108,92,231,0.06); border-radius: 0 4px 4px 0; }
.cd-md table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.cd-md th { background: rgba(108,92,231,0.18); color: #fff; text-align: left; padding: 8px 12px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.1); }
.cd-md td { padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
.cd-md tr:hover td { background: rgba(255,255,255,0.02); }
.cd-md-check { display: inline-block; margin-right: 4px; color: var(--text-muted); }
.cd-md-check.checked { color: var(--green); }

/* ===== Próximas Ações com checkbox (view mode) ===== */
.cd-vivo-todo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  line-height: 1.5;
  font-size: 13px;
  color: var(--blue);
  transition: opacity 0.15s;
}
.cd-vivo-todo:hover { background: rgba(255,255,255,0.025); border-radius: 4px; padding-left: 4px; padding-right: 4px; margin-left: -4px; margin-right: -4px; }
.cd-vivo-todo-check {
  flex-shrink: 0;
  margin-top: 3px;
  width: 14px;
  height: 14px;
  accent-color: var(--lilas, #6c5ce7);
  cursor: pointer;
}
.cd-vivo-todo-text { flex: 1; min-width: 0; }
.cd-vivo-todo-done .cd-vivo-todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===== List editor (lista editável de itens) ===== */
.cd-vivo-list-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 8px 10px;
}
.cd-vivo-list-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cd-vivo-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
}
.cd-vivo-list-row:last-child { border-bottom: none; }
.cd-vivo-list-bullet {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}
.cd-vivo-list-row.cd-vivo-acao .cd-vivo-list-bullet    { color: var(--blue); }
.cd-vivo-list-row.cd-vivo-decisao .cd-vivo-list-bullet { color: #55efc4; }
.cd-vivo-list-row.cd-vivo-blocker .cd-vivo-list-bullet { color: var(--yellow); }
.cd-vivo-list-row.cd-vivo-alert .cd-vivo-list-bullet   { color: var(--red); }
.cd-list-item {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text, #dfe6e9);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 3px;
  font-family: inherit;
  outline: none;
}
.cd-list-item:focus {
  background: rgba(108,92,231,0.08);
  box-shadow: 0 0 0 1px rgba(108,92,231,0.35);
}
.cd-list-item::placeholder { color: var(--text-muted); opacity: 0.5; }
.cd-vivo-list-remove {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  opacity: 0.6;
}
.cd-vivo-list-row:hover .cd-vivo-list-remove { opacity: 1; }
.cd-vivo-list-remove:hover {
  background: rgba(214,48,49,0.18);
  color: #ff7675;
  border-color: rgba(214,48,49,0.45);
}
.cd-vivo-list-add {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed rgba(108,92,231,0.4);
  color: var(--lilas);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cd-vivo-list-add:hover {
  background: rgba(108,92,231,0.1);
  border-color: rgba(108,92,231,0.7);
  border-style: solid;
  color: #fff;
}

/* ===== Empty state da aba Geral ===== */
.cd-ctxg-empty {
  text-align: center;
  padding: 40px 24px;
  max-width: 480px;
  margin: 40px auto;
}
.cd-ctxg-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #dfe6e9);
  margin-bottom: 10px;
}
.cd-ctxg-empty-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.cd-ctxg-empty-cta {
  background: rgba(108,92,231,0.18);
  border: 1px solid rgba(108,92,231,0.45);
  color: var(--lilas);
  padding: 9px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}
.cd-ctxg-empty-cta:hover {
  background: rgba(108,92,231,0.32);
  color: #fff;
  border-color: rgba(108,92,231,0.7);
}

/* ===== Modal com abas (Vivo / Geral) ===== */
.cd-ctxg-tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: var(--surface-1, #181f25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cd-ctxg-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cd-ctxg-tab:hover {
  color: #fff;
  background: rgba(255,255,255,0.03);
}
.cd-ctxg-tab.active {
  color: var(--lilas);
  border-bottom-color: var(--lilas);
}
.cd-ctxg-pane {
  flex: 1;
  overflow-y: auto;
  padding: 18px 28px 28px;
}
.cd-ctxg-modal-tabs .cd-ctxg-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Ajustes do cd-ctx-vivo dentro do modal — esconde o botão de expandir
   (o modal já é a tela cheia) e remove constraints de coluna estreita */
.cd-ctx-vivo-modal {
  border-bottom: none;
  background: transparent;
}
.cd-ctx-vivo-modal .cd-col-label {
  background: transparent;
  position: static;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 14px;
  font-size: 11px;
}
.cd-ctx-vivo-modal .cd-vivo-resumo {
  font-size: 14px;
  line-height: 1.6;
}
.cd-ctx-vivo-modal .cd-vivo-item {
  font-size: 13px;
  line-height: 1.55;
  padding: 5px 0;
}
.cd-ctx-vivo-modal .cd-vivo-group-label {
  font-size: 10px;
  margin-top: 16px;
}
.cd-ctx-vivo-modal .cd-vivo-edit-btn {
  position: static;
  margin-left: auto;
  width: auto;
  height: auto;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
}

@media (max-width: 720px) {
  .cd-ctxg-modal { top: 0; left: 0; transform: none; width: 100vw; max-height: 100vh; border-radius: 0; }
  .cd-ctxg-body { padding: 16px 18px 24px; }
  .cd-ctxg-modal-tabs .cd-ctxg-body { padding: 0; }
  .cd-ctxg-pane { padding: 14px 16px 20px; }
  .cd-md table { font-size: 12px; }
  .cd-md th, .cd-md td { padding: 6px 8px; }
}

/* Botão atualizar contexto no hero */
.cd-ctx-update-btn {
  background: rgba(108,92,231,0.12);
  border: 1px solid rgba(108,92,231,0.3);
  color: var(--lilas);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  margin-top: 8px;
}
.cd-ctx-update-btn:hover { background: rgba(108,92,231,0.22); }
.cd-ctx-update-btn:disabled { opacity: 0.5; cursor: default; }
/* Selo de freshness do Contexto Vivo (substituiu o botão manual de atualizar) */
.cd-ctx-freshness {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  margin-top: 8px;
  align-self: center;
}

/* Botão editar contexto — FAB flutuante */
.cd-vivo-edit-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-2, #2d3436);
  border: 1.5px solid var(--border, rgba(255,255,255,0.1));
  color: var(--lilas);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.cd-vivo-edit-btn:hover {
  border-color: var(--magenta);
  color: #fff;
  transform: scale(1.08);
  background: rgba(108,92,231,0.3);
}

/* Botão expandir — FAB ao lado do edit */
.cd-vivo-expand-btn {
  position: fixed;
  bottom: 28px;
  right: 92px;
  z-index: 900;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-2, #2d3436);
  border: 1.5px solid var(--border, rgba(255,255,255,0.1));
  color: var(--lilas);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.cd-vivo-expand-btn:hover {
  border-color: var(--magenta);
  color: #fff;
  transform: scale(1.08);
  background: rgba(108,92,231,0.3);
}

/* ===== Contexto Vivo — modo tela cheia ===== */
.cd-vivo-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 9998;
  animation: cdVivoBackdropIn 0.18s ease-out;
}
@keyframes cdVivoBackdropIn { from { opacity: 0; } to { opacity: 1; } }

.cd-ctx-vivo.cd-vivo-fullscreen {
  position: fixed;
  top: 4vh; left: 50%;
  transform: translateX(-50%);
  width: min(960px, 94vw);
  max-height: 92vh;
  z-index: 9999;
  background: var(--surface, #1e272e);
  border: 1px solid rgba(108,92,231,0.4);
  border-radius: 12px;
  padding: 28px 32px 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  overflow-y: auto;
  animation: cdVivoModalIn 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes cdVivoModalIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Em fullscreen, botões viram parte do header da seção (não FAB) */
.cd-ctx-vivo.cd-vivo-fullscreen .cd-vivo-expand-btn,
.cd-ctx-vivo.cd-vivo-fullscreen .cd-vivo-edit-btn {
  position: absolute;
  top: 18px;
  width: 36px; height: 36px;
  font-size: 15px;
  bottom: auto;
  box-shadow: none;
}
.cd-ctx-vivo.cd-vivo-fullscreen .cd-vivo-expand-btn { right: 64px; }
.cd-ctx-vivo.cd-vivo-fullscreen .cd-vivo-edit-btn   { right: 20px; }

/* Conforto de leitura no fullscreen */
.cd-ctx-vivo.cd-vivo-fullscreen .cd-lbl-vivo {
  font-size: 18px;
  margin-bottom: 16px;
  padding-right: 120px;
}
.cd-ctx-vivo.cd-vivo-fullscreen .cd-vivo-resumo {
  font-size: 15px;
  line-height: 1.65;
}
.cd-ctx-vivo.cd-vivo-fullscreen .cd-vivo-item {
  font-size: 14px;
  padding: 8px 0;
  line-height: 1.55;
}
.cd-ctx-vivo.cd-vivo-fullscreen .cd-vivo-group-label {
  font-size: 11px;
  margin-top: 18px;
}

/* Mobile / telas pequenas */
@media (max-width: 720px) {
  .cd-ctx-vivo.cd-vivo-fullscreen {
    top: 0; left: 0;
    transform: none;
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .cd-vivo-expand-btn { right: 86px; bottom: 24px; width: 46px; height: 46px; }
  .cd-vivo-edit-btn   { right: 24px; bottom: 24px; width: 46px; height: 46px; }
}

/* Tag "editando" no header */
.cd-vivo-editing-tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--lilas);
  background: rgba(108,92,231,0.15);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Texto vazio */
.cd-vivo-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  padding: 4px 0 8px;
}

/* Form de edição */
.cd-vivo-form { padding-top: 2px; }
.cd-form-row { margin-bottom: 10px; }
.cd-form-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b2bec3;
  margin-bottom: 4px;
}
.cd-form-hint { text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.cd-vivo-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: #dfe6e9;
  font-size: 12px;
  font-family: inherit;
  padding: 7px 9px;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.15s;
}
textarea.cd-vivo-input {
  min-height: 60px;
  max-height: 60vh;
  overflow-y: auto;
}
.cd-vivo-input:focus {
  outline: none;
  border-color: rgba(108,92,231,0.5);
}
.cd-vivo-input-sm { resize: none; height: 32px; padding: 5px 9px; max-height: none; min-height: 0; }
.cd-form-actions { display: flex; gap: 8px; margin-top: 4px; }
.cd-vivo-save-btn {
  background: rgba(108,92,231,0.2);
  border: 1px solid rgba(108,92,231,0.4);
  color: var(--lilas);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.cd-vivo-save-btn:hover { background: rgba(108,92,231,0.35); }
.cd-vivo-save-btn:disabled { opacity: 0.5; cursor: default; }
.cd-vivo-cancel-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.cd-vivo-cancel-btn:hover { color: #b2bec3; border-color: rgba(255,255,255,0.2); }

/* Select no form de contexto vivo */
.cd-vivo-input select,
select.cd-vivo-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23636e72'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 28px;
  cursor: pointer;
}

/* ─── Client Detail — Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cd-hero-inner {
    padding: 12px 16px;
    gap: 12px;
  }
  .cd-hero-id {
    width: 100%;
    flex: none;
  }
  .cd-hero-stats {
    border-left: none;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 10px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
  }
  .cd-hero-stat {
    min-width: 60px;
    padding: 8px 14px;
  }
  .cd-hs-val { font-size: 20px; }
  .cd-ctx-update-btn { margin-top: 0; padding: 6px 10px; }
  .cd-body {
    grid-template-columns: 1fr;
  }
  .cd-filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .cd-filter-tabs::-webkit-scrollbar { display: none; }
  .cd-filter-tab { flex-shrink: 0; }
}

@media (max-width: 480px) {
  .cd-hero-name { font-size: 15px; }
  .cd-hero-logo-wrap { width: 38px; height: 38px; }
  .cd-hero-logo, .cd-hero-logo-fb { width: 38px; height: 38px; }
  .cd-hero-logo-fb { font-size: 14px; }
  .cd-back { font-size: 10px; padding: 4px 9px; }
  .cd-hs-val { font-size: 18px; }
  .cd-hs-lbl { font-size: 9px; }
  .cd-hero-stat { min-width: 52px; padding: 8px 10px; }
}

/* ─── Search field reutilizável (Cliente Detalhe / Portfólio / Time) ─── */
.search-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 1 240px;
  min-width: 140px;
}
.search-field::before {
  content: '🔍';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.55;
  pointer-events: none;
}
.search-field input {
  width: 100%;
  padding: 6px 26px 6px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search-field input::placeholder { color: var(--text-muted); }
.search-field input:focus {
  border-color: var(--accent, var(--magenta));
  background: var(--surface-2);
}
.search-field .search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  display: none;
}
.search-field .search-clear:hover { color: var(--text); }
.search-field.has-value .search-clear { display: inline-block; }

/* Empty state quando search não encontra nada */
.search-empty {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* Posicionamento dentro do filter-tabs do cliente detalhe */
.cd-filter-tabs .search-field {
  margin-left: auto;
}

/* Posicionamento na section-header do portfólio */
.ch-section-header .search-field {
  margin-left: auto;
}

/* Time — Home (header) e Membro (filter-bar) */
.tm-section-header .search-field { margin-left: auto; }
.tm-filter-bar .search-field { margin-left: auto; }

/* ==========================================================================
   Sirius identity overrides (FINAL) — colocado no fim pra ganhar cascade
   sobre declarações originais com mesma especificidade (.nav-tab.active,
   .btn-new-task, etc). Conforme design-guide.md §7.
   ========================================================================== */

/* Nav tab active — gradient suave + texto branco (gradient v2 darker) */
.nav-tab.active {
  background: var(--gradient-soft);
  color: #FFFFFF;
  font-weight: 700;
}
.nav-tab:hover:not(.active) { color: var(--accent); }

/* Botões primários — gradient suave + texto branco */
.btn-new-task,
.btn-create-task,
button.btn-primary,
.btn-primary,
.cta {
  background: var(--gradient-btn);
  color: #FFFFFF;
  font-weight: 700;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
}
.btn-new-task:hover,
.btn-create-task:hover {
  filter: brightness(1.12);
}

/* KPI hero (card Total) — gradient text */
.stat-hero .stat-value {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header CTA — botão "Nova tarefa" no header (proxy do #btnNewTask) */
.btn-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn-header-cta:hover { border-color: var(--accent); background: var(--surface); }
.btn-header-cta svg { flex-shrink: 0; }

/* ==========================================================================
   Calendário — view unificada pet/vet · Sirius SC-vibe v1 (2026-05-20)
   ========================================================================== */

#calendarioContent { padding: 0 24px 32px; }

.cal-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 20px;
}

/* Header */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-bottom: 18px; flex-wrap: wrap;
}
.cal-title-group h1.cal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  color: #FFFFFF;
  text-shadow: 0 0 24px rgba(0, 246, 245, 0.25);
  margin: 0;
}
.cal-title-group .cal-subtitle {
  font-size: 13px; color: var(--text-muted); margin-top: 4px;
}
.cal-nav {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); padding: 6px; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.cal-nav-btn {
  background: transparent; border: none; color: var(--text-secondary);
  font-size: 16px; width: 32px; height: 32px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s;
}
.cal-nav-btn:hover { background: var(--surface-2); color: var(--accent); }
.cal-month-label {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 16px; min-width: 160px; text-align: center; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.cal-today-btn {
  background: var(--gradient-soft); color: #fff; border: none;
  padding: 6px 14px; border-radius: var(--radius-sm); font-weight: 700;
  font-family: 'Space Grotesk', sans-serif; font-size: 12px; cursor: pointer;
  margin-left: 6px; transition: filter .15s;
}
.cal-today-btn:hover { filter: brightness(1.15); }

/* Banner do tema do mês */
.cal-tema-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-radius: var(--radius);
  margin-bottom: 16px; color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-size: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.28);
}
.cal-tema-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,.85); box-shadow: 0 0 12px rgba(255,255,255,.7);
}

/* Filtros */
.cal-filtros {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.cal-filtro-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-filtro-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); min-width: 60px;
}
.cal-filtro-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-pill {
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border); padding: 5px 12px;
  border-radius: 999px; font-size: 12px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.cal-pill:hover { border-color: var(--border-hover); color: var(--text); }
.cal-pill.active {
  background: var(--gradient-soft); color: #fff;
  border-color: transparent; font-weight: 700;
}
.cal-pill-tipo.active {
  background: var(--pill-color, var(--gradient-soft));
}

/* Grid head (dias da semana) */
.cal-grid-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin-bottom: 6px;
}
.cal-dow {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.1em;
  padding: 8px 0;
}

/* Grid de células */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-cell {
  min-height: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: all .15s;
  position: relative; overflow: hidden;
}
.cal-cell:hover {
  border-color: var(--accent-light);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,246,245,0.08);
}
.cal-cell-empty {
  background: transparent; border: 1px dashed rgba(7,239,245,0.06);
  cursor: default; pointer-events: none;
}
.cal-cell-empty:hover { transform: none; background: transparent; box-shadow: none; }
.cal-cell-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px rgba(0,246,245,0.15);
}
.cal-cell-day {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 14px; color: var(--text); line-height: 1;
}
.cal-cell-today .cal-cell-day {
  color: var(--accent); font-size: 15px;
}
.cal-cell-events { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; }
.cal-chip {
  font-size: 10px; color: #fff; padding: 3px 7px;
  border-radius: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  font-weight: 600; line-height: 1.3;
}
.cal-chip-text { display: block; overflow: hidden; text-overflow: ellipsis; }
.cal-chip-more {
  font-size: 10px; color: var(--accent); font-weight: 700;
  padding: 2px 6px; align-self: flex-start;
}

/* Legenda */
.cal-legenda {
  margin-top: 18px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 11px; color: var(--text-secondary);
}
.cal-leg-section { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.cal-leg-item { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; }
.cal-leg-icon {
  font-weight: 700; min-width: 18px; display: inline-block; text-align: center;
}

/* Modal do dia */
.cal-modal-bg {
  position: fixed; inset: 0; background: rgba(4,12,19,0.82);
  z-index: 9000; display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(6px);
}
.cal-modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  max-width: 720px; width: 100%;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 32px rgba(210,78,255,0.15);
}
.cal-modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 22px 26px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.cal-modal-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700;
  margin: 0; letter-spacing: -0.01em; color: var(--text);
}
.cal-modal-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.cal-modal-close {
  background: transparent; border: none; color: var(--text-secondary);
  font-size: 28px; cursor: pointer; line-height: 1; padding: 0 4px;
  transition: color .15s;
}
.cal-modal-close:hover { color: var(--accent); }
.cal-modal-body { padding: 18px 26px 26px; display: flex; flex-direction: column; gap: 16px; }

.cal-event-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.cal-event-head {
  border-left: 3px solid #666;
  padding-left: 12px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.cal-event-tipo {
  display: inline-block; padding: 3px 9px; border-radius: 4px;
  font-size: 10px; font-weight: 700; color: #fff;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cal-event-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 700;
  margin: 0; color: var(--text); flex: 1;
}
.cal-event-desc {
  font-size: 13px; color: var(--text-secondary); line-height: 1.55;
  margin-bottom: 14px;
}
.cal-event-ativ {
  border-top: 1px solid var(--border); padding-top: 12px;
}
.cal-event-ativ-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px;
}
.cal-event-ativ-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.cal-event-ativ-cell {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-radius: 4px;
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: 12px;
}
.cal-event-ativ-cli { color: var(--text-secondary); font-weight: 500; }
.cal-event-ativ-icon { font-weight: 700; font-size: 14px; }
.cal-ativ-destaque { background: rgba(255,217,102,0.16); border-color: rgba(255,217,102,0.35); }
.cal-ativ-destaque .cal-event-ativ-icon { color: #FFD966; }
.cal-ativ-ativar { background: rgba(0,246,245,0.10); border-color: rgba(0,246,245,0.25); }
.cal-ativ-ativar .cal-event-ativ-icon { color: var(--accent); }
.cal-ativ-info { background: rgba(120,160,220,0.10); border-color: rgba(120,160,220,0.25); }
.cal-ativ-info .cal-event-ativ-icon { color: #B5C7E0; font-size: 10px; }
.cal-ativ-na { opacity: 0.4; }

/* Loading / erro */
.cal-loading, .cal-error {
  padding: 60px 20px; text-align: center; color: var(--text-muted);
  font-size: 14px;
}
.cal-error { color: var(--red); }

/* Responsive */
@media (max-width: 720px) {
  .cal-cell { min-height: 80px; padding: 5px; }
  .cal-cell-day { font-size: 12px; }
  .cal-chip { font-size: 9px; padding: 2px 5px; }
  .cal-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cal-nav { width: 100%; justify-content: space-between; }
  .cal-month-label { min-width: 0; flex: 1; }
  .cal-event-ativ-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Calendário v2 — GCal status + chips com origem + meta de evento */
.cal-gcal-status {
  font-size: 11px; padding: 0 4px 12px; min-height: 0; transition: all .2s;
  color: var(--text-muted);
}
.cal-gcal-status.loading { color: var(--accent); }
.cal-gcal-status.error   { color: var(--yellow); }

.cal-chip { display: flex; align-items: center; gap: 4px; }
.cal-chip-mark {
  font-size: 8px; opacity: 0.75; line-height: 1; flex-shrink: 0;
}

.cal-event-meta {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px;
  font-size: 12px; color: var(--text-secondary);
}
.cal-event-meta-item { display: inline-flex; align-items: center; gap: 4px; }

.cal-event-link {
  display: inline-block; margin-bottom: 12px; font-size: 12px;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dashed rgba(0, 246, 245, 0.4);
  padding-bottom: 1px;
}
.cal-event-link:hover { color: #fff; border-bottom-color: var(--accent); }

/* Calendário v3 — seção inline Sirius Digital (Google Calendar embed) */
.cal-gcal-section {
  margin-top: 32px;
  padding: 18px 18px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-gcal-section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-bottom: 14px;
  gap: 12px; flex-wrap: wrap;
}
.cal-gcal-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px; font-weight: 700;
  margin: 0; color: var(--text); letter-spacing: -0.01em;
}
.cal-gcal-section-sub {
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
}
.cal-gcal-section-link {
  color: var(--accent); font-size: 12px;
  text-decoration: none; font-weight: 600;
  border-bottom: 1px dashed rgba(0, 246, 245, 0.3);
  padding-bottom: 1px;
}
.cal-gcal-section-link:hover {
  color: #fff; border-bottom-color: var(--accent);
}
.cal-gcal-iframe-inline {
  height: 720px; border: 0; display: block;
  margin: 0 -18px -1px;
  width: calc(100% + 36px);
}
@media (max-width: 720px) {
  .cal-gcal-iframe-inline { height: 540px; }
}

/* Calendário v6 — render nativo via /api/calendar-events (cor por mês definida no JS) */
.cal-header-actions {
  display: flex; align-items: center; gap: 12px;
}
.cal6-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 12px;
}
.cal6-toolbar .cal6-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.cal6-toolbar .cal6-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal6-toolbar .cal6-btn-icon { padding: 6px 10px; font-size: 16px; line-height: 1; }
.cal6-toolbar .cal6-month-label {
  margin: 0 0 0 8px;
  font-size: 18px; font-weight: 600; color: var(--text);
}
.cal6-theme-badge {
  margin-left: 14px;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  color: #1d1d1d;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.2;
  max-width: 60%;
}
.cal6-theme-badge strong {
  font-weight: 700;
  white-space: nowrap;
}
.cal6-theme-badge .cal6-theme-sub {
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .cal6-theme-badge { display: none; }
}

/* Filterbar · chips por projeto · multi-select */
.cal6-filterbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px;
  padding: 2px 0;
}
.cal6-filter-label {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  margin-right: 4px; letter-spacing: 0.02em; text-transform: uppercase;
}
.cal6-filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms ease;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal6-filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cal6-filter-chip.has-proj-color:hover {
  border-color: var(--proj-color, var(--accent));
  color: var(--proj-color, var(--accent));
}
.cal6-filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cal6-filter-chip.is-active:hover {
  filter: brightness(1.08);
  color: #fff;
}
.cal6-filter-chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cal6-filter-chip.is-active .cal6-filter-chip-dot {
  background: #fff !important;
  opacity: 0.9;
}

/* Evento com cor de projeto (Foco em vermelho institucional)
   Texto branco com !important pra sobrescrever .cal6-event { color: #1d1d1d !important } */
.cal6-event.cal6-event-proj,
.cal6-event.cal6-event-proj .cal6-event-time,
.cal6-event.cal6-event-proj .cal6-event-title,
.cal6-event.cal6-event-proj .cal6-event-badge {
  color: #fff !important;
}
.cal6-event.cal6-task-deadline.cal6-event-proj .cal6-event-badge {
  background: rgba(255,255,255,0.18);
}
.cal6-filter-clear {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
}
.cal6-filter-clear:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.cal6-body { min-height: 480px; }
.cal6-loading, .cal6-error {
  padding: 60px 20px; text-align: center;
  color: var(--text-muted); font-size: 14px;
}
.cal6-error { color: var(--yellow); }

.cal6-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal6-grid-weekdays {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface-2, rgba(255,255,255,0.03));
  border-bottom: 1px solid var(--border);
}
.cal6-weekday {
  padding: 10px 8px; text-align: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.5px;
}
.cal6-grid-cells {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
}
/* Recolher semanas passadas */
.cal6-hide-past .cal6-cell-pastweek { display: none; }
.cal6-past-toggle {
  display: block; width: 100%;
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-bottom: none;
  padding: 7px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: center;
  font-family: 'Inter', sans-serif;
}
.cal6-past-toggle:hover { color: var(--text); background: var(--surface-2); }
.cal6-past-toggle .cal6-past-hide { display: none; }
.cal6-past-toggle.is-expanded .cal6-past-show { display: none; }
.cal6-past-toggle.is-expanded .cal6-past-hide { display: inline; }
/* "+N mais" por dia */
.cal6-cell-overflow[hidden] { display: none; }
.cal6-more {
  display: block; width: 100%; margin-top: 3px;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  border: none; border-radius: 4px; padding: 2px 4px;
  font-size: 10px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.cal6-more:hover { background: rgba(255,255,255,0.10); color: var(--text); }
.cal6-cell {
  min-height: 110px;
  padding: 6px 6px 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: visible;
  background: var(--surface);
}
.cal6-cell:nth-child(5n) { border-right: none; }
.cal6-cell-outside { background: rgba(255,255,255,0.015); }
.cal6-cell-outside .cal6-cell-day { color: var(--text-muted); opacity: 0.45; }
.cal6-cell-today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal6-cell-day {
  font-size: 12px; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
  padding: 2px 4px;
  display: inline-block;
}
.cal6-cell-day-today {
  background: var(--accent);
  color: #00131C;
  border-radius: 999px;
  min-width: 22px; text-align: center;
  padding: 2px 7px;
}
.cal6-event {
  display: block;
  padding: 2px 6px;
  margin-bottom: 2px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.3;
  color: #1d1d1d !important;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  position: relative;
}
/* Concluído / passado · risco + opacity */
.cal6-event-done {
  opacity: 0.55;
  text-decoration: line-through !important;
  text-decoration-color: rgba(0,0,0,0.55);
  text-decoration-thickness: 1px;
}
.cal6-event-done.cal6-event-proj {
  text-decoration-color: rgba(255,255,255,0.7);
}
/* Atrasado · bolinha vermelha pulsando no canto direito.
   Vermelho com borda escura pra contrastar em fundo claro/escuro. */
.cal6-event-overdue::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.55);
  animation: cal6-overdue-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.cal6-event-overdue { padding-right: 16px; }
@keyframes cal6-overdue-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}
.cal6-event:hover { filter: brightness(1.08); text-decoration: none; }
.cal6-event-time {
  font-weight: 700;
  margin-right: 4px;
}
.cal6-event-title { font-weight: 500; }
.cal6-event-more {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 6px;
  cursor: default;
}
@media (max-width: 720px) {
  .cal6-cell { min-height: 80px; padding: 4px; }
  .cal6-event { font-size: 10px; padding: 1px 4px; }
}

/* Prazos de tarefas — pintam pela cor do cliente (inline style do JS).
   Sem !important no background pra permitir o override; fallback cinza
   continua valendo pra task de cliente não reconhecido. */
.cal6-event.cal6-task-deadline {
  background: #2f3a48;
  border-left: 3px solid #6e7d8f;
  color: #d8dee8 !important;
  font-weight: 500;
}
.cal6-event.cal6-task-deadline:hover { filter: brightness(1.15); }
/* Quando há cor de cliente, texto branco e sem barra cinza à esquerda */
.cal6-event.cal6-task-deadline.cal6-event-proj {
  color: #fff !important;
  border-left: none;
}
/* Badge "MEET" — pequeno indicador antes do horário pra eventos com Meet.
   Cor de fundo amarela com texto preto, contrasta em qualquer bg do evento. */
.cal6-event-badge-meet {
  background: #fbd75b !important;
  color: #1d1d1d !important;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: 1px;
}
.cal6-event-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.16);
  color: #fff;
  padding: 1px 5px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: 1px;
}

/* ─── Visão Geral — resumo de contexto vivo de todos os projetos ───────── */
.vg-wrap { padding: 24px 28px 60px; max-width: 1400px; margin: 0 auto; }
.vg-header { margin-bottom: 22px; }
.vg-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.vg-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.vg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
}
.vg-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 14px 16px 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease;
}
.vg-card:hover {
  border-color: var(--accent, #00f6f5);
  transform: translateY(-1px);
  text-decoration: none;
}
.vg-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.vg-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.vg-card-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.vg-card-status {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 2px 7px;
  border-radius: 999px;
}
.vg-card-date {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  order: 9;
}
.vg-fresh {
  font-size: 10px;
  letter-spacing: 0.03em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.vg-fresh::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.vg-fresh-green { color: #2ecc71; background: rgba(46,204,113,0.14); }
.vg-fresh-mid   { color: var(--text-muted); background: rgba(255,255,255,0.05); }
.vg-fresh-stale { color: #e67e22; background: rgba(230,126,34,0.14); }
.vg-alerts { margin-bottom: 8px; }
.vg-alert {
  font-size: 12px;
  color: #e67e22;
  background: rgba(230, 126, 34, 0.08);
  border-left: 2px solid #e67e22;
  padding: 4px 8px;
  border-radius: 3px;
  margin-bottom: 4px;
}
.vg-contexto {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 10px;
  opacity: 0.92;
}
.vg-contexto.vg-empty { color: var(--text-muted); font-style: italic; }
.vg-acoes {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.vg-acoes li {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 0 3px 14px;
  position: relative;
  line-height: 1.4;
}
.vg-acoes li::before {
  content: '○';
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--accent, #00f6f5);
  font-size: 10px;
}
.vg-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
@media (max-width: 720px) {
  .vg-wrap { padding: 16px 14px 40px; }
  .vg-grid { grid-template-columns: 1fr; }
  .vg-title { font-size: 22px; }
}

/* ─── Release Notes (banner + botão header + modal) ────────────────────── */

/* Banner sutil no topo */
.release-banner {
  background: linear-gradient(90deg, rgba(0, 246, 245, 0.04) 0%, rgba(210, 78, 255, 0.03) 100%);
  border-bottom: 1px solid rgba(0, 246, 245, 0.12);
  padding: 0;
  font-family: 'Inter', sans-serif;
}
.release-banner[hidden] { display: none !important; }
.release-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  max-width: 100%;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.release-banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0, 246, 245, 0.5);
  flex: 0 0 auto;
  animation: release-pulse 2.4s ease-in-out infinite;
}
@keyframes release-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.release-banner-label {
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.release-banner-sep { color: rgba(255, 255, 255, 0.2); }
.release-banner-date {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}
.release-banner-title {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}
.release-banner-link {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}
.release-banner-link:hover { opacity: 0.7; }
.release-banner-close {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin-left: 4px;
}
.release-banner-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

/* Botão no header */
.btn-release {
  position: relative;
}
.btn-release.has-unseen {
  color: var(--accent);
}
.release-badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 6px rgba(210, 78, 255, 0.6);
  border: 2px solid var(--surface);
}
.release-badge-dot[hidden] { display: none !important; }

/* Modal */
.release-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 19, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.release-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.release-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: min(640px, calc(100vw - 48px));
  max-height: calc(100vh - 80px);
  background: #0E1318;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  z-index: 111;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: 'Inter', sans-serif;
}
.release-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.release-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex: 0 0 auto;
}
.release-modal-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.release-modal-icon {
  color: var(--accent);
  display: inline-flex;
}
.release-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.01em;
}
.release-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.release-modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
}
.release-modal-body {
  overflow-y: auto;
  padding: 22px 26px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.release-modal-body::-webkit-scrollbar { width: 6px; }
.release-modal-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }

/* ===== Modal de Rotinas ===== */
.rotinas-modal { width: min(820px, calc(100vw - 40px)); }
/* Tela cheia */
.rotinas-modal.rotinas-fullscreen {
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  max-width: none;
  max-height: none;
  top: 14px;
  left: 14px;
  transform: none;
}
.rotinas-modal.rotinas-fullscreen.open { transform: none; }
.rotinas-inner { max-width: 1080px; margin: 0 auto; }
/* Painel de antecipação */
.rotinas-antecipa {
  margin: 0 0 24px;
  padding: 16px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0,246,245,0.06), rgba(210,78,255,0.05));
  border: 1px solid rgba(0,246,245,0.18);
}
.rotinas-antecipa-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  margin-bottom: 10px;
}
.rotinas-antecipa ul { margin: 0; padding-left: 18px; }
.rotinas-antecipa li { font-size: 12.5px; line-height: 1.65; color: rgba(255,255,255,0.7); margin-bottom: 4px; }
.rotinas-antecipa li strong { color: var(--accent, #00F6F5); font-weight: 600; }
.rotinas-antecipa-note { margin-top: 10px; font-size: 11.5px; color: rgba(255,255,255,0.5); }
.rotinas-antecipa-note em { color: rgba(255,255,255,0.4); }
/* Total mínimo por dia (tfoot) */
.rotinas-table tfoot .rt-totals td {
  background: rgba(0,246,245,0.07);
  border: 1px solid rgba(0,246,245,0.22);
  border-radius: 8px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent, #00F6F5);
  padding: 7px 4px;
  vertical-align: middle;
}
.rotinas-table tfoot .rt-totals td small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}
.rt-fmt-story { color: #cfd6dd; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16); }
.rotinas-legend-disc { width: 100%; font-size: 11px; color: rgba(255,255,255,0.42); margin-top: 5px; }
.rotinas-intro {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
  margin: 0 0 20px;
}
.rotinas-pending {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #ffb84d;
  background: rgba(255, 109, 0, 0.12);
  border: 1px solid rgba(255, 109, 0, 0.25);
}
.rotinas-person { margin-bottom: 22px; }
.rotinas-person-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}
.rotinas-avatar {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #06121a;
  background: var(--rp, #00F6F5);
}
.rotinas-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}
.rotinas-sub { font-size: 12px; color: rgba(255, 255, 255, 0.5); }
.rotinas-total {
  margin-left: auto;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent, #00F6F5);
  white-space: nowrap;
}
.rotinas-total small { font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.45); margin-left: 2px; }
.rotinas-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px 0;
  table-layout: fixed;
}
.rotinas-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  padding: 4px 0;
  text-align: center;
}
.rotinas-table td {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  vertical-align: top;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}
.rotinas-table td strong { color: var(--accent, #00F6F5); font-weight: 600; }
.rotinas-table td.rotinas-off { color: rgba(255, 255, 255, 0.35); font-style: italic; text-align: center; }
.rotinas-table td.rotinas-off small { display: block; font-size: 10px; margin-top: 2px; }
/* Células detalhadas (cliente · número · formato) */
.rotinas-table-detail td { text-align: left; padding: 8px 7px; }
.rt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 3px;
}
.rt-cli { font-size: 11.5px; color: rgba(255, 255, 255, 0.82); font-weight: 500; white-space: nowrap; }
.rt-cli-comport { color: #ff9d3c; }
.rotinas-comport-banner {
  margin: 2px 0 22px;
  padding: 13px 16px;
  border-radius: 9px;
  background: rgba(255, 109, 0, 0.05);
  border: 1px solid rgba(255, 109, 0, 0.16);
}
.rotinas-comport-banner-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.rotinas-comport-where { font-size: 12px; color: rgba(255,255,255,0.55); margin-left: 4px; }
.rotinas-orient-line { font-size: 12.5px; line-height: 1.6; color: rgba(255,255,255,0.72); }
.rotinas-orient-line strong { color: rgba(255,255,255,0.92); font-weight: 600; }
.rotinas-orient-line em { color: rgba(255,255,255,0.45); }
.rt-num { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.92); }
.rt-num strong { color: var(--accent, #00F6F5); }
.rt-grp {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.38);
  font-weight: 700;
  margin: 6px 0 3px;
}
.rt-grp:first-child { margin-top: 0; }
.rt-grp small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--accent, #00F6F5); }
.rt-mix { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
/* Tags de formato */
.rt-fmt {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}
.rt-fmt.carrossel { color: #e9a9ff; background: rgba(210, 78, 255, 0.14); border: 1px solid rgba(210, 78, 255, 0.3); }
.rt-fmt.reels    { color: #7ff3f2; background: rgba(0, 246, 245, 0.1);  border: 1px solid rgba(0, 246, 245, 0.28); }
.rt-fmt.card     { color: #ffc480; background: rgba(255, 157, 60, 0.12); border: 1px solid rgba(255, 157, 60, 0.3); }
.rotinas-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin: 0 0 18px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.rt-leg-txt { font-size: 11px; color: rgba(255, 255, 255, 0.45); margin-right: 12px; }
/* Bloco Comport (distribuído Luan + Rick) */
.rotinas-comport {
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(255, 109, 0, 0.045);
  border: 1px solid rgba(255, 109, 0, 0.16);
}
.rotinas-comport .rotinas-person-head { margin-bottom: 12px; }
.rotinas-avatar-comport { color: #fff !important; border: 1px solid rgba(255,255,255,0.15); }
.rotinas-name-tag {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  vertical-align: middle;
}
.rotinas-total-pending {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #ffb84d !important;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(255, 109, 0, 0.12);
  border: 1px solid rgba(255, 109, 0, 0.25);
}
.rotinas-perfis { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.rt-perfil {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #ff9d3c;
  background: rgba(255, 157, 60, 0.1);
  border: 1px solid rgba(255, 157, 60, 0.28);
}
.rotinas-orient {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}
.rotinas-orient-title { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.88); margin-bottom: 7px; }
.rotinas-orient ol { margin: 0; padding-left: 18px; }
.rotinas-orient li { font-size: 12px; line-height: 1.6; color: rgba(255,255,255,0.72); margin-bottom: 4px; }
.rotinas-orient li strong { color: rgba(255,255,255,0.92); font-weight: 600; }
.rotinas-note em { color: rgba(255,255,255,0.42); }
.rotinas-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
}
.rotinas-note strong { color: rgba(255, 255, 255, 0.75); font-weight: 600; }
.rotinas-priority {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(0, 246, 245, 0.05);
  border: 1px solid rgba(0, 246, 245, 0.14);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
}
.rotinas-priority strong { color: rgba(255, 255, 255, 0.92); }
@media (max-width: 640px) {
  .rotinas-table { border-spacing: 3px 0; }
  .rotinas-table td { font-size: 11px; padding: 7px 3px; }
}

.release-entry {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.release-entry:first-child { padding-top: 4px; }
.release-entry:last-child { border-bottom: none; padding-bottom: 0; }
.release-entry-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}
.release-entry-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 500;
  padding: 3px 9px;
  background: rgba(0, 246, 245, 0.08);
  border-radius: 4px;
  flex: 0 0 auto;
}
.release-entry-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.01em;
}
.release-entry-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.release-item {
  padding-left: 16px;
  position: relative;
}
.release-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}
.release-item-feature {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.release-item-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}

/* ─── Meu Dia — sidebar fixa à direita (v2: refined) ──────────────────── */
.myday {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--myday-w);
  display: flex;
  flex-direction: column;
  background: #0A0E14;
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 50;
  font-family: 'Inter', sans-serif;
}
.myday[hidden],
.myday-rail[hidden] { display: none !important; }
body.has-myday #app { padding-right: calc(var(--myday-w) + var(--myday-gutter)); }

/* ─── Header ─── */
.myday-head {
  padding: 22px 22px 16px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.myday-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.myday-title-block { display: flex; flex-direction: column; gap: 1px; }
.myday-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.01em;
}
.myday-date {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.myday-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.myday-icon-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
}

.myday-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.myday-progress-label {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.myday-progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
}
.myday-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(0, 246, 245, 0.5);
  transition: width 0.4s ease;
}

.myday-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.myday-link-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 10.5px;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.myday-link-btn:hover { color: rgba(255, 255, 255, 0.7); }
.myday-link-cta { color: rgba(0, 246, 245, 0.55); }
.myday-link-cta:hover { color: var(--accent); }

/* ─── Body (lista de tarefas) ─── */
.myday-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
.myday-body::-webkit-scrollbar { width: 4px; }
.myday-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }
.myday-body::-webkit-scrollbar-track { background: transparent; }

.myday-empty {
  padding: 40px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 400;
}

.myday-group { margin-bottom: 16px; }
.myday-group:last-child { margin-bottom: 0; }
.myday-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}
.myday-group-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex: 0 0 auto;
}
.myday-group-header.is-overdue  .myday-group-dot { background: #FF3366; box-shadow: 0 0 8px rgba(255, 51, 102, 0.4); }
.myday-group-header.is-progress .myday-group-dot { background: #FFB020; box-shadow: 0 0 8px rgba(255, 176, 32, 0.45); }
.myday-group-header.is-blocked  .myday-group-dot { background: #8A93A8; box-shadow: 0 0 8px rgba(138, 147, 168, 0.4); }
.myday-group-header.is-today    .myday-group-dot { background: var(--accent); box-shadow: 0 0 8px rgba(0, 246, 245, 0.4); }
.myday-group-count {
  margin-left: auto;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  letter-spacing: 0;
}

/* ─── Grupo Bloqueadas: recolhível (tag + dropdown) ─── */
.myday-group--blocked { margin-top: 14px; }
.myday-blocked-toggle {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.myday-blocked-toggle .myday-group-count { margin-left: auto; }
.myday-blocked-toggle:hover { color: rgba(255, 255, 255, 0.6); }
.myday-blocked-chevron {
  flex: 0 0 auto;
  margin-left: 8px;
  opacity: 0.5;
  transition: transform 0.18s ease;
}
.myday-group--blocked.is-collapsed .myday-blocked-chevron { transform: rotate(-90deg); }
.myday-blocked-body {
  overflow: hidden;
  transition: max-height 0.22s ease, opacity 0.18s ease;
  max-height: 1500px;
  opacity: 1;
}
.myday-group--blocked.is-collapsed .myday-blocked-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ─── Item de tarefa ─── */
.myday-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
  position: relative;
}
.myday-item:hover {
  background: rgba(255, 255, 255, 0.025);
}
.myday-item.is-done .myday-item-title {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.25);
}
.myday-item.is-done .myday-item-meta { opacity: 0.4; }

/* Indicador lateral discreto (substitui borda grossa) */
.myday-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background 0.15s;
}
.myday-item.is-overdue::before { background: #FF3366; }
.myday-item.is-p1::before      { background: var(--magenta); }
.myday-item.is-blocked::before { background: #f39c12; }
/* Atrasada porque está travada: barra listrada vermelho/laranja pra deixar claro que o atraso veio do bloqueio */
.myday-item.is-overdue-blocked::before {
  background: repeating-linear-gradient(
    135deg,
    #FF3366 0 4px,
    #f39c12 4px 8px
  );
  width: 3px;
}

/* Checkbox custom — minimalista circular */
.myday-check {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  flex: 0 0 auto;
}
.myday-check:hover {
  border-color: rgba(0, 246, 245, 0.6);
}
.myday-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.myday-check:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #0A0E14;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.myday-check:disabled { opacity: 0.4; cursor: wait; }

/* Confirmação visual ao concluir — verde rápido antes do card mudar de categoria */
.myday-item.is-just-completed {
  background: rgba(46, 204, 113, 0.07);
  transition: background 0.18s ease;
}
.myday-item.is-just-completed .myday-check {
  background: #2ecc71 !important;
  border-color: #2ecc71 !important;
  opacity: 1 !important;
  animation: mydayCheckPulse 0.42s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55);
}
.myday-item.is-just-completed .myday-check::after {
  border-color: #fff !important;
}
.myday-item.is-just-completed .myday-item-title {
  text-decoration: line-through;
  color: rgba(46, 204, 113, 0.85);
  transition: color 0.18s, text-decoration 0.18s;
}
@keyframes mydayCheckPulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55); }
  50%  { transform: scale(1.18); box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.myday-item-main { min-width: 0; }
.myday-item-title {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  word-wrap: break-word;
  letter-spacing: -0.005em;
}
.myday-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.myday-item-chip {
  font-size: 10px;
  padding: 1px 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  border: none;
  letter-spacing: 0.01em;
}
.myday-item-chip.client-chip {
  color: var(--chip-color, rgba(255, 255, 255, 0.5));
  position: relative;
  padding-left: 9px;
}
.myday-item-chip.client-chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--chip-color, currentColor);
  transform: translateY(-50%);
}
.myday-item-deadline {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.myday-item-deadline.overdue { color: #FF6B85; }
.myday-item-deadline.today { color: var(--accent); }
.myday-item-deadline.overdue-blocked {
  color: #f39c12;
  font-weight: 600;
}

/* Chip "Travada" — laranja sólido, peso pra destacar entre as demais meta */
.myday-item-chip.blocked-chip {
  color: #f39c12;
  font-weight: 600;
  padding-left: 9px;
  position: relative;
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}
.myday-item-chip.blocked-chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f39c12;
  transform: translateY(-50%);
  box-shadow: 0 0 6px rgba(243, 156, 18, 0.55);
}

/* Status chip — andamento / em aprovação. Padrão visual do blocked-chip,
   cores do STATUS_POPOVER_OPTS em app.js. Pendente é default e fica omitido. */
.myday-item-chip.status-chip {
  padding-left: 9px;
  position: relative;
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.myday-item-chip.status-chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translateY(-50%);
}
.myday-item-chip.status-andamento { color: #74b9ff; }
.myday-item-chip.status-andamento::before { background: #74b9ff; }
.myday-item-chip.status-emaprovacao { color: #fdcb6e; }
.myday-item-chip.status-emaprovacao::before { background: #fdcb6e; }

/* P1 — dot pequeno antes do título em vez de emoji */
.myday-item.is-p1 .myday-item-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--magenta);
  margin-right: 7px;
  vertical-align: 1px;
  box-shadow: 0 0 6px rgba(210, 78, 255, 0.4);
}

/* ─── Scratchpad ─── */
.myday-notes {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 14px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
}
.myday-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.myday-notes-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}
.myday-notes-clear {
  background: none;
  border: none;
  font: inherit;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.myday-notes-clear:hover {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.04);
}

.myday-notes-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1 1 auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.myday-notes-empty {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  padding: 8px 4px;
  line-height: 1.5;
}
.myday-notes-sep {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.22);
  padding: 8px 4px 2px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.myday-note-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 5px;
  transition: background 0.12s;
}
.myday-note-item:hover { background: rgba(255, 255, 255, 0.025); }

.myday-note-check {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
}
.myday-note-check:hover { border-color: rgba(0, 246, 245, 0.6); }
.myday-note-item.is-done .myday-note-check {
  background: rgba(0, 246, 245, 0.4);
  border-color: rgba(0, 246, 245, 0.5);
}
.myday-note-item.is-done .myday-note-check::after {
  content: '';
  position: absolute;
  left: 3px; top: 5px;
  width: 6px; height: 3px;
  border-left: 1.5px solid #0A0E14;
  border-bottom: 1.5px solid #0A0E14;
  transform: rotate(-45deg);
}

.myday-note-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  cursor: text;
  word-break: break-word;
  padding: 1px 2px;
  border-radius: 3px;
}
.myday-note-item.is-done .myday-note-text {
  color: rgba(255, 255, 255, 0.32);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}
.myday-note-text.is-editing {
  background: rgba(0, 246, 245, 0.06);
  outline: 1px solid rgba(0, 246, 245, 0.3);
  cursor: text;
}

.myday-note-promote,
.myday-note-del {
  flex: 0 0 auto;
  background: none;
  border: none;
  padding: 3px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.myday-note-item:hover .myday-note-promote,
.myday-note-item:hover .myday-note-del,
.myday-note-promote:focus,
.myday-note-del:focus {
  opacity: 1;
}
.myday-note-promote:hover {
  color: var(--accent);
  background: rgba(0, 246, 245, 0.08);
}
.myday-note-del:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
}

.myday-notes-add {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.myday-notes-add::placeholder { color: rgba(255, 255, 255, 0.22); }
.myday-notes-add:focus {
  border-color: rgba(0, 246, 245, 0.3);
  background: rgba(255, 255, 255, 0.03);
}
.myday-notes-add:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Trilho lateral (botão pra reabrir) ─── */
.myday-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #0A0E14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: rgba(255, 255, 255, 0.4);
  padding: 12px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 49;
  transition: all 0.15s ease;
  font-family: inherit;
}
.myday-rail:hover {
  color: var(--accent);
  border-color: rgba(0, 246, 245, 0.3);
  padding-right: 11px;
}
.myday-rail-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.myday-rail-badge {
  background: #FF3366;
  color: white;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 17px;
  text-align: center;
  letter-spacing: 0;
}

/* ─── Telas pequenas: sidebar vira fullscreen ─────────────────────────── */
@media (max-width: 1280px) {
  /* Sidebar ocupa tela inteira quando aberta */
  .myday {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    z-index: 100;
  }
  body.has-myday #app { padding-right: 0; }

  /* Trilho vira FAB pill no canto inferior direito */
  .myday-rail {
    top: auto;
    left: auto;
    bottom: 20px;
    right: 20px;
    transform: none;
    border-radius: 999px;
    flex-direction: row;
    gap: 8px;
    padding: 11px 16px;
    background: var(--accent);
    color: #0A0E14;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 246, 245, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 99;
  }
  .myday-rail:hover {
    color: #0A0E14;
    border-color: transparent;
    padding-right: 16px;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 246, 245, 0.45), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
  .myday-rail-label {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  .myday-rail-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    border: 2px solid var(--bg);
  }
  /* Em fullscreen, o botão de recolher tem mais peso visual */
  .myday-icon-btn {
    width: 36px;
    height: 36px;
  }
  .myday-icon-btn svg { width: 18px; height: 18px; }

  /* Padding interno mais generoso pro toque em mobile */
  .myday-head { padding: 18px 20px 14px; }
  .myday-body { padding: 8px 12px 16px; }
  .myday-notes { padding: 14px 20px 18px; }
  .myday-item { padding: 12px 12px; }
  .myday-check { width: 19px; height: 19px; }
}

/* Mobile pequeno: ajustes finos */
@media (max-width: 480px) {
  .myday-rail {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
  }
  .myday-rail-label { font-size: 11.5px; }
  .myday-head { padding: 16px 16px 12px; }
  .myday-body { padding: 6px 10px 12px; }
  .myday-notes { padding: 12px 16px 16px; }
}

/* ── Trava de identidade obrigatória ── */
body.identity-locked { overflow: hidden; }
.identity-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 12, 19, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.identity-gate.open { opacity: 1; pointer-events: auto; }
.identity-gate-card {
  width: min(560px, 100%);
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  text-align: center;
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.identity-gate.open .identity-gate-card { transform: scale(1); }
.identity-gate-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.identity-gate-sub {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.identity-gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.identity-gate-btn {
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.identity-gate-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
}
.identity-gate-btn:active { transform: scale(0.97); }
.identity-gate-btn.is-current {
  border-color: var(--accent);
  background: rgba(0, 246, 245, 0.12);
  color: var(--accent);
}

/* ─── Passo 2 do gate: novidades importantes com aceite ─── */
.gate-news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 22px;
  text-align: left;
  max-height: 46vh;
  overflow-y: auto;
}
.gate-news-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gate-news-date {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding-top: 2px;
  letter-spacing: 0.02em;
}
.gate-news-body { min-width: 0; }
.gate-news-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.gate-news-summary {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.gate-news-ack {
  width: 100%;
  border-color: var(--accent);
  background: rgba(0, 246, 245, 0.12);
  color: var(--accent);
}
.gate-news-ack:hover {
  background: rgba(0, 246, 245, 0.2);
  border-color: var(--accent);
}
