/* GE3 — o mesmo design da RD (apps/BT/public/styles/theme.css + projeto.css +
   processos.css): página preta com pontos, barra lateral escura de ícones,
   blocos pastel (amarelo) e cartões de vidro escuro, Inter. Pedido da Hélia,
   14/11/2026. */
:root {
  --bg-page: #121210;
  --true-black: #121210;
  --bg-card-elevated: #1E1D19;
  --bg-card: rgba(255, 255, 255, 0.05);
  --pastel-yellow: #F1E7C6;
  --accent-hover: #E8DBAE;
  --accent-soft: rgba(241, 231, 198, .5);
  --text-on-pastel: #171712;
  --text-on-pastel-muted: rgba(23, 23, 18, 0.55);
  --text-on-black: #F6F3EA;
  --text-primary: #F3F1E9;
  --text-secondary: rgba(243, 241, 233, 0.68);
  --text-muted: rgba(243, 241, 233, 0.44);
  --border-dark: rgba(255, 255, 255, 0.1);
  --success: #22c55e; --warning: #eab308; --danger: #ef4444;
  --sidebar-width: 72px;
  --radius-sm: 14px; --radius-md: 20px; --radius-lg: 28px; --radius-xl: 36px; --radius-full: 999px;
  --shadow-sm: 0 2px 8px rgba(30, 26, 15, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 26, 15, 0.09);
  --shadow-lg: 0 20px 48px rgba(30, 26, 15, 0.14);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-entry: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.25s var(--ease);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--pastel-yellow); color: var(--text-on-pastel); }
:focus-visible { outline: 2px solid var(--pastel-yellow); outline-offset: 2px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

/* Pontos de fundo (o "DotPattern" da RD) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.16) 1px, transparent 0);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, black 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, black 30%, transparent 100%);
}
#app, .entrar { position: relative; z-index: 1; }
#app { display: flex; width: 100%; }

kbd {
  font: 600 11px var(--mono); padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--border-dark); color: var(--text-muted); background: rgba(255, 255, 255, .04);
}

/* ── Barra lateral ─────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; left: 12px; top: 12px; bottom: 12px; width: var(--sidebar-width);
  background: var(--true-black); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .04);
  display: flex; flex-direction: column; align-items: center; padding: 20px 0; z-index: 100;
}
.sidebar-logo {
  width: 44px; height: 44px; border-radius: 50%; background: var(--pastel-yellow); color: var(--text-on-pastel);
  display: grid; place-items: center; margin-bottom: 32px; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); flex-shrink: 0;
}
.sidebar-nav { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sidebar-icon {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  color: #666; border-radius: var(--radius-md); margin-bottom: 4px; transition: var(--transition);
  position: relative; text-decoration: none; background: none; border: 0; cursor: pointer;
}
.sidebar-icon svg { width: 22px; height: 22px; flex-shrink: 0; }
.sidebar-icon:hover { color: var(--text-on-black); background: rgba(255, 255, 255, .14); transform: scale(1.08); }
.sidebar-icon:active { transform: scale(.96); }
.sidebar-icon.active { color: var(--pastel-yellow); background: rgba(241, 231, 198, .14); }
.sidebar-logout:hover { color: var(--danger); background: rgba(239, 68, 68, .12); }
.sidebar-icon[data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; left: 58px; white-space: nowrap; z-index: 200;
  background: var(--bg-card-elevated); color: var(--text-primary); padding: 8px 14px;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; box-shadow: var(--shadow-md);
  animation: tooltipIn .2s ease;
}
@keyframes tooltipIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.sidebar-avatar {
  width: 40px; height: 40px; border-radius: 50%; margin-top: 16px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--bg-card-elevated); border: 2px solid rgba(255, 255, 255, .1);
  font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--text-on-black);
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 450;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }
.hamburger-btn {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 400; width: 44px; height: 44px;
  background: var(--bg-card-elevated); border: 1px solid var(--border-dark); border-radius: var(--radius-md);
  align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-md);
}

/* ── Conteúdo ──────────────────────────────────────────────────────────── */
.main {
  flex: 1; min-width: 0; min-height: 100vh; display: flex; flex-direction: column;
  margin-left: calc(var(--sidebar-width) + 24px); padding: 16px 20px 24px 8px;
}
.header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding: 8px 0; }
.header-left { flex: 1; min-width: 0; }
.page-title { font-size: 32px; font-weight: 300; line-height: 1.3; letter-spacing: -.5px; }
.title-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  background: var(--pastel-yellow); color: var(--text-on-pastel); border-radius: 8px; vertical-align: middle; margin: 0 4px;
}
.page-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.quem-papel { color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 10px; background: var(--bg-card); padding: 10px 16px;
  border-radius: var(--radius-lg); border: 1px solid var(--border-dark); min-width: 300px; cursor: text;
}
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input { border: 0; background: transparent; font-size: 13px; width: 100%; outline: none; }
.search-box input::placeholder { color: var(--text-muted); }
.search-box:focus-within { border-color: rgba(241, 231, 198, .5); }
.icon-btn-header {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-dark); background: var(--bg-card);
  display: grid; place-items: center; cursor: pointer; color: var(--text-secondary); transition: var(--transition); flex-shrink: 0;
}
.icon-btn-header:hover { background: var(--pastel-yellow); color: var(--text-on-pastel); transform: translateY(-1px); }
.icon-btn-header.a-rodar svg { animation: rodar .8s linear infinite; }
@keyframes rodar { to { transform: rotate(360deg); } }

.sync { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-full); background: rgba(34, 197, 94, .1); color: #86efac; font-size: 11.5px; font-weight: 500; }
.sync-ponto { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sync.erro { background: rgba(239, 68, 68, .12); color: #fca5a5; }
.sync.parado { background: rgba(255, 255, 255, .06); color: var(--text-muted); }

.ecra { animation: aparecer .35s var(--ease-entry) both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Dashboard ─────────────────────────────────────────────────────────── */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; min-width: 0; }
.content-left { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stat-cards-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; min-width: 0; }

.stat-card { border-radius: var(--radius-lg); padding: 20px; transition: var(--transition); min-width: 0; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0, 0, 0, .1); }
.stat-card-light {
  background: var(--pastel-yellow); color: var(--text-on-pastel);
  --text-primary: var(--text-on-pastel); --text-secondary: var(--text-on-pastel-muted); --text-muted: var(--text-on-pastel-muted);
}
.stat-card-dark { background: var(--bg-card-elevated); border: 1px solid rgba(255, 255, 255, .06); }
.stat-card-dark:hover { background: #28271F; }
.stat-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.stat-card-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .1); display: grid; place-items: center; }
.stat-card-icon svg { width: 16px; height: 16px; }
.stat-card-icon-dark { background: rgba(0, 0, 0, .1); }
.stat-card-title { flex: 1; font-size: 13px; font-weight: 500; opacity: .9; }

.fluxo-total { display: flex; align-items: baseline; gap: 10px; padding: 4px 0 12px; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.fluxo-total-num { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.fluxo-total-txt { font-size: 13px; color: var(--text-secondary); }
.fluxo-linha {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 11px 0; border: 0; border-top: 1px solid rgba(0, 0, 0, .08); background: none; cursor: pointer; text-align: left;
}
.fluxo-linha:first-child { border-top: 0; }
.fluxo-linha:hover .fluxo-num { transform: translateX(-3px); }
.fluxo-linha .chip { font-size: 12px; padding: 5px 12px; }
.fluxo-num { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.5px; font-variant-numeric: tabular-nums; transition: transform .2s var(--ease); }
.fluxo-paralelo { font-size: 11px; color: var(--text-muted); margin-left: 6px; }

.rever-linha {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 12px 0; border: 0; border-top: 1px solid rgba(255, 255, 255, .06); background: none; cursor: pointer; text-align: left;
}
.rever-linha:first-child { border-top: 0; padding-top: 2px; }
.rever-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rever-rotulo { font-size: 13px; font-weight: 500; }
.rever-sub { font-size: 11.5px; color: var(--text-muted); }
.rever-num { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.rever-num.quente { color: var(--pastel-yellow); }
.rever-linha:hover .rever-rotulo { color: var(--pastel-yellow); }

/* Chips (as cores do "Fluxo" da RD) */
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip-ge   { background: rgba(23, 23, 18, .08); color: #3f3f37; }
.chip-orc  { background: rgba(59, 130, 246, .12); color: #1d4ed8; }
.chip-proj { background: rgba(34, 197, 94, .14); color: #166534; }
.chip-lic  { background: rgba(147, 51, 234, .12); color: #6b21a8; }
.chip-val  { background: rgba(234, 179, 8, .2); color: #854d0e; }

.chart-card {
  background: var(--bg-card); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--border-dark); border-radius: var(--radius-lg); padding: 24px; min-width: 0;
}
.chart-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.chart-title-row { display: flex; align-items: center; gap: 12px; }
.chart-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .06); display: grid; place-items: center; color: var(--text-secondary); }
.chart-icon svg { width: 16px; height: 16px; }
.chart-title { font-size: 16px; font-weight: 600; }
.chart-nota { font-size: 12px; color: var(--text-muted); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Por concelho: uma barra empilhada por fase */
.conc-linha {
  display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 34px; align-items: center; gap: 12px;
  width: 100%; padding: 7px 0; border: 0; background: none; cursor: pointer; text-align: left;
}
.conc-linha:hover .conc-nome { color: var(--pastel-yellow); }
.conc-nome { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conc-pista { height: 8px; border-radius: 100px; background: rgba(255, 255, 255, .06); overflow: hidden; display: flex; }
.conc-pista i { display: block; height: 100%; transition: width .5s var(--ease); }
.conc-total { font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.conc-mais { font-size: 12px; color: var(--text-muted); padding-top: 8px; }
.cor-GE { background: #8a877a; }
.cor-Orcamentacao { background: #3b82f6; }
.cor-Projeto { background: #22c55e; }
.cor-Validacao { background: var(--pastel-yellow); }
.cor-Licenciamento { background: #a855f7; }

/* Dias úteis: colunas (como o "Processos por Mês" da RD) */
.colunas { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 24px; }
.coluna { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.coluna-pista { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.coluna-barra {
  width: 100%; max-width: 56px; border-radius: 12px 12px 4px 4px; background: var(--pastel-yellow);
  min-height: 4px; position: relative; transform-origin: bottom; animation: crescer .6s var(--ease-entry) both;
}
.coluna-barra.quente { background: #f2a49c; }
.coluna-barra.vazia { background: rgba(255, 255, 255, .08); }
.coluna-valor { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.coluna-rotulo { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
@keyframes crescer { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Coluna da direita */
.sidebar-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-link {
  background: var(--pastel-yellow); color: var(--text-on-pastel); border-radius: var(--radius-lg); padding: 16px;
  text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: var(--transition);
}
.quick-link:hover { background: var(--accent-hover); transform: translateY(-2px); }
.quick-link-icon svg { width: 22px; height: 22px; display: block; }
.quick-link-text { font-size: 13px; font-weight: 600; }
.risk-section {
  background: var(--pastel-yellow); border-radius: var(--radius-lg); padding: 16px; color: var(--text-on-pastel);
  --text-primary: var(--text-on-pastel); --text-secondary: var(--text-on-pastel-muted); --text-muted: var(--text-on-pastel-muted);
}
.risk-section-header {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px;
}
.carga-legenda { margin-left: auto; font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.risk-loading, .risk-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 12px 0; }
.risk-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 5px; background: rgba(0, 0, 0, .03);
  border: 0; border-left: 3px solid rgba(0, 0, 0, .12); cursor: pointer; transition: background .15s;
}
.risk-item:last-child { margin-bottom: 0; }
.risk-item:hover { background: rgba(0, 0, 0, .06); }
.risk-item-late { border-left-color: var(--danger); }
.risk-item-warn { border-left-color: var(--warning); }
.risk-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.risk-item-num { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.risk-item-name { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.risk-item-prazo { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 100px; flex-shrink: 0; white-space: nowrap; }
.badge-red { background: rgba(239, 68, 68, .12); color: #dc2626; }
.badge-orange { background: rgba(234, 179, 8, .16); color: #b45309; }
.badge-gray { background: rgba(0, 0, 0, .06); color: var(--text-muted); }

.carga-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, .05); }
.carga-item:last-child { border-bottom: 0; padding-bottom: 0; }
.carga-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--true-black); color: var(--text-on-black);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .5px;
}
.carga-avatar.sem { background: rgba(0, 0, 0, .1); color: var(--text-on-pastel); }
.carga-info { flex: 1; min-width: 0; }
.carga-nome-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.carga-nome { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carga-num { font-size: 12px; font-weight: 700; }
.carga-bar-wrap { height: 4px; background: rgba(0, 0, 0, .07); border-radius: 100px; overflow: hidden; margin-bottom: 6px; }
.carga-bar { height: 100%; border-radius: 100px; background: var(--warning); transition: width .5s var(--ease); }
.carga-bar.alta { background: var(--danger); }
.carga-chips { display: flex; gap: 4px; flex-wrap: wrap; }

.bot-estado { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.bot-ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.bot-ponto.erro { background: var(--danger); }
.bot-ponto.parado { background: rgba(0, 0, 0, .25); }
.bot-txt { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.bot-lista { margin-top: 10px; list-style: none; }
.bot-lista li { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; padding: 6px 0; border-top: 1px solid rgba(0, 0, 0, .06); color: var(--text-secondary); }
.bot-lista b { color: var(--text-primary); font-weight: 600; }

/* ── Processos (tabela como a da RD) ───────────────────────────────────── */
.card {
  background: var(--bg-card); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--border-dark); border-radius: var(--radius-xl); overflow: hidden;
}
.table-card { display: flex; flex-direction: column; min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.card-title { font-size: 16px; font-weight: 600; }
.card-conta { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
/* Separadores + pesquisa à esquerda, por cima da tabela (como a RD; Hélia, 26/11/2026) */
.card-header-filtros { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 14px; }
.card-actions { display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; width: 100%; min-width: 0; }
.search-box-tabela { min-width: 260px; flex: 0 1 320px; padding: 9px 14px; border-radius: var(--radius-md); }
.filter-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: rgba(255, 255, 255, .04); padding: 4px; border-radius: var(--radius-lg); }
.filter-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid transparent; background: transparent;
  border-radius: var(--radius-md); font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: .15s var(--ease);
}
.filter-tab:hover { color: var(--text-primary); }
.filter-tab .n { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 100px; background: rgba(255, 255, 255, .07); font-variant-numeric: tabular-nums; }
.filter-tab.ativo { background: var(--pastel-yellow); color: var(--text-on-pastel); box-shadow: var(--shadow-sm); }
.filter-tab.ativo .n { background: rgba(0, 0, 0, .1); }

.table-wrapper { overflow: auto; padding: 0 8px 8px; max-height: calc(100vh - 230px); }
.tabela { width: 100%; border-collapse: collapse; }
.tabela thead { position: sticky; top: 0; z-index: 2; background: #1a1916; }
.tabela th { text-align: left; padding: 0; border-bottom: 1px solid rgba(255, 255, 255, .07); white-space: nowrap; }
.tabela th button {
  display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 14px 16px; border: 0; background: none; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px;
}
.tabela th.dir button { justify-content: flex-end; }
.tabela th button svg { opacity: .35; transition: opacity .15s; }
.tabela th button:hover { color: var(--text-primary); }
.tabela th button:hover svg, .tabela th.ordenado button svg { opacity: 1; }
.tabela th.ordenado button { color: var(--pastel-yellow); }
.tabela td { padding: 14px 16px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid rgba(255, 255, 255, .04); vertical-align: middle; white-space: nowrap; }
.tabela td.num { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.tabela td.mono { font-variant-numeric: tabular-nums; }
.tabela td.dir { text-align: right; }
.tabela td.fraco { color: var(--text-muted); }
.tabela tbody tr { cursor: pointer; transition: background .15s; }
.tabela tbody tr:hover { background: rgba(255, 255, 255, .03); }
.tabela tbody tr.sel { background: rgba(241, 231, 198, .08); box-shadow: inset 3px 0 0 var(--pastel-yellow); }
.tabela tbody tr.anulado td { opacity: .55; }
.tabela tbody tr.anulado td.num { text-decoration: line-through; }
.tabela tr.carregar td { text-align: center; color: var(--text-muted); padding: 40px; cursor: default; }
.suave { color: var(--text-muted); }

.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; white-space: nowrap; background: rgba(255, 255, 255, .07); color: var(--text-primary); }
.tag.tarefa { background: rgba(241, 231, 198, .14); color: var(--pastel-yellow); }
.tag.ambar { background: rgba(234, 179, 8, .14); color: #facc15; }
.tag.vermelho { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.tag.verde { background: rgba(34, 197, 94, .14); color: #86efac; }

.dias { display: inline-flex; align-items: center; gap: 8px; }
.dias-barra { width: 54px; height: 4px; border-radius: 100px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.dias-barra i { display: block; height: 100%; background: var(--pastel-yellow); border-radius: 100px; }
.dias.quente .dias-barra i { background: var(--danger); }
.dias b { color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }

.vazio { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 16px; color: var(--text-muted); font-size: 13px; text-align: center; }
.atalhos { margin-top: 12px; font-size: 11.5px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Relatórios (Hélia, 26/11/2026): tabelas limpas, como os quadros
   «Fichas por prazo» da RD; só as duas últimas faixas a vermelho. ───── */
.rel-nota { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.rel-grelha { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 20px; margin-bottom: 20px; }
.rel-card { padding: 20px 20px 12px; border-radius: var(--radius-lg); min-width: 0; }
.rel-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rel-titulo { font-size: 15px; font-weight: 600; }
.rel-scroll { overflow-x: auto; }
.rel-tabela { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rel-tabela th {
  padding: 8px 10px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px;
  text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.rel-tabela th:first-child, .rel-tabela td:first-child { text-align: left; }
.rel-tabela td { padding: 9px 10px; font-size: 13px; color: var(--text-secondary); text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.rel-tabela td:first-child { color: var(--text-primary); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.rel-tabela td.zero { color: var(--text-muted); opacity: .6; }
.rel-tabela td.alerta { color: #ff4d4d; font-weight: 700; }
.rel-tabela td.total, .rel-tabela th.total { color: var(--text-primary); font-weight: 700; }
.rel-tabela tr.totais td { color: var(--text-primary); font-weight: 700; background: rgba(255, 255, 255, .04); border-bottom-color: rgba(255, 255, 255, .1); }
.rel-tabela tr.totais td.zero { color: var(--text-muted); font-weight: 500; }
.rel-tabela tr.totais td.alerta { color: #ff4d4d; }
.rel-tabela tr.sem-pessoa td:first-child { color: var(--text-muted); font-style: italic; }
.rel-tabela .rel-vazio { text-align: center; color: var(--text-muted); padding: 24px; }
.rel-sem-dias { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }

/* ── Painel de detalhe (o side-panel da RD) ────────────────────────────
   Fechado = fora do ecrã E invisível (visibility), por isso nunca aparece
   aberto nem apanha o foco; abre com a classe .aberto. */
.painel-fundo {
  position: fixed; inset: 0; z-index: 290; background: rgba(0, 0, 0, .45);
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
}
.painel-fundo.aberto { opacity: 1; visibility: visible; }
.side-panel {
  position: fixed; top: 16px; right: 16px; bottom: 16px; width: 480px; max-width: calc(100vw - 32px); z-index: 300;
  background: rgba(20, 19, 16, .94); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  border: 1px solid var(--border-dark); border-radius: var(--radius-xl); box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(100% + 32px)); visibility: hidden;
  transition: transform .4s var(--ease-entry), visibility .4s;
}
.side-panel.aberto { transform: none; visibility: visible; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 24px; border-bottom: 1px solid var(--border-dark); }
.panel-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.panel-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.panel-sub strong { color: var(--text-primary); }
.panel-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 14px; border-radius: var(--radius-full);
  background: var(--pastel-yellow); color: var(--text-on-pastel); font-size: 12.5px; font-weight: 600; text-decoration: none; transition: var(--transition);
}
.panel-link:hover { background: var(--accent-hover); transform: translateY(-1px); }
.panel-close { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .06); color: var(--text-secondary); cursor: pointer; }
.panel-close:hover { background: rgba(255, 255, 255, .12); color: var(--text-primary); }
.panel-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }

.p-acoes {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 16px; margin-bottom: 20px;
  background: var(--pastel-yellow); color: var(--text-on-pastel); border-radius: var(--radius-md);
}
.p-acoes:empty { display: none; }
.p-acoes label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-on-pastel-muted); flex: 1 1 140px; }
.p-acoes select {
  height: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid rgba(0, 0, 0, .15); background: #fffdf5;
  color: var(--text-on-pastel); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; color-scheme: light;
}
.p-acoes .nota { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; }
.p-acoes .nota svg { flex-shrink: 0; margin-top: 1px; }

.btn-primary, .btn, .btn-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px;
  border-radius: var(--radius-full); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: var(--transition); border: 0;
}
.btn-primary, .btn { background: var(--true-black); color: var(--text-on-black); box-shadow: var(--shadow-md); }
.btn-primary:hover, .btn:hover { background: #2a2a2a; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sec { background: transparent; color: var(--text-on-pastel); border: 1.5px solid rgba(0, 0, 0, .2); }
.btn-sec:hover { border-color: var(--text-on-pastel); }

.erro { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, .12); color: #fca5a5; font-size: 13px; }
.erro svg { flex-shrink: 0; margin-top: 1px; }

.p-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin: 22px 0 10px; }
.p-sec:first-child { margin-top: 0; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.campo { padding: 12px 14px; background: rgba(255, 255, 255, .03); border-radius: var(--radius-sm); min-width: 0; }
.campo.largo { grid-column: 1 / -1; }
.lic-conc-vazio { font-size: 13px; margin: 0; }
.campo dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); margin-bottom: 4px; }
.campo dd { font-size: 13.5px; font-weight: 500; color: var(--text-primary); overflow-wrap: anywhere; }
.campo dd.mono { font-variant-numeric: tabular-nums; }
.campo a { color: var(--pastel-yellow); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.campo a:hover { text-decoration: underline; }

.hist { list-style: none; position: relative; padding-left: 18px; }
.hist::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border-dark); }
.hist li { position: relative; padding: 0 0 14px; font-size: 13px; }
.hist li::before { content: ''; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--pastel-yellow); box-shadow: 0 0 0 3px #141310; }
.hist li.suave::before { background: var(--border-dark); }
.hist .det { color: var(--text-secondary); }
.hist .q { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Entrar (o login da RD: cartão em dois painéis) ───────────────────── */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.entrar-cartao {
  width: min(1000px, 100%); min-height: 580px; display: flex; border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  animation: revelar 1s var(--ease-entry) both;
}
@keyframes revelar { from { opacity: 0; transform: translateY(32px) scale(.97); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.entrar-esq { flex: 1.15; position: relative; background: #0c0c0b; padding: 36px; display: flex; flex-direction: column; overflow: hidden; }
.entrar-grelha {
  position: absolute; inset: 14px; border-radius: 22px; border: 1px solid rgba(241, 231, 198, .14);
  background-image: linear-gradient(rgba(241, 231, 198, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(241, 231, 198, .035) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 40% 45%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 80% at 40% 45%, #000 40%, transparent 100%);
}
.entrar-marca { position: relative; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: var(--text-on-black); }
.entrar-marca-sinal { width: 36px; height: 36px; border-radius: 10px; background: var(--pastel-yellow); color: var(--text-on-pastel); display: grid; place-items: center; }

/* O caminho de um processo: pontos ligados por uma linha, com a bifurcação */
.entrar-fluxo { position: relative; list-style: none; margin: auto 0; padding: 8px 0 8px 8px; display: flex; flex-direction: column; gap: 22px; }
.entrar-fluxo::before { content: ''; position: absolute; left: 13px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--pastel-yellow), rgba(241, 231, 198, .15)); border-radius: 2px; }
.entrar-fluxo li { position: relative; display: flex; align-items: center; gap: 14px; opacity: 0; animation: passo .7s var(--ease-entry) forwards; }
.entrar-fluxo li:nth-child(1) { animation-delay: .35s; }
.entrar-fluxo li:nth-child(2) { animation-delay: .5s; }
.entrar-fluxo li:nth-child(3) { animation-delay: .65s; }
.entrar-fluxo li:nth-child(4) { animation-delay: .8s; }
@keyframes passo { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.f-ponto { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; position: relative; z-index: 1; box-shadow: 0 0 0 4px #0c0c0b; }
.f-nome { font-size: 15px; font-weight: 600; color: var(--text-on-black); }
.f-nota { font-size: 11.5px; color: rgba(246, 243, 234, .45); }
.f-ge .f-ponto { background: var(--pastel-yellow); }
.f-orc .f-ponto { background: #3b82f6; }
.f-proj .f-ponto { background: #22c55e; }
.f-lic .f-ponto { background: #a855f7; }
.f-val .f-ponto { background: #F1E7C6; }
.f-dois { gap: 18px !important; flex-wrap: wrap; row-gap: 10px !important; }
.f-ramo { display: inline-flex; align-items: center; gap: 14px; }
.f-ramo + .f-ramo { gap: 10px; }
.f-ramo + .f-ramo::before { content: 'ou'; font-size: 11px; color: rgba(246, 243, 234, .35); margin-right: 6px; }
.f-ramo + .f-ramo .f-ponto { box-shadow: none; }
.entrar-pilulas { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.entrar-pilula {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: rgba(246, 243, 234, .6);
}

.entrar-dir {
  flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 52px 48px; background: var(--pastel-yellow); color: var(--text-on-pastel);
}
.entrar-dir::after {
  content: ''; position: absolute; top: -90px; right: -90px; width: 220px; height: 220px; border-radius: 50%;
  border: 28px solid var(--text-on-pastel); opacity: .05; pointer-events: none; animation: rodar 60s linear infinite;
}
.entrar-form { position: relative; z-index: 1; width: 100%; max-width: 330px; display: flex; flex-direction: column; animation: aparecer .9s var(--ease-entry) .2s both; }
.entrar-form h1 { font-size: 34px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.1; margin-bottom: 10px; }
.entrar-sub { font-size: 14px; line-height: 1.5; color: var(--text-on-pastel-muted); margin-bottom: 26px; }
.entrar-msg { font-size: 13.5px; line-height: 1.5; margin-bottom: 16px; }
.entrar-msg.erro-txt {
  padding: 12px 14px; border-radius: 14px; background: rgba(185, 28, 28, .1); border: 1px solid rgba(185, 28, 28, .2);
  color: #991b1b; font-weight: 500;
}
.entrar-btn { height: 50px; width: 100%; font-size: 14.5px; border-radius: 16px; }
.entrar-btn svg { transition: transform .2s var(--ease); }
.entrar-btn:hover svg { transform: translateX(3px); }
.entrar-info {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 14px; border-radius: 14px;
  background: rgba(0, 0, 0, .05); font-size: 12.5px; line-height: 1.5; color: var(--text-on-pastel-muted);
}
.entrar-info svg { flex-shrink: 0; margin-top: 1px; color: var(--text-on-pastel); }
.entrar-info strong { color: var(--text-on-pastel); }

@media (max-width: 820px) {
  .entrar { padding: 12px; place-items: start center; }
  .entrar-cartao { flex-direction: column; min-height: 0; border-radius: var(--radius-lg); }
  .entrar-esq { padding: 24px; gap: 22px; }
  .entrar-fluxo { margin: 4px 0; gap: 16px; }
  .f-dois .f-nota { display: none; }
  .f-dois { flex-wrap: nowrap; }
  .entrar-dir { padding: 32px 24px 36px; }
  .entrar-form h1 { font-size: 28px; }
}

/* ── Aviso ─────────────────────────────────────────────────────────────── */
.aviso {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 600; max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: var(--radius-full); background: var(--pastel-yellow); color: var(--text-on-pastel);
  font-size: 13px; font-weight: 600; box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
}
.aviso.mau { background: #f2a49c; }

/* ── Ecrãs estreitos ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  /* A coluna da direita passa para baixo (nunca se esconde). */
  .sidebar-right { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); align-items: start; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: flex; left: 0; top: 0; bottom: 0; width: 240px; border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    z-index: 500; padding: 24px 16px; align-items: stretch; animation: gaveta .3s var(--ease);
  }
  @keyframes gaveta { from { transform: translateX(-100%); } to { transform: none; } }
  .sidebar.mobile-open .sidebar-logo, .sidebar.mobile-open .sidebar-avatar { margin-left: 4px; }
  .sidebar.mobile-open .sidebar-nav, .sidebar.mobile-open .sidebar-bottom { align-items: stretch; }
  .sidebar.mobile-open .sidebar-icon { width: 100%; justify-content: flex-start; gap: 14px; padding: 0 12px; }
  .sidebar.mobile-open .sidebar-icon[data-tooltip]::after,
  .sidebar.mobile-open .sidebar-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip); position: static; background: none; box-shadow: none; padding: 0; animation: none;
    font-size: 14px; font-weight: 500; color: inherit;
  }
  .sidebar.mobile-open .sidebar-icon:hover { transform: none; }
  .hamburger-btn { display: flex; }
  .main { margin-left: 0; padding: 72px 16px 24px; }
  .header { flex-wrap: wrap; margin-bottom: 16px; padding: 0; }
  .page-title { font-size: 24px; }
  /* Só fica o botão Atualizar no cabeçalho (a pesquisa está por cima da tabela). */
  .header-right { width: auto; position: absolute; top: 16px; right: 16px; }
  .search-box { min-width: 0; flex: 1; }
  .card-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-box-tabela { flex: 1 1 auto; width: 100%; }
  .search-box kbd { display: none; }
  .stat-cards-row { grid-template-columns: minmax(0, 1fr); }
  .card { border-radius: var(--radius-lg); }
  .card-header { padding: 16px; }
  .filter-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { flex-shrink: 0; }
  .table-wrapper { max-height: none; }
  .atalhos { display: none; }
  .side-panel { top: 8px; right: 8px; bottom: 8px; max-width: calc(100vw - 16px); border-radius: var(--radius-lg); }
  .panel-head, .panel-body { padding-left: 18px; padding-right: 18px; }
  .campos { grid-template-columns: minmax(0, 1fr); }
  .colunas { gap: 6px; }
  .conc-linha { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 30px; gap: 8px; }
}
@media (max-width: 480px) {
  .main { padding: 72px 12px 20px; }
  .chart-card { padding: 18px; }
  .coluna-rotulo { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Período das «Entradas e saídas» (Hélia, 26/11/2026) */
.rel-periodo { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rel-periodo label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary, #b9af8e); }
.rel-periodo input { height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-dark, #3a3526); background: var(--bg-card-elevated, #1d1c19); color: inherit; font: inherit; font-size: 12px; color-scheme: dark; }
