/* Ajustes sobre Bootstrap 5 — tema e barra lateral */
:root {
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-bg: #f3f4f6;
    --bs-primary: #1f5fc4; --bs-primary-rgb: 31, 95, 196;
    --bs-link-color: #2457c5; --bs-link-hover-color: #1b449c;
    --bs-border-radius: .5rem;
    --side: #16233f;
}
body { -webkit-font-smoothing: antialiased; }
.btn-primary { --bs-btn-bg: #2457c5; --bs-btn-border-color: #2457c5; --bs-btn-hover-bg: #1b449c; --bs-btn-hover-border-color: #1b449c; --bs-btn-active-bg: #163a85; --bs-btn-active-border-color: #163a85; }
.card { border: 1px solid #e6e9f0; border-radius: .75rem; }
.card.shadow-sm { box-shadow: 0 1px 2px rgba(16,24,40,.05) !important; }
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.table-light { --bs-table-bg: #f8f9fc; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7686; font-weight: 600; border-bottom-color: #e6e9f0; }
code { color: #1c2430; background: #eef1f6; padding: .1rem .4rem; border-radius: 4px; }
.detalhe > dt, .detalhe > dd { padding: .85rem 1.1rem; margin: 0; border-bottom: 1px solid #eef0f5; }
.detalhe > dt { color: #6b7686; font-weight: 500; background: #f8f9fc; }
.detalhe > dt:nth-last-of-type(1), .detalhe > dd:nth-last-of-type(1) { border-bottom: 0; }
.form-card { max-width: 680px; }
.form-label { font-size: .88rem; }

/* estrutura com barra lateral */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 244px; flex-shrink: 0; background: var(--side); color: #b9c3d6; display: flex; flex-direction: column; padding: 1.25rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .marca { display: flex; align-items: center; gap: .55rem; color: #fff; font-weight: 700; font-size: 1.15rem; padding: .25rem .75rem 1.25rem; text-decoration: none; }
.sidebar .marca img { width: 100%; max-width: 200px; height: auto; display: block; }
.sidebar nav { flex: 1; gap: 2px; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: #e6ebf5; padding: .6rem .75rem; border-radius: .5rem; font-weight: 500; }
.sidebar .nav-link i { display: none; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active { background: #1f5fc4; color: #fff; }
.sidebar hr { border-color: rgba(255,255,255,.15); margin: .6rem .5rem; opacity: 1; }
.sidebar .utilizador .btn { border-color: rgba(255,255,255,.45); }
.sidebar .utilizador { margin-top: auto; position: sticky; bottom: 0; background: var(--side); border-top: 1px solid rgba(255,255,255,.12); padding: 1rem .5rem 0; color: #fff; font-size: .88rem; }
.sidebar .utilizador small { color: #9aa7bd; }
.conteudo { flex: 1; min-width: 0; max-width: 1180px; margin: 0; padding: 2rem 2.25rem 3rem; }

/* cartões do painel */
.cartao { transition: box-shadow .15s, transform .15s; }
.cartao:hover { border-color: #c9d3e6; }
.kpi .n { font-size: 2rem; font-weight: 700; line-height: 1.1; color: #1c2430; } .kpi.alerta { background: #fff5f5; border-color: #f1b5b5; } .kpi.alerta .n { color: #c0281f; }
.badge.pilula { border-radius: 999px; font-weight: 600; font-size: .75rem; padding: .3em .7em; }

/* login / erro */
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: linear-gradient(160deg, #14213d 0%, #1f3a6e 100%); padding: 1rem; }
.logo-auth { width: 100%; max-width: 260px; height: auto; }
.auth-card { width: 100%; max-width: 420px; flex: 0 1 420px; margin: 0 auto; border-radius: 1rem; }

@media (max-width: 800px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; padding: .75rem; }
    .sidebar nav { flex-direction: row !important; flex-wrap: wrap; flex: none; }
    .sidebar hr { display: none; }
    .sidebar .utilizador { margin-top: .5rem; }
    .conteudo { padding: 1.25rem 1rem 2rem; }
}
.pesquisa { min-width: 220px; }
.col-campo { width: 24%; }
.campo-motivo { width: 280px; }
