/* ═══════════════════════════════════════════════════════════════════
   Orkestra — Design System
   Tema escuro padrão  |  variáveis CSS para tema claro
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface2:  #22263a;
  --border:    #2d3042;
  --text:      #e2e8f0;
  --muted:     #8892a4;
  --primary:   #4f7df0;
  --primary-h: #3a63d4;
  --danger:    #e74c3c;
  --warning:   #f39c12;
  --success:   #2ecc71;
  --info:      #3498db;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

[data-theme="light"] {
  --bg:      #f4f2ea;
  --surface: #ffffff;
  --surface2:#f6f3ec;
  --border:  #e7e1d5;
  --text:    #20242c;
  --muted:   #6f695d;
  --primary: #4a76ec;
  --shadow:  0 4px 24px rgba(0,0,0,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }

body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 15px; height: 15px; }
::-webkit-scrollbar-track { background: var(--surface2); border-radius: 99px; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 99px; border: 3px solid var(--surface2); min-height: 40px; min-width: 40px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
* { scrollbar-width: auto; scrollbar-color: var(--muted) var(--surface2); }

/* ── Typography ───────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ──────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────── */
#sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.sidebar-brand .logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.logo-img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}
/* Marca Orkestra (anel SVG) — sem caixa de fundo */
.logo-icon-mark { background: none !important; border-radius: 0 !important; overflow: visible; }
.logo-icon-mark svg { width: 100%; height: 100%; display: block; }
/* Modal de personalização de logo */
.branding-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text);
  padding: 10px 14px 6px 16px;
  margin-top: 4px;
}
.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-left: 2px solid var(--primary);
  cursor: pointer;
  user-select: none;
  border-radius: 0;
}
.nav-section-toggle:hover { background: var(--surface2); }
.nav-arrow {
  font-size: 17px;
  transition: transform .2s ease;
  opacity: .7;
}
.nav-section-toggle.collapsed .nav-arrow { transform: rotate(-90deg); }
.nav-group-items {
  overflow: hidden;
  max-height: 300px;
  transition: max-height .25s ease;
}
.nav-group-items.collapsed { max-height: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 0;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  transition: background .15s, color .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(79,125,240,.14); color: var(--primary); }
.nav-item .icon { font-size: 16px; width: 18px; text-align: center; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.sidebar-greeting {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.sidebar-greeting-av {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.sidebar-greeting-txt {
  font-size: 14px; color: var(--text); min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#sidebar.sidebar-collapsed .sidebar-greeting { justify-content: center; padding: 10px 4px; }
#sidebar.sidebar-collapsed .sidebar-greeting-txt { display: none; }
.install-pwa-btn {
  width: 100%; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--primary);
  border: none; border-radius: var(--radius); cursor: pointer;
  transition: filter .12s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.install-pwa-btn:hover { filter: brightness(1.08); }
.install-pwa-btn:active { transform: scale(.98); }
/* Quando o navegador confirma que dá para instalar, dá um leve destaque */
.install-pwa-btn.install-ready { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
#sidebar.sidebar-collapsed .install-pwa-btn { display: none !important; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: default;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .uname { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .urole { font-size: 11px; color: var(--muted); }

.theme-btn, .logout-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s;
}
.theme-btn:hover, .logout-btn:hover { color: var(--text); }

/* Menu do botão X (sair / trocar de usuário) */
.logout-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 1100;
}
.logout-menu-item {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s;
}
.logout-menu-item:hover { background: var(--surface2); }
.logout-menu-cancel { color: var(--muted); font-size: 12px; }

/* ── Main content ────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#topbar {
  height: 54px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
#topbar h1 { font-size: 17px; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-actions-wrap { display: flex; align-items: center; gap: 8px; }
.topbar-search-btn { font-size: 16px; padding: 4px 8px; }

#view { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ── KPI grid ────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-card .kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-card .kpi-value { font-size: 28px; font-weight: 700; line-height: 1; }
.kpi-card .kpi-sub   { font-size: 11px; color: var(--muted); }
.kpi-red    { border-left: 3px solid var(--danger); }
.kpi-green  { border-left: 3px solid var(--success); }
.kpi-blue   { border-left: 3px solid var(--primary); }
.kpi-orange { border-left: 3px solid var(--warning); }
.kpi-gray   { border-left: 3px solid var(--muted); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-h); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #c0392b; }
.btn-ghost    { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--border); }
.btn-ghost.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Botão "Atualizar" da topbar — destacado (contorno azul, preenche no hover) */
.topbar-refresh-btn { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary);
  font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.topbar-refresh-btn:hover { background: var(--primary); color: #fff; }
.topbar-refresh-btn:disabled { opacity: .5; cursor: default; }

/* Meu Dia — coordenação (admin): seletor de pessoa + panorama da equipe */
.md-admin-head { margin-bottom: 14px; }
.md-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.md-view-sel { padding: 5px 10px; }
.md-ro-tag { font-size: 11px; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; color: var(--muted); }
.md-pano-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.md-pano-card { flex: 0 0 auto; min-width: 108px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; cursor: pointer; transition: border-color .12s, background .12s; }
.md-pano-card:hover { border-color: var(--primary); }
.md-pano-card.active { border: 1.5px solid var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.md-pano-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; }
.md-pano-counts { display: flex; gap: 8px; font-size: 11px; font-weight: 600; }

/* Barra de filtros da aba Tarefas/Kanban: grupos, separador e interruptor segmentado */
.tl-sep { width: 1px; align-self: stretch; min-height: 22px; background: var(--border); margin: 0 2px; }
.tl-grp-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg-btn { padding: 6px 13px; background: transparent; color: var(--muted); border: none; cursor: pointer; font-size: 12px; font-weight: 500; line-height: 1.4; }
.seg-btn:hover { background: var(--surface2); }
.seg-btn.active { background: var(--primary); color: #fff; }

/* Tooltip flutuante ao arrastar barras no Gantt do simulador */
.sim-drag-tip { position: fixed; z-index: 9999; display: none; pointer-events: none;
  background: #111827; color: #fff; font-size: 12px; font-weight: 500;
  padding: 4px 9px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.sim-bar-grp:hover .sim-bar-hit[data-sim-bar="move"] { cursor: grab; }

/* Campos "data alvo" do simulador (Início do projeto / Entrega desejada) */
.sim-target-group { display: inline-flex; gap: 8px; }
.sim-tgt { display: inline-flex; flex-direction: column; gap: 1px; border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 10px; background: var(--surface); cursor: pointer; }
.sim-tgt.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent); }
.sim-tgt-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sim-tgt.active .sim-tgt-lbl { color: var(--primary); }
.sim-tgt input[type=date] { border: none; background: transparent; font-size: 13px; padding: 0; color: var(--text); }
.sim-tgt-head { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.sim-tgt-chip { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 99px; background: var(--surface2); color: var(--muted); }
.sim-tgt.active .sim-tgt-chip { background: var(--primary); color: #fff; }
.btn-icon { padding: 6px; border-radius: 6px; }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ── Badges / Pills ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-todo       { background: rgba(139,148,158,.15); color: #8b949e; border: 1px solid rgba(139,148,158,.40); }
.badge-in_progress{ background: rgba(79,125,240,.18); color: #6fa8ff; border: 1px solid rgba(79,125,240,.55); }
.badge-ongoing    { background: rgba(243,156,18,.18); color: #f39c12; border: 1px solid rgba(243,156,18,.55); }
.badge-waiting    { background: rgba(249,115,22,.18); color: #f97316; border: 1px solid rgba(249,115,22,.55); }
.badge-awaiting_approval { background: rgba(139,92,246,.18); color: #8b5cf6; border: 1px solid rgba(139,92,246,.55); }
.badge-completed  { background: rgba(46,204,113,.18); color: #2ecc71; border: 1px solid rgba(46,204,113,.55); }
.badge-blocked    { background: rgba(231,76,60,.18); color: #e74c3c; border: 1px solid rgba(231,76,60,.55); } /* legado */
.badge-low    { background: rgba(139,148,158,.12); color: var(--muted); }
.badge-medium { background: rgba(243,156,18,.18); color: #f39c12; }
.badge-high   { background: rgba(231,76,60,.18); color: #e74c3c; }
.badge-critical { background: rgba(231,76,60,.25); color: #ff6b6b; font-weight: 700; }

/* discipline badges */
.badge-electronic    { background: rgba(52,152,219,.18); color: #3498db; }
.badge-mechanical    { background: rgba(155,89,182,.18); color: #9b59b6; }
.badge-visual        { background: rgba(26,188,156,.18); color: #1abc9c; }
.badge-documentation { background: rgba(243,156,18,.18); color: #f39c12; }
.badge-general       { background: rgba(139,148,158,.12); color: var(--muted); }

/* ── Status badge clicável ───────────────────────────── */
.status-badge-btn {
  cursor: pointer;
  user-select: none;
  transition: opacity .15s, transform .1s;
}
.status-badge-btn:hover { opacity: .8; transform: scale(1.05); }

/* Picker flutuante */
.status-picker-pop {
  position: absolute;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}
.spp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s;
}
.spp-item:hover { background: var(--surface2); }
.spp-current { background: var(--surface2); }
.spp-check { font-size: 12px; color: var(--success); font-weight: 700; }

/* Picker de responsável inline */
.task-resp-btn {
  display: flex; align-items: center; gap: 5px;
  min-width: 100px; cursor: pointer;
  border-radius: 6px; padding: 2px 5px;
  transition: background .15s;
}
.task-resp-btn:hover { background: var(--hover); }
.resp-picker-pop {
  position: absolute; z-index: 9999;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px; display: flex; flex-direction: column;
  gap: 2px; min-width: 180px; max-height: 280px; overflow-y: auto;
}
.rpp-item {
  display: flex; align-items: center; gap: 8px;
  justify-content: space-between;
  padding: 6px 8px; border-radius: 7px;
  cursor: pointer; transition: background .12s;
}
.rpp-item:hover { background: var(--surface2); }
.rpp-item.rpp-current { background: var(--surface2); }

/* ── Painel de ajuda recolhível ──────────────────────── */
.help-panel {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.help-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  padding: 10px 14px; cursor: pointer;
  color: var(--text); font-size: 13px; font-weight: 600;
  text-align: left;
}
.help-toggle:hover { background: var(--surface2); }
.help-toggle-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.help-toggle-label { flex: 1; }
.help-arrow { font-size: 10px; color: var(--muted); transition: transform .2s; }
.help-body {
  border-top: 1px solid var(--border);
  padding: 16px;
  transition: all .2s;
}
.help-panel.help-collapsed .help-body { display: none; }
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.help-item {
  display: flex; gap: 12px; align-items: flex-start;
}
.help-item-icon {
  font-size: 20px; flex-shrink: 0; margin-top: 1px;
}
.help-item-title {
  font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 3px;
}
.help-item-text {
  font-size: 12px; color: var(--muted); line-height: 1.55;
}

/* ── Botão de nota por tarefa ────────────────────────── */
.note-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.25;
  padding: 2px 4px;
  border-radius: 5px;
  line-height: 1;
  transition: opacity .15s, background .15s;
  flex-shrink: 0;
}
.note-btn:hover { opacity: 0.75; background: var(--surface2); }
.note-btn.note-has {
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(79,125,240,.5));
}

/* Popover de nota */
.note-picker-pop {
  position: absolute;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.npp-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.npp-ta {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 10px;
  resize: vertical;
  min-height: 80px;
  width: 100%;
  transition: border-color .15s;
}
.npp-ta:focus { outline: none; border-color: var(--primary); }
.npp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.npp-hint {
  font-size: 10px;
  color: var(--muted);
}

/* ── Color dot ───────────────────────────────────────── */
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Avatar ──────────────────────────────────────────── */
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
label { font-size: 12px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  transition: border-color .15s;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}
select option { background: var(--surface2); }
textarea { resize: vertical; min-height: 72px; }

/* ── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn .15s;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp .18s;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-body   { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Filters bar ─────────────────────────────────────── */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters select, .filters input { width: auto; padding: 6px 10px; }

/* ── Section header ──────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ── Kanban ──────────────────────────────────────────── */
/* Wrapper com scroll horizontal */
.kb-scroll-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 16px;
}
.kanban {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
  min-width: max-content;
}
.kanban-col {
  background: var(--surface2);
  border-radius: 10px;
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanban-col-header {
  padding: 12px 14px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.kb-anon-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.kb-col-label {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-count {
  font-size: 11px;
  color: var(--muted);
  background: var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  flex-shrink: 0;
}
.kanban-col-body {
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  flex: 1;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow .12s, border-color .12s;
  flex-shrink: 0;
}
.kanban-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); border-color: var(--primary); }
.kanban-card.dragging { opacity: .5; cursor: grabbing; }
.task-row { cursor: grab; }
.task-row.dragging { opacity: .35; cursor: grabbing; }
.kanban-card.kb-done .kc-name { text-decoration: line-through; opacity: .6; }
.tl-group-body { min-height: 48px; }
.phase-body.drag-over,
.tl-group-body.drag-over {
  background: rgba(79,125,240,.08);
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  border-radius: 4px;
}
.kanban-card .kc-name { font-weight: 400; font-size: 13px; line-height: 1.4; }
.kanban-card .kc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.kanban-col.drag-over { background: rgba(79,125,240,.07); outline: 2px dashed var(--primary); }
.kb-empty-col { text-align: center; padding: 20px 8px; color: var(--muted); font-size: 12px; }

/* Drag de colunas */
.kb-col-draggable { cursor: grab; user-select: none; }
.kb-col-draggable:active { cursor: grabbing; }
.kb-drag-handle { font-size: 14px; color: var(--muted); margin-right: 2px; opacity: 0.5; }
.kanban-col-header:hover .kb-drag-handle { opacity: 1; }
.kanban-col.kb-col-dragging { opacity: 0.45; }
.kanban-col.kb-col-drop-target { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }

/* Coluna Concluído */
.kb-done-col { border: 1px dashed var(--success); opacity: 0.85; }
.kb-done-col:hover { opacity: 1; }

/* ── Kanban estilo Asana (kb2) ───────────────────────── */
.kb2-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
  height: calc(100vh - 210px);
}
.kb2-col {
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border-radius: 10px;
  max-height: 100%;
}
.kb2-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  flex-shrink: 0;
}
.kb2-col-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kb2-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.kb2-col-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--border);
  border-radius: 99px;
  padding: 1px 8px;
}
.kb2-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 60px;
}
.kb2-col-body.drag-over { background: rgba(79,125,240,.07); border-radius: 8px; }
.kb2-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow .12s;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.kb2-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); border-color: var(--primary); }
.kb2-card.dragging { opacity: .45; }
.kb2-card.drag-over-card { outline: 2px solid var(--primary); outline-offset: 2px; }
.kb2-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.kb2-card-top .kc-name {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  cursor: text;
  flex: 1;
}
.kc-name.milestone { font-weight: 700; }
.kb2-card.kb-done .kc-name { text-decoration: line-through; opacity: .55; }
.kb2-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.kb2-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb2-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}
.kb2-date {
  font-size: 11px;
  color: var(--muted);
}
.kb2-date.overdue { color: var(--danger); font-weight: 600; }
.kb2-edit-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .1s;
}
.kb2-card:hover .kb2-edit-btn { opacity: 1; }
.kb2-edit-btn:hover { color: var(--primary); background: var(--surface2); }
.kb2-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--muted);
  font-size: 12px;
}

/* ── Project card (grid) ─────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s, transform .1s;
  cursor: pointer;
}
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-card-bar { height: 5px; }
.project-card-body { padding: 14px 16px 16px; }
.project-card-title { font-size: 14px; font-weight: 700; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.project-card-meta { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ── Project list — layout compacto ─────────────────── */
.proj-page { display: flex; flex-direction: column; gap: 10px; }

/* Chips de grupos recolhidos */
.proj-chips-row { display: flex; gap: 10px; flex-wrap: wrap; }
.proj-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: var(--surface); border-radius: 10px; cursor: pointer;
  transition: box-shadow .15s; user-select: none;
}
.proj-chip:hover { box-shadow: 0 2px 10px rgba(0,0,0,.09); }
.proj-chip-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.proj-chip-label { font-size: 13px; font-weight: 600; }
.proj-chip-count { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--border); color: var(--muted); }
.proj-chip-arrow { font-size: 18px; color: var(--muted); transition: transform .2s; margin-left: 2px; }
.proj-chip.expanded .proj-chip-arrow { transform: rotate(90deg); }

/* Grupo de projetos (seção) */
.proj-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.proj-group-hdr {
  display: grid;
  grid-template-columns: 52px 1fr 150px 140px 90px 32px;
  gap: 12px; align-items: center;
  padding: 7px 16px;
  background: var(--surface2, var(--bg));
  border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
}
.proj-group-title {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.proj-group-title-badge {
  background: var(--border); border-radius: 99px;
  padding: 1px 8px; font-size: 11px; color: var(--muted);
}

/* Card linha */
.pcn {
  display: grid;
  grid-template-columns: 52px 1fr 150px 140px 90px 32px;
  gap: 12px; align-items: center;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
  position: relative; user-select: none;
}
.pcn:last-child   { border-bottom: none; }
.pcn:hover        { background: var(--surface2, #f8f9fc); }
.pcn:hover .pcn-menu-btn { opacity: 1; }

/* Donut + accent */
.pcn-lead { display: flex; align-items: center; gap: 5px; }
.pcn-accent-bar { width: 3px; height: 32px; border-radius: 2px; flex-shrink: 0; }

/* Info */
.pcn-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcn-sub  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Barra de progresso */
.pcn-bar-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 3px; }
.pcn-bar-fill  { height: 100%; border-radius: 99px; transition: width .4s; }
.pcn-bar-lbl   { font-size: 11px; color: var(--muted); }

/* Data */
.pcn-date     { font-size: 12px; font-weight: 600; white-space: nowrap; }
.pcn-date-ok  { color: var(--text); }
.pcn-date-red { color: var(--danger); }

/* Status chip */
.pcn-status       { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; text-align: center; }
.pcn-status-ok    { background: rgba(34,197,94,.12); color: #16a34a; }
.pcn-status-risk  { background: rgba(239,68,68,.1);  color: var(--danger); }
.pcn-status-none  { background: var(--border); color: var(--muted); }

/* Menu ⋮ */
.pcn-menu-wrap   { position: relative; }
.pcn-menu-btn    {
  opacity: 0; background: transparent; border: none;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  font-size: 16px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, background .1s;
}
.pcn-menu-btn:hover { background: var(--border); color: var(--text); }
.pcn-menu-drop {
  position: absolute; right: 0; top: 32px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.13);
  z-index: 200; min-width: 160px; overflow: hidden; display: none;
}
.pcn-menu-drop.open { display: block; }
.pcn-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 12px; cursor: pointer;
  transition: background .1s; white-space: nowrap;
}
.pcn-menu-item:hover          { background: var(--surface2, var(--bg)); }
.pcn-menu-item-danger         { color: var(--danger); }
.pcn-menu-item-danger:hover   { background: rgba(239,68,68,.06); }
.pcn-menu-sep { height: 1px; background: var(--border); margin: 2px 0; }

/* Drag */
.pcard-dragging { opacity: 0.4; }
.pcard-drop { outline: 2px dashed var(--primary); outline-offset: -2px; border-radius: 8px; }

/* ── Color palette picker ────────────────────────────── */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .1s, border-color .1s;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text); transform: scale(1.15); }

/* ── Team workload bars ──────────────────────────────── */
.workload-bar-wrap { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.workload-bar      { height: 100%; border-radius: 99px; transition: width .4s; }

/* ── Empty state ─────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow);
  animation: slideUp .2s;
  max-width: 320px;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }

/* ── Loading ─────────────────────────────────────────── */
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.ork-spinner { width: 52px; height: 52px; margin: 0 auto 14px; animation: ork-spin 1.1s linear infinite; }
.ork-spinner svg { width: 100%; height: 100%; display: block; }
@keyframes ork-spin { to { transform: rotate(360deg); } }

/* ── Modal wide ──────────────────────────────────────── */
.modal-wide { width: 680px; }
.modal-x-btn {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.modal-x-btn:hover { color: var(--text); }
.modal-err { margin: 0; }

/* ── Task list (Asana-style) ─────────────────────────── */
.task-list { display: flex; flex-direction: column; }

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background .12s;
  user-select: none;            /* arrastar não seleciona texto (evita o "estranho") */
}
/* Indicadores de onde a tarefa vai cair ao soltar (acima/abaixo) */
.task-row.drag-insert-above { box-shadow: inset 0 3px 0 0 var(--primary); }
.task-row.drag-insert-below { box-shadow: inset 0 -3px 0 0 var(--primary); }
.task-row:first-child { border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.task-row:last-child  { border-radius: 0 0 var(--radius) var(--radius); }
.task-row:hover { background: var(--surface2); }

.task-row-icon { width: 18px; text-align: center; color: var(--muted); flex-shrink: 0; font-size: 14px; }
.task-row-main { flex: 1; min-width: 0; }
.task-row-name { font-size: 14.5px; font-weight: 400; display: flex; align-items: center; gap: 0; min-width: 0; }
.trn-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.task-row-name.milestone { font-weight: 700; }
.task-row-name.done { text-decoration: line-through; color: var(--muted); }
.task-row-desc { display: block; font-size: 11px; color: var(--muted); }
.task-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
/* Triângulo de expandir/recolher subtarefas (estilo Asana) */
.sub-toggle { flex-shrink: 0; width: 22px; height: 24px; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--muted); transition: transform .12s; }
.sub-toggle::before { content: '\25B8'; font-size: 16px; line-height: 1; }   /* ▸ maior */
.sub-toggle:hover { color: var(--text); }
.sub-toggle.open { transform: rotate(90deg); }
/* Subtarefas (aninhadas sob a tarefa-macro) — indentadas para dentro */
.subtask-row { padding-left: 80px; background: var(--surface2); }
/* Linha inline "Adicionar uma subtarefa…" (estilo Asana) */
.subtask-add-row { padding: 5px 14px 5px 80px; background: var(--surface2); flex-wrap: wrap; gap: 4px; }
.subtask-add-input { flex: 1; min-width: 160px; border: none; background: transparent;
  font-size: 12.5px; color: var(--text); padding: 4px 2px; font-family: inherit; }
.subtask-add-input::placeholder { color: var(--muted); }
.subtask-add-input:focus { outline: none; border-bottom: 1px solid var(--primary); }
.subtask-row .task-row-name { font-size: 13.5px; }
.subtask-elbow { color: var(--muted); font-size: 14px; flex-shrink: 0; width: 16px; text-align: center; opacity: .7; }
/* Campos extras na linha de adicionar subtarefa */
.sub-add-extras { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.sub-add-date { padding: 3px 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 11.5px; font-family: inherit;
  cursor: pointer; width: 120px; }
.sub-add-date:focus { outline: none; border-color: var(--primary); }
.sub-add-status { padding: 3px 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 11.5px; font-family: inherit; cursor: pointer; }
.sub-add-status:focus { outline: none; border-color: var(--primary); }
.subtask-count { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; margin-left: 8px;
  font-size: 10px; font-weight: 700; color: var(--primary); background: rgba(79,125,240,0.12);
  border: 1px solid rgba(79,125,240,0.3); border-radius: 10px; padding: 1px 7px; vertical-align: middle; }
.task-row.has-subs .task-complete-btn { opacity: .75; }

/* Quick add row */
.quick-add-row {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  margin-top: 4px;
}
.quick-add-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  padding: 4px 0;
}
.add-task-inline-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-top: 4px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  transition: color .15s, border-color .15s;
}
.add-task-inline-btn:hover { color: var(--text); border-color: var(--muted); }

/* Quick-add inline row (Lista de Tarefas) */
.tl-quickadd {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 52px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  animation: fadeIn .15s;
}
.tl-qa-name {
  flex: 3 1 0;
  min-width: 220px;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.tl-qa-proj, .tl-qa-phase {
  flex: 1 1 0;
  padding: 5px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  min-width: 100px;
  max-width: 200px;
}
.tl-qa-phase { max-width: 170px; }
/* .tl-qa-due agora é hidden, mantido apenas para compatibilidade */
.tl-qa-daterange {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 80px;
  flex-shrink: 0;
  transition: border-color .15s;
}
.tl-qa-daterange:hover { border-color: var(--primary); }
.tl-qa-daterange .drp-label { color: var(--muted); }
.tl-qa-daterange:has(.drp-label:not(:empty)):not(.drp-label) .drp-label { color: var(--text); }

/* ── Date Range Picker popup ──────────────────────────────────────────── */
.drp-popup {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  padding: 14px;
  width: 284px;
  user-select: none;
  animation: fadeIn .12s ease;
}
.drp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.drp-nav {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: border-color .12s, color .12s;
}
.drp-nav:hover { border-color: var(--primary); color: var(--primary); }
.drp-month-label { font-weight: 700; font-size: 13px; }
.drp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.drp-wdh {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  padding: 3px 0 5px;
  text-transform: uppercase;
}
.drp-cell {
  text-align: center;
  padding: 6px 2px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background .1s, color .1s;
  position: relative;
}
.drp-empty { cursor: default; }
.drp-cell:not(.drp-empty):hover { background: var(--surface2); }
.drp-today { font-weight: 700; color: var(--primary); }
.drp-range-start,
.drp-range-end {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 4px;
  font-weight: 600;
}
.drp-in-range {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: 0;
  color: var(--text);
}
.drp-range-start.drp-in-range,
.drp-range-end.drp-in-range { border-radius: 4px; }
.drp-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.drp-status { font-size: 11px; color: var(--muted); flex: 1; }
.drp-status-date { color: var(--text); font-weight: 600; }
.drp-status-hint { font-style: italic; }
.drp-actions { display: flex; gap: 6px; flex-shrink: 0; }
.drp-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.drp-clear:hover { color: var(--danger); border-color: var(--danger); }
.drp-confirm {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 3px 12px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
}
.drp-confirm:disabled { opacity: .35; cursor: default; }

.kb-quickadd { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface2); border-top: 1px solid var(--border); }
.kb-quickadd input, .kb-quickadd select { font-size: 12px; border: 1px solid var(--border); border-radius: 4px; padding: 4px 6px; background: var(--surface); color: var(--text); width: 100%; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.input-err { border-color: var(--danger) !important; animation: shake .3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

/* Status select inline */
.status-sel {
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

/* Kanban add button */
.kb-add-btn {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.kb-add-btn:hover { color: var(--text); background: var(--surface2); }

/* ── Task complete button (clique para concluir) ─────── */
.task-complete-btn {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: border-color .15s, background .15s, color .15s;
}
.task-complete-btn:hover {
  border-color: var(--success);
  color: var(--success);
}
.task-complete-btn.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* ── Project detail — phases ─────────────────────────── */
.phase-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
  transition: opacity .15s;
}
.phase-dragging { opacity: 0.4; }
.phase-drop-above::before,
.phase-drop-below::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: var(--primary, #4f7df0);
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
}
.phase-drop-above::before { top: -2px; }
.phase-drop-below::after  { bottom: -2px; }
.phase-drag-handle:active { cursor: grabbing; }
.phase-drag-wrap[draggable="true"]:hover .phase-drag-handle { color: var(--text); }
.phase-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  user-select: none;
  transition: background .12s;
}
.phase-header:hover { background: var(--surface2); }
.phase-toggle { color: var(--muted); font-size: 11px; width: 14px; text-align: center; }
.phase-body   { padding: 0; }

/* ── Task list column header ─────────────────────────── */
.tl-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Template banner ─────────────────────────────────── */
.template-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(79,125,240,.1);
  border: 1px solid rgba(79,125,240,.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.template-banner-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 16px;
  flex-shrink: 0;
}
/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Kanban project tag ──────────────────────────────── */
.kb-project-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Login page ──────────────────────────────────────── */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 380px;
  box-shadow: var(--shadow);
}
.login-box .logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}
.login-box .logo-icon-lg {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 12px;
}
.login-box .logo-icon-lg.logo-icon-mark { background: none; border-radius: 0; }
.login-box h2 { text-align: center; margin-bottom: 4px; font-size: 22px; font-weight: 700; }
.login-box .login-tagline {
  text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--primary); margin: 2px 0 4px;
}
.login-box .subtitle { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-error { background: rgba(231,76,60,.12); color: #e74c3c; border: 1px solid rgba(231,76,60,.3); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: none; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover  { color: var(--text); }

/* ── Utilities ───────────────────────────────────────── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-4  { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-bold { font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Simulator ────────────────────────────────────────── */
.sim-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sim-label { font-size: 13px; color: var(--muted); }

/* Resumo do projeto: duração total + datas, sempre visível na barra do simulador */
.sim-summary-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 12px;
  background: rgba(79,125,240,0.08);
  border: 1px solid rgba(79,125,240,0.25);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}
.sim-summary-info strong { font-weight: 700; color: var(--text); }
.sim-sum-label { color: var(--muted); font-weight: 500; }
.sim-sum-sep   { color: var(--muted); opacity: 0.6; }
.sim-sum-arrow { color: var(--muted); font-weight: 700; margin: 0 2px; }
.sim-sum-dur   { color: var(--primary); }

/* ── Radar de Ação Diária ──────────────────────────────────────────── */
.radar-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 4px;
}
.radar-date { font-size: 13px; display: block; margin-bottom: 10px; }
.radar-cards-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  overflow-x: auto;
}
.radar-card {
  flex: 1 1 140px;
  min-width: 140px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.radar-card:hover {
  border-color: var(--rc, var(--primary));
  background: var(--surface);
  transform: translateY(-1px);
}
.radar-card-active {
  border-color: var(--rc, var(--primary)) !important;
  background: var(--surface) !important;
  box-shadow: 0 0 0 2px var(--rc, var(--primary)) inset;
}
.radar-card-num { font-size: 28px; font-weight: 800; line-height: 1; }
.radar-card-lbl { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ── Barra de progresso na linha de tarefa ────────────────────────── */
.trow-prog-wrap {
  height: 14px;
  background: var(--border);
  border-radius: 7px;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 240px;
}
.trow-prog-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 7px;
  transition: width .3s;
}
.trow-prog-lbl {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 0 3px rgba(0,0,0,0.55);
  pointer-events: none;
  letter-spacing: 0.02em;
}

/* ── Badges de duração e esforço nas tarefas ──────────────────────── */
.task-duration-badge {
  display: inline-block;
  flex-shrink: 0;
  margin-left: 6px;
  padding: 1px 6px;
  background: rgba(136,146,164,0.15);
  color: var(--muted);
  border: 1px solid rgba(136,146,164,0.35);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.task-effort-badge {
  display: inline-block;
  flex-shrink: 0;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(79,125,240,0.12);
  color: var(--primary);
  border: 1px solid rgba(79,125,240,0.3);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

/* ── Capacidade (Heatmap) ──────────────────────────────────────────── */
.cap-page { display: flex; flex-direction: column; gap: 10px; }
.cap-wrap { padding: 0; }

.cap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}
.cap-corner, .cap-weekhead, .cap-userhead, .cap-cell {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.cap-corner {
  background: var(--surface2);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  position: sticky; left: 0; top: 0;
  z-index: 3;
  min-width: 180px;
}
.cap-weekhead {
  background: var(--surface2);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  min-width: 80px;
  white-space: nowrap;
  position: sticky; top: 0;
  z-index: 2;
}
.cap-userhead {
  background: var(--surface);
  position: sticky; left: 0;
  z-index: 1;
  border-right: 1px solid var(--border);
}
.cap-user-info { padding: 2px 0; }
.cap-user-name { font-weight: 600; font-size: 13px; }
.cap-user-sub  { font-size: 10px; color: var(--muted); margin-left: 11px; margin-top: 2px; }

.cap-cell {
  text-align: center;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: filter .15s, transform .1s;
  user-select: none;
}
.cap-cell:hover { filter: brightness(1.15); transform: scale(1.02); }
.cap-pct { font-weight: 700; font-size: 14px; }
.cap-hrs { font-size: 10px; opacity: 0.8; margin-top: 1px; }

.cap-task-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cap-task-table th {
  background: var(--surface2);
  text-align: left;
  padding: 8px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.cap-task-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cap-task-table tr:hover td { background: var(--surface2); }

/* ── Documentos ISO ────────────────────────────────────────────────── */
.iso-page { display: flex; flex-direction: column; gap: 12px; }

.iso-summary {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 12px;
}
.iso-summary-card {
  flex: 1; min-width: 130px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  display: flex; flex-direction: column; gap: 2px;
}
.iso-summary-card:hover { background: var(--surface); transform: translateY(-1px); }
.iso-sum-num { font-size: 26px; font-weight: 800; line-height: 1; }
.iso-sum-lbl { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

.iso-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.iso-table th {
  background: var(--surface2);
  text-align: left;
  padding: 10px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.iso-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.iso-table tr:last-child td { border-bottom: none; }
.iso-table tr:hover td { background: var(--surface2); }
.iso-code { font-family: monospace; font-weight: 700; color: var(--primary); white-space: nowrap; }
.iso-title { font-weight: 600; }
.iso-status-badge {
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
  display: inline-block; white-space: nowrap;
}
.iso-version-chip {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(79,125,240,0.12);
  color: var(--primary);
  border: 1px solid rgba(79,125,240,0.3);
  border-radius: 10px;
  font-size: 11px; font-weight: 700;
  font-family: monospace;
}

/* Detail */
.iso-detail { display: flex; flex-direction: column; gap: 12px; }
.iso-detail-header { padding: 18px 20px; }
.iso-grid-2col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
@media (max-width: 900px) {
  .iso-grid-2col { grid-template-columns: 1fr; }
}

/* Timeline */
.iso-timeline { position: relative; padding-left: 8px; }
.iso-tl-step {
  position: relative;
  padding: 8px 0 8px 28px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
}
.iso-tl-step:last-child { border-left-color: transparent; }
.iso-tl-step.reached { border-left-color: var(--primary); }
.iso-tl-dot {
  position: absolute;
  left: -8px; top: 10px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.iso-tl-step.current .iso-tl-dot {
  box-shadow: 0 0 0 3px rgba(79,125,240,0.35);
  animation: ecr-pulse 1.8s infinite;
}
.iso-tl-label { font-weight: 600; font-size: 13px; }

/* Versões table */
.iso-version-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.iso-version-table th {
  background: var(--surface2);
  text-align: left;
  padding: 8px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.iso-version-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.iso-version-table tr.iso-version-current td {
  background: rgba(79,125,240,0.08);
}

/* History */
.iso-history-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.iso-history-row {
  display: flex; gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

/* ── Log de Engenharia (ECR) ───────────────────────────────────────── */
.ecr-page { display: flex; flex-direction: column; gap: 12px; }

.ecr-summary {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 12px;
}
.ecr-summary-card {
  flex: 1; min-width: 130px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  display: flex; flex-direction: column; gap: 2px;
}
.ecr-summary-card:hover { background: var(--surface); transform: translateY(-1px); }
.ecr-sum-num { font-size: 26px; font-weight: 800; line-height: 1; }
.ecr-sum-lbl { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

.ecr-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ecr-table th {
  background: var(--surface2);
  text-align: left;
  padding: 10px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ecr-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.ecr-table tr:last-child td { border-bottom: none; }
.ecr-table tr:hover td { background: var(--surface2); }
.ecr-code { font-family: monospace; font-weight: 700; color: var(--primary); white-space: nowrap; }
.ecr-title { font-weight: 600; }
.ecr-proj-chip {
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  display: inline-block; max-width: 160px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ecr-status-badge {
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
  display: inline-block; white-space: nowrap;
}

/* Detail page */
.ecr-detail { display: flex; flex-direction: column; gap: 12px; }
.ecr-detail-header { padding: 18px 20px; }
.ecr-grid-2col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 12px;
}
@media (max-width: 900px) {
  .ecr-grid-2col { grid-template-columns: 1fr; }
}
.ecr-info-table {
  width: 100%; border-collapse: collapse;
}
.ecr-info-table td {
  padding: 6px 0;
  font-size: 13px;
  vertical-align: top;
}
.ecr-info-table td:first-child {
  color: var(--muted);
  width: 120px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-right: 12px;
}

/* Timeline */
.ecr-timeline { position: relative; padding-left: 8px; }
.ecr-tl-step {
  position: relative;
  padding: 8px 0 8px 28px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
}
.ecr-tl-step:last-child { border-left-color: transparent; }
.ecr-tl-step.reached { border-left-color: var(--primary); }
.ecr-tl-dot {
  position: absolute;
  left: -8px; top: 10px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.ecr-tl-step.current .ecr-tl-dot {
  box-shadow: 0 0 0 3px rgba(79,125,240,0.35);
  animation: ecr-pulse 1.8s infinite;
}
@keyframes ecr-pulse {
  0%   { box-shadow: 0 0 0 3px rgba(79,125,240,0.35); }
  50%  { box-shadow: 0 0 0 6px rgba(79,125,240,0.15); }
  100% { box-shadow: 0 0 0 3px rgba(79,125,240,0.35); }
}
.ecr-tl-label { font-weight: 600; font-size: 13px; }
.ecr-tl-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.ecr-att-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.ecr-att-row:last-child { border-bottom: none; }

/* ── Anexos de projeto ─────────────────────────────────────────────── */
.att-page { display: flex; flex-direction: column; gap: 12px; }

.att-header { padding: 16px 18px; }

.att-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.att-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(79,125,240,0.08);
}

.att-cat-section { padding: 0; overflow: hidden; }
.att-cat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  user-select: none;
}
.att-cat-header:hover { background: rgba(79,125,240,0.06); }
.att-cat-toggle { font-size: 10px; color: var(--muted); width: 12px; }
.att-cat-icon { font-size: 18px; }
.att-cat-name { font-weight: 600; flex: 1; }
.att-cat-count {
  background: var(--surface); color: var(--muted);
  padding: 2px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border);
}
.att-cat-body { padding: 0; }

.att-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.att-row:last-child { border-bottom: none; }
.att-row:hover { background: var(--surface2); }
.att-icon { font-size: 26px; flex-shrink: 0; }
.att-main { flex: 1; min-width: 0; }
.att-name {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.att-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
  align-items: center;
}
.att-version {
  background: var(--primary); color: white;
  padding: 1px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 700;
}
.att-desc { font-style: italic; }
.att-actions { display: flex; gap: 4px; flex-shrink: 0; }
.att-empty { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; font-style: italic; }

/* ── Burndown card (visão-geral do projeto) ───────────────────────── */
.vg-burndown-card { margin-bottom: 12px; }
.vg-burndown-card svg text { font-family: inherit; }

/* ── Saúde por fase (visão-geral do projeto) ─────────────────────── */
/* Planejado × Executado por fase */
.pve-row {
  display: grid;
  grid-template-columns: 180px 1fr 52px 110px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.pve-row:last-child { border-bottom: none; }
.pve-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pve-bar-wrap { position: relative; height: 18px; background: var(--border); border-radius: 4px; overflow: hidden; }
.pve-bar-planned { position: absolute; inset: 0; background: #c8c8c8; border-radius: 4px; }
.pve-bar-wip     { position: absolute; top: 0; height: 100%; background: var(--warning); opacity: .65; }
.pve-bar-done    { position: absolute; inset: 0; border-radius: 4px 0 0 4px; transition: width .4s; }
.pve-bar-label   { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 700; color: #fff; }
.pve-pct  { font-weight: 700; text-align: right; }
.pve-info { font-size: 11px; color: var(--muted); white-space: nowrap; }

.sim-mode-group { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.sim-mode-btn {
  padding: 6px 14px;
  font-size: 13px;
  background: var(--surface2);
  color: var(--muted);
  border: none;
  cursor: pointer;
  transition: background .15s;
}
.sim-mode-btn.active { background: var(--primary); color: #fff; }
.sim-empty { padding: 60px; text-align: center; color: var(--muted); font-size: 14px; }

/* Simulador ocupa a altura da viewport: controles no topo + área tabela/Gantt
   flexível. Assim a barra de rolagem horizontal do Gantt fica sempre visível,
   sem precisar rolar a página até o fim. */
.sim-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 420px;
}
.sim-page #sim-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sim-main {
  display: flex;
  height: calc(100vh - 200px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
/* No simulador, a área tabela/Gantt preenche o espaço (a barra horizontal do
   Gantt fica sempre visível). No Gantt do PROJETO mantém a altura fixa acima. */
.sim-page .sim-main { height: auto; flex: 1; min-height: 0; }

/* Left table */
.sim-table-wrap { display: flex; flex-direction: column; width: 680px; flex-shrink: 0; border-right: 2px solid var(--border); position: relative; }
.sim-table-hdr, .sim-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.sim-table-hdr {
  background: var(--surface2);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  flex-shrink: 0;
  height: 48px;
}
.sim-table-body { overflow-y: auto; flex: 1; }
.sim-row { transition: background .1s; }
.sim-row:hover { background: var(--surface2); }
.sim-row.sim-crit { background: rgba(231,76,60,.05); }
.sim-row.sim-crit:hover { background: rgba(231,76,60,.1); }

/* Colunas: total fixo ~450px → stc-name recebe ~230px com painel 680px */
.stc-move { width: 36px; display:flex; align-items:center; justify-content:center; gap:2px; flex-shrink:0; }
.stc-num  { width: 26px; text-align: right; padding: 0 4px; color: var(--muted); flex-shrink:0; }
.stc-name { flex: 1; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 120px; }
.stc-dur  { width: 72px; display:flex; align-items:center; gap:4px; padding: 0 4px; flex-shrink:0; }
.stc-pred { width: 122px; display:flex; align-items:center; gap:3px; padding: 0 4px; flex-shrink:0; }
.sim-table-hdr > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stc-pred .sim-pred { flex:1; min-width:0; }
.stc-date { width: 118px; display:flex; align-items:center; gap:3px; font-size:11px; padding: 0 3px; flex-shrink:0; }
.stc-date .sim-date-inp { flex:1; min-width:0; }
.sim-pred-pick, .sim-pin-btn {
  flex-shrink:0; border:1px solid var(--border); background:var(--surface2);
  border-radius:4px; cursor:pointer; font-size:11px; line-height:1; padding:3px 5px; color:var(--muted);
}
.sim-pred-pick:hover, .sim-pin-btn:hover { background: var(--surface); }
.sim-pin-btn.pinned { background: var(--primary); border-color: var(--primary); filter:none; opacity:1; }
.stc-float{ width: 40px; font-size:11px; text-align:center; flex-shrink:0; }
.stc-crit { width: 40px; text-align:center; flex-shrink:0; }

.sim-inp {
  width: 100%;
  padding: 3px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
}
.sim-inp:focus { background: var(--surface2); border-color: var(--primary); outline: none; }
.stc-dur .sim-inp { width: 46px; }
.sim-row.sim-milestone { background: rgba(79,125,240,.07); border-top: 2px solid var(--primary); }
.sim-row.sim-milestone .stc-name { font-weight: 700; color: var(--primary); letter-spacing:.01em; }
.sim-milestone-diamond { color: var(--primary); font-size: 13px; margin-right: 4px; }
.sim-pred { width: 72px; }
.sim-float-val { color: var(--muted); }
.sim-star { color: #e74c3c; font-size: 13px; }

/* Tarefas concluídas — travadas, somente leitura */
.sim-row-done { opacity: 0.55; cursor: default !important; }
.sim-row-done:hover { background: transparent !important; }
.sim-row-done.sim-milestone { background: rgba(100,116,139,.07) !important; }
.sim-row-done .stc-name { color: var(--muted); }
.sim-row-done .stc-name strong { text-decoration: line-through; }
.sim-row-done .drag-handle { display: none; }
.sim-done-lock { color: var(--muted); font-size: 12px; opacity: 0.7; }
.sim-done-date { font-size: 11px; color: var(--muted); padding: 0 2px; }

/* Drag rows in simulator */
.sim-row { cursor: default; }
.sim-row .drag-handle { opacity: 0.35; }
.sim-row:hover .drag-handle { opacity: 1; }

/* Date input in simulator */
.sim-date-inp {
  width: 90px; padding: 2px 3px; border: 1px solid transparent;
  border-radius: 4px; background: transparent; color: var(--text);
  font-size: 11px; cursor: pointer;
}
.sim-date-inp:hover { border-color: var(--border); background: var(--surface2); }
.sim-date-inp:focus { border-color: var(--primary); outline: none; background: var(--surface2); }
.sim-date-inp.sim-date-pinned { border-color: #e67e22; color: #e67e22; background: rgba(230,126,34,.08); }

/* Panel resize handle (drag border between table and gantt) */
.sim-panel-resize {
  position: absolute; top: 0; right: -4px; width: 8px; height: 100%;
  cursor: col-resize; z-index: 10;
  background: transparent;
}
.sim-panel-resize:hover, .sim-panel-resize:active {
  background: rgba(79,125,240,.4);
}

/* Drag handle */
.drag-handle {
  color: var(--muted); font-size: 14px; cursor: grab; padding: 0 2px;
  flex-shrink: 0; user-select: none; opacity: 0.4; transition: opacity .15s;
}
.task-row:hover .drag-handle,
.sim-row:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

/* Drag insert indicators */
.drag-insert-above { box-shadow: 0 -2px 0 var(--primary); }
.drag-insert-below { box-shadow: 0 2px 0 var(--primary); }

/* Multi-select checkbox */
.row-sel-cb {
  width: 14px; height: 14px; flex-shrink: 0; cursor: pointer;
  opacity: 0; transition: opacity .15s; accent-color: var(--primary);
  margin: 0 2px 0 0;
}
.task-row:hover .row-sel-cb,
.sim-row:hover .row-sel-cb,
.kanban-card:hover .row-sel-cb,
.row-sel-cb:checked { opacity: 1; }
.kb-sel-cb { display: block; }

/* Selected row highlight */
.row-selected { background: rgba(79,125,240,0.10) !important; }
.sim-row.row-selected { background: rgba(79,125,240,0.10) !important; }
.kanban-card.row-selected { outline: 2px solid var(--primary); }

/* Right gantt */
.sim-gantt-wrap {
  flex: 1;
  overflow: auto;
  position: relative;
}
.sim-month-lbl { font-size: 11px; font-weight: 700; fill: var(--text); }
.sim-day-lbl   { font-size: 10px; fill: var(--muted); }
.overdue { color: var(--danger); font-weight: 600; }

/* Drag-and-drop de projetos no Gantt do portfólio */
.pg-row-drag { transition: background .12s; position: relative; }
.pg-row-drag.pg-row-dragging { opacity: 0.4; }
.pg-row-drag:hover .pg-row-handle { opacity: 1 !important; color: var(--text) !important; }
.pg-row-drop-above::before,
.pg-row-drop-below::after {
  content: ""; position: absolute; left: 4px; right: 4px; height: 2.5px;
  background: var(--primary, #4f7df0); border-radius: 2px; z-index: 5;
}
.pg-row-drop-above::before { top: 0; }
.pg-row-drop-below::after  { bottom: 0; }

/* ── Project view toggle (Lista / Gantt) ───────────────────────────── */
/* ── Barra de projeto: tabs agrupadas + ações compactas ─────────────── */
.proj-toolbar {
  display: flex; align-items: flex-end; gap: 6px; flex-wrap: nowrap;
}
.pvt-groups {
  display: flex; align-items: flex-end; gap: 10px;
}
/* Cada seção: label EM CIMA + grupo de botões EMBAIXO */
.pvt-section {
  display: flex; flex-direction: column; gap: 3px;
}
.pvt-group {
  display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden;
  background: var(--surface);
}
.pvt-group-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted); user-select: none; padding-left: 2px;
}
.pvt-sep {
  width: 1px; align-self: stretch; background: var(--border); margin: 14px 2px 0; flex-shrink: 0;
}
.pvt-btn {
  background: none; border: none; border-right: 1px solid var(--border);
  padding: 5px 11px; font-size: 12px;
  cursor: pointer; color: var(--muted); transition: background .15s; white-space: nowrap;
}
.pvt-btn:last-child { border-right: none; }
.pvt-btn:hover { background: var(--surface2); color: var(--text); }
.pvt-btn.active { background: var(--primary); color: #fff; border-right-color: var(--primary); }

/* ── Dropdown de ações ──────────────────────────────────────────────── */
.pvt-actions { display: flex; align-items: center; gap: 6px; }
.proj-toolbar .pvt-actions { margin-left: 4px; }
.pvt-drop { position: relative; }
.pvt-drop-toggle {
  display: flex; align-items: center; gap: 4px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px;
  font-size: 12px; color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.pvt-drop-toggle:hover { background: var(--surface2); border-color: var(--primary); color: var(--primary); }
.pvt-drop-toggle.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pvt-drop-item.active { color: var(--primary); font-weight: 600; }

/* ── Botão "Hoje" do Gantt ────────────────────────────────────────── */
.btn-gantt-today {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary, #4f7df0) 0%, #6366f1 100%);
  border: none; border-radius: 6px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  box-shadow: 0 1px 3px rgba(99,102,241,.25);
}
.btn-gantt-today:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(99,102,241,.35); filter: brightness(1.05); }
.btn-gantt-today:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(99,102,241,.25); }
.btn-gantt-today svg { stroke: #fff; }
.pvt-drop-toggle .drop-caret { font-size: 10px; opacity: .6; }
.pvt-drop-menu {
  display: none; position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: 6px; min-width: 180px; z-index: 200;
}
.pvt-drop.open .pvt-drop-menu { display: block; }
.pvt-drop-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px;
  font-size: 13px; color: var(--text); cursor: pointer; background: none;
  border: none; width: 100%; text-align: left; white-space: nowrap;
  transition: background .12s;
}
.pvt-drop-item:hover { background: var(--surface2); color: var(--primary); }
.pvt-drop-item .di-icon { font-size: 14px; width: 18px; text-align: center; }
.pvt-drop-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Botão Voltar — sempre visível na toolbar do projeto ────────────── */
.pvt-back-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); transition: background .15s, border-color .15s, color .15s;
}
.pvt-back-btn:hover {
  background: var(--surface); border-color: var(--primary); color: var(--primary);
}

/* legado: mantém compatibilidade se houver .proj-view-toggle em outras views */
.proj-view-toggle {
  display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-right: 8px;
}

/* ── Project Gantt view ────────────────────────────────────────────── */
.pg-phase-hdr {
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: rgba(79,125,240,.06); border-top: 1px solid rgba(79,125,240,.2);
  font-size: 12px; font-weight: 600; color: var(--primary);
}
.pg-task-row {
  display: flex; align-items: center; gap: 4px; padding: 0 4px 0 8px;
  border-bottom: 1px solid var(--border); font-size: 12px;
}
.pg-task-row:hover { background: var(--surface2); }
/* Cabeçalho do Gantt do projeto: mesmo gap/padding das linhas para as colunas alinharem */
#pg-table-wrap .sim-table-hdr { gap: 4px; padding: 0 4px 0 8px; }
.pg-num   { width: 20px; text-align: center; color: var(--muted); font-size: 11px; flex-shrink: 0; }
.pg-name  { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pg-name.done { text-decoration: line-through; color: var(--muted); }
.pg-name.pg-clickable { cursor: pointer; }
.pg-name.pg-clickable:hover { color: var(--primary); text-decoration: underline; }
.pg-dur   { width: 62px; flex-shrink: 0; display: flex; align-items: center; gap: 2px; }
.pg-pred    { width: 56px; flex-shrink: 0; }
.pg-date2   { width: 96px; flex-shrink: 0; }
.pg-date2.overdue input { color: var(--danger); }
.pg-planned { width: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.btn-plan {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted); font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s, color .15s;
}
.btn-plan:hover   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-plan.active  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-plan:disabled { opacity: .4; cursor: default; }

/* Sino de alerta na linha (aba Tarefas) — espelha o "P", com destaque âmbar quando ativo */
.btn-bell {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s, color .15s; filter: grayscale(1); opacity: .7;
}
.btn-bell:hover  { background: var(--surface); opacity: 1; filter: none; }
.btn-bell.active { background: rgba(243,156,18,.16); border-color: #f39c12; filter: none; opacity: 1; }

/* Popover rápido do sino */
.alert-quick-pop {
  position: fixed; z-index: 4000; width: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 12px;
}
.alert-quick-pop .aqp-title { font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.alert-quick-pop .aqp-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.alert-quick-pop .aqp-lvl {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  border-radius: 7px; padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.alert-quick-pop .aqp-lvl span { font-size: 10px; font-weight: 500; color: var(--muted); }
.alert-quick-pop .aqp-lvl.active { border-color: var(--primary); background: rgba(79,125,240,.12); }
.alert-quick-pop .aqp-lbl { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.alert-quick-pop .aqp-target {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface2); color: var(--text); padding: 7px 9px; font-size: 13px; margin-bottom: 10px;
}
.alert-quick-pop .aqp-msg {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface2); color: var(--text); padding: 7px 9px; font-size: 13px; margin-bottom: 12px;
}
.alert-quick-pop .aqp-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Aba Tarefas no celular: sino + status lado a lado */
.mtask-action { display: flex; align-items: center; gap: 8px; }

/* Editable inputs inside project Gantt (reuses sim-inp style) */
.pg-inp {
  width: 100%; border: none; background: transparent; font-size: 11px;
  color: var(--text); padding: 2px 3px; border-radius: 3px;
  font-family: inherit;
}
.pg-inp:hover, .pg-inp:focus { background: var(--surface2); outline: 1px solid var(--primary); }
.pg-inp-pred { width: 52px; }
.pg-inp-date { width: 92px; }

/* ── Executive Dashboard ─────────────────────────────────────────── */
.dash-kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px;
}
.dash-kpi-grid.k5 { grid-template-columns: repeat(5, 1fr); }
.dash-kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.dash-kpi-card.dash-kpi-alert { border-color: rgba(231,76,60,0.4); }
.dash-kpi-card.kpi-clickable { cursor: pointer; transition: border-color .15s, background .15s, transform .12s; }
.dash-kpi-card.kpi-clickable:hover { background: var(--hover); border-color: var(--primary); transform: translateY(-2px); }
.dash-kpi-card.kpi-clickable.dash-kpi-alert:hover { border-color: var(--danger); }
.modal-ms-link { cursor: pointer; }
.modal-ms-link:hover { background: var(--hover); border-radius: var(--radius); }
.dash-kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dash-kpi-value { font-size: 32px; font-weight: 700; line-height: 1.1; }
.dash-kpi-denom { font-size: 18px; font-weight: 400; color: var(--muted); }
.dash-kpi-sub   { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash-section-title  { font-size: 14px; font-weight: 600; }

.dash-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.dash-filter-btn {
  border: 1px solid var(--border); background: var(--surface2); color: var(--muted);
  border-radius: 6px; padding: 3px 10px; font-size: 11px; cursor: pointer; transition: all .15s;
}
.dash-filter-btn:hover { color: var(--text); background: var(--border); }
.dash-filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.risk-badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.risk-high      { background: rgba(231,76,60,.15);  color: #e74c3c; }
.risk-attention { background: rgba(243,156,18,.15); color: #f39c12; }
.risk-ok        { background: rgba(46,204,113,.15); color: #2ecc71; }

.dash-prog-wrap { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; min-width: 40px; }
.dash-prog-fill { height: 100%; border-radius: 99px; transition: width .3s; }

.dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--muted);
  padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.dash-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--surface2); }
.dash-row-link { cursor: pointer; }
.dash-row-link:hover td { background: rgba(79,125,240,0.08) !important; }

.dash-proj-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dash-motivo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
/* Tabela com colunas redimensionáveis (arrastar a borda do cabeçalho) */
.resizable-table { table-layout: fixed; }
.resizable-table th, .resizable-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resizable-table th { position: relative; }
.col-resizer { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; user-select: none; z-index: 3; }
.col-resizer:hover, .col-resizer.dragging { background: var(--primary); opacity: .5; }
.dash-ms-dt  { color: var(--muted); font-size: 10px; }

.dash-split-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-panel { border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-y: auto; max-height: 280px; }
.dash-panel-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; padding-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; text-align: center; border-bottom: 1px solid var(--border); }

.dash-ms-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dash-ms-row:last-child { border-bottom: none; }
.dash-ms-row.dash-ms-overdue { background: rgba(231,76,60,.04); border-radius: 4px; padding: 6px 4px; }
.dash-ms-info  { flex: 1; min-width: 0; }
.dash-ms-name  { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-ms-proj  { font-size: 10px; color: var(--muted); }
.dash-ms-date  { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.dash-ms-overdue .dash-ms-date { color: var(--danger); }

.dash-chart-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.dash-chart-row:last-child { border-bottom: none; }
.dash-chart-label   { width: 120px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.dash-chart-bar-wrap { flex: 1; height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.dash-chart-bar-fill { height: 100%; border-radius: 99px; transition: width .4s; }
.dash-chart-pct { width: 36px; font-size: 11px; text-align: right; color: var(--muted); flex-shrink: 0; }
.dash-empty { text-align: center; padding: 24px; color: var(--muted); font-size: 12px; }

/* ── Visão Geral (project overview dashboard) ──────────────────────────── */
.vg-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Visão Geral: Marcos | Progresso lado a lado; empilha no celular */
.vg-main-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 768px) {
  .vg-main-grid { grid-template-columns: 1fr; }
}

/* KPI row */
.vg-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.vg-kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}
.vg-kpi-donut {
  gap: 18px;
}
.vg-kpi-icon {
  font-size: 28px;
  flex-shrink: 0;
  opacity: 0.85;
}
.vg-kpi-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.vg-kpi-val {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.vg-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.vg-kpi-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Section title */
.vg-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Milestone status bar */
.vg-ms-bar-card { padding: 18px 20px; }
.vg-ms-bar-wrap {
  display: flex;
  height: 12px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--border);
  gap: 2px;
}
.vg-ms-bar-seg {
  height: 100%;
  min-width: 4px;
  transition: width .5s;
}
.vg-seg-done    { background: var(--success); }
.vg-seg-atrisk  { background: var(--warning); }
.vg-seg-overdue { background: var(--danger); }
.vg-seg-ok      { background: var(--primary); }

.vg-ms-bar-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}
.vg-leg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Milestone list */
.vg-ms-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.vg-ms-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.vg-ms-row:last-child { border-bottom: none; }
.vg-ms-diamond {
  font-size: 14px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.vg-ms-name {
  flex: 1;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vg-ms-date {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 90px;
  text-align: right;
}
.vg-ms-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Badge colors per status */
.vg-ms-diamond.ms-done,
.vg-ms-badge.ms-done    { color: var(--success); background: rgba(46,204,113,.12); }
.vg-ms-diamond.ms-atrisk,
.vg-ms-badge.ms-atrisk  { color: var(--warning); background: rgba(243,156,18,.12); }
.vg-ms-diamond.ms-overdue,
.vg-ms-badge.ms-overdue { color: var(--danger);  background: rgba(231,76,60,.12);  }
.vg-ms-diamond.ms-ok,
.vg-ms-badge.ms-ok      { color: var(--primary); background: rgba(79,125,240,.12); }
.vg-ms-diamond.ms-noprazo,
.vg-ms-badge.ms-noprazo { color: var(--muted);   background: var(--surface2); }

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

/* ── Editor de Templates ────────────────────────────────────────────────── */
.tmpl-phase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .15s;
}
.tmpl-phase.dragging { opacity: 0.5; }
.tmpl-phase.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,125,240,.25); }
.tmpl-phase-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(79,125,240,.06);
  border-bottom: 1px solid var(--border);
}
.tmpl-phase-name {
  flex: 1;
  font-weight: 700;
  font-size: 13px;
}
.tmpl-phase-disc {
  width: 130px;
}
.tmpl-phase-body { padding: 10px 12px; }
.tmpl-tasks-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 6px 4px 4px;
}
.tmpl-task-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}
.tmpl-task-row.dragging { opacity: 0.5; }
.tmpl-task-row.drag-over { background: rgba(79,125,240,.08); border-radius: 5px; }
.tmpl-task-row > input:nth-child(2),
.tmpl-task-row > input[class="tmpl-inp"]:first-of-type {
  flex: 1;
}
.tmpl-inp {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
}
.tmpl-inp:focus { outline: none; border-color: var(--primary); }
.tmpl-drag {
  cursor: grab;
  color: var(--muted);
  font-size: 14px;
  user-select: none;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.tmpl-drag:active { cursor: grabbing; }
.tmpl-num {
  width: 28px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}
.tmpl-pred-inp {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}
.tmpl-gate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 4px;
  border-top: 1px dashed var(--border);
  margin-top: 6px;
}
.tmpl-gate-row .tmpl-inp { flex: 1; }

/* ── Sticky headers nas tabelas ─────────────────────────────────────────────── */
.dash-table thead th,
.goal-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}
.tl-col-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}

/* ── Sidebar collapsível ─────────────────────────────────────────────────────── */
#sidebar { transition: width .22s ease, min-width .22s ease; }
#sidebar.sidebar-collapsed { width: 56px; min-width: 56px; overflow: hidden; }
.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
  margin-left: auto;
  line-height: 1;
  transition: color .15s;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover { color: var(--text); }
#sidebar.sidebar-collapsed .sidebar-brand span.brand-label,
#sidebar.sidebar-collapsed .nav-item-label,
#sidebar.sidebar-collapsed .nav-section-label,
#sidebar.sidebar-collapsed .nav-arrow,
#sidebar.sidebar-collapsed .sidebar-recent,
#sidebar.sidebar-collapsed .user-info,
#sidebar.sidebar-collapsed .theme-btn,
#sidebar.sidebar-collapsed .logout-btn { display: none !important; }
#sidebar.sidebar-collapsed .sidebar-brand { padding: 14px 10px; justify-content: center; }
#sidebar.sidebar-collapsed .logo { justify-content: center; }
#sidebar.sidebar-collapsed .nav-item { padding: 10px 0; justify-content: center; gap: 0; }
#sidebar.sidebar-collapsed .nav-section-toggle { display: none !important; }
#sidebar.sidebar-collapsed .user-chip { justify-content: center; padding: 6px 4px; gap: 0; }
#sidebar.sidebar-collapsed .nav-group-items { max-height: 500px !important; } /* sempre visível */
.nav-item-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-svg-icon { display: flex; align-items: center; justify-content: center; }
.nav-svg-icon svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Projetos Recentes na sidebar ────────────────────────────────────────────── */
.sidebar-recent {
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.sidebar-recent-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 18px 4px;
}
.sidebar-recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  cursor: pointer;
  border-radius: 0;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-recent-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-recent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Busca global ────────────────────────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  backdrop-filter: blur(2px);
}
.search-box-wrap {
  width: min(640px, 92vw);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  overflow: hidden;
  animation: searchIn .18s ease;
}
@keyframes searchIn {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.search-icon { font-size: 18px; flex-shrink: 0; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 17px;
  color: var(--text);
  font-family: inherit;
}
.search-input::placeholder { color: var(--muted); }
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.sr-focus { background: var(--surface2); }
.search-result-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.search-result-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 1px 6px;
  background: var(--surface2);
  border-radius: 4px;
  flex-shrink: 0;
}
.search-result-name { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-sub  { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.search-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.search-hint { padding: 8px 18px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); display: flex; gap: 12px; }

/* ── Filtros rápidos no Portfólio ────────────────────────────────────────────── */
.port-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 0;
  flex-wrap: wrap;
}
.pfc-btn {
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.pfc-btn:hover { border-color: var(--primary); color: var(--primary); }
.pfc-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Hover preview de projeto ────────────────────────────────────────────────── */
.proj-preview-card {
  position: fixed;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  padding: 14px 16px;
  min-width: 240px;
  max-width: 300px;
  pointer-events: none;
  animation: previewIn .14s ease;
}
@keyframes previewIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.proj-preview-name { font-weight: 700; font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.proj-preview-row  { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 3px 0; }
.proj-preview-label { color: var(--muted); }
.proj-preview-bar  { height: 4px; border-radius: 99px; background: var(--surface2); overflow: hidden; margin-top: 6px; }
.proj-preview-fill { height: 100%; border-radius: 99px; }

/* ── Barra de ações em lote ──────────────────────────────────────────────────── */
.bulk-bar {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: 99px;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 6px 24px rgba(79,125,240,.35);
  z-index: 150;
  white-space: nowrap;
  animation: bulkIn .2s ease;
}
@keyframes bulkIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.bulk-bar-count { font-size: 13px; font-weight: 700; color: var(--primary); }
.bulk-bar-sep { width: 1px; height: 18px; background: var(--border); }
.bulk-bar-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .12s;
}
.bulk-bar-btn:hover { background: var(--surface2); }
.bulk-bar-btn.danger { color: var(--danger); }
.bulk-bar-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
}

/* ── Edição inline de data ────────────────────────────────────────────────────── */
.inline-date-cell { cursor: pointer; }
.inline-date-cell:hover { text-decoration: underline dashed; text-underline-offset: 3px; }
.inline-date-input {
  border: 1px solid var(--primary);
  border-radius: 5px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  padding: 2px 6px;
  font-family: inherit;
  outline: none;
}

/* ── Modo compacto ───────────────────────────────────────────────────────────── */
body.compact #view        { padding: 12px 16px; }
body.compact .card        { padding: 14px; margin-bottom: 12px; }
body.compact .dash-kpi-card { padding: 12px 16px; }
body.compact .task-row    { min-height: 34px; padding: 5px 12px; }
body.compact #topbar      { height: 46px; min-height: 46px; }
body.compact .dash-table th, body.compact .dash-table td { padding: 7px 12px; }
body.compact .goal-table  th, body.compact .goal-table td { padding: 7px 12px; }
body.compact h1           { font-size: 15px; }

/* ── Estilos de impressão (PDF via window.print()) ──────────────────────── */
@media print {
  /* Ocultar navegação, topbar e botões */
  .sidebar, .topbar, #back-btn, .topbar-actions, .modal-overlay,
  .btn, button { display: none !important; }

  /* Expandir conteúdo para ocupar a página inteira */
  body, #app { background: #fff !important; color: #000 !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .view-container { padding: 12px !important; }

  /* Cabeçalho de impressão */
  .view-container::before {
    content: "Dashboard de Projetos — JFA Engenharia";
    display: block;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 2px solid #4f7df0;
    padding-bottom: 6px;
    margin-bottom: 14px;
  }

  /* KPI cards */
  .dash-kpi-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }
  .dash-kpi-card { background: #f4f6fb !important; border: 1px solid #dde2f0 !important; break-inside: avoid; }
  .dash-kpi-card .dash-kpi-val { color: #1a237e !important; }
  .dash-kpi-card .dash-kpi-label { color: #555 !important; }

  /* Tabelas */
  .dash-table { width: 100% !important; border-collapse: collapse !important; }
  .dash-table th { background: #e8ecf8 !important; color: #333 !important; }
  .dash-table td { border-bottom: 1px solid #e0e4f0 !important; }
  .dash-row-link:hover td { background: transparent !important; }

  /* Risk badges */
  .risk-high    { background: #ffeaea !important; color: #c0392b !important; }
  .risk-attention { background: #fff8e1 !important; color: #e67e22 !important; }
  .risk-ok      { background: #eafaf1 !important; color: #27ae60 !important; }

  /* Gantt e painéis — em preto-e-branco simplificado */
  .dash-split-panels { flex-direction: column !important; }
  .dash-panel { border: 1px solid #dde2f0 !important; background: #f9fafb !important; break-inside: avoid; }

  /* Barras de progresso */
  .dash-prog-fill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  /* Quebras de página */
  .dash-kpi-grid { page-break-after: avoid; }
  .dash-split-panels { page-break-before: auto; }

  /* Ocultar svg gantt interativo (muito complexo p/ impressão) */
  svg { max-width: 100% !important; }

  /* Força cores a serem impressas */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* Saúde do portfólio — layout de impressão */
  .health-grid { grid-template-columns: 1fr 1fr !important; gap: 16px !important; }
  .health-panel-body { max-height: none !important; overflow: visible !important; }
  .health-resp-tasks { display: block !important; }
  .fab-container, .bulk-bar, .search-overlay { display: none !important; }
}

/* ── Saúde — impressão (botão separado) ──────────────────────────────────────── */
.health-print-area .health-grid { display: grid; }
@media print {
  body.printing-health #sidebar,
  body.printing-health #topbar,
  body.printing-health .topbar-actions,
  body.printing-health #fab-container { display: none !important; }
  body.printing-health #main { margin: 0; }
  body.printing-health #view { padding: 20px; overflow: visible; }
}

/* ── Saúde do Portfólio ─────────────────────────────────────────────────────── */
.health-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .health-grid { grid-template-columns: 1fr; }
}
.health-panel-body {
  max-height: 340px;
  overflow-y: auto;
}
.health-empty {
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.health-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.health-count-badge.danger  { background: rgba(231,76,60,.15); color: var(--danger); }
.health-count-badge.warning { background: rgba(243,156,18,.15); color: var(--warning); }
.health-count-badge.ok      { background: rgba(46,204,113,.15); color: var(--success); }

/* Accordion: tarefas por responsável */
.health-resp-row {
  border-bottom: 1px solid var(--border);
}
.health-resp-row:last-child { border-bottom: none; }
.health-resp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .15s;
  gap: 8px;
}
.health-resp-header:hover { background: var(--surface2); }
.health-chevron { font-size: 11px; color: var(--muted); transition: transform .2s; }
.health-resp-row.open .health-chevron { transform: rotate(180deg); }
.health-resp-tasks { display: none; padding: 0 16px 8px; }
.health-resp-row.open .health-resp-tasks { display: block; }
.health-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.health-task-item:hover { background: var(--surface2); }

/* Rows: projetos e marcos */
.health-crit-row, .health-ms-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.health-crit-row:last-child, .health-ms-row:last-child { border-bottom: none; }
.health-crit-row:hover, .health-ms-row:hover { background: var(--surface2); }

/* Rows: carga */
.health-load-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.health-load-row:last-child { border-bottom: none; }
.health-load-row:hover { background: var(--surface2); }

/* ── Floating Action Button ─────────────────────────────────────────────────── */
#fab-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79,125,240,.5);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fab-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(79,125,240,.7); }
.fab-btn.open  { transform: rotate(45deg); }
.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  animation: fabMenuIn .15s ease;
}
@keyframes fabMenuIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: background .15s, transform .1s;
}
.fab-item:hover { background: var(--surface2); transform: translateX(-3px); }

/* ── Atalhos de teclado ─────────────────────────────────────────────────────── */
.kb-shortcut-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.kb-shortcut-row:last-child { border-bottom: none; }
kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  min-width: 70px;
  justify-content: center;
  box-shadow: 0 1px 0 var(--border);
}

/* ── Nav badge (contador alertas na sidebar) ────────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
}

/* ── Metas (Goals) ──────────────────────────────────────────────────────────── */
.goal-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.goal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}
.goal-table {
  width: 100%;
  border-collapse: collapse;
}
.goal-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.goal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.goal-row:hover td { background: var(--hover); }
.goal-row:last-child td { border-bottom: none; }
.goal-title {
  font-weight: 500;
  color: var(--text);
}
.goal-milestone-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.goal-milestone-item:hover { background: var(--hover); }
.goal-milestone-item input[type=checkbox] { cursor: pointer; flex-shrink: 0; width: auto; }

/* ── Comentários ──────────────────────────────────────────────────── */
.comments-section { display:flex; flex-direction:column; gap:12px; }
.comment-item { padding:10px 0; border-bottom:1px solid var(--border); }
.comment-item:last-child { border-bottom:none; }
.comment-header { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.comment-author { font-weight:600; font-size:13px; }
.comment-time { font-size:11px; color:var(--muted); flex:1; }
.comment-del-btn { background:none; border:none; cursor:pointer; color:var(--muted); font-size:12px; padding:2px 4px; border-radius:4px; }
.comment-del-btn:hover { background:var(--danger); color:#fff; }
.comment-body { font-size:13px; line-height:1.55; color:var(--text); padding-left:32px; }
.comment-input-wrap { display:flex; gap:8px; align-items:flex-end; }
.comment-input { flex:1; resize:vertical; min-height:60px; padding:8px 10px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface2); color:var(--text); font-size:13px; }
.comment-input:focus { outline:none; border-color:var(--primary); }

/* ══════════════════════════════════════════════════════════════════
   v142 — NOVAS FEATURES
   ══════════════════════════════════════════════════════════════════ */

/* ── F1: Meu Dia ──────────────────────────────────────────────────── */
.myday-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 900px) { .myday-grid { grid-template-columns: 1fr; } }
.myday-section { margin-bottom: 0; }
.myday-section-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
  padding: 0 0 10px 0; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.myday-task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-radius: var(--radius);
  cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.myday-task-row:last-child { border-bottom: none; }
.myday-task-row:hover { background: var(--hover); }
.myday-task-info { flex: 1; min-width: 0; }
.myday-task-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.myday-task-proj { font-size: 11px; color: var(--muted); }
.myday-task-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.myday-task-date { font-size: 11px; color: var(--muted); }
.myday-task-date.overdue { color: var(--danger); font-weight: 600; }

/* Ações rápidas de status (Meu Dia / mobile) */
.myday-actions { display: flex; gap: 8px; margin-top: 8px; }
.myday-act {
  font-size: 13px; font-weight: 600; padding: 7px 14px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
  cursor: pointer; transition: background .12s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.myday-act:active { transform: scale(.97); }
.myday-act-start { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.myday-act-start:hover { background: color-mix(in srgb, var(--primary) 12%, var(--surface2)); }
.myday-act-done { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.myday-act-done:hover { background: color-mix(in srgb, var(--success) 12%, var(--surface2)); }

/* No celular: botões maiores e mais fáceis de tocar */
@media (max-width: 700px) {
  .myday-actions { gap: 10px; flex-wrap: wrap; }
  .myday-act { flex: 1; min-height: 42px; font-size: 14px; padding: 10px 12px; }
  /* Evita overflow horizontal: data/status descem para baixo do nome */
  .myday-task-row {
    flex-wrap: wrap; align-items: flex-start;
    max-width: 100%; box-sizing: border-box; overflow-x: hidden;
  }
  .myday-task-info { width: 100%; min-width: 0; }
  .myday-task-name {
    white-space: normal; word-break: break-word; line-height: 1.35;
  }
  .myday-task-meta {
    width: 100%; order: 3; justify-content: flex-start;
    gap: 10px; margin-top: 4px; padding-left: 22px;
    flex-wrap: wrap;
  }
  /* O grid principal não deve ultrapassar a tela */
  .myday-grid, .myday-section, .card { max-width: 100%; box-sizing: border-box; }
}
/* Garantia global contra overflow horizontal no celular (PWA/app instalado) */
@media (max-width: 768px) {
  html, body, #app, #main, #view { overflow-x: hidden; max-width: 100%; }
}

/* ── Chip de status (toca para abrir o seletor) ───────────────────── */
.status-chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background .12s;
}
.status-chip-btn:hover { filter: brightness(1.08); }
/* Cor por status — diferencia "A Fazer", "Em Execução", etc. de relance */
.status-chip-btn.chip-todo        { background: rgba(139,148,158,.12); border-color: rgba(139,148,158,.40); color: var(--muted); }
.status-chip-btn.chip-in_progress { background: rgba(79,125,240,.16);  border-color: rgba(79,125,240,.55);  color: #4f7df0; }
.status-chip-btn.chip-ongoing     { background: rgba(243,156,18,.16);  border-color: rgba(243,156,18,.55);  color: #d98c0a; }
.status-chip-btn.chip-waiting     { background: rgba(249,115,22,.16);  border-color: rgba(249,115,22,.55);  color: #f97316; }
.status-chip-btn.chip-awaiting_approval { background: rgba(139,92,246,.16); border-color: rgba(139,92,246,.55); color: #8b5cf6; }
.status-chip-btn.chip-completed   { background: rgba(46,204,113,.16);  border-color: rgba(46,204,113,.55);  color: #1fa15a; }
.status-chip-btn.chip-blocked     { background: rgba(231,76,60,.16);   border-color: rgba(231,76,60,.55);   color: #e74c3c; }
.status-chip-btn .status-chip-caret { color: inherit; opacity: .65; }
.status-chip-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-chip-caret { font-size: 10px; color: var(--muted); }
@media (max-width: 700px) {
  .status-chip-btn { font-size: 13px; padding: 9px 14px; min-height: 40px; }
}

/* ── Folha de seleção de status (sobe de baixo) ───────────────────── */
.status-sheet-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: statusFade .15s ease;
}
@keyframes statusFade { from { opacity: 0; } to { opacity: 1; } }
.status-sheet {
  width: 100%; max-width: 480px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px 16px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  animation: statusUp .2s ease;
}
@keyframes statusUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.status-sheet-title {
  text-align: center; font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 10px 0 8px; letter-spacing: .3px; text-transform: uppercase;
}
.status-sheet-opt {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: none; background: none; color: var(--text);
  font-size: 15px; cursor: pointer; border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
.status-sheet-opt:hover, .status-sheet-opt.current { background: var(--surface2); }
.status-sheet-opt.current { font-weight: 700; }
.status-sheet-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.status-sheet-lbl { flex: 1; text-align: left; }
.status-sheet-check { color: var(--success); font-weight: 700; }
.status-sheet-cancel {
  width: 100%; margin-top: 6px; padding: 14px; border: none;
  background: var(--surface2); color: var(--text); font-size: 15px; font-weight: 600;
  border-radius: var(--radius); cursor: pointer;
}

/* ── Listas mobile: Tarefas e Projetos ────────────────────────────── */
.mtask-intro { font-size: 13px; color: var(--muted); margin: 0 2px 12px; line-height: 1.5; }
.mtask-list, .mproj-list { display: flex; flex-direction: column; gap: 8px; }
.mtask-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mtask-main { flex: 1; min-width: 0; }
.mtask-name { font-size: 14px; font-weight: 500; line-height: 1.35; }
.mtask-name.mtask-done { text-decoration: line-through; color: var(--muted); }
.mtask-sub { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtask-over { color: var(--danger); font-weight: 600; }
.mtask-action { flex-shrink: 0; }
.mtask-empty { text-align: center; padding: 32px 16px; }
.mtask-group-hdr {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); margin: 16px 2px 8px;
}
.mtask-group-hdr.danger  { color: var(--danger); }
.mtask-group-hdr.warning { color: var(--warning); }
.mtask-group-count {
  background: var(--surface2); color: var(--muted);
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px;
}

.mproj-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mproj-bar { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.mproj-main { flex: 1; min-width: 0; }
.mproj-name { font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mproj-sub { font-size: 12px; color: var(--muted); margin: 3px 0 7px; }
.mproj-track { height: 5px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.mproj-fill { height: 100%; border-radius: 99px; }
.mproj-arrow { color: var(--muted); font-size: 22px; flex-shrink: 0; }
.mback-btn {
  background: none; border: none; color: var(--primary); font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 4px 0; margin-bottom: 12px;
}

/* Toggle "Minhas / Todos" no app (Projetos e Tarefas) */
.mscope-toggle {
  display: inline-flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; margin: 0 0 12px;
  -webkit-tap-highlight-color: transparent;
}
.mscope-btn {
  background: transparent; border: none; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 7px 16px;
  border-radius: 999px; cursor: pointer; transition: background .12s, color .12s;
}
.mscope-btn.active { background: var(--primary); color: #fff; }
@media (max-width: 768px) {
  /* No celular a navegação é o menu (☰) + botões próprios; esconde os "voltar" do topo */
  #back-btn, #proj-back-btn, #section-back-btn { display: none !important; }
}

/* ── Barra de progresso no topo (transição fluida entre telas) ─────── */
#view-loading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 5000; pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity .15s ease;
}
#view-loading-bar.active { opacity: 1; }
#view-loading-bar.active::before {
  content: ''; position: absolute; top: 0; height: 100%; width: 35%;
  background: var(--primary); border-radius: 0 3px 3px 0;
  animation: viewBarSlide 1.05s ease-in-out infinite;
}
@keyframes viewBarSlide {
  0%   { left: -35%; }
  100% { left: 100%; }
}

/* ── F2: Banner de notificação (myday-banner) ─────────────────────── */
.myday-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.5);
  border-radius: var(--radius);
  padding: 10px 16px; margin: 0 0 12px 0;
  font-size: 13px; color: #92680a;
  position: sticky; top: 0; z-index: 10;
}
.myday-banner-link {
  background: none; border: none; cursor: pointer;
  color: var(--primary); text-decoration: underline;
  font-size: 13px; padding: 0;
}
.myday-banner-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 0 4px; line-height: 1;
}
.myday-banner-close:hover { color: var(--text); }

/* ── F6: Feed de Atividade ────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }
.activity-entry {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.activity-entry:last-child { border-bottom: none; }
.activity-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
  background: #8d95a0;
}
.activity-body { flex: 1; font-size: 13px; line-height: 1.6; }
.activity-user { font-weight: 600; margin-right: 4px; }
.activity-action { color: var(--muted); margin-right: 4px; }
.activity-entity { color: var(--primary); font-weight: 500; margin-right: 4px; }
.activity-detail { font-size: 12px; color: var(--muted); }
.activity-time { font-size: 11px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.activity-empty { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }

/* ── Painel "Em execução agora" (por funcionário) ─────────────────── */
.tep-wrap { padding: 14px 16px; }
.tep-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tep-toggle:hover { opacity: .85; }
.tep-toggle-arrow {
  display: inline-block; color: var(--muted); font-size: 12px;
  transition: transform .15s ease;
}
.tep-wrap:not(.tep-collapsed) .tep-toggle-arrow { transform: rotate(90deg); }
.tep-wrap.tep-collapsed .tep-body { display: none; }
.tep-grid {
  display: flex; gap: 10px; align-items: stretch;
}
.tep-card {
  flex: 1 1 0; min-width: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 13px;
}
.tep-card-idle { opacity: .65; }
.tep-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tep-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.tep-head-text { min-width: 0; }
.tep-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tep-sub { font-size: 11px; color: var(--muted); }
.tep-task {
  padding: 8px 6px; border-top: 1px solid var(--border);
  cursor: pointer; border-radius: 6px; transition: background .12s;
}
.tep-task:first-of-type { border-top: none; }
.tep-task:hover { background: var(--hover); }
.tep-task-name { font-size: 13px; font-weight: 500; line-height: 1.4; margin-bottom: 5px; }
.tep-task-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tep-proj {
  font-size: 11px; color: var(--muted); line-height: 1.35; word-break: break-word;
}
.tep-dates { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tep-arrow { color: var(--muted); font-size: 11px; }
.tep-chip {
  font-size: 11px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; white-space: nowrap;
}
.tep-chip-late { color: var(--danger); border-color: var(--danger); font-weight: 600; }
.tep-empty { font-size: 12px; color: var(--muted); font-style: italic; padding: 6px 0; }

/* ── F7: Responsividade mobile ────────────────────────────────────── */
#hamburger-btn, .hamburger-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 22px; padding: 4px 8px; color: var(--text);
  margin-right: 8px;
}
#mobile-sb-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.45);
}
@media (max-width: 768px) {
  #hamburger-btn, .hamburger-btn { display: block; }
  #sidebar {
    display: none !important;
    position: fixed !important; z-index: 1000 !important;
    height: 100% !important; top: 0; left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  #sidebar.mobile-open { display: flex !important; }
  #mobile-sb-overlay.active { display: block; }
  #main { margin-left: 0 !important; }
  .tl-quickadd { flex-wrap: wrap; }
  .gantt-wrap, .sim-main, #pg-right { display: none !important; }
  .dash-kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .pvt-btn { font-size: 11px; padding: 4px 7px; }
  .pvt-drop-toggle { font-size: 11px; padding: 4px 7px; }
  .pvt-groups { gap: 3px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn { font-size: 11px; padding: 4px 8px; }

  /* ── Detalhe do projeto no app (visão Geral) — adequado ao smartphone ── */
  /* Toolbar quebra em linhas em vez de espremer/estourar a tela */
  .proj-toolbar { flex-wrap: wrap; row-gap: 8px; align-items: flex-start; }
  .pvt-groups { flex-wrap: wrap; row-gap: 8px; }
  .pvt-actions { flex-wrap: wrap; }
  .proj-toolbar .pvt-actions { margin-left: 0; }

  /* Cabeçalho: título em cima, contadores embaixo (não lado a lado) */
  .vg-ph-row { flex-wrap: wrap; }
  .vg-proj-header h2 { font-size: 18px; }
  .vg-ph-stats { width: 100%; gap: 8px 14px; padding-left: 22px; }

  /* Lista de marcos: nome em uma linha; data + status quebram embaixo */
  .vg-ms-row { flex-wrap: wrap; gap: 4px 10px; padding: 12px 0; }
  .vg-ms-name { flex: 1 0 60%; white-space: normal; }
  .vg-ms-date { margin-left: 32px; min-width: 0; text-align: left; order: 3; }
  .vg-ms-badge { order: 2; }

  /* Cards um pouco mais compactos no celular */
  .vg-ms-bar-card, .vg-kpi-card { padding: 14px 16px; }
}

/* ── F11: Modo Apresentação ───────────────────────────────────────── */
.exit-presentation-btn {
  display: none; position: fixed; top: 16px; right: 16px; z-index: 9999;
  align-items: center; gap: 8px;
  background: var(--danger, #ef4444); color: #fff;
  border: none; border-radius: 8px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
body.presentation-mode #sidebar { display: none !important; }
body.presentation-mode #main { margin-left: 0 !important; }
body.presentation-mode .dash-kpi-value { font-size: 36px !important; }
body.presentation-mode .card-actions,
body.presentation-mode .tl-quickadd { display: none !important; }
body.presentation-mode #topbar-actions .btn:not(#btn-present) { opacity: 0.4; }
body.presentation-mode .exit-presentation-btn { display: flex; }
body.presentation-mode #fab-container { display: none !important; }
body.presentation-mode .bulk-bar { display: none !important; }

/* ── F4: Excel export button ──────────────────────────────────────── */
/* no extra CSS needed — uses existing btn classes */

/* ── F8: Bulk date change ─────────────────────────────────────────── */
/* uses existing modal + form CSS */

/* ── F9: Phase template button ────────────────────────────────────── */
/* uses existing btn + modal CSS */

/* ── F10: Baseline legend ─────────────────────────────────────────── */
.gantt-baseline-legend {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--muted); padding: 4px 8px;
}
.gantt-baseline-legend span { display: flex; align-items: center; gap: 4px; }
.gantt-baseline-swatch {
  display: inline-block; width: 14px; height: 6px; border-radius: 2px;
}
.baseline-planned { background: rgba(120,120,120,0.55); }
.baseline-current { background: var(--primary, #4f7df0); }
.gantt-baseline-bar { fill: rgba(120,120,120,0.45); }

/* ── On-Time Variance Chart (Donut + desvio por mês) ─────────────────── */
.otc-combo { display: flex; gap: 24px; align-items: flex-start; }
.otc-left {
  width: 230px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 6px; text-align: center;
}
.otc-left-total { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 8px; }
.otc-left-period { font-size: 13px; color: var(--muted); margin-top: 2px; }
.otc-left-legend { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.otc-left-legend > div { font-size: 13px; color: var(--text); display: flex; align-items: center; }
.otc-lg-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 8px; }

.otc-right { flex: 1; min-width: 0; border-left: 1px solid var(--border); padding-left: 22px; }
.otc-right-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

.otc-mes {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface2); border-radius: 8px;
  border-left: 4px solid var(--primary);
  padding: 9px 14px; margin: 26px 0 10px;
}
.otc-right-title + .otc-mes { margin-top: 10px; }   /* primeiro mês cola no título */
.otc-mes-lbl { font-size: 13.5px; font-weight: 800; letter-spacing: .6px; color: var(--text); text-transform: uppercase; }
.otc-mes-cnt {
  font-size: 11.5px; font-weight: 700; color: var(--primary);
  background: rgba(79,125,240,.12); padding: 2px 11px; border-radius: 99px;
}

/* projetos do mês em 2 colunas — cada projeto é um cartão delimitado */
.otc-rows-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 6px 0 4px; }
@media (max-width: 1100px) { .otc-rows-grid { grid-template-columns: 1fr; } }
.otc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border);
  transition: border-color .12s, background .12s;
}
.otc-row:hover { border-color: var(--primary); background: var(--bg); }
.otc-row-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.otc-row-name { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otc-row-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.otc-dev { display: flex; align-items: center; width: 132px; flex-shrink: 0; border-left: 1px solid var(--border); padding-left: 10px; }
.otc-dev-half { flex: 1; display: flex; align-items: center; gap: 6px; }
.otc-dev-half.left { justify-content: flex-end; }
.otc-dev-half.right { justify-content: flex-start; }
.otc-dev-axis { width: 2px; align-self: stretch; min-height: 22px; background: var(--border); }
.otc-dev-bar { height: 18px; border-radius: 5px; display: inline-block; }
.otc-dev-bar.early { background: #3b82f6; }
.otc-dev-bar.late  { background: #ef4444; }
.otc-dev-lbl { font-size: 11px; font-weight: 700; white-space: nowrap; }
.otc-dev-dot { width: 11px; height: 11px; border-radius: 50%; background: #22c55e; display: inline-block; }

.otc-axis-legend { display: flex; gap: 22px; justify-content: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.otc-axis-legend span { font-size: 12px; color: var(--text); display: flex; align-items: center; }
.otc-lg-sq { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.otc-lg-dot2 { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ── Especificação de Projeto (FQ 904) ─── */
.spec-full { grid-column: 1 / -1; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }

/* ── Modo "Diretor" (somente leitura) ───────────────────────────────────
   A API já bloqueia qualquer escrita para role=viewer (ver app/main.py).
   As regras abaixo apenas escondem, na interface, os controles de
   criar/editar/excluir/reordenar para deixar a experiência consistente
   com o acesso somente leitura. */
body.viewer-mode [onclick^="openTaskModal"],
body.viewer-mode [onclick^="openMemberModal"],
body.viewer-mode [onclick^="openGoalModal"],
body.viewer-mode [onclick^="openChangeCreateModal"],
body.viewer-mode [onclick^="openChangeEditModal"],
body.viewer-mode [onclick^="openChangeTransitionModal"],
body.viewer-mode [onclick^="openChangeImportModal"],
body.viewer-mode [onclick^="openChangeAttachModal"],
body.viewer-mode [onclick^="openIsoCreateModal"],
body.viewer-mode [onclick^="openIsoEditModal"],
body.viewer-mode [onclick^="openIsoTransitionModal"],
body.viewer-mode [onclick^="openIsoVersionModal"],
body.viewer-mode [onclick^="openHomModal"],
body.viewer-mode [onclick^="openAttUploadModal"],
body.viewer-mode [onclick^="openAttEditModal"],
body.viewer-mode [onclick^="openInlineDateEdit"],
body.viewer-mode [onclick^="openInlineDateRangeEdit"],
body.viewer-mode [onclick^="pgEditTask"],
body.viewer-mode [onclick^="duplicateProject"],
body.viewer-mode [onclick^="delTask"],
body.viewer-mode [onclick^="deleteChange"],
body.viewer-mode [onclick^="deleteComment"],
body.viewer-mode [onclick^="deleteGoal"],
body.viewer-mode [onclick^="deleteHom"],
body.viewer-mode [onclick^="isoDelete"],
body.viewer-mode [onclick^="attDelete"],
body.viewer-mode [onclick^="bulkDelete"],
body.viewer-mode [onclick^="deactivateMember"],
body.viewer-mode [onclick^="tmplAddTask"],
body.viewer-mode [onclick^="tmplDelTask"],
body.viewer-mode [onclick^="tmplAddPhase"],
body.viewer-mode [onclick^="pdTaskTogglePlan"],
body.viewer-mode [onclick^="saveProjectSpec"],
body.viewer-mode [onclick^="saveInlineDateRange"],
body.viewer-mode .btn-danger {
  display: none !important;
}

/* Drag handles de reordenação (projetos, fases, tarefas, kanban, templates).
   Importante: NÃO ocultar .pg-row-drag — é a linha inteira do nome do projeto
   no Gantt do portfólio, não apenas a alça de arraste. */
body.viewer-mode .drag-handle,
body.viewer-mode .kb-drag-handle,
body.viewer-mode .pg-row-handle,
body.viewer-mode .phase-drag-handle,
body.viewer-mode .tmpl-drag {
  display: none !important;
}

/* Itens arrastáveis: reduz a sugestão visual de que podem ser movidos */
body.viewer-mode [draggable="true"] {
  cursor: default !important;
}

