/* Dashboard MT/AT — o mesmo design da RD e da GE3 (apps/ge3/public/estilo.css):
   página preta com pontos, barra lateral de ícones, realce pastel, cartões
   de vidro escuro, Inter. Só o que esta app usa. */
: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; --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); --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);
  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, textarea { font: inherit; color: inherit; }
a { color: inherit; }
: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; }
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%; }

/* ── 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; font-size: 12px; font-weight: 800; }
.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; }
.sidebar-icon:hover { color: var(--text-on-black); background: rgba(255, 255, 255, .14); }
.sidebar-icon.active { color: var(--pastel-yellow); background: rgba(241, 231, 198, .14); }
.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); }
.sidebar-avatar { width: 40px; height: 40px; border-radius: 50%; margin-top: 16px; display: grid; place-items: center; background: var(--bg-card-elevated); border: 2px solid rgba(255, 255, 255, .1); font-size: 12px; font-weight: 700; }

/* ── 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: 20px; padding: 8px 0; }
.page-title { font-size: 30px; font-weight: 300; letter-spacing: -.5px; }
.page-title b { font-weight: 600; }
.page-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.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.parado { background: rgba(255, 255, 255, .06); color: var(--text-muted); }
.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); }
.icon-btn-header:hover { background: var(--pastel-yellow); color: var(--text-on-pastel); }

.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; margin-bottom: 16px; }
.card-header { display: flex; flex-direction: column; gap: 14px; 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); }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.campo-filtro, .entrada { height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border-dark); background: var(--bg-card-elevated); font-size: 13px; color-scheme: dark; }
.campo-filtro:focus, .entrada:focus { outline: none; border-color: rgba(241, 231, 198, .5); }
.pesquisa { flex: 0 1 300px; min-width: 200px; }
textarea.entrada { height: auto; min-height: 80px; padding: 10px 12px; width: 100%; resize: vertical; }
.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: 0; background: transparent; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; }
.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); }
.filter-tab.ativo { background: var(--pastel-yellow); color: var(--text-on-pastel); }
.filter-tab.ativo .n { background: rgba(0, 0, 0, .1); }

.table-wrapper { overflow: auto; padding: 0 8px 8px; max-height: calc(100vh - 260px); }
.tabela { width: 100%; border-collapse: collapse; }
.tabela thead { position: sticky; top: 0; z-index: 2; background: #1a1916; }
.tabela th { text-align: left; padding: 14px 12px; border-bottom: 1px solid rgba(255, 255, 255, .07); white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.tabela td { padding: 11px 12px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid rgba(255, 255, 255, .04); vertical-align: top; }
.tabela td.num { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela td.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela td.obs { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabela tbody tr.clica { cursor: pointer; }
.tabela tbody tr.clica:hover { background: rgba(255, 255, 255, .03); }
.tabela tbody tr.mesmo td { border-top: 0; }
.tabela tbody tr.mesmo td.num .nproc { visibility: hidden; }
.tabela tr.carregar td { text-align: center; color: var(--text-muted); padding: 40px; }
.ativ { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-muted); margin-top: 2px; white-space: normal; }
.suave { color: var(--text-muted); }
.vazio { padding: 56px 16px; color: var(--text-muted); font-size: 13px; text-align: center; }

.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.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; }
.tag.realce { background: rgba(241, 231, 198, .14); color: var(--pastel-yellow); }

/* Alertas (tarefa nova, saiu de pendente): ficam até alguém os apagar */
.alertas { list-style: none; padding: 8px 16px 12px; }
.alertas li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.alertas li:last-child { border-bottom: 0; }
.alertas .num { font-weight: 600; color: var(--text-primary); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .2); }
.alertas .txt { flex: 1; min-width: 0; }
.alertas .q { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

.btn, .btn-sec, .btn-mini { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--radius-full); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; border: 0; transition: var(--transition); white-space: nowrap; }
.btn { background: var(--pastel-yellow); color: var(--text-on-pastel); }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sec { background: transparent; color: var(--text-primary); border: 1.5px solid var(--border-dark); }
.btn-sec:hover { border-color: var(--text-secondary); }
.btn-mini { height: 28px; padding: 0 12px; font-size: 12px; background: rgba(255, 255, 255, .07); color: var(--text-primary); }
.btn-mini:hover { background: rgba(255, 255, 255, .14); }
.btn-perigo { color: #fca5a5; }

/* ── Painel de detalhe ── */
.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: 520px; max-width: calc(100vw - 32px); z-index: 300; background: rgba(20, 19, 16, .96); 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: 22px 24px; border-bottom: 1px solid var(--border-dark); }
.panel-title { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.panel-sub { font-size: 13px; color: var(--text-secondary); }
.panel-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.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-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.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; }
.tarefa { padding: 14px; background: rgba(255, 255, 255, .03); border-radius: var(--radius-sm); margin-bottom: 8px; }
.tarefa-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tarefa-nome { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.tarefa-dados { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; color: var(--text-secondary); }
.tarefa-dados b { color: var(--text-muted); font-weight: 500; }
.tarefa-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.tarefa-acoes .campo-filtro { height: 30px; font-size: 12px; }
.devolvida { margin-top: 8px; font-size: 12.5px; color: #fca5a5; }
.linha-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.linha-form .entrada { flex: 1; }
.erro { padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, .12); color: #fca5a5; font-size: 13px; }

/* ── Admin ── */
.grelha { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; align-items: start; }
.grelha .card { margin-bottom: 0; }
.corpo { padding: 16px 20px 20px; }
.equipa { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.equipa:last-child { border-bottom: 0; }
.membros { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.membros .tag button { margin-left: 6px; border: 0; background: none; cursor: pointer; color: var(--text-muted); }
.nota { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

/* ── Entrar ── */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.entrar-cartao { width: min(440px, 100%); padding: 36px; border-radius: var(--radius-xl); background: var(--bg-card-elevated); border: 1px solid var(--border-dark); box-shadow: 0 32px 80px rgba(0, 0, 0, .55); }
.entrar-cartao h1 { font-size: 26px; font-weight: 300; margin: 18px 0 8px; }
.entrar-cartao p { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }

.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; }

@media (max-width: 768px) {
  .sidebar { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 64px; flex-direction: row; border-radius: 22px 22px 0 0; padding: 0 12px; }
  .sidebar-logo, .sidebar-avatar { display: none; }
  .sidebar-nav, .sidebar-bottom { flex-direction: row; flex: 0; margin: 0; }
  .sidebar-nav { flex: 1; }
  .sidebar-icon[data-tooltip]:hover::after { display: none; }
  .main { margin-left: 0; padding: 16px 12px 88px; }
  .page-title { font-size: 24px; }
  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
  .filter-tab { flex-shrink: 0; }
  .table-wrapper { max-height: none; }
  .side-panel { top: 8px; right: 8px; bottom: 8px; max-width: calc(100vw - 16px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
