/* =====================================================================
   Tema AUDITORIA — layout estilo "eCoursie" recolorido em ROSA + CINZA
   (fundo degradê · moldura arredondada · sidebar rosa sólida · painel direito)
   Lembrete de nomenclatura: :root = MODO ESCURO | [data-theme="dark"] = MODO CLARO
   ===================================================================== */
/* IMPORTANTE: tema escopado em .aud-shell — NÃO vaza cor/estilo pro RH/login/sistema. */
.aud-shell                     { --accent:#E5398A; --accent-hover:#C42B72; --aud-pink-soft:rgba(229,57,138,.14); }
[data-theme="dark"] .aud-shell { --accent:#E5398A; --accent-hover:#C42B72; --aud-pink-soft:rgba(229,57,138,.10); }

/* ---- Página: fundo em degradê (margem fina) ---- */
.aud-shell { min-height:100vh; padding:10px; background:linear-gradient(150deg,#120A16 0%,#0E1525 100%); }
[data-theme="dark"] .aud-shell { background:linear-gradient(135deg,#FCE7F3 0%,#F4F1FA 45%,#FDF2F8 100%); }

/* ---- Moldura branca arredondada (a "placa" do app) — grande ---- */
.aud-frame { display:flex; max-width:1640px; margin:0 auto; width:100%; min-height:calc(100vh - 20px);
  background:var(--bg-card); border:1px solid var(--border-color); border-radius:24px; overflow:hidden;
  box-shadow:0 24px 70px rgba(0,0,0,.16); }

/* wrapper estica a sidebar até o rodapé (pink full-height) */
.aud-side-wrap { display:flex; }

/* ---- Sidebar rosa sólida ---- */
.aud-side { width:240px; flex-shrink:0; background:linear-gradient(180deg,#E5398A 0%,#B81E63 100%);
  display:flex; flex-direction:column; padding:24px 16px; color:#fff; }
.aud-brand { display:flex; align-items:center; gap:10px; padding:4px 8px 22px; }
.aud-brand-ic { width:38px; height:38px; border-radius:11px; background:rgba(255,255,255,.20); color:#fff; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.aud-brand-t { font-family:var(--font-display); font-weight:800; font-size:15px; line-height:1.15; color:#fff; }
.aud-brand-s { font-size:11px; color:rgba(255,255,255,.72); }
.aud-nav { display:flex; flex-direction:column; gap:6px; flex:1; margin-top:6px; }
.aud-navitem { display:flex; align-items:center; gap:13px; padding:12px 14px; border-radius:13px; border:none; background:transparent; color:rgba(255,255,255,.84); font-weight:600; font-size:14px; cursor:pointer; transition:all .16s ease; text-align:left; width:100%; font-family:var(--font-body); }
.aud-navitem:hover { background:rgba(255,255,255,.15); color:#fff; }
.aud-navitem.active { background:#fff; color:#C42B72; box-shadow:0 8px 18px rgba(0,0,0,.18); }
.aud-navitem i { width:18px; text-align:center; font-size:15px; }
.aud-side-foot { border-top:1px solid rgba(255,255,255,.22); padding-top:14px; display:flex; flex-direction:column; gap:12px; }
.aud-user { display:flex; align-items:center; gap:10px; }
.aud-avatar { width:36px; height:36px; border-radius:50%; background:rgba(255,255,255,.22); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; text-transform:uppercase; flex-shrink:0; }
.aud-user-n { font-size:13px; font-weight:700; color:#fff; }
.aud-user-r { font-size:11px; color:rgba(255,255,255,.72); text-transform:capitalize; }
.aud-side .aud-iconbtn { background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.28); color:#fff; }
.aud-side .aud-iconbtn:hover { background:rgba(255,255,255,.28); }

/* ---- Área principal (branca) com glow suave ---- */
.aud-main { flex:1; min-width:0; padding:26px 32px; position:relative; }
.aud-main::before { content:""; position:absolute; top:-70px; right:-50px; width:360px; height:360px; border-radius:50%; background:radial-gradient(circle, rgba(229,57,138,.18), rgba(229,57,138,0) 70%); pointer-events:none; z-index:0; }
.aud-main::after { content:""; position:absolute; bottom:-90px; left:8%; width:320px; height:320px; border-radius:50%; background:radial-gradient(circle, rgba(229,57,138,.10), rgba(229,57,138,0) 70%); pointer-events:none; z-index:0; }
.aud-main > * { position:relative; z-index:1; }

/* ---- Ícones utilitários ---- */
.aud-iconbtn { width:38px; height:38px; border-radius:11px; border:1px solid var(--border-color); background:var(--bg-card); color:var(--text-muted); cursor:pointer; transition:.15s; display:inline-flex; align-items:center; justify-content:center; }
.aud-iconbtn:hover { color:var(--accent); border-color:var(--accent); }

/* ---- Header da página (título grande + busca/sino) ---- */
.aud-pagehead { display:flex; align-items:center; gap:14px; margin-bottom:20px; }
.aud-pagehead h1 { font-family:var(--font-display); font-size:26px; font-weight:800; color:var(--text-main); margin:0; }
.aud-pagehead .sp { flex:1; }

/* ---- Pílulas de filtro ---- */
.aud-pill { display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border-radius:999px; border:1px solid var(--border-color); background:var(--bg-hover); color:var(--text-main); font-size:13px; font-weight:600; cursor:pointer; }
.aud-pill select { border:none; background:transparent; color:inherit; font:inherit; outline:none; cursor:pointer; }

/* ---- Abas (pílulas) ---- */
.aud-tab { transition:all .16s ease; }
.aud-tab:hover:not(.active) { border-color:var(--accent) !important; color:var(--accent) !important; }
.aud-tab.active { background:#E5398A !important; color:#fff !important; border-color:#E5398A !important; box-shadow:0 6px 14px rgba(229,57,138,.30); }

/* ---- Cards ---- */
.aud-shell .dash-card { border-radius:18px !important; box-shadow:0 2px 10px rgba(16,24,40,.05) !important; border:1px solid var(--border-color) !important; }
.aud-card-soft { border-radius:18px; padding:16px 18px; background:var(--aud-pink-soft); border:1px solid var(--border-color); }
/* borda fina rosa (tela Auditar) */
.aud-card-pink { border:1px solid rgba(229,57,138,.40) !important; box-shadow:0 2px 14px rgba(229,57,138,.08) !important; }
.aud-card-pink .aud-crit { border-top-color:rgba(229,57,138,.16); }
/* segurança contra overflow no mobile */
.aud-main, .aud-main > * { max-width:100%; }
.aud-dash-grid > div { min-width:0; }
canvas { max-width:100% !important; }

/* ---- KPI premium ---- */
.aud-kpi { position:relative; background:var(--bg-card); border:1px solid var(--border-color); border-radius:18px; padding:16px 18px; overflow:hidden; box-shadow:var(--shadow-card); transition:transform .2s ease, box-shadow .2s ease; }
.aud-kpi:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(229,57,138,.14); }
.aud-kpi::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; background:linear-gradient(90deg,#E5398A,#C42B72); }
.aud-kpi .k-top { display:flex; align-items:center; gap:10px; }
.aud-kpi .k-ic { width:32px; height:32px; border-radius:9px; background:var(--aud-pink-soft); color:#E5398A; display:inline-flex; align-items:center; justify-content:center; font-size:15px; flex-shrink:0; }
.aud-kpi .k-label { font-size:12px; color:var(--text-muted); font-weight:600; }
.aud-kpi .k-val { font-size:28px; font-weight:800; color:var(--text-main); margin-top:8px; font-family:var(--font-display); line-height:1; }

/* ---- Painel direito (estilo "online users") ---- */
.aud-rail { display:flex; flex-direction:column; gap:14px; }
.aud-railcard { background:var(--bg-card); border:1px solid var(--border-color); border-radius:18px; padding:16px; }
.aud-rail-item { display:flex; align-items:center; gap:10px; padding:8px 0; }
.aud-rail-item .av { width:34px; height:34px; border-radius:50%; background:var(--aud-pink-soft); color:var(--accent); display:flex; align-items:center; justify-content:center; font-weight:800; flex-shrink:0; }
.aud-dash-grid { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:18px; align-items:start; }
@media (max-width:980px){ .aud-dash-grid { grid-template-columns:1fr; } }

/* ---- Botões ---- */
.aud-shell .btn-primary-rh {
  background:linear-gradient(135deg,#E5398A,#C42B72) !important; box-shadow:0 4px 14px rgba(229,57,138,.30) !important; color:#fff !important; border:none !important; border-radius:12px !important; transition:transform .15s ease, box-shadow .2s ease !important; }
.aud-shell .btn-primary-rh:hover { transform:translateY(-1px); box-shadow:0 6px 18px rgba(229,57,138,.40) !important; }
.aud-shell .btn-secondary-rh { border-radius:12px !important; }
/* (override global de .login-btn removido — o botão de login volta ao preto #0F172A do tema base) */

/* ---- Tabelas ---- */
.aud-shell .emp-table { border-radius:14px; overflow:hidden; }
.aud-shell .emp-table-header { text-transform:uppercase; letter-spacing:.7px; font-size:11px !important; font-weight:700 !important; color:var(--text-muted) !important; }
.aud-shell .emp-row { transition:background .16s ease, box-shadow .16s ease; }
.aud-shell .emp-row:hover { background:var(--aud-pink-soft) !important; box-shadow:inset 3px 0 0 var(--accent); }

/* ---- Foco / inputs (só na área de auditoria) ---- */
.aud-shell .btn-primary-rh:focus-visible, .aud-shell .aud-tab:focus-visible, .aud-shell .aud-navitem:focus-visible, .aud-shell input:focus-visible, .aud-shell select:focus-visible, .aud-shell textarea:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.aud-shell input:focus, .aud-shell select:focus, .aud-shell textarea:focus { border-color:var(--accent) !important; box-shadow:0 0 0 3px var(--aud-pink-soft) !important; }

/* ---- Tela AUDITAR: critérios touch-friendly ---- */
.aud-crit { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:12px 16px; border-top:1px solid var(--border-light); }
.aud-crit-label { order:1; flex:1 1 auto; min-width:130px; font-size:15px; color:var(--text-main); }
.aud-crit-ctrl { order:2; flex:0 0 auto; }
.aud-crit-nota { order:3; flex:0 0 auto; min-width:40px; text-align:right; font-weight:800; font-size:16px; }
.aud-peso { font-size:10px; color:var(--accent); border:1px solid var(--accent); border-radius:10px; padding:1px 6px; margin-left:6px; }
.aud-notes, .aud-qe { display:flex; gap:6px; }
.aud-notebtn { min-width:42px; min-height:44px; padding:0 10px; font-size:14px; font-weight:700; border-radius:10px; cursor:pointer; border:1px solid rgba(229,57,138,.30); background:var(--bg-card); color:var(--text-main); transition:.12s; }
.aud-notebtn:hover { border-color:var(--accent); }
.aud-notebtn.on { background:linear-gradient(135deg,#E5398A,#C42B72); color:#fff; border-color:transparent; box-shadow:0 4px 10px rgba(229,57,138,.3); }
.aud-notebtn.sn.on { background:var(--text-muted); box-shadow:none; }
.aud-qin { min-height:44px; width:88px; }
@media (max-width:680px){
  .aud-crit-nota { order:2; }
  .aud-crit-ctrl { order:3; flex:1 0 100%; }
  .aud-notes, .aud-qe { width:100%; }
  .aud-notebtn, .aud-qin { flex:1; min-width:0; }
  input, select, textarea { font-size:16px !important; }   /* evita zoom no iOS */
}

/* ---- Listas em CARDS no celular ---- */
.aud-mlist { display:flex; flex-direction:column; gap:10px; padding:14px; }
.aud-mcard { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid var(--border-color); border-radius:14px; background:var(--bg-card); cursor:pointer; transition:.15s; }
.aud-mcard:active { background:var(--aud-pink-soft); transform:scale(.99); }
.aud-mcard-main { flex:1; min-width:0; }
.aud-mcard-title { font-size:15px; font-weight:700; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aud-mcard-sub { font-size:12px; color:var(--text-muted); margin-top:3px; }
.aud-mcard-nota { font-size:21px; font-weight:800; flex-shrink:0; }

/* ---- Popup em tela cheia no celular ---- */
@media (max-width:680px){
  .aud-modal { width:100% !important; max-width:100% !important; height:100% !important; max-height:100% !important; border-radius:0 !important; }
  .aud-modal-overlay { padding:0 !important; }
}

/* ---- Login no mesmo estilo do sistema ---- */
.aud-login { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; background:linear-gradient(150deg,#120A16 0%,#0E1525 100%); }
[data-theme="dark"] .aud-login { background:linear-gradient(135deg,#FCE7F3 0%,#F4F1FA 45%,#FDF2F8 100%); }
.aud-login-card { position:relative; width:100%; max-width:410px; background:var(--bg-card); border:1px solid var(--border-color); border-radius:24px; box-shadow:0 24px 70px rgba(0,0,0,.20); padding:40px 34px; text-align:center; overflow:hidden; }
.aud-login-card::before { content:""; position:absolute; top:-70px; left:50%; transform:translateX(-50%); width:260px; height:260px; border-radius:50%; background:radial-gradient(circle, rgba(229,57,138,.20), transparent 70%); pointer-events:none; }
.aud-login-chip { position:relative; width:66px; height:66px; border-radius:19px; background:linear-gradient(135deg,#E5398A,#C42B72); color:#fff; display:flex; align-items:center; justify-content:center; font-size:30px; margin:0 auto 18px; box-shadow:0 12px 26px rgba(229,57,138,.38); }
.aud-login h1 { position:relative; font-family:var(--font-display); font-size:24px; font-weight:800; color:var(--text-main); margin:0 0 4px; }
.aud-login .sub { position:relative; font-size:13px; color:var(--text-muted); margin:0 0 26px; }
.aud-login .input-group input { border:1px solid rgba(229,57,138,.28) !important; border-radius:11px !important; }
.aud-login-foot { position:relative; margin-top:22px; font-size:12px; color:var(--text-muted); }

/* ---- Mobile ---- */
.aud-topbar { display:none; }
@media (max-width:980px){
  html, body { overflow-x:hidden; max-width:100%; }
  .aud-shell { padding:0; }
  .aud-frame { border-radius:0; min-height:100vh; box-shadow:none; border:none; }
  .aud-topbar { display:flex; align-items:center; gap:12px; padding:12px 16px; background:var(--bg-card); border-bottom:1px solid var(--border-color); position:sticky; top:0; z-index:100; box-shadow:0 3px 16px rgba(0,0,0,.08); }
  .aud-topbar .greet { font-family:var(--font-display); font-weight:700; color:var(--text-main); font-size:15px; line-height:1.1; }
  .aud-topbar .greet small { display:block; font-size:11px; color:var(--text-muted); font-weight:500; }
  .aud-side-wrap .aud-side { position:fixed; left:0; top:0; z-index:200; height:100vh; transform:translateX(-100%); transition:transform .25s ease; }
  .aud-side-wrap.open .aud-side { transform:translateX(0); box-shadow:0 0 50px rgba(0,0,0,.4); }
  .aud-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:150; }
  .aud-main { padding:18px 14px; }
}
@media (max-width:640px){
  .aud-pagehead h1 { font-size:21px; }
  .aud-kpi .k-val { font-size:24px; }
}
