/* Void CRM — estilos base (autenticação + aplicação) */
:root {
  --bg: #07060c; --surface: #100f18; --surface-2: #16151f; --line: rgba(255,255,255,.09);
  --ink: #f2f1f7; --muted: #a6a3b5; --accent: #ff2d55; --accent-ink: #fff;
  --radius: 14px; --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --font-head: Syne, var(--font);
}
* { min-width: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15.5px; overflow-x: clip; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn, .form-control, .form-select { min-height: 44px; }
.form-control, .form-select, .input-group-text { background-color: #0b0a12; border-color: rgba(255,255,255,.15); color: var(--ink); font-size: 16px; }
.form-control:focus { background-color: #0d0c15; border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(255,45,85,.2); color: var(--ink); }
.btn-accent { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: var(--accent-ink);
  --bs-btn-hover-bg: #ff4d6d; --bs-btn-hover-border-color: #ff4d6d; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #e0244a; --bs-btn-active-border-color: #e0244a; --bs-btn-disabled-bg: var(--accent); font-weight: 600; }
.card { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.badge-soft { display: inline-flex; gap: .35rem; align-items: center; padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: .85rem; color: var(--ink); }

/* Céu estrelado (fundo das páginas de autenticação) */
.starfield { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background:
    radial-gradient(1px 1px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 140px 90px, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 260px 170px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 330px 40px, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 80px 220px, rgba(255,255,255,.7) 50%, transparent 51%);
  background-size: 360px 300px; }
.starfield::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(55% 45% at 80% 0%, rgba(255,45,85,.22), transparent 70%), radial-gradient(50% 40% at 0% 100%, rgba(90,60,200,.18), transparent 70%); }

/* Páginas de autenticação */
.auth-page { min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; letter-spacing: .02em; }
.auth-card { width: min(420px, 100%); background: rgba(16,15,24,.9); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 5vw, 34px); backdrop-filter: blur(8px); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.auth-title { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; margin: 0 0 18px; }
.auth-text { color: var(--muted); }
.auth-link { color: var(--muted); text-align: center; text-decoration: none; padding: 8px; }
.auth-link:hover { color: var(--ink); }
.auth-foot { color: var(--muted); font-size: .8rem; margin-top: 20px; }
.pass-meter { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.pass-meter span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* Aplicação */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: 0 0 264px; background: #0b0a12; border-right: 1px solid var(--line); }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar-inner { display: flex; flex-direction: column; min-height: 100%; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; padding: 4px 10px 20px; }
.side-title { font-size: .75rem; color: #7f7c90; margin: 18px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; color: #d8d6e2; text-decoration: none; padding: 10px 12px; border-radius: 10px; background: none; border: 0; text-align: left; min-height: 44px; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active { background: rgba(255,45,85,.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.user-chip { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.user-chip-text strong, .user-chip-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { color: var(--muted); }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,45,85,.18); color: #fff; font-weight: 600; font-size: .9rem; }
.avatar-sm { width: 32px; height: 32px; flex-basis: 32px; font-size: .8rem; }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: #0b0a12; border-bottom: 1px solid var(--line); }
.topbar-title { font-family: var(--font-head); font-weight: 800; }
.content { flex: 1; min-width: 0; padding: clamp(14px, 3vw, 32px); }
.content:focus { outline: none; }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
/* No desktop o cartão do módulo ocupa pelo menos o ecrã inteiro */
.module-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(16px, 3vw, 30px); }
@media (min-width: 992px) { .module-card { min-height: calc(100vh - 64px); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2rem); margin: 0 0 4px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; height: 100%; }
a.stat:hover { border-color: var(--accent); }
.stat-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: rgba(255,45,85,.14); color: var(--accent); }
.stat-l { display: block; color: var(--muted); font-size: .85rem; }
.stat-v { display: block; font-weight: 600; }
.table { --bs-table-bg: transparent; }
.table thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
@media (max-width: 575.98px) { .table { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
