:root {
  --as-navy: #0f2942;
  --as-navy-2: #16385a;
  --as-accent: #10b981;
  --as-accent-dark: #0e9f74;
  --as-bg: #f1f5f9;
  --as-border: #e2e8f0;
  --as-text: #1e293b;
  --as-muted: #64748b;
}

body {
  background-color: var(--as-bg);
  color: var(--as-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Layout com sidebar */
.as-layout { display: flex; min-height: 100vh; }

.as-sidebar {
  width: 260px;
  background: var(--as-navy);
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.as-brand {
  padding: 1.25rem 1.25rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .55rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.as-brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--as-accent); }
.as-nav { padding: .75rem; overflow-y: auto; flex: 1; }
.as-nav a {
  display: flex; align-items: center; gap: .65rem;
  color: #cbd5e1; text-decoration: none;
  padding: .65rem .85rem; border-radius: .5rem;
  font-size: .93rem; margin-bottom: .15rem;
  transition: background .15s, color .15s;
}
.as-nav a:hover { background: var(--as-navy-2); color: #fff; }
.as-nav a.active { background: var(--as-accent); color: #04231a; font-weight: 600; }
.as-nav .as-nav-sec {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: #64748b; padding: .9rem .85rem .35rem;
}
.as-sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; }

.as-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.as-topbar {
  background: #fff; border-bottom: 1px solid var(--as-border);
  padding: .85rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.as-content { padding: 1.5rem; flex: 1; }

.as-badge-perfil { font-size: .72rem; letter-spacing: .03em; }

/* Cards de metricas */
.as-stat { border: 1px solid var(--as-border); border-radius: .75rem; background: #fff; }
.as-stat .valor { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.as-stat .rotulo { color: var(--as-muted); font-size: .85rem; }
.as-stat .icone {
  width: 48px; height: 48px; border-radius: .65rem;
  display: flex; align-items: center; justify-content: center;
}

.btn-accent { background: var(--as-accent); border-color: var(--as-accent); color: #04231a; font-weight: 600; }
.btn-accent:hover { background: var(--as-accent-dark); border-color: var(--as-accent-dark); color: #04231a; }

.card { border: 1px solid var(--as-border); border-radius: .75rem; }
.table > :not(caption) > * > * { padding: .7rem .75rem; }

/* ============================================================
   Auth / Login
   ============================================================ */
.as-auth-body { background: var(--as-bg); }
.as-auth { min-height: 100vh; display: flex; }

/* Painel institucional (esquerda) */
.as-auth-side {
  flex: 1 1 55%;
  position: relative;
  overflow: hidden;
  color: #e2e8f0;
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(16,185,129,.18), transparent 55%),
    radial-gradient(900px 500px at 120% 120%, rgba(16,185,129,.10), transparent 50%),
    linear-gradient(155deg, #0b2136 0%, var(--as-navy) 45%, var(--as-navy-2) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 3.5rem;
}
/* textura sutil de grade */
.as-auth-side::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 40%, #000 0%, transparent 75%);
}
.as-auth-side-inner { position: relative; max-width: 480px; z-index: 1; }

.as-auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 2.25rem; }
.as-auth-logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--as-accent); color: #04231a; font-size: 1.25rem;
  box-shadow: 0 6px 18px rgba(16,185,129,.35);
}
.as-auth-brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }

.as-auth-title {
  font-size: clamp(1.7rem, 2.5vw, 2.35rem); font-weight: 800; line-height: 1.15;
  letter-spacing: -.02em; color: #fff; margin-bottom: 1rem; text-wrap: balance;
}
.as-auth-lead { font-size: 1.02rem; line-height: 1.65; color: rgba(226,232,240,.82); margin-bottom: 2rem; }

.as-auth-feats { display: grid; gap: .85rem; margin: 0 0 2.25rem; }
.as-auth-feats li { display: flex; align-items: flex-start; gap: .75rem; font-size: .96rem; color: rgba(226,232,240,.92); }
.as-auth-feats li i {
  color: var(--as-accent); font-size: 1.15rem; line-height: 1.4; flex-shrink: 0;
}
.as-auth-trust {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .85rem; color: rgba(226,232,240,.7);
  padding: .6rem .9rem; border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; background: rgba(255,255,255,.04);
}
.as-auth-trust i { color: var(--as-accent); }

/* Coluna do formulario (direita) */
.as-auth-form {
  flex: 1 1 45%;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.25rem;
}
.as-auth-card { width: 100%; max-width: 400px; }

.as-auth-brand--mobile { justify-content: center; margin-bottom: 1.75rem; }
.as-auth-brand--mobile .as-auth-brand-name { color: var(--as-navy); }

.as-auth-heading { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--as-text); margin-bottom: .25rem; }
.as-auth-sub { color: var(--as-muted); margin-bottom: 1.5rem; }

.as-auth .form-label { font-weight: 600; font-size: .9rem; color: #334155; }
.as-input .input-group-text { background: #fff; border-right: 0; color: var(--as-muted); }
.as-input .form-control { border-left: 0; padding-left: 0; }
.as-input .form-control:focus { box-shadow: none; border-color: var(--as-border); }
.as-input:focus-within {
  border-radius: .5rem;
  box-shadow: 0 0 0 .2rem rgba(16,185,129,.18);
}
.as-input:focus-within .input-group-text,
.as-input:focus-within .form-control,
.as-input:focus-within .btn { border-color: var(--as-accent); }
.as-input .form-control, .as-input .input-group-text, .as-input .btn { padding-top: .6rem; padding-bottom: .6rem; }

.as-auth-demo {
  background: #f8fafc; border: 1px dashed var(--as-border);
  border-radius: .65rem; padding: .85rem 1rem; color: #475569;
}
.as-auth-foot { margin: 1.75rem 0 0; text-align: center; font-size: .8rem; color: var(--as-muted); }

@media (max-width: 991.98px) {
  .as-auth-form { padding: 2.5rem 1.25rem; }
}

/* Trilha de auditoria */
.as-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.as-timeline::before {
  content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--as-border);
}
.as-timeline li { position: relative; padding: 0 0 1.1rem 2.1rem; }
.as-timeline li .ponto {
  position: absolute; left: 4px; top: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--as-accent); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--as-border);
}
.hash-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem; word-break: break-all; color: var(--as-muted); }

@media (max-width: 991.98px) {
  .as-sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .25s; }
  .as-sidebar.aberta { left: 0; }
  .as-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1040; }
  .as-overlay.ativa { display: block; }
}
