:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section { padding: 48px 24px; }
.section.narrow { max-width: 560px; margin: 0 auto; }
.section.center { text-align: center; }
.lead { color: var(--muted); font-size: 1.05rem; }
.muted { color: var(--muted); }

/* Botões */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: 0.9rem; }

/* Site público */
.site-header { border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--ink); font-weight: 500; }
.main-nav a.active { color: var(--primary); }

.hero { background: linear-gradient(180deg, #eff6ff, #fff); padding: 72px 24px; text-align: center; }
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }
.hero .lead { max-width: 560px; margin: 0 auto 28px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 24px 0 32px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-top: 0; }
.price-tag { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--primary); }

.contact-strip { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.contact-strip div { display: flex; flex-direction: column; gap: 4px; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }

.site-footer { border-top: 1px solid var(--border); padding: 24px; text-align: center; color: var(--muted); margin-top: 48px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.small-print { font-size: 0.82rem; margin-top: 4px; }
.legal-page h2 { margin-top: 32px; }
.legal-page .lead { margin-bottom: 24px; }
.muted-link { color: var(--muted); font-size: 0.9rem; }

/* Formulários */
.form { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.narrow-form { max-width: 560px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.form input, .form select, .form textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 400;
  background: #fff;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; align-items: end; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form-inline input, .form-inline select { min-width: 140px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.item-add-block { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 20px; }
.item-add-block .form { margin: 0; }
.search-form { margin: 16px 0; }
.search-form input, .search-form select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; min-width: 260px; }

/* Login */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { background: #fff; padding: 40px; border-radius: var(--radius); border: 1px solid var(--border); width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login-box h1 { font-size: 1.4rem; margin: 0 0 8px; }
.login-box input { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; width: 100%; }
.login-box label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }

/* Backoffice — estrutura estilo iOS/macOS: sidebar como painel sobreposto,
   revelado por um botão de menu na barra superior. */
.admin-body { margin: 0; }
.admin-shell { min-height: 100vh; position: relative; }

.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 45; }
.sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }

.admin-sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: 260px; z-index: 50;
  display: flex; flex-direction: column; padding: 20px 0;
  transform: translateX(-100%); transition: transform 0.25s ease;
  overflow-y: auto;
}
.admin-sidebar.open { transform: translateX(0); box-shadow: 12px 0 32px rgba(0, 0, 0, 0.25); }
.admin-brand { font-weight: 800; color: #fff; padding: 0 20px 20px; font-size: 1.1rem; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav > a { color: #cbd5e1; padding: 10px 20px; }
.admin-nav a:hover { text-decoration: none; }

.admin-nav-group { display: flex; flex-direction: column; }
.admin-nav-group-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 10px 20px; border: none; background: none; color: #cbd5e1; font: inherit; font-size: 1em; cursor: pointer; }
.admin-nav-group-toggle .chev { display: inline-block; transition: transform 0.15s ease; opacity: 0.6; }
.admin-nav-group-toggle.open .chev,
.admin-nav-group-toggle.active .chev { transform: rotate(90deg); }
.admin-nav-submenu { display: none; flex-direction: column; padding: 4px 0 6px 12px; }
.admin-nav-submenu.open { display: flex; }
.admin-nav-submenu a { padding: 8px 20px; font-size: 0.92rem; }
.theme-swatch-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; }

.admin-body-inner { min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 56px; flex-shrink: 0; }
.menu-toggle { width: 36px; height: 36px; border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 8px; flex-shrink: 0; }
.menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 1px; }
.topbar-tabs { display: flex; align-items: center; gap: 4px; }
.topbar-tabs a { padding: 7px 14px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; }
.topbar-tabs a:hover { text-decoration: none; }
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-left: 7px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
}
.topbar-spacer { flex: 1; }
.topbar-search { margin: 0; }
.topbar-search input { font: inherit; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; width: 180px; max-width: 40vw; }
.topbar-right { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar-btn { padding: 7px 12px; border-radius: 8px; font-size: 0.86rem; font-weight: 600; cursor: pointer; border: none; background: none; font: inherit; white-space: nowrap; }
.topbar-btn:hover { text-decoration: none; }

.theme-swatch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: none; background: none; font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; color: #cbd5e1; }
.theme-swatch-preview { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.theme-swatch-violet .theme-swatch-preview { background: linear-gradient(135deg, #0b0d12 50%, #8b7cff 50%); }
.theme-swatch-daylight .theme-swatch-preview { background: linear-gradient(135deg, #f4f6fa 50%, #1e3a66 50%); }
.theme-swatch-santander .theme-swatch-preview { background: linear-gradient(135deg, #ffffff 50%, #ec0000 50%); }
.theme-swatch-forest .theme-swatch-preview { background: linear-gradient(135deg, #ffffff 50%, #1b5e3a 50%); }
.theme-swatch-petrol .theme-swatch-preview { background: linear-gradient(135deg, #f5f8f8 50%, #0e6e6e 50%); }
.theme-swatch-ivano .theme-swatch-preview { background: linear-gradient(135deg, #0d1b2a 50%, #4fb0d9 50%); }
.theme-swatch-groove .theme-swatch-preview { background: linear-gradient(135deg, #121212 50%, #1db954 50%); }

.admin-main { flex: 1; padding: 28px 32px; max-width: 1100px; width: 100%; }
.admin-content table { margin-top: 16px; }

.page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table th { background: #f1f5f9; font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.03em; }
.table tr:last-child td { border-bottom: none; }
.table input { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; width: 100%; max-width: 220px; }

.dashboard-layout { display: flex; gap: 28px; align-items: flex-start; }
.dashboard-main { flex: 2 1 0; min-width: 0; }
.dashboard-side { flex: 1 1 260px; min-width: 220px; max-width: 320px; display: flex; flex-direction: column; gap: 8px; }
.dashboard-side h2 { margin-bottom: 4px; }
.goal-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 16px; }
.goal-ring { position: relative; width: 140px; height: 140px; margin: 0 auto 10px; }
.goal-ring svg { width: 100%; height: 100%; }
.goal-ring-track { stroke: var(--border); }
.goal-ring-fill { transition: stroke-dashoffset 0.4s ease; }
.goal-ring-publicacoes { stroke: var(--primary); }
.goal-ring-lucro { stroke: var(--success); }
.goal-ring-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; }
.goal-title { font-weight: 600; margin: 4px 0 2px; }
.goal-detail { margin: 0; font-size: 0.85rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 20px 0 32px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-positive .stat-value { color: var(--success); }
.stat-negative .stat-value { color: var(--danger); }
.text-positive { color: var(--success); font-weight: 600; }
.text-negative { color: var(--danger); font-weight: 600; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #e2e8f0; color: var(--ink); }
.badge-novo { background: #dbeafe; color: #1e40af; }
.badge-em_analise { background: #fef3c7; color: #92400e; }
.badge-orcamentado { background: #ede9fe; color: #5b21b6; }
.badge-aprovado { background: #d1fae5; color: #065f46; }
.badge-em_reparacao { background: #fed7aa; color: #9a3412; }
.badge-reparado { background: #bbf7d0; color: #14532d; }
.badge-nao_reparado { background: #fed7aa; color: #9a3412; }
.badge-entregue { background: #cbd5e1; color: #1e293b; }
.badge-rejeitado { background: #fecaca; color: #991b1b; }
.badge.sla-ok { background: #e2e8f0; color: var(--muted); font-weight: 500; }
.badge.sla-overdue { background: #fecaca; color: #991b1b; }

.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }
.link-btn.danger { color: var(--danger); }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }
.flash-ok { background: #d1fae5; color: #065f46; }
.flash-error { background: #fecaca; color: #991b1b; }

.conteudo-grupo { font-size: 1.05rem; margin: 26px 0 -4px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.conteudo-grupo:first-child { margin-top: 0; }

.activity-list { list-style: none; padding: 0; margin: 12px 0 32px; display: flex; flex-direction: column; gap: 8px; }
.activity-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; }
.activity-desc { font-weight: 500; }
.activity-meta { white-space: nowrap; font-size: 0.8rem; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 260px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px 14px; margin: 16px 0; }
.bar-group { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 180px; width: 100%; }
.bar-col { flex: 1 1 0; max-width: 30px; min-width: 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bar-value { font-size: 0.62rem; color: var(--muted); white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); }
.bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-receita { background: var(--primary); }
.bar-despesa { background: var(--danger); }
.bar-label { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.month-row { cursor: pointer; }
.month-row:hover td { background: #f1f5f9; }

.ledger-layout { display: flex; gap: 24px; align-items: flex-start; margin-top: 12px; }
.ledger-months { flex: 0 0 240px; }
.ledger-months h3, .ledger-detail h3 { margin: 0 0 8px; font-size: 1rem; }
.ledger-months .table { font-size: 0.85rem; }
.ledger-months tr.active td { background: var(--primary); color: #fff; }
.ledger-months tr.active a { color: #fff; }
.ledger-detail { flex: 1; min-width: 0; border-left: 1px solid var(--border); padding-left: 24px; }
@media (max-width: 860px) {
  .ledger-layout { flex-direction: column; }
  .ledger-months { flex-basis: auto; width: 100%; }
  .ledger-detail { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; width: 100%; }
}
.subtable { margin: 4px 0; }
.subtable th, .subtable td { font-size: 0.85rem; }
.chart-legend { display: flex; gap: 20px; font-size: 0.85rem; color: var(--muted); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.legend-receita { background: var(--primary); }
.legend-despesa { background: var(--danger); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 16px 0; }
.calendar-weekday { background: #f1f5f9; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px; text-align: center; }
.calendar-cell { background: #fff; min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.calendar-cell-empty { background: #f8fafc; }
.calendar-cell-today { background: #eff6ff; }
.calendar-cell { cursor: pointer; transition: background 0.12s ease; }
.calendar-cell:hover { background: #eef2f7; }
.calendar-cell-empty { cursor: default; }
.calendar-cell-empty:hover { background: #f8fafc; }
.calendar-daynum { font-weight: 700; font-size: 0.85rem; margin-bottom: 2px; }
.calendar-daynum a { color: var(--ink); }
.calendar-event { display: block; font-size: 0.72rem; padding: 2px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.calendar-event-recolha { background: var(--primary); }
.calendar-event-entrega { background: var(--success); }
.calendar-event-publicacao { background: #a855f7; }
.calendar-event-outro { background: var(--muted); }
.calendar-event-done { opacity: 0.6; }
.legend-recolha { background: var(--primary); }
.legend-entrega { background: var(--success); }
.legend-publicacao { background: #a855f7; }
.legend-outro { background: var(--muted); }

@media (max-width: 720px) {
  .admin-sidebar { width: 82vw; max-width: 300px; }
  .admin-main { padding: 20px; }
  .admin-topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; row-gap: 8px; }
  .topbar-right { width: 100%; justify-content: flex-end; }
  .dashboard-layout { flex-direction: column; align-items: stretch; }
  .dashboard-side { max-width: none; flex-direction: row; flex-wrap: wrap; }
  .goal-card { flex: 1 1 200px; }

  /* Tabelas com muitas colunas (Processos, Clientes, Despesas/Receitas...) não cabem
     num ecrã de telemóvel — em vez de espremer o texto em várias linhas ilegíveis,
     deixa a tabela no seu tamanho natural; o wrapper .table-scroll (criado por JS
     em cada página) é que desliza para o lado, mantendo título/botões no lugar. */
  .table { width: max-content; min-width: 100%; }
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ================= Backoffice: temas de cor =================
   Isolado em .admin-body (e variantes [data-theme]) para nunca afetar o
   site público, que continua a usar as cores claras definidas em :root.
   Cada tema define o mesmo conjunto de variáveis --a-*; todos os
   componentes abaixo usam essas variáveis, por isso mudar de tema não
   exige tocar em mais nada. */
.admin-body,
.admin-body[data-theme="violet"] {
  --a-on-accent: #0b0d12;
  --a-bg: #0b0d12;
  --a-surface: #151822;
  --a-surface-2: #1b1f2b;
  --a-border: #272c3a;
  --a-ink: #e8eaf2;
  --a-muted: #8890a8;
  --a-accent: #8b7cff;
  --a-accent-dark: #7566e6;
  --a-accent-soft: #211f38;
  --a-good: #34d399;
  --a-good-soft: #10281f;
  --a-warn: #ffb454;
  --a-warn-soft: #35270f;
  --a-bad: #ff6b81;
  --a-bad-soft: #34141c;
  --a-info: #d98bff;
  --a-info-soft: #3a1f4a;
}
.admin-body[data-theme="daylight"] {
  --a-on-accent: #ffffff;
  --a-bg: #f4f6fa;
  --a-surface: #ffffff;
  --a-surface-2: #e9eef8;
  --a-border: #d7deea;
  --a-ink: #101b33;
  --a-muted: #5b6b85;
  --a-accent: #1e3a66;
  --a-accent-dark: #142a4d;
  --a-accent-soft: #e2e7f1;
  --a-good: #1f8a5a;
  --a-good-soft: #e1f3ea;
  --a-warn: #9c6b12;
  --a-warn-soft: #f5ead3;
  --a-bad: #b23b3b;
  --a-bad-soft: #f6e2e2;
  --a-info: #7c3aed;
  --a-info-soft: #ece3fb;
}
.admin-body[data-theme="santander"] {
  --a-on-accent: #ffffff;
  --a-bg: #f5f5f6;
  --a-surface: #ffffff;
  --a-surface-2: #fce9e9;
  --a-border: #e5e5e7;
  --a-ink: #1a1a1a;
  --a-muted: #6b6b70;
  --a-accent: #ec0000;
  --a-accent-dark: #c40000;
  --a-accent-soft: #fce0e0;
  --a-good: #1f8a5a;
  --a-good-soft: #e1f3ea;
  --a-warn: #9c6b12;
  --a-warn-soft: #f5ead3;
  --a-bad: #b23b3b;
  --a-bad-soft: #f6e2e2;
  --a-info: #7c3aed;
  --a-info-soft: #ece3fb;
}
.admin-body[data-theme="forest"] {
  --a-on-accent: #ffffff;
  --a-bg: #f6f8f6;
  --a-surface: #ffffff;
  --a-surface-2: #e3efe6;
  --a-border: #dce6de;
  --a-ink: #16241a;
  --a-muted: #5b6e5f;
  --a-accent: #1b5e3a;
  --a-accent-dark: #12432a;
  --a-accent-soft: #dcefe2;
  --a-good: #1f8a5a;
  --a-good-soft: #e1f3ea;
  --a-warn: #9c6b12;
  --a-warn-soft: #f5ead3;
  --a-bad: #b23b3b;
  --a-bad-soft: #f6e2e2;
  --a-info: #7c3aed;
  --a-info-soft: #ece3fb;
}
.admin-body[data-theme="petrol"] {
  --a-on-accent: #ffffff;
  --a-bg: #f5f8f8;
  --a-surface: #ffffff;
  --a-surface-2: #e1eeee;
  --a-border: #dae5e5;
  --a-ink: #16262a;
  --a-muted: #5b6e70;
  --a-accent: #0e6e6e;
  --a-accent-dark: #0a5555;
  --a-accent-soft: #d9efef;
  --a-good: #1f8a5a;
  --a-good-soft: #e1f3ea;
  --a-warn: #9c6b12;
  --a-warn-soft: #f5ead3;
  --a-bad: #b23b3b;
  --a-bad-soft: #f6e2e2;
  --a-info: #7c3aed;
  --a-info-soft: #ece3fb;
}
.admin-body[data-theme="ivano"] {
  --a-on-accent: #0b1a26;
  --a-bg: #14293d;
  --a-surface: #1c3650;
  --a-surface-2: #24435f;
  --a-border: #2f4f6d;
  --a-ink: #eaf2f7;
  --a-muted: #9db3c4;
  --a-accent: #3ec6e0;
  --a-accent-dark: #2fa8c0;
  --a-accent-soft: #1c4652;
  --a-good: #34d399;
  --a-good-soft: #16332b;
  --a-warn: #ffb454;
  --a-warn-soft: #3a2c14;
  --a-bad: #ff6b81;
  --a-bad-soft: #3a1620;
  --a-info: #c58bff;
  --a-info-soft: #332147;
}
.admin-body[data-theme="groove"] {
  --a-on-accent: #0b0d12;
  --a-bg: #121212;
  --a-surface: #181818;
  --a-surface-2: #282828;
  --a-border: #2a2a2a;
  --a-ink: #ffffff;
  --a-muted: #b3b3b3;
  --a-accent: #1db954;
  --a-accent-dark: #1aa34a;
  --a-accent-soft: #1a2e22;
  --a-good: #1db954;
  --a-good-soft: #1a2e22;
  --a-warn: #ffb454;
  --a-warn-soft: #3a2c14;
  --a-bad: #ff6b6b;
  --a-bad-soft: #3a1a1a;
  --a-info: #a56eff;
  --a-info-soft: #291f3a;
}

.admin-body {
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--a-bg);
  color: var(--a-ink);
}
.admin-body h1, .admin-body h2, .admin-body h3 { font-family: "Sora", sans-serif; }
.admin-body a { color: var(--a-accent); }
.admin-body .muted, .admin-body .lead { color: var(--a-muted); }

.admin-body .login-shell { background: var(--a-bg); }
.admin-body .login-box { background: var(--a-surface); border-color: var(--a-border); }
.admin-body .login-box h1 { color: var(--a-ink); }
.admin-body .login-box label { color: var(--a-ink); }
.admin-body .login-box input { background: var(--a-bg); border-color: var(--a-border); color: var(--a-ink); }

.admin-body .admin-sidebar { background: var(--a-surface); border-right: 1px solid var(--a-border); }
.admin-body .admin-brand { color: var(--a-ink); }
.admin-body .admin-brand { display: flex; align-items: center; gap: 10px; }
.admin-body .admin-brand img { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; background: #fff; }
.admin-body .admin-nav a { color: var(--a-muted); padding-left: 17px; border-left: 3px solid transparent; }
.admin-body .admin-nav a:hover { background: var(--a-surface-2); color: var(--a-ink); }
.admin-body .admin-nav a.active { background: var(--a-surface-2); color: var(--a-ink); border-left-color: var(--a-accent); font-weight: 700; }
.admin-body .admin-nav-group-toggle { color: var(--a-muted); }
.admin-body .admin-nav-group-toggle:hover { background: var(--a-surface-2); color: var(--a-ink); }
.admin-body .admin-nav-group-toggle.active { color: var(--a-ink); font-weight: 700; }
.admin-body .admin-nav-submenu a { color: var(--a-muted); }
.admin-body .admin-nav-submenu a:hover { background: var(--a-surface-2); color: var(--a-ink); }
.admin-body .admin-nav-submenu a.active { color: var(--a-accent); font-weight: 700; }
.admin-body .theme-swatch { color: var(--a-muted); }
.admin-body .theme-swatch:hover { background: var(--a-surface-2); color: var(--a-ink); }
.admin-body .theme-swatch.active { color: var(--a-ink); font-weight: 700; }
.admin-body .topbar-tabs a { color: var(--a-muted); }
.admin-body .topbar-tabs a:hover { background: var(--a-surface-2); color: var(--a-ink); }
.admin-body .topbar-tabs a.active { background: var(--a-accent-soft); color: var(--a-accent); }
.admin-body .admin-main { background: var(--a-bg); }
.admin-body .flash-ok { background: var(--a-good-soft); color: var(--a-good); }
.admin-body .flash-error { background: var(--a-bad-soft); color: var(--a-bad); }

.admin-body .admin-topbar { background: var(--a-surface); border-bottom: 1px solid var(--a-border); }
.admin-body .menu-toggle span { background: var(--a-ink); }
.admin-body .menu-toggle:hover { background: var(--a-surface-2); }
.admin-body .topbar-btn { color: var(--a-muted); }
.admin-body .topbar-btn:hover { background: var(--a-surface-2); color: var(--a-ink); }
.admin-body .topbar-search input { background: var(--a-surface-2); border-color: var(--a-border); color: var(--a-ink); }
.admin-body .topbar-search input::placeholder { color: var(--a-muted); }

.admin-body .form label { color: var(--a-ink); }
.admin-body .form input,
.admin-body .form select,
.admin-body .form textarea,
.admin-body .search-form input,
.admin-body .search-form select {
  background: var(--a-surface);
  border-color: var(--a-border);
  color: var(--a-ink);
}
.admin-body .form input::placeholder { color: var(--a-muted); }

.admin-body .btn-primary { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-on-accent); }
.admin-body .btn-primary:hover { background: var(--a-accent-dark); }
.admin-body .btn-secondary { background: transparent; color: var(--a-accent); border-color: var(--a-accent); }
.admin-body .btn-secondary:hover { background: var(--a-accent-soft); }
.admin-body .btn-danger { background: transparent; color: var(--a-bad); border-color: var(--a-bad); }
.admin-body .btn-danger:hover { background: var(--a-bad); color: #fff; }
.admin-body .link-btn { color: var(--a-accent); }
.admin-body .link-btn.danger { color: var(--a-bad); }

.admin-body .table { background: var(--a-surface); border-color: var(--a-border); }
.admin-body .table th { background: var(--a-surface-2); color: var(--a-muted); border-color: var(--a-border); }
.admin-body .table td { border-color: var(--a-border); color: var(--a-ink); }
.admin-body .table tr:hover td { background: var(--a-surface-2); }
.admin-body .table input { background: var(--a-bg); border-color: var(--a-border); color: var(--a-ink); }

.admin-body .stat-card { background: var(--a-surface); border: 1px solid var(--a-border); border-top: 2px solid var(--a-accent); }
.admin-body .goal-card { background: var(--a-surface); border-color: var(--a-border); }
.admin-body .goal-ring-track { stroke: var(--a-border); }
.admin-body .goal-ring-publicacoes { stroke: var(--a-accent); }
.admin-body .goal-ring-lucro { stroke: var(--a-good); }
.admin-body .goal-ring-center { color: var(--a-ink); }
.admin-body .goal-detail { color: var(--a-muted); }
.admin-body .stat-label { color: var(--a-muted); }
.admin-body .stat-value { color: var(--a-ink); font-family: "IBM Plex Mono", monospace; }
.admin-body .stat-card.stat-positive { border-top-color: var(--a-good); }
.admin-body .stat-card.stat-positive .stat-value { color: var(--a-good); }
.admin-body .stat-card.stat-negative { border-top-color: var(--a-bad); }
.admin-body .stat-card.stat-negative .stat-value { color: var(--a-bad); }
.admin-body .text-positive { color: var(--a-good); }
.admin-body .text-negative { color: var(--a-bad); }

.admin-body .badge { background: var(--a-surface-2); color: var(--a-ink); font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.admin-body .badge-novo { background: var(--a-accent-soft); color: var(--a-accent); }
.admin-body .badge-em_analise { background: var(--a-warn-soft); color: var(--a-warn); }
.admin-body .badge-orcamentado { background: var(--a-accent-soft); color: var(--a-accent); }
.admin-body .badge-aprovado { background: var(--a-good-soft); color: var(--a-good); }
.admin-body .badge-em_reparacao { background: var(--a-warn-soft); color: var(--a-warn); }
.admin-body .badge-reparado { background: var(--a-good-soft); color: var(--a-good); }
.admin-body .badge-nao_reparado { background: var(--a-warn-soft); color: var(--a-warn); }
.admin-body .badge-entregue { background: var(--a-surface-2); color: var(--a-muted); }
.admin-body .badge-rejeitado { background: var(--a-bad-soft); color: var(--a-bad); }
.admin-body .badge.sla-ok { background: var(--a-surface-2); color: var(--a-muted); }
.admin-body .badge.sla-overdue { background: var(--a-bad-soft); color: var(--a-bad); }

.admin-body .conteudo-grupo { color: var(--a-ink); border-bottom-color: var(--a-border); }
.admin-body .activity-list li { background: var(--a-surface); border-color: var(--a-border); color: var(--a-ink); }
.admin-body .activity-meta { color: var(--a-muted); }

.admin-body .chart { background: var(--a-surface); border-color: var(--a-border); }
.admin-body .bar-receita { background: var(--a-accent); }
.admin-body .bar-despesa { background: var(--a-bad); }
.admin-body .bar-label { color: var(--a-muted); }
.admin-body .bar-value { color: var(--a-muted); }
.admin-body .month-row:hover td { background: var(--a-surface-2); }
.admin-body .subtable { background: var(--a-surface-2); }
.admin-body .subtable th { background: var(--a-surface); }
.admin-body .ledger-detail { border-left-color: var(--a-border); }
.admin-body .ledger-months tr.active td { background: var(--a-accent); color: var(--a-on-accent); }
.admin-body .ledger-months tr.active a { color: var(--a-on-accent); }
.admin-body .chart-legend { color: var(--a-muted); }
.admin-body .legend-receita { background: var(--a-accent); }
.admin-body .legend-despesa { background: var(--a-bad); }

.admin-body .calendar-grid { background: var(--a-border); border-color: var(--a-border); }
.admin-body .calendar-weekday { background: var(--a-surface-2); color: var(--a-muted); }
.admin-body .calendar-cell { background: var(--a-surface); }
.admin-body .calendar-cell-empty { background: var(--a-bg); }
.admin-body .calendar-cell-today { background: var(--a-accent-soft); }
.admin-body .calendar-cell:hover { background: var(--a-surface-2); }
.admin-body .calendar-cell-empty:hover { background: var(--a-bg); }
.admin-body .calendar-daynum a { color: var(--a-ink); }
.admin-body .legend-recolha { background: var(--a-accent); }
.admin-body .legend-entrega { background: var(--a-good); }
.admin-body .legend-publicacao { background: var(--a-info); }
.admin-body .legend-outro { background: var(--a-muted); }
.admin-body .calendar-event-recolha { background: var(--a-accent-soft); color: var(--a-accent); }
.admin-body .calendar-event-entrega { background: var(--a-good-soft); color: var(--a-good); }
.admin-body .calendar-event-publicacao { background: var(--a-info-soft); color: var(--a-info); }
.admin-body .calendar-event-outro { background: var(--a-surface-2); color: var(--a-muted); }

/* ================= Refinamentos transversais (todos os temas) ================= */
/* Foco visível para teclado, na cor do tema. */
.admin-body :where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--a-accent); outline-offset: 2px; border-radius: 6px; }
.admin-body .form input:focus, .admin-body .form select:focus, .admin-body .form textarea:focus,
.admin-body .search-form input:focus, .admin-body .search-form select:focus,
.admin-body .topbar-search input:focus, .admin-body .table input:focus, .admin-body .login-box input:focus {
  outline: none; border-color: var(--a-accent); box-shadow: 0 0 0 3px var(--a-accent-soft);
}
.admin-body .form input, .admin-body .form select, .admin-body .form textarea,
.admin-body .search-form input, .admin-body .search-form select, .admin-body .topbar-search input {
  transition: border-color .15s ease, box-shadow .15s ease;
}

/* Botões: transições suaves e alvo mínimo de 40px. */
.admin-body .btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease; font: inherit; font-weight: 600; }
.admin-body .btn:active { transform: translateY(1px); }
.admin-body .btn-sm { min-height: 32px; }
.admin-body .topbar-tabs a, .admin-body .topbar-btn, .admin-body .admin-nav a,
.admin-body .admin-nav-group-toggle, .admin-body .theme-swatch { transition: background-color .15s ease, color .15s ease; }

/* Cartões com um pouco mais de profundidade. */
.admin-body .stat-card, .admin-body .goal-card { border-radius: 12px; transition: border-color .15s ease; }
.admin-body .stat-card:hover { border-color: var(--a-muted); }
.admin-body .stat-card.stat-positive:hover, .admin-body .stat-card.stat-negative:hover { border-color: var(--a-border); }
.admin-body .stat-value { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.admin-body .table { border-radius: 12px; }
.admin-body .table td { font-variant-numeric: tabular-nums; }

/* Barra de topo: nunca provoca scroll horizontal na página.
   Os separadores deslizam para o lado se não couberem. */
.admin-topbar { min-width: 0; }
.topbar-tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar-tabs::-webkit-scrollbar { display: none; }
.topbar-tabs a { white-space: nowrap; flex-shrink: 0; }
.topbar-right { flex-wrap: nowrap; }
.topbar-right .topbar-btn { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
/* Até 1000px: menu + pesquisa + conta numa linha, separadores numa segunda linha. */
@media (max-width: 1000px) {
  .admin-topbar { flex-wrap: wrap; height: auto; padding: 8px 16px; row-gap: 6px; }
  .topbar-tabs { order: 10; width: 100%; margin: 0 -6px; }
  .topbar-spacer { display: none; }
  .topbar-search { margin-left: auto; }
  .topbar-search input { width: 160px; }
}
@media (max-width: 720px) {
  .topbar-right { width: auto; }
  .topbar-search { flex: 1; }
  .topbar-search input { width: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-body *, .admin-body *::before, .admin-body *::after { transition: none !important; animation: none !important; }
}

/* ================= Tema "ID Repair" — paleta do site (Color Scheme.png) =================
   Fundo creme, cartões brancos, azul-aço nos destaques, coral nos botões principais.
   Cores sólidas: sem manchas de luz nem gradientes. */
.admin-body[data-theme="idrepair"] {
  --a-bg: #f0ede2;
  --a-surface: #ffffff;
  --a-surface-2: #e7e2d3;
  --a-border: #dad3c1;
  --a-ink: #1d2b35;
  --a-muted: #4e5d66;
  --a-accent: #2c5772;
  --a-accent-dark: #234659;
  --a-accent-soft: #dce5ea;
  --a-on-accent: #f0ede2;
  --a-good: #1a6e45;
  --a-good-soft: #ddefe3;
  --a-warn: #8f5210;
  --a-warn-soft: #f7e6cf;
  --a-bad: #a93636;
  --a-bad-soft: #f6e0dc;
  --a-info: #6a4a9c;
  --a-info-soft: #ece4f5;
  --a-glow-2: #f27243;
  --a-cta: #f27243;
  --a-cta-hover: #f58b64;
  --a-on-cta: #1d2b35;
}
.theme-swatch-idrepair .theme-swatch-preview { background: linear-gradient(135deg, #f0ede2 50%, #f27243 50%); }
.admin-body[data-theme="idrepair"] .btn-primary { background: var(--a-cta); border-color: var(--a-cta); color: var(--a-on-cta); }
.admin-body[data-theme="idrepair"] .btn-primary:hover { background: var(--a-cta-hover); border-color: var(--a-cta-hover); }
.admin-body[data-theme="idrepair"] h1, .admin-body[data-theme="idrepair"] h2 { color: var(--a-accent); }
.admin-body[data-theme="idrepair"] .admin-brand { color: var(--a-accent); }
/* Sem manchas de luz; fica só a grelha subtil */
.admin-body[data-theme="idrepair"] .admin-ambiente .amb { display: none; }
/* Cartões sólidos (sem degradê) e linha do topo sólida */
.admin-body[data-theme="idrepair"] .stat-card, .admin-body[data-theme="idrepair"] .goal-card { background: var(--a-surface); box-shadow: 0 1px 2px rgba(29,43,53,.05), 0 10px 26px -14px rgba(29,43,53,.22); }
.admin-body[data-theme="idrepair"] .stat-card::before { background: var(--a-accent); }
.admin-body[data-theme="idrepair"] .stat-card.stat-positive::before { background: var(--a-good); }
.admin-body[data-theme="idrepair"] .stat-card.stat-negative::before { background: var(--a-bad); }
.admin-body[data-theme="idrepair"] .stat-card::after, .admin-body[data-theme="idrepair"] .goal-card::after { background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(241,176,147,.3), transparent 50%); }
.admin-body[data-theme="idrepair"] .table { box-shadow: 0 10px 26px -18px rgba(29,43,53,.25); }
/* Faixa de boas-vindas do dashboard em azul-aço sólido, como o hero do site */
.admin-body[data-theme="idrepair"] .dash-hero { background: #2c5772; border-color: #2c5772; color: #f0ede2; box-shadow: 0 16px 40px -24px rgba(29,43,53,.6); }
.admin-body[data-theme="idrepair"] .dash-hero::before { display: none; }
.admin-body[data-theme="idrepair"] .dash-hero::after { background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(241,176,147,.18), transparent 50%); }
.admin-body[data-theme="idrepair"] .dash-hero h1 { color: #f0ede2; }
.admin-body[data-theme="idrepair"] .dash-data { color: #c9d6de; }
.admin-body[data-theme="idrepair"] .dash-resumo { color: #c9d6de; }
.admin-body[data-theme="idrepair"] .dash-resumo span { background: #386173; border-color: rgba(240,237,226,.16); }
.admin-body[data-theme="idrepair"] .dash-resumo b { color: #f0ede2; }
.admin-body[data-theme="idrepair"] .dash-hero .btn-secondary { color: #f0ede2; border-color: rgba(240,237,226,.5); }
.admin-body[data-theme="idrepair"] .dash-hero .btn-secondary:hover { background: #f0ede2; color: #2c5772; }
/* Login: cartão branco com linha coral no topo */
.admin-body[data-theme="idrepair"] .login-box { background: #ffffff; box-shadow: 0 24px 60px -30px rgba(29,43,53,.45); }
.admin-body[data-theme="idrepair"] .login-box::before { background: #f27243; }

/* ================= Efeitos visuais (todos os temas, só com tokens --a-*) ================= */
:root { --a-curva: cubic-bezier(.22, .61, .36, 1); }

/* Fundo ambiente: duas manchas de luz desfocadas + grelha subtil, fixas atrás de tudo. */
.admin-ambiente { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.admin-ambiente .amb { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.admin-ambiente .a1 { width: 620px; height: 620px; top: -220px; left: -160px; background: radial-gradient(circle, color-mix(in srgb, var(--a-accent) 38%, transparent), transparent 70%); animation: a-deriva1 24s ease-in-out infinite alternate; }
.admin-ambiente .a2 { width: 520px; height: 520px; bottom: -240px; right: -140px; background: radial-gradient(circle, color-mix(in srgb, var(--a-glow-2, var(--a-info)) 30%, transparent), transparent 70%); animation: a-deriva2 28s ease-in-out infinite alternate; }
.admin-ambiente .amb-grelha { position: absolute; inset: 0; background-image: linear-gradient(color-mix(in srgb, var(--a-ink) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--a-ink) 5%, transparent) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 60% 50% at 30% 10%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse 60% 50% at 30% 10%, #000 10%, transparent 70%); }
@keyframes a-deriva1 { to { transform: translate(140px, 90px) scale(1.12); } }
@keyframes a-deriva2 { to { transform: translate(-160px, -70px) scale(1.1); } }
.admin-shell { position: relative; z-index: 1; }
.admin-body .admin-main { background: transparent; }
.admin-body .login-shell { position: relative; z-index: 1; background: transparent; }

/* Barra de topo e menu lateral em "vidro". */
.admin-body .admin-topbar { background: color-mix(in srgb, var(--a-surface) 72%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom-color: color-mix(in srgb, var(--a-border) 70%, transparent); }
.admin-body .admin-sidebar { background: color-mix(in srgb, var(--a-surface) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.admin-body .topbar-tabs a.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a-accent) 35%, transparent); }

/* Entrada suave das páginas: cada bloco do conteúdo aparece em cascata.
   fill-mode "backwards" (e não "both") para não deixar transformações depois de acabar,
   assim menus/dropdowns dentro do conteúdo nunca ficam tapados. */
.admin-content > * { animation: a-entra .55s var(--a-curva) backwards; }
.admin-content > *:nth-child(2) { animation-delay: .05s; }
.admin-content > *:nth-child(3) { animation-delay: .1s; }
.admin-content > *:nth-child(4) { animation-delay: .15s; }
.admin-content > *:nth-child(5) { animation-delay: .2s; }
.admin-content > *:nth-child(n+6) { animation-delay: .25s; }
.stat-grid > * { animation: a-entra .55s var(--a-curva) backwards; }
.stat-grid > *:nth-child(2) { animation-delay: .06s; }
.stat-grid > *:nth-child(3) { animation-delay: .12s; }
.stat-grid > *:nth-child(4) { animation-delay: .18s; }
.stat-grid > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes a-entra { from { opacity: 0; transform: translateY(14px); } }
.admin-body .flash { animation: a-entra .4s var(--a-curva) backwards; }

.admin-body h1 { letter-spacing: -0.03em; }
.admin-body h2 { letter-spacing: -0.02em; }

/* Cartões de estatística: vidro, linha de luz no topo, elevação e foco de luz que segue o rato. */
.admin-body .stat-card, .admin-body .goal-card { position: relative; overflow: hidden; isolation: isolate; border-top: 1px solid var(--a-border); background: linear-gradient(160deg, color-mix(in srgb, var(--a-surface-2) 70%, var(--a-surface)) 0%, var(--a-surface) 60%); box-shadow: 0 1px 0 color-mix(in srgb, var(--a-ink) 6%, transparent) inset, 0 12px 30px -18px rgba(0, 0, 0, .45); transition: transform .3s var(--a-curva), box-shadow .3s var(--a-curva), border-color .3s; }
.admin-body .stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--a-accent), color-mix(in srgb, var(--a-accent) 10%, transparent)); }
.admin-body .stat-card.stat-positive::before { background: linear-gradient(90deg, var(--a-good), color-mix(in srgb, var(--a-good) 10%, transparent)); }
.admin-body .stat-card.stat-negative::before { background: linear-gradient(90deg, var(--a-bad), color-mix(in srgb, var(--a-bad) 10%, transparent)); }
.admin-body .stat-card::after, .admin-body .goal-card::after, .admin-body .dash-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--a-accent) 16%, transparent), transparent 50%); pointer-events: none; }
.admin-body .stat-card:hover::after, .admin-body .goal-card:hover::after, .admin-body .dash-hero:hover::after { opacity: 1; }
.admin-body .stat-card:hover, .admin-body .goal-card:hover, .admin-body .stat-card.stat-positive:hover, .admin-body .stat-card.stat-negative:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--a-accent) 40%, var(--a-border)); box-shadow: 0 1px 0 color-mix(in srgb, var(--a-ink) 6%, transparent) inset, 0 20px 40px -20px color-mix(in srgb, var(--a-accent) 45%, rgba(0, 0, 0, .5)); }
.admin-body a.stat-card { color: inherit; text-decoration: none; }
.admin-body .stat-value { font-size: 1.75rem; }

/* Anéis dos objetivos: enchem com animação (ver JS) e têm um leve brilho. */
.admin-body .goal-ring-fill { transition: stroke-dashoffset 1.3s var(--a-curva); }
.admin-body .goal-ring-publicacoes { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--a-accent) 55%, transparent)); }
.admin-body .goal-ring-lucro { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--a-good) 55%, transparent)); }

/* Faixa de boas-vindas do dashboard */
.admin-body .dash-hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 28px; margin: 0 0 8px; border-radius: 18px; border: 1px solid var(--a-border); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--a-accent) 22%, var(--a-surface)) 0%, var(--a-surface) 55%); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .6); }
.admin-body .dash-hero::before { content: ""; position: absolute; width: 320px; height: 320px; right: -90px; top: -150px; border-radius: 50%; z-index: -1; background: radial-gradient(circle, color-mix(in srgb, var(--a-glow-2, var(--a-info)) 30%, transparent), transparent 70%); filter: blur(10px); }
.admin-body .dash-hero h1 { margin: 2px 0 8px; font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.admin-body .dash-data { margin: 0; font-family: "IBM Plex Mono", monospace; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--a-muted); }
.admin-body .dash-resumo { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; color: var(--a-muted); font-size: .92rem; }
.admin-body .dash-resumo span { padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--a-surface-2) 80%, transparent); border: 1px solid var(--a-border); }
.admin-body .dash-resumo b { color: var(--a-ink); font-family: "IBM Plex Mono", monospace; }
.admin-body .dash-acoes { display: flex; gap: 10px; flex-wrap: wrap; }

/* Botões: reflexo ao passar o rato e brilho na cor do tema. */
.admin-body .btn { position: relative; overflow: hidden; isolation: isolate; border-radius: 999px; padding-left: 20px; padding-right: 20px; }
.admin-body .btn-sm { padding-left: 14px; padding-right: 14px; }
.admin-body .btn-primary { box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--a-cta, var(--a-accent)) 85%, transparent); }
.admin-body .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--a-cta, var(--a-accent)) 90%, transparent); }
.admin-body .btn-primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--a-curva); }
.admin-body .btn-primary:hover::after { transform: translateX(120%); }

/* Tabelas: cantos arredondados e linha de destaque à esquerda ao passar o rato. */
.admin-body .table { border-collapse: separate; border-spacing: 0; box-shadow: 0 12px 30px -20px rgba(0, 0, 0, .45); }
.admin-body .table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--a-accent); }
.admin-body .table tr:last-child td { border-bottom: none; }

/* Estados com um ponto colorido antes do texto. */
.admin-body .badge[class*="badge-"]::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 6px currentColor; }

/* Login */
.admin-body .login-box { position: relative; overflow: hidden; border-radius: 20px; padding: 40px 36px; background: color-mix(in srgb, var(--a-surface) 78%, transparent); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7), 0 1px 0 color-mix(in srgb, var(--a-ink) 8%, transparent) inset; animation: a-entra .6s var(--a-curva) backwards; }
.admin-body .login-box::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--a-accent), var(--a-glow-2, var(--a-info)), transparent); }
.admin-body .login-logo { width: 52px; height: 52px; border-radius: 14px; background: #fff; object-fit: contain; box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--a-accent) 70%, transparent); }
.admin-body .login-box h1 { margin: 4px 0 0; }
.admin-body .login-sub { margin: -8px 0 4px; font-size: .92rem; }
.admin-body .login-box .btn { width: 100%; min-height: 46px; margin-top: 4px; }

@media (max-width: 720px) {
  .admin-body .dash-hero { padding: 20px; }
  .admin-body .dash-acoes { width: 100%; }
  .admin-body .dash-acoes .btn { flex: 1; }
}

/* Telemóvel: pesquisa com espaço, nome da conta encurtado, botões da faixa sem partir linha. */
@media (max-width: 720px) {
  .admin-topbar { gap: 8px; }
  .topbar-search { flex: 1; min-width: 0; }
  .topbar-right .topbar-btn { max-width: 96px; padding: 7px 8px; }
  .admin-body .dash-acoes .btn { white-space: nowrap; padding-left: 14px; padding-right: 14px; }
}

/* Campo "chave de acesso" em Conteúdo do site */
.campo-chave { display: flex; gap: 8px; align-items: center; }
.campo-chave input { flex: 1; min-width: 0; font-family: "IBM Plex Mono", monospace; }
.campo-ajuda { margin: -6px 0 4px; font-size: .85rem; overflow-wrap: anywhere; }
