/* =========================================================================
   Portal de Integridade · Rumo
   styles.css — redesign (Opção A em todas as telas)
   Mantém TODAS as classes e seletores usados por public/app.js e .ejs.
   ========================================================================= */

/* ----------------- Tokens ----------------- */
:root {
  --rumo-navy:    #003865;
  --rumo-navy-2:  #0a4a7e;
  --rumo-navy-3:  #e6eef5;
  --rumo-cyan:    #32A6E6;
  --rumo-cyan-2:  #e8f5fd;
  --rumo-green:   #1E9F7F;
  --rumo-green-2: #e6f6f1;
  --rumo-lime:    #7FE06C;
  --rumo-purple:  #9F4BB9;
  --rumo-purple-2:#f4ecf8;

  --ink:    #0B1F33;
  --ink-2:  #334155;
  --ink-3:  #64748B;
  --ink-4:  #94A3B8;
  --line:   #E5EAF0;
  --line-2: #EEF2F6;
  --bg:     #F6F8FB;
  --bg-2:   #FBFCFD;
  --surface:#FFFFFF;

  --danger:   #C2334D;
  --danger-2: #fbe8ec;
  --warn:     #B57500;
  --warn-2:   #fdf4dd;

  /* legados do styles.css antigo — mantidos para não quebrar nada */
  --brand-blue:   #003865;
  --brand-purple: #9F4BB9;
  --brand-green:  #1E9F7F;
  --muted:        #64748B;
  --focus:        rgba(50,166,230,.22);
  --shadow-soft:  0 12px 32px -16px rgba(15,30,55,.18);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11','ss01','ss02';
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4, h5 {
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
}
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
svg { display: block; }

/* ------------- Layouts ------------- */
.landing-body { background: var(--bg); min-height: 100vh; }
.app-body     { background: var(--bg); min-height: 100vh; }

.landing-shell {
  width: min(1160px, 94vw);
  margin: 0 auto;
  padding: 32px 0 56px;
  display: grid;
  gap: 20px;
}

/* ------------- Top bar global ------------- */
.portal-topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.portal-topbar-inner {
  width: min(1280px, 96vw);
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.portal-brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: block;
  object-fit: contain;
  background: var(--rumo-navy);
  padding: 6px;
}
.portal-brand-text { display: grid; line-height: 1.15; gap: 2px; }
.portal-brand-text strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.portal-brand-text small {
  font-size: 11.5px;
  color: var(--ink-3);
}
.portal-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.top-user-profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid var(--line);
}
.top-user-avatar,
.top-user-avatar-fallback {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.top-user-avatar {
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
}
.top-user-avatar-fallback {
  background: var(--rumo-cyan-2);
  color: var(--rumo-navy);
  font-weight: 600;
  font-size: 12px;
}
.top-user-meta { display: grid; gap: 0; line-height: 1.15; }
.top-user-name {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.top-user-role {
  color: var(--ink-3);
  font-size: 11.5px;
}
.btn-topbar {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, border-color .15s;
}
.btn-topbar:hover { background: var(--bg); }

/* Footer */
.portal-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.portal-footer-inner {
  width: min(1280px, 96vw);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}
.portal-footer-logo { height: 26px; width: auto; opacity: .8; }

/* ------------- Buttons ------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  padding: 0 16px;
  min-height: 40px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
  border-color: var(--rumo-cyan);
}
.btn-primary {
  background: var(--rumo-navy);
  color: #fff;
  border-color: var(--rumo-navy);
}
.btn-primary:hover { background: var(--rumo-navy-2); }
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}
.btn-secondary {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--bg); }
.btn-ghost-dark {
  background: #fff;
  color: var(--rumo-navy);
  border-color: var(--line);
}

/* ------------- Cards / panels ------------- */
.panel,
.modules,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
}
.panel { padding: 20px; }

.eyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-3);
}

/* ------------- Login (variação A · split) ------------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--bg);
}
.login-brand-panel {
  background: linear-gradient(160deg, #003865 0%, #002a4d 70%, #062441 100%);
  color: #fff;
  padding: 56px 64px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand-rings {
  position: absolute;
  right: -180px; top: -180px;
  width: 640px; height: 640px;
  opacity: .14;
  pointer-events: none;
}
.login-brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}
.login-brand-mark .mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  display: grid; place-items: center;
}
.login-brand-mark .mark img { width: 30px; height: 30px; }
.login-brand-mark strong {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: block;
}
.login-brand-mark span {
  font-size: 12px;
  opacity: .7;
}
.login-brand-body { position: relative; max-width: 460px; }
.login-brand-body .eyebrow {
  color: rgba(255,255,255,.65);
  font-size: 11.5px;
  margin-bottom: 12px;
  letter-spacing: normal;
  text-transform: none;
}
.login-brand-body .eyebrow img {
  display: block;
  width: clamp(220px, 60%, 320px);
  max-height: 150px;
  height: auto;
  object-fit: contain;
}
.login-brand-body h2 {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.08;
  color: #fff;
  margin: 14px 0 18px;
}
.login-brand-body h2 .accent { color: var(--rumo-lime); }
.login-brand-body p {
  font-size: 15px;
  line-height: 1.55;
  opacity: .82;
  max-width: 420px;
  color: rgba(255,255,255,.92);
}
.login-brand-features {
  margin-top: 28px;
  display: grid;
  gap: 12px;
  max-width: 360px;
}
.login-brand-features li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  opacity: .88;
}
.login-brand-features li .ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(50,166,230,.16);
  color: #79c7ee;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.login-brand-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: .55;
  font-size: 12px;
}
.login-brand-foot img { height: 16px; filter: brightness(0) invert(1); }

.login-form-panel {
  background: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form-wrap { width: 100%; max-width: 380px; margin: 0 auto; }
.login-form-wrap h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.login-form-wrap .lead {
  color: var(--ink-3);
  font-size: 14px;
  margin-bottom: 32px;
}
.login-cta-ms {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  background: var(--rumo-navy);
  color: #fff;
  border: 1px solid var(--rumo-navy);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s;
}
.login-cta-ms:hover { background: var(--rumo-navy-2); }
.ms-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; }
.ms-icon svg { width: 20px; height: 20px; }
.login-shield-note {
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.login-shield-note .ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--rumo-green-2);
  color: var(--rumo-green);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.login-shield-note p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.login-shield-note strong { color: var(--ink); font-weight: 600; }
.login-footnote {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.login-footnote a {
  color: inherit;
  text-decoration: none;
}
.login-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--rumo-green-2);
  color: #0E5F4A;
  border: 1px solid #c3e8dd;
  margin-bottom: 18px;
}
.login-chip::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--rumo-green);
}

/* Legacy login fallback (login-center-card) — caso usado em outra rota */
.login-center-card {
  width: min(440px, 94vw);
  margin: 32px auto;
  padding: 36px 36px 28px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.login-center-card h1 { font-size: 24px; }
.login-lead { color: var(--ink-3); }
.login-actions { display: flex; }
.login-hint { color: var(--ink-3); font-size: 12px; }
.login-logo { width: 56px; height: 56px; margin: 0 auto 12px; display: block; }

/* ------------- Landing (home) ------------- */
.landing-intro {
  text-align: left;
  padding: 8px 0;
}
.landing-intro h1 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.landing-intro p {
  max-width: 70ch;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.modules {
  padding: 24px;
}
.modules-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.modules-heading p {
  margin: 4px 0 16px;
  color: var(--ink-3);
  font-size: 13.5px;
}

.module-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.module-card {
  padding: 22px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  position: relative;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.module-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: var(--rumo-navy);
}
.module-card.gradient-a::before { background: var(--rumo-navy); }
.module-card.gradient-b::before { background: var(--rumo-green); }
.module-card.gradient-c::before { background: var(--rumo-purple); }
.module-card:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-soft);
}
.module-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.module-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-3);
}
.module-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* ------------- App shell + sidebar (Opção A: ícones, hover-expand) ------------- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  transition: grid-template-columns .2s ease;
}
.app-shell.is-sidebar-expanded { grid-template-columns: 240px minmax(0, 1fr); }
/* compatibilidade c/ classe legada do .ejs (já vem no markup) */
.app-shell.is-sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }

.sidebar {
  background: var(--rumo-navy);
  color: rgba(255,255,255,.85);
  padding: 22px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: width .2s ease;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 48px;
}
.sidebar-head::before {
  content: '';
  width: 44px; height: 44px;
  border-radius: 12px;
  background:
    url('/Logo/logo%20portal.svg') center/28px no-repeat,
    rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.sidebar-toggle {
  width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  margin-left: auto;
}
.sidebar-toggle .nav-icon { width: 14px; height: 14px; }
.sidebar-toggle:hover { background: rgba(255,255,255,.14); }

.sidebar-nav {
  display: grid;
  gap: 4px;
}
.sidebar-nav a {
  text-decoration: none;
  color: rgba(255,255,255,.78);
  font-weight: 500;
  padding: 0 12px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: background .15s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-nav a.active {
  background: #fff;
  color: var(--rumo-navy);
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--rumo-cyan);
}
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; display: inline-grid; place-items: center; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-label {
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .15s;
}

.app-shell.is-sidebar-expanded .nav-label,
.sidebar:hover .nav-label { opacity: 1; }
.app-shell.is-sidebar-collapsed .nav-label { opacity: 0; }
.sidebar:hover { width: 240px; }

.sidebar-nav a > .nav-label { display: inline-block; }

.app-main {
  padding: 28px 36px 56px;
  background: var(--bg);
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

/* ------------- Hero-line (cabeçalho de página) ------------- */
.hero-line {
  background: transparent;
  border: 0;
  padding: 0 4px;
}
.hero-line .eyebrow { margin-bottom: 6px; }
.hero-line h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-line p {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 14px;
  max-width: 70ch;
  line-height: 1.55;
}
.hero-line.compact { padding: 0 4px; }

.app-main-form {
  gap: 10px;
}

.app-main-form .hero-line h1 {
  font-size: 24px;
}

.app-main-form .hero-line p {
  margin-top: 4px;
  max-width: 120ch;
  line-height: 1.4;
}

.app-main-form .form-identity-panel {
  padding: 14px 16px;
}

.app-main-form .identity-compact-row {
  padding: 8px 10px;
  gap: 10px;
}

.app-main-form .form-wizard {
  gap: 10px;
}

.app-main-form .wizard-progress {
  padding: 14px 16px;
}

/* ------------- Tabs ------------- */
.tabs-top { margin-top: 4px; }
.tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.tab-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover { background: rgba(15,30,55,.04); }
.tab-btn.active {
  background: #fff;
  color: var(--rumo-navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15,30,55,.10), 0 0 0 1px var(--line);
}
.tab-content[hidden] { display: none !important; }

/* ------------- Panel section head (eyebrow + h2 dentro de tabs) ------------- */
.panel-section-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 16px;
}
.panel-section-head .eyebrow { margin-bottom: 4px; }
.panel-section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.panel-section-head p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 70ch;
  line-height: 1.55;
}

/* ------------- Filters ------------- */
.filters-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.filter-grid label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.003em;
  min-width: 0;
}
.filter-grid select,
.filter-grid input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 36px;
}
.btn-filter-clear {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 10px;
  padding: 0 14px;
  height: 36px;
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-filter-clear:hover { background: var(--bg); }
.btn-export-excel {
  background: var(--rumo-navy);
  color: #fff;
  border-color: var(--rumo-navy);
}
.btn-export-excel:hover { background: var(--rumo-navy-2); }

.filter-feedback {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  font-size: 12.5px;
}
.filter-feedback strong { color: var(--ink); font-weight: 600; }
.filter-feedback span  { color: var(--ink-3); }

/* ------------- QLP status ------------- */
.qlp-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--rumo-green-2);
  border: 1px solid #c3e8dd;
  color: #0E5F4A;
  border-radius: 10px;
  font-size: 12.5px;
  width: fit-content;
}
.qlp-status::before {
  content: '';
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--rumo-green);
}
.qlp-status strong { color: #0E5F4A; font-weight: 600; }
.qlp-status span   { color: #1f5b4d; }
.qlp-status.is-loading {
  background: var(--rumo-cyan-2);
  border-color: #c6e3f6;
  color: #0a4d77;
}
.qlp-status.is-loading::before { background: var(--rumo-cyan); }
.qlp-status.is-loading span::after {
  content: ' carregando…';
  font-weight: 600;
  color: var(--rumo-cyan);
}

/* ------------- KPI grid + Hero ring ------------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1.05fr repeat(3, 1fr);
  gap: 12px;
}
.stat-card {
  padding: 18px 20px;
  display: grid;
  gap: 4px;
  position: relative;
}
.stat-card h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-card p {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
}
/* KPI hero é o 4º card (Conclusão %) — destacamos via :last-child com gradient navy */
.stats-grid .stat-card:nth-child(4) {
  background: linear-gradient(135deg, #003865 0%, #002240 100%);
  color: #fff;
  border-color: #003865;
}
.stats-grid .stat-card:nth-child(4) h2 { color: #fff; }
.stats-grid .stat-card:nth-child(4) p  { color: rgba(255,255,255,.65); }
.stats-grid .stat-card:nth-child(4)::after {
  content: '↑ vs ciclo anterior';
  position: absolute;
  right: 18px; top: 18px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(127,224,108,.18);
  color: #bcf2ad;
  border-radius: 999px;
}

/* ------------- Dashboard visual grid ------------- */
.dashboard-visual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.vp-pending-card {
  grid-column: 1 / -1;
  order: -1;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
}
.chart-card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.donut-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.donut-chart {
  --rate: 0;
  width: 160px; height: 160px;
  position: relative;
  display: grid;
  place-items: center;
}
.donut-chart svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.donut-track,
.donut-progress {
  fill: none;
  stroke-width: 12;
}
.donut-track { stroke: var(--line-2); }
.donut-progress {
  stroke: var(--rumo-navy);
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
  transition: stroke-dashoffset .35s ease;
}
.donut-rate {
  position: absolute;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#donut-chart-label {
  margin: 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

.bar-legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.bar-legend-row span { color: var(--ink-3); }
.bar-legend-row strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
  margin-bottom: 14px;
}
.bar-track.stacked {
  display: flex;
}
.bar-filled,
.bar-pending {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .35s ease;
}
.bar-filled  { background: var(--rumo-green); }
.bar-pending { background: var(--rumo-purple); }

.role-completion-list,
.flow-status-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.chart-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink-3);
  font-size: 12.5px;
  background: var(--bg-2);
}

/* VP pending (drill-down) */
.vp-pending-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}
.vp-pending-list > li {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.pending-tree-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.pending-tree-summary::-webkit-details-marker { display: none; }
.pending-tree-summary::before {
  content: '';
  width: 0; height: 0;
  border-style: solid;
  border-width: 4px 0 4px 5px;
  border-color: transparent transparent transparent var(--ink-3);
  transition: transform .15s ease;
  flex: 0 0 auto;
}
details[open] > .pending-tree-summary::before { transform: rotate(90deg); }
.pending-tree-summary:hover { background: var(--bg); }
.pending-tree-label {
  flex: 1;
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pending-tree-counts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pending-tree-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pending-tree-badge-total {
  background: var(--rumo-navy-3);
  color: var(--rumo-navy);
  border-color: #d2dfeb;
}
.pending-tree-badge-filled {
  background: var(--rumo-green-2);
  color: #0E5F4A;
  border-color: #c3e8dd;
}
.pending-tree-badge-pending {
  background: var(--rumo-purple-2);
  color: #6e2d85;
  border-color: #e2cbed;
}
.pending-tree-count { color: var(--rumo-navy); font-weight: 600; }
.pending-tree-children {
  margin: 0;
  list-style: none;
  padding: 4px 8px 10px 30px;
  display: grid;
  gap: 2px;
  background: var(--bg-2);
  border-top: 1px solid var(--line-2);
}
.pending-tree-node {
  border-left: 2px solid var(--line);
  padding-left: 8px;
}
.pending-tree-node details > .pending-tree-summary {
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
}
.pending-tree-node details > .pending-tree-summary:hover { background: #fff; }
.pending-tree-leaf {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pending-tree-leaf .pending-tree-label { font-weight: 400; font-size: 12.5px; color: var(--ink-2); }

/* Thematic list */
.thematic-list {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 8px;
}
.thematic-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.thematic-list li div { display: grid; gap: 2px; min-width: 0; }
.thematic-list li strong { font-size: 13px; font-weight: 500; color: var(--ink); }
.thematic-list li small  { font-size: 11.5px; color: var(--ink-3); }
.thematic-list li span {
  min-width: 36px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--rumo-navy-3);
  color: var(--rumo-navy);
  font-weight: 600;
  font-size: 12px;
}

/* ------------- Tables ------------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
}
th {
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-2); }

/* ------------- Forms ------------- */
.form {
  display: grid;
  gap: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
input, select, textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 40px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
}
textarea { min-height: 80px; }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input[readonly] {
  background: var(--bg-2);
  color: var(--ink-2);
  border-style: dashed;
  border-color: var(--line);
}

.form-identity-hint {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #c6e3f6;
  background: var(--rumo-cyan-2);
  color: #0a4d77;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.form-identity-hint::before {
  content: 'i';
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--rumo-cyan);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-style: italic;
  font-size: 11px;
  flex: 0 0 auto;
}

.identity-compact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}

.identity-item {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

.identity-item strong {
  color: var(--ink);
  font-weight: 600;
}

/* ------------- Wizard / Stepper (form A) ------------- */
.form-wizard { display: grid; gap: 12px; }

.wizard-progress {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 22px;
}
.wizard-progress-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.wizard-progress-head .step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.wizard-progress-head h2 {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.wizard-progress-head .step-meta { font-size: 12.5px; color: var(--ink-3); }
.wizard-progress-head .step-meta strong { color: var(--rumo-green); font-weight: 600; }
.wizard-bar {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 6px;
  margin-bottom: 12px;
}
.wizard-bar span {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  transition: background .2s;
}
.wizard-bar span.is-done    { background: var(--rumo-green); }
.wizard-bar span.is-current { background: var(--rumo-navy); }

.wizard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wizard-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.wizard-chip:hover { background: var(--bg); }
.wizard-chip.is-done {
  background: var(--rumo-green-2);
  color: #0E5F4A;
  border-color: #c3e8dd;
}
.wizard-chip.is-done::before {
  content: '✓';
  font-size: 11px;
  font-weight: 700;
}
.wizard-chip.is-current {
  background: var(--rumo-navy);
  color: #fff;
  border-color: var(--rumo-navy);
}

.question {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 26px;
  display: grid;
  gap: 16px;
}
.question.is-hidden { display: none !important; }
.question .q-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--rumo-navy-3);
  color: var(--rumo-navy);
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  width: fit-content;
}
.question h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.4;
  max-width: 62ch;
}
.question .q-hint {
  font-size: 13px;
  color: var(--ink-3);
  max-width: 70ch;
  line-height: 1.55;
}
.radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.radios label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.radios label:hover { border-color: #cbd5e1; }
.radios label:has(input:checked) {
  border-color: var(--rumo-navy);
  background: #f3f7fb;
  box-shadow: 0 0 0 3px rgba(0,56,101,.08);
}
.radios input[type="radio"] {
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  margin: 1px 0 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
  padding: 0;
  background: #fff;
  min-height: 0;
}
.radios input[type="radio"]:checked {
  border-color: var(--rumo-navy);
}
.radios input[type="radio"]:checked::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--rumo-navy);
}

.conditional {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 18px 20px;
  position: relative;
}
.conditional::before {
  content: 'DETALHAMENTO';
  position: absolute;
  top: -10px; left: 16px;
  background: var(--rumo-cyan);
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px 0;
  border-top: 1px solid var(--line-2);
  margin-top: 4px;
}
.wizard-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.wizard-status::before {
  content: '';
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--rumo-green);
}

/* Botão primário do formulário (manter compat com .form .btn-primary) */
.form .btn-primary {
  background: var(--rumo-navy);
  color: #fff;
  border: 1px solid var(--rumo-navy);
  min-height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}
.form .btn-primary:hover { background: var(--rumo-navy-2); }
.form .btn-primary:disabled,
.form .btn-primary[aria-disabled="true"] {
  background: #b0b7c3;
  border-color: #b0b7c3;
  color: #ffffff;
  box-shadow: none;
}
.form .btn-primary:disabled:hover,
.form .btn-primary[aria-disabled="true"]:hover {
  background: #b0b7c3;
  transform: none;
}

/* ------------- Access control (Opção A: cards com chips) ------------- */
.access-module-card {
  padding: 0;
  overflow: hidden;
}
.access-module-card .access-module-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
}
.access-module-card .access-module-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--rumo-navy-3);
  color: var(--rumo-navy);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.access-module-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.access-module-description {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}
.access-module-meta {
  margin-left: auto;
  text-align: right;
  font-size: 11.5px;
  color: var(--ink-3);
  display: grid;
  gap: 4px;
  justify-items: end;
}
.access-module-meta .access-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--rumo-green-2);
  color: #0E5F4A;
  border: 1px solid #c3e8dd;
  font-size: 11.5px;
  font-weight: 600;
}
.access-module-meta .access-pill::before {
  content: '';
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--rumo-green);
}
.access-module-meta .access-pill.is-restricted {
  background: var(--rumo-purple-2);
  color: #6e2d85;
  border-color: #e2cbed;
}
.access-module-meta .access-pill.is-restricted::before { background: var(--rumo-purple); }

.access-module-card form {
  padding: 20px 22px;
  display: grid;
  gap: 16px;
}
.access-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: stretch;
}
.access-grid label {
  display: grid;
  gap: 6px;
}
.access-grid textarea {
  min-height: 110px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.6;
}
.access-grid .btn {
  width: fit-content;
  align-self: end;
}

.entra-lookup-results {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
}
.entra-lookup-item {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  padding: 10px 14px;
  display: grid;
  gap: 2px;
  cursor: pointer;
  font: inherit;
}
.entra-lookup-item:last-child { border-bottom: 0; }
.entra-lookup-item strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.entra-lookup-item span   { color: var(--ink-2); font-size: 12.5px; }
.entra-lookup-item small  { color: var(--ink-3); font-size: 11.5px; }
.entra-lookup-item:hover  { background: var(--bg); }

.lookup-hint {
  color: var(--ink-3);
  font-size: 11.5px;
}
.access-bootstrap-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid #f3e3a9;
  background: var(--warn-2);
  color: var(--warn);
  border-radius: 10px;
  font-size: 13px;
}

/* ------------- Alerts ------------- */
.alert {
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 13.5px;
  color: var(--ink);
  display: grid; gap: 4px;
}
.alert.success {
  background: var(--rumo-green-2);
  border-color: #c3e8dd;
  color: #0E5F4A;
}
.alert.error {
  background: var(--danger-2);
  border-color: #f0c8d2;
  color: var(--danger);
}
.alert strong { font-weight: 600; }
.alert ul { margin: 8px 0 0; padding-left: 18px; }

/* ------------- Modal ------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,30,55,.55);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 30;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: min(960px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(0,30,58,.35);
}
.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.modal-close:hover { background: var(--bg); }
.modal-content {
  padding: 18px 22px 24px;
  display: grid;
  gap: 16px;
}
.submission-summary {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.submission-summary h4 {
  margin: 0 0 10px;
  color: var(--rumo-navy);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.submission-summary ul {
  margin: 0; padding-left: 16px;
  display: grid; gap: 6px;
  font-size: 13px;
}
.submission-history-summary p {
  margin: 0 0 8px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.submission-history-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.submission-history-list .btn-view-submission { padding: 4px 10px; font-size: 12px; }
.submission-history-list .btn-view-submission.is-active {
  background: var(--rumo-cyan-2);
  border-color: #c6e3f6;
  color: var(--rumo-navy);
}
.submission-block {
  border-top: 1px solid var(--line-2);
  margin-top: 12px;
  padding-top: 12px;
}
.submission-block:first-of-type {
  border-top: 0; margin-top: 0; padding-top: 0;
}
.submission-block h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.submission-block p {
  margin: 2px 0;
  color: var(--ink-2);
  font-size: 13px;
}
.case-flow-form {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.flow-summary {
  background: #f3f8fe;
  border-color: #b8cbe2;
}
.flow-summary h4 {
  color: #113b63;
}
.flow-summary p {
  color: #1f3f5c;
}
.flow-summary .case-flow-form input,
.flow-summary .case-flow-form select,
.flow-summary .case-flow-form textarea {
  background: #fff;
  border-color: #9fb9d3;
  color: #0b1f33;
}
.flow-summary .case-flow-form input::placeholder,
.flow-summary .case-flow-form textarea::placeholder {
  color: #5f7388;
}
.case-flow-form label { margin: 0; }
.case-flow-form textarea,
.case-flow-form label:nth-child(2),
.case-flow-form label:nth-child(3),
.case-flow-form .case-flow-actions {
  grid-column: 1 / -1;
}
.case-flow-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.case-flow-feedback {
  color: var(--ink-3);
  font-size: 12.5px;
}

.btn-view-submission {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
  font-size: 12.5px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-view-submission:hover {
  background: var(--rumo-navy-3);
  border-color: #c8d8e8;
  color: var(--rumo-navy);
}

.btn-view-submission-primary {
  border-color: #003865;
  background: #003865;
  color: #ffffff;
}

.btn-view-submission-primary:hover {
  border-color: #0a4a7e;
  background: #0a4a7e;
  color: #ffffff;
}

.modal-open { overflow: hidden; }

/* ------------- Global loader ------------- */
.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(246,248,251,.92);
  backdrop-filter: blur(3px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  z-index: 999;
}
.global-loader[hidden] { display: none; }
.global-loader-spinner {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--rumo-navy);
  animation: spinLoader .85s linear infinite;
}
.global-loader-text {
  margin: 0;
  font-weight: 600;
  color: var(--rumo-navy);
  font-size: 13.5px;
}
.loading-dots::after {
  content: '...';
  display: inline-block;
  width: 1.25em;
  animation: blinkDots 1.2s steps(4, end) infinite;
}

@keyframes spinLoader { to { transform: rotate(360deg); } }
@keyframes blinkDots { 0% { width: 0; } 100% { width: 1.25em; } }
@keyframes revealUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.reveal-up { animation: revealUp .3s ease both; }
.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 160ms; }

/* ------------- Glossary ------------- */
.glossary ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.glossary li strong { color: var(--ink); font-weight: 600; }

/* ------------- Responsive ------------- */
@media (max-width: 1180px) {
  .stats-grid          { grid-template-columns: repeat(2, 1fr); }
  .filter-grid         { grid-template-columns: repeat(3, 1fr) auto; }
  .module-cards        { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { padding: 40px 28px; }
  .filter-grid       { grid-template-columns: 1fr 1fr; }
  .filter-actions    { grid-column: 1 / -1; justify-content: flex-end; }
  .dashboard-visual-grid { grid-template-columns: 1fr; }
  .module-cards      { grid-template-columns: 1fr; }
  .app-shell, .app-shell.is-sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0;
    height: auto; flex-direction: row;
    overflow-x: auto;
    padding: 12px;
  }
  .sidebar:hover { width: auto; }
  .sidebar-head { display: none; }
  .sidebar-nav { display: flex; gap: 6px; }
  .sidebar-nav a {
    height: 40px;
    padding: 0 12px;
  }
  .nav-label { opacity: 1; }
  .app-main { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .radios { grid-template-columns: 1fr; }
  .access-grid { grid-template-columns: 1fr; }
  .case-flow-form { grid-template-columns: 1fr; }
  .portal-topbar-inner {
    min-height: auto;
    padding: 12px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .portal-topbar-actions { width: 100%; overflow-x: auto; }
  .hero-line h1 { font-size: 22px; }
  table { font-size: 12.5px; }
  th, td { padding: 10px 12px; }
  .modal-card { width: 100%; max-height: 92vh; }
}

@media (min-width: 881px) {
  .login-brand-body .eyebrow img {
    width: clamp(280px, 66%, 400px);
    max-height: 190px;
  }
}
