:root {
  --blue-900: #0c1929;
  --blue-800: #132337;
  --blue-700: #1e4d8c;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-050: #f0f4ff;
  --blue-025: #f8faff;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-100: #ccfbf1;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warning-amber: #d97706;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "Source Serif 4", "Georgia", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(165deg, #eef2ff 0%, #f8fafc 38%, #ffffff 100%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Na tela de login: esconde hero, nova auditoria e auditorias recentes */
body.login-view #heroSection,
body.login-view #auditSection,
body.login-view #detailSection {
  display: none !important;
}

body.login-view .content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 0px);
  padding: 2rem;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.auth-card {
  box-shadow: var(--shadow-lg);
  padding: 2rem 2rem 2.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.auth-card-inner {
  display: grid;
  gap: 0.25rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
  color: var(--text);
  font-family: var(--font-display);
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
  line-height: 1.45;
}

.auth-alert {
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.auth-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.auth-form {
  display: grid;
  gap: 1.1rem;
}

.auth-label {
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input::placeholder {
  color: var(--slate-400);
}

.auth-input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-submit {
  margin-top: 0.25rem;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
}

.auth-submit:hover {
  background: var(--blue-900);
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-card .switch-form {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px 1fr;
}

body.login-view .shell {
  grid-template-columns: 1fr;
}

body.login-view .sidebar {
  display: none;
}

.sidebar {
  background: linear-gradient(180deg, var(--blue-900) 0%, #0a1628 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 1rem;
  min-height: 100vh;
  align-self: stretch;
}

#sessionPanel {
  margin-top: 0.2rem;
}

.brand-card,
.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.brand-card {
  background: linear-gradient(145deg, rgba(30, 77, 140, 0.95), rgba(12, 25, 41, 0.98));
  color: var(--white);
  text-align: center;
  max-width: 100%;
  margin: 0 0 0.5rem 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.brand-logo {
  width: 108px;
  height: 108px;
  border-radius: 18px;
  object-fit: contain;
  background: var(--white);
  padding: 6px;
  box-shadow: var(--shadow-md);
}

.brand-logo-wrapper {
  display: flex;
  justify-content: center;
  margin: 6px 0 10px 0;
}

.brand-title {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  white-space: normal;
  word-break: break-word;
  font-weight: 700;
}

.brand-card .muted {
  color: rgba(255, 255, 255, 0.78);
}

.brand-subtitle {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.panel h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.contribution-card {
  background: linear-gradient(145deg, rgba(30, 77, 140, 0.95), rgba(12, 25, 41, 0.98));
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.15);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.contribution-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-sm);
}

.contribution-card h2 {
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.contribution-card .muted {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.contribution-card p {
  margin: 0;
  font-size: 0.9rem;
}

.content {
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  display: grid;
  gap: 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* —— Hero dashboard —— */
.hero-dashboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 1.5rem;
}

.hero-main {
  max-width: 52rem;
}

.hero-eyebrow {
  color: var(--teal-700);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin: 0 0 0.5rem 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.65rem 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-lead {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 40rem;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 5.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-value--sm {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: normal;
}

.kpi-value--alert {
  color: var(--danger);
}

.kpi-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
}

.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.muted {
  color: var(--text-soft);
  line-height: 1.55;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.audit-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
}

.card-elevated {
  box-shadow: var(--shadow-sm);
}

.card-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.card-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-700);
  background: var(--teal-100);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.card-intro {
  margin: 0 0 1.1rem 0;
  font-size: 0.9rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.queue-header {
  align-items: flex-start;
  margin-bottom: 1rem;
}

.queue-header h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.queue-subtitle {
  margin: 0;
  font-size: 0.86rem;
  max-width: 36rem;
}

.btn-ghost-sm {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--blue-700);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.btn-ghost-sm:hover {
  background: var(--blue-050);
  border-color: rgba(37, 99, 235, 0.35);
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-muted);
}

button:not(.password-toggle):not(.link):not(.btn-ghost-sm) {
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: var(--white);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}

button.ghost {
  background: transparent;
  color: var(--blue-700);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.queue-list.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.queue-card {
  --queue-accent: var(--blue-500);
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.queue-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--queue-accent);
  border-radius: 4px 0 0 4px;
}

.queue-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.18);
}

.queue-card--low {
  --queue-accent: var(--teal-600);
}

.queue-card--moderate {
  --queue-accent: #ca8a04;
}

.queue-card--high {
  --queue-accent: #ea580c;
}

.queue-card--critical {
  --queue-accent: var(--danger);
}

.queue-card-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 1rem 1rem 1rem 1.15rem;
}

.queue-card-title {
  margin: 0 0 0.2rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.queue-card-course {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.queue-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.queue-card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.queue-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.severity-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
}

.severity-pill--low {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.severity-pill--moderate {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.severity-pill--high {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.severity-pill--critical {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
}

.list-item-main {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.list-item-delete {
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* —— Badges & severidade —— */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
}

.badge-sev-neutral {
  background: var(--blue-050);
  color: var(--blue-700);
  border-color: rgba(37, 99, 235, 0.15);
}

.badge-sev-low {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge-sev-moderate {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge-sev-high {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.badge-sev-critical {
  background: var(--danger-soft);
  color: #991b1b;
  border-color: #fecaca;
}

.badge-soft {
  background: var(--surface-muted);
  color: var(--text-soft);
  border-color: var(--border);
  font-weight: 500;
}

/* —— Painel de detalhe —— */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-md);
}

.detail-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.detail-eyebrow {
  margin: 0 0 0.35rem 0;
  color: var(--teal-700);
  font-weight: 600;
}

.detail-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.audit-detail-root {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.audit-detail-root.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.detail-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  background: var(--surface-muted);
}

.detail-block--highlight {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
  border-color: rgba(37, 99, 235, 0.12);
}

.detail-block-title {
  margin: 0 0 0.85rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.detail-block p {
  margin: 0 0 0.65rem 0;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.detail-block p:last-child {
  margin-bottom: 0;
}

.detail-dl {
  display: grid;
  gap: 0.5rem 1.25rem;
  grid-template-columns: auto 1fr;
  font-size: 0.9rem;
  margin: 0;
}

.detail-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-dl dd {
  margin: 0;
  color: var(--text);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.metric-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  text-align: center;
}

.metric-tile-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.metric-tile-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Tile inteiro clicavel (alto risco): nativo <button> = Enter/Espaco no teclado */
.metric-tile--interactive {
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.metric-tile--interactive:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--blue-025);
  box-shadow: var(--shadow-sm);
}

.metric-tile--interactive:focus {
  outline: none;
}

.metric-tile--interactive:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

.metric-tile-hint {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue-700);
  letter-spacing: 0.02em;
}

.risk-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.risk-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.risk-list li strong {
  color: var(--text);
  font-weight: 600;
}

.recommendation-box {
  border-left: 4px solid var(--teal-600);
  padding: 1rem 1.1rem;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.item-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.item-card--low {
  border-top: 3px solid var(--teal-600);
}

.item-card--moderate {
  border-top: 3px solid #ca8a04;
}

.item-card--high {
  border-top: 3px solid #ea580c;
}

.item-card--critical {
  border-top: 3px solid var(--danger);
}

.item-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.item-card-head h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.item-card-body {
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.item-field {
  font-size: 0.88rem;
  line-height: 1.5;
}

.item-field strong {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.feedback {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--blue-900);
  color: var(--white);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  display: none;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  z-index: 50;
}

.feedback.error {
  background: var(--danger);
}

.empty-state {
  color: var(--text-muted);
}

.upload-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.upload-label input[type="file"] {
  padding: 0.75rem;
  border: 2px dashed rgba(37, 99, 235, 0.28);
  border-radius: var(--radius-sm);
  background: var(--blue-025);
  cursor: pointer;
  font-size: 0.9rem;
}

.upload-label input[type="file"]:hover {
  border-color: var(--blue-500);
  background: var(--blue-050);
}

.upload-text {
  font-size: 0.95rem;
}

.audit-progress {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--blue-050);
}

.audit-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text);
}

.audit-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.audit-progress-fill {
  width: 8%;
  height: 100%;
  background: linear-gradient(135deg, var(--blue-700), var(--teal-600));
  transition: width 0.35s ease;
}

.audit-progress-step {
  margin: 8px 0 0 0;
  font-size: 0.9rem;
}

.password-wrap {
  position: relative;
  width: 100%;
}

.auth-password-input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--blue-700);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.password-toggle .eye-off {
  display: none;
}

.switch-form {
  margin-top: 16px;
  font-size: 0.95rem;
}

button.link,
.link {
  background: none;
  border: none;
  color: var(--blue-700);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

button.link:hover,
.link:hover {
  color: var(--blue-900);
}

.list-item-user,
.list-item-log {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.list-item-user .muted,
.list-item-log .muted {
  margin-left: auto;
  font-size: 0.85rem;
}

.badge-inactive {
  background: #fef2f2;
  color: var(--danger);
}

/* Diagnostico de payload da API */
.payload-debug-pre {
  margin: 0;
  padding: 1rem;
  max-height: min(55vh, 520px);
  overflow: auto;
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--blue-900);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.diag-issues-list {
  margin: 0.5rem 0 1rem 1.1rem;
  padding: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 1200;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(420px, 96vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1rem 1.1rem;
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.modal-head h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-close {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-soft);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 0;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.contribution-qrcode {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

@media (max-width: 1100px) {
  .hero-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .audit-grid {
    grid-template-columns: 1fr;
  }

  .hero-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-card-inner {
    grid-template-columns: 1fr;
  }

  .queue-card-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .hero-kpis {
    grid-template-columns: 1fr;
  }

  .detail-dl {
    grid-template-columns: 1fr;
  }
}
