
:root {
  --bg-body: #f3f6fb;
  --bg-card: #ffffff;
  --bg-soft: #f8fafc;
  --border-color: #dbe3ee;
  --border-light: #e2e8f0;
  --text-main: #0f172a;
  --text-soft: #64748b;
  --text-white: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #0ea5e9;
  --brand-navy: #111899;
  --brand-black: #050505;
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.07);
  --shadow-card: 0 8px 22px rgba(15, 23, 42, 0.08);
  --shadow-modal: 0 22px 58px rgba(15, 23, 42, 0.18);
  --theme-ring: rgba(37, 99, 235, 0.16);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --page-padding: clamp(8px, 1vw, 14px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg-body);
  color: var(--text-main);
}

.main-content {
  width: 100%;
  padding: var(--page-padding);
}

.main-content-compact {
  padding: clamp(8px, 1vw, 14px);
}

.page-shell {
  width: 100%;
  max-width: 1960px;
  margin: 0 auto;
}

.page-shell-wide {
  max-width: 1960px;
}

.page-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.compact-top-actions {
  margin-bottom: 8px;
}

.page-top-actions-left,
.page-top-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-link,
.mini-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.mini-link {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

.mini-link:hover {
  background: #eff6ff;
  color: var(--primary);
}

.mini-chip {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.app-brand-mini {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  display: inline-flex;
  height: 31px;
  justify-content: center;
  overflow: hidden;
  padding: 4px 12px 3px;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.app-brand-mini:hover {
  border-color: #93c5fd;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.brand-wordmark {
  --brand-size: 30px;
  --brand-stretch: 0.96;
  --brand-track: -0.045em;
  align-items: center;
  display: inline-flex;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.28));
  font-family: "Arial Narrow", "Arial Black", Arial, sans-serif;
  font-size: var(--brand-size);
  font-weight: 900;
  letter-spacing: var(--brand-track);
  line-height: 0.88;
  text-transform: uppercase;
  transform: scaleX(var(--brand-stretch));
  transform-origin: left center;
  white-space: nowrap;
}

.brand-wordmark-dark {
  color: var(--brand-black);
}

.brand-wordmark-blue {
  color: var(--brand-navy);
  margin-left: 0.035em;
}

.brand-wordmark-globe {
  align-items: center;
  background:
    linear-gradient(90deg, transparent 47%, var(--brand-black) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, var(--brand-black) 47% 53%, transparent 53%);
  border: 0.075em solid var(--brand-black);
  border-radius: 999px;
  color: transparent;
  display: inline-flex;
  height: 0.72em;
  justify-content: center;
  margin: 0 0.035em 0 0.03em;
  position: relative;
  top: 0.025em;
  width: 0.72em;
}

.brand-wordmark-globe::before,
.brand-wordmark-globe::after {
  border-color: var(--brand-black);
  border-style: solid;
  content: "";
  position: absolute;
}

.brand-wordmark-globe::before {
  border-width: 0 0.052em;
  border-radius: 50%;
  inset: 0.08em 0.17em;
}

.brand-wordmark-globe::after {
  border-width: 0.052em 0;
  inset: 0.21em 0.06em;
}

.brand-wordmark-mini {
  --brand-size: 18px;
  --brand-stretch: 0.94;
  --brand-track: -0.05em;
}

.brand-wordmark-dashboard {
  --brand-size: 30px;
  --brand-stretch: 0.95;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 8px;
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  min-height: 48px;
  padding: 9px 16px 8px;
}

.brand-wordmark-login {
  --brand-size: 37px;
  --brand-stretch: 0.95;
  --brand-track: -0.048em;
}

.topbar {
  display: none;
}

.table-section,
.form-section {
  margin-bottom: 8px;
}

.table-section:last-child,
.form-section:last-child {
  margin-bottom: 0;
}

.btn-principal,
.btn-secundario {
  border: none;
  border-radius: 8px;
  min-height: 34px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s ease;
}

.btn-principal {
  background: var(--primary);
  color: #fff;
}

.btn-principal:hover {
  background: var(--primary-hover);
}

.btn-secundario {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-secundario:hover {
  background: #cbd5e1;
}

.btn-principal.pequeno {
  min-height: 32px;
  padding: 7px 12px;
  font-size: 12px;
}

.mensagem-sucesso {
  background: #dcfce7;
  color: #166534;
  padding: 9px 11px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}

.mensagem-erro {
  background: #fee2e2;
  color: #991b1b;
  padding: 9px 11px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.badge-pix {
  background: #dcfce7;
  color: #166534;
}

.badge-especie {
  background: #fef3c7;
  color: #92400e;
}

.badge-cartao {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-aberto {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-andamento {
  background: #dcfce7;
  color: #166534;
}

.badge-aguardando {
  background: #fef3c7;
  color: #92400e;
}

.dashboard-hero {
  background: #0f172a;
  color: var(--text-white);
  border-radius: 8px;
  padding: clamp(14px, 1.4vw, 20px);
  box-shadow: var(--shadow-soft);
  margin-bottom: 10px;
}

.dashboard-hero h1 {
  font-size: clamp(22px, 2vw, 30px);
  margin-bottom: 6px;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 900px;
  color: rgba(255,255,255,0.86);
  line-height: 1.35;
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid rgba(219, 227, 238, 0.9);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-card:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.dashboard-card h3 {
  font-size: 16px;
  margin-bottom: 5px;
  color: var(--text-main);
}

.dashboard-card p {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 10px;
}

.dashboard-card span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-top {
  align-items: center;
  background: #0f172a;
  border: 1px solid #111827;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  color: var(--text-white);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 7px;
  min-height: 72px;
  padding: 10px 12px;
}

.dashboard-title-group {
  min-width: 0;
}

.dashboard-brand-row {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
}

.dashboard-title-group .mini-chip {
  background: rgba(219, 234, 254, 0.14);
  border-color: rgba(191, 219, 254, 0.35);
  color: #dbeafe;
  margin-bottom: 5px;
  min-height: 22px;
  padding: 3px 8px;
}

.dashboard-title-group h1 {
  color: #ffffff;
  font-size: clamp(21px, 1.55vw, 25px);
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 3px;
}

.dashboard-title-group p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.dashboard-period-filter {
  display: flex;
}

.dashboard-period-trigger {
  align-items: flex-start;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-surface, #ffffff) 86%, var(--color-primary, #2563eb) 7%), var(--color-surface, #ffffff));
  border: 1px solid color-mix(in srgb, var(--color-border, #cbd5e1) 70%, var(--color-primary, #2563eb) 30%);
  border-radius: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.64) inset,
    0 8px 20px rgba(15, 23, 42, 0.10);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  min-height: 40px;
  min-width: 210px;
  padding: 7px 12px;
  text-align: left;
  transition: 0.18s ease;
}

.dashboard-period-trigger span {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.dashboard-period-trigger strong {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.dashboard-period-trigger small {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.dashboard-period-trigger[data-periodo-ativo="true"] {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-surface, #ffffff) 82%, var(--color-primary, #2563eb) 11%), var(--color-surface, #ffffff));
  border-color: color-mix(in srgb, var(--color-primary, #2563eb) 58%, var(--color-border, #cbd5e1) 42%);
}

.dashboard-period-trigger[data-periodo-ativo="true"] span {
  color: var(--color-primary, #2563eb);
}

.dashboard-period-trigger:hover {
  border-color: color-mix(in srgb, var(--color-primary, #2563eb) 46%, var(--color-border, #cbd5e1) 54%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.52) inset,
    0 10px 22px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.dashboard-period-trigger:focus {
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.18),
    0 10px 22px rgba(15, 23, 42, 0.12);
  outline: none;
}

.dashboard-period-overlay {
  align-items: center;
  animation: dashboardPeriodOverlayIn 0.18s ease-out;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 320;
}

.dashboard-period-overlay.hidden {
  display: none;
}

.dashboard-period-overlay.is-closing {
  animation: dashboardPeriodOverlayOut 0.18s ease-in forwards;
}

.dashboard-period-sheet {
  animation: dashboardPeriodSheetIn 0.22s cubic-bezier(0.2, 0.85, 0.25, 1.05);
  background:
    linear-gradient(180deg, var(--color-surface, #ffffff) 0%, color-mix(in srgb, var(--color-surface, #ffffff) 94%, #eff6ff 6%) 100%);
  border: 1px solid color-mix(in srgb, var(--color-border, #dbe3ee) 78%, var(--color-primary, #2563eb) 8%);
  border-radius: 22px;
  box-shadow:
    0 32px 90px rgba(15, 23, 42, 0.30),
    0 1px 0 rgba(255, 255, 255, 0.58) inset;
  max-width: 482px;
  overflow: hidden;
  transform-origin: center;
  width: min(482px, 100%);
}

.dashboard-period-overlay.is-closing .dashboard-period-sheet {
  animation: dashboardPeriodSheetOut 0.18s ease-in forwards;
}

.dashboard-period-handle {
  background: linear-gradient(90deg, #dbeafe, #94a3b8, #dbeafe);
  border-radius: 999px;
  height: 5px;
  margin: 11px auto 0;
  width: 52px;
}

.dashboard-period-sheet-header {
  align-items: flex-start;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--color-primary, #2563eb) 10%, transparent) 0, transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--color-surface, #ffffff) 90%, #eff6ff 10%), var(--color-surface, #ffffff));
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px 13px;
}

.dashboard-period-heading {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.dashboard-period-kicker {
  color: var(--color-primary, #2563eb);
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.dashboard-period-sheet-header h2 {
  color: var(--text-main);
  font-size: 19px;
  font-weight: 950;
  line-height: 1.1;
  margin: 0;
}

.dashboard-period-header-range {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), color-mix(in srgb, var(--color-surface, #ffffff) 86%, var(--color-primary, #2563eb) 8%));
  border: 1px solid color-mix(in srgb, var(--color-border, #dbe3ee) 74%, var(--color-primary, #2563eb) 26%);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.62) inset;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
}

.dashboard-period-header-range span,
.dashboard-calendar-weekdays span {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dashboard-period-header-range strong {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.dashboard-period-header-actions {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  gap: 7px;
}

.dashboard-period-clear {
  background: color-mix(in srgb, var(--color-surface, #ffffff) 82%, var(--color-primary, #2563eb) 7%);
  border: 1px solid color-mix(in srgb, var(--color-border, #dbe3ee) 70%, var(--color-primary, #2563eb) 24%);
  border-radius: 999px;
  color: var(--color-primary, #2563eb);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  min-height: 31px;
  padding: 0 11px;
  transition: 0.18s ease;
}

.dashboard-period-clear:hover {
  background: color-mix(in srgb, var(--color-primary, #2563eb) 12%, var(--color-surface, #ffffff));
  transform: translateY(-1px);
}

.dashboard-period-sheet-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.dashboard-calendar {
  background: color-mix(in srgb, var(--color-surface, #ffffff) 94%, var(--color-primary, #2563eb) 3%);
  border: 1px solid color-mix(in srgb, var(--color-border, #e2e8f0) 82%, var(--color-primary, #2563eb) 12%);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.58) inset,
    0 12px 28px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.dashboard-calendar-nav {
  align-items: center;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface, #ffffff) 96%, var(--color-primary, #2563eb) 4%), var(--color-surface, #ffffff));
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  min-height: 48px;
  padding: 3px 6px;
}

.dashboard-calendar-nav strong {
  background: color-mix(in srgb, var(--color-primary, #2563eb) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary, #2563eb) 18%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--text-main) 88%, var(--color-primary, #2563eb) 12%);
  font-size: 14px;
  font-weight: 950;
  justify-self: center;
  min-width: 190px;
  padding: 7px 12px;
  text-align: center;
}

.dashboard-calendar-nav button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--color-primary, #2563eb);
  cursor: pointer;
  display: inline-flex;
  font-size: 24px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  transition: 0.18s ease;
  width: 36px;
}

.dashboard-calendar-nav button:hover {
  background: color-mix(in srgb, var(--color-primary, #2563eb) 10%, transparent);
  transform: translateY(-1px);
}

.dashboard-calendar-weekdays,
.dashboard-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dashboard-calendar-weekdays {
  background: color-mix(in srgb, var(--color-surface, #ffffff) 94%, var(--color-primary, #2563eb) 4%);
  padding: 9px 10px 5px;
}

.dashboard-calendar-weekdays span {
  font-size: 10px;
  text-align: center;
}

.dashboard-calendar-days {
  gap: 1px;
  padding: 7px 10px 12px;
}

.dashboard-calendar-empty {
  min-height: 39px;
}

.dashboard-calendar-day {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 39px;
  position: relative;
  transition: 0.16s ease;
}

.dashboard-calendar-day:hover {
  background: color-mix(in srgb, var(--color-primary, #2563eb) 10%, transparent);
  color: var(--color-primary, #2563eb);
}

.dashboard-calendar-day.is-today {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--color-primary, #2563eb) 48%, transparent),
    0 0 0 3px color-mix(in srgb, var(--color-primary, #2563eb) 7%, transparent);
}

.dashboard-calendar-day.is-range {
  background: color-mix(in srgb, var(--color-primary, #2563eb) 14%, transparent);
  border-radius: 8px;
  color: var(--color-primary, #2563eb);
}

.dashboard-calendar-day.is-start,
.dashboard-calendar-day.is-end,
.dashboard-calendar-day.is-single {
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  box-shadow:
    0 9px 18px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dashboard-calendar-day.is-start {
  border-radius: 999px 10px 10px 999px;
}

.dashboard-calendar-day.is-end {
  border-radius: 10px 999px 999px 10px;
}

.dashboard-calendar-day.is-single {
  border-radius: 999px;
}

.dashboard-period-message {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  min-height: 18px;
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.dashboard-period-sheet-actions {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface, #ffffff) 92%, transparent), color-mix(in srgb, var(--color-surface, #ffffff) 86%, var(--color-primary, #2563eb) 6%));
  border-top: 1px solid var(--color-border, #e2e8f0);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  padding: 12px 16px 16px;
}

.dashboard-period-sheet-actions .btn-principal,
.dashboard-period-sheet-actions .btn-secundario {
  border-radius: 12px;
  font-size: 14px;
  min-height: 42px;
}

@keyframes dashboardPeriodOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dashboardPeriodOverlayOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes dashboardPeriodSheetIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dashboardPeriodSheetOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

@media (max-width: 1024px) {
  .dashboard-period-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .dashboard-period-sheet {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    max-width: none;
    width: 100%;
  }

  .dashboard-period-sheet {
    animation-name: dashboardPeriodBottomSheetIn;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    max-height: 92vh;
  }

  .dashboard-period-overlay.is-closing .dashboard-period-sheet {
    animation-name: dashboardPeriodBottomSheetOut;
  }

  .dashboard-period-sheet-actions {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes dashboardPeriodBottomSheetIn {
  from {
    opacity: 1;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dashboardPeriodBottomSheetOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 1;
    transform: translateY(100%);
  }
}

.dashboard-top .btn-secundario {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.dashboard-top .btn-secundario:hover {
  background: rgba(255, 255, 255, 0.18);
}

.dashboard-icon-sprite {
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.dashboard-icon {
  fill: none;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.95;
}

.dashboard-metric-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 40px;
}

.dashboard-kpi-icon,
.dashboard-operational-icon {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), var(--dashboard-accent-soft, rgba(37, 99, 235, 0.09)));
  border: 1px solid var(--dashboard-accent-border, rgba(15, 23, 42, 0.07));
  border-radius: 999px;
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  color: var(--dashboard-accent, #2563eb);
  height: 40px;
  padding: 8px;
  width: 40px;
}

.dashboard-kpi-total .dashboard-kpi-icon,
.dashboard-operational-vagas .dashboard-operational-icon {
  color: #2563eb;
}

.dashboard-kpi-aguardando .dashboard-kpi-icon,
.dashboard-operational-pendentes .dashboard-operational-icon {
  color: #b45309;
}

.dashboard-kpi-andamento .dashboard-kpi-icon,
.dashboard-operational-entregues .dashboard-operational-icon {
  color: #15803d;
}

.dashboard-kpi-certificados .dashboard-kpi-icon {
  color: #047857;
}

.dashboard-kpi-cancelados .dashboard-kpi-icon,
.dashboard-operational-cancelados .dashboard-operational-icon {
  color: #b91c1c;
}

.dashboard-operational-frequencia .dashboard-operational-icon {
  color: #b91c1c;
}

.btn-secundario.pequeno {
  min-height: 32px;
  padding: 7px 12px;
  font-size: 12px;
}

.btn-principal:disabled,
.btn-secundario:disabled {
  cursor: wait;
  opacity: 0.7;
}

.dashboard-kpis {
  align-items: stretch;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(5, minmax(135px, 1fr));
  margin-bottom: 9px;
}

.dashboard-kpi {
  background: #ffffff;
  border: 1px solid rgba(219, 227, 238, 0.95);
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: space-between;
  min-height: 92px;
  padding: 9px 10px;
}

.dashboard-kpi-total {
  --dashboard-accent: #2563eb;
  --dashboard-accent-soft: rgba(37, 99, 235, 0.09);
  --dashboard-accent-border: rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-left-color: #2563eb;
}

.dashboard-kpi-aguardando {
  --dashboard-accent: #b45309;
  --dashboard-accent-soft: rgba(217, 119, 6, 0.1);
  --dashboard-accent-border: rgba(217, 119, 6, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
  border-left-color: #d97706;
}

.dashboard-kpi-andamento {
  --dashboard-accent: #15803d;
  --dashboard-accent-soft: rgba(22, 163, 74, 0.09);
  --dashboard-accent-border: rgba(22, 163, 74, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  border-left-color: #16a34a;
}

.dashboard-kpi-certificados {
  --dashboard-accent: #047857;
  --dashboard-accent-soft: rgba(5, 150, 105, 0.09);
  --dashboard-accent-border: rgba(5, 150, 105, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  border-left-color: #059669;
}

.dashboard-kpi-cancelados {
  --dashboard-accent: #b91c1c;
  --dashboard-accent-soft: rgba(220, 38, 38, 0.08);
  --dashboard-accent-border: rgba(220, 38, 38, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
  border-left-color: #dc2626;
}

.dashboard-kpi .dashboard-metric-head span,
.dashboard-operational-item .dashboard-metric-head span {
  color: var(--text-soft);
  display: block;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0;
  min-width: 0;
  padding-top: 0;
}

.dashboard-kpi strong {
  color: var(--text-main);
  display: block;
  font-size: clamp(29px, 2.25vw, 36px);
  font-weight: 900;
  line-height: 0.9;
  margin-bottom: 3px;
  margin-top: 0;
}

.dashboard-operational-item strong {
  color: var(--text-main);
  display: block;
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 3px;
  margin-top: 0;
}

.dashboard-kpi small,
.dashboard-operational-item small {
  color: var(--text-soft);
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.dashboard-content-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.dashboard-panel {
  min-width: 0;
}

.dashboard-panel-header {
  align-items: flex-end;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 6px;
  min-height: 30px;
}

.dashboard-panel-header h2 {
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.1;
  margin-bottom: 2px;
}

.dashboard-panel-header p {
  color: var(--text-soft);
  font-size: 12px;
}

.dashboard-status {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #e2e8f0;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  min-height: 28px;
  padding: 4px 9px;
  white-space: nowrap;
}

.dashboard-status-ok {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(187, 247, 208, 0.32);
  color: #dcfce7;
}

.dashboard-status-erro {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(254, 202, 202, 0.34);
  color: #fee2e2;
}

.dashboard-operational-grid {
  align-items: stretch;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
}

.dashboard-operational-item,
.dashboard-shortcut {
  background: #ffffff;
  border: 1px solid rgba(219, 227, 238, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  color: inherit;
  min-width: 0;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dashboard-operational-item {
  border-left: 4px solid #2563eb;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: space-between;
  min-height: 94px;
  padding: 9px 10px;
}

.dashboard-operational-vagas {
  --dashboard-accent: #2563eb;
  --dashboard-accent-soft: rgba(37, 99, 235, 0.09);
  --dashboard-accent-border: rgba(37, 99, 235, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-left-color: #2563eb;
}

.dashboard-operational-pendentes {
  --dashboard-accent: #b45309;
  --dashboard-accent-soft: rgba(217, 119, 6, 0.1);
  --dashboard-accent-border: rgba(217, 119, 6, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
  border-left-color: #d97706;
}

.dashboard-operational-entregues {
  --dashboard-accent: #047857;
  --dashboard-accent-soft: rgba(5, 150, 105, 0.09);
  --dashboard-accent-border: rgba(5, 150, 105, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  border-left-color: #059669;
}

.dashboard-operational-frequencia {
  --dashboard-accent: #b91c1c;
  --dashboard-accent-soft: rgba(220, 38, 38, 0.08);
  --dashboard-accent-border: rgba(220, 38, 38, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
  border-left-color: #dc2626;
}

.dashboard-operational-cancelados {
  --dashboard-accent: #b91c1c;
  --dashboard-accent-soft: rgba(220, 38, 38, 0.08);
  --dashboard-accent-border: rgba(220, 38, 38, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
  border-left-color: #dc2626;
}

.dashboard-operational-pendentes strong {
  color: #b45309;
}

.dashboard-operational-entregues strong {
  color: #047857;
}

.dashboard-operational-frequencia strong {
  color: #b91c1c;
}

.dashboard-operational-cancelados strong {
  color: #b91c1c;
}

.dashboard-operational-vagas:hover,
.dashboard-shortcut:hover {
  border-color: #93c5fd;
}

.dashboard-operational-pendentes:hover {
  border-color: #fbbf24;
}

.dashboard-operational-entregues:hover {
  border-color: #5eead4;
}

.dashboard-operational-frequencia:hover {
  border-color: #fca5a5;
}

.dashboard-operational-cancelados:hover {
  border-color: #fca5a5;
}

.dashboard-operational-item:hover,
.dashboard-shortcut:hover {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}

.dashboard-shortcut-grid {
  align-items: stretch;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.dashboard-shortcut {
  --shortcut-accent: #2563eb;
  --shortcut-accent-border: rgba(37, 99, 235, 0.16);
  --shortcut-accent-hover: rgba(37, 99, 235, 0.14);
  --shortcut-accent-soft: rgba(37, 99, 235, 0.08);
  align-items: center;
  display: flex;
  gap: 9px;
  box-shadow: none;
  min-height: 56px;
  padding: 8px 10px;
}

.dashboard-shortcut-icon {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), var(--shortcut-accent-soft));
  border: 1px solid var(--shortcut-accent-border);
  border-radius: 999px;
  box-shadow:
    0 5px 12px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  color: var(--shortcut-accent);
  height: 36px;
  padding: 7px;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
  width: 36px;
}

.dashboard-shortcut-secondary .dashboard-shortcut-icon {
  --shortcut-accent: #475569;
  --shortcut-accent-border: rgba(71, 85, 105, 0.14);
  --shortcut-accent-hover: rgba(71, 85, 105, 0.13);
  --shortcut-accent-soft: rgba(71, 85, 105, 0.08);
  border-color: #e2e8f0;
}

.dashboard-shortcut[href="/alunos-andamento"],
.dashboard-shortcut[href="/conclusao"],
.dashboard-shortcut[href="/frequencia"] {
  --shortcut-accent: #15803d;
  --shortcut-accent-border: rgba(22, 163, 74, 0.16);
  --shortcut-accent-hover: rgba(22, 163, 74, 0.13);
  --shortcut-accent-soft: rgba(22, 163, 74, 0.08);
}

.dashboard-shortcut[href="/alunos-cancelados"] {
  --shortcut-accent: #b91c1c;
  --shortcut-accent-border: rgba(220, 38, 38, 0.16);
  --shortcut-accent-hover: rgba(220, 38, 38, 0.13);
  --shortcut-accent-soft: rgba(220, 38, 38, 0.08);
}

.dashboard-shortcut[href="/alunos"] {
  --shortcut-accent: #b45309;
  --shortcut-accent-border: rgba(217, 119, 6, 0.18);
  --shortcut-accent-hover: rgba(217, 119, 6, 0.13);
  --shortcut-accent-soft: rgba(217, 119, 6, 0.08);
}

.dashboard-shortcut[href="/ferramentas"] {
  --shortcut-accent: #475569;
  --shortcut-accent-border: rgba(71, 85, 105, 0.14);
  --shortcut-accent-hover: rgba(71, 85, 105, 0.13);
  --shortcut-accent-soft: rgba(71, 85, 105, 0.08);
}

.dashboard-shortcut[href="/usuarios"] {
  --shortcut-accent: #2563eb;
  --shortcut-accent-border: rgba(37, 99, 235, 0.16);
  --shortcut-accent-hover: rgba(37, 99, 235, 0.13);
  --shortcut-accent-soft: rgba(37, 99, 235, 0.08);
}

.dashboard-shortcut-copy {
  min-width: 0;
}

.dashboard-shortcut strong {
  color: var(--text-main);
  display: block;
  font-size: 11.5px;
  line-height: 1.2;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.dashboard-shortcut span {
  color: var(--primary);
  display: block;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.15;
}

.dashboard-shortcut:hover .dashboard-shortcut-icon {
  background: linear-gradient(145deg, #ffffff, var(--shortcut-accent-hover));
  box-shadow:
    0 7px 15px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  color: var(--shortcut-accent);
  transform: translateY(-1px);
}

.dashboard-shortcut-secondary:hover .dashboard-shortcut-icon {
  background: linear-gradient(145deg, #ffffff, var(--shortcut-accent-hover));
  color: var(--shortcut-accent);
}

.dashboard-shortcut-primary {
  border-top: 2px solid var(--shortcut-accent);
}

.dashboard-shortcut-secondary {
  background: #f8fafc;
}

.dashboard-shortcut-secondary span {
  color: #475569;
}

.section-spacer {
  margin-top: 10px;
}

.auth-page {
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 34%),
    #eef4fb;
}

.auth-login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.auth-login-card {
  background: #ffffff;
  border: 1px solid rgba(219, 227, 238, 0.95);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
  max-width: 390px;
  overflow: hidden;
  width: 100%;
}

.auth-brand-strip {
  align-items: center;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  min-height: 116px;
  padding: 16px 16px 13px;
  position: relative;
}

.auth-brand-strip::after {
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.75), transparent);
  bottom: 0;
  content: "";
  height: 1px;
  left: 18px;
  position: absolute;
  right: 18px;
}

.auth-brand-wordmark-wrap {
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 8px;
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  display: flex;
  justify-content: center;
  padding: 8px 14px;
  width: min(292px, 100%);
}

.auth-brand-year {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
}

.auth-login-header {
  padding: 16px 16px 8px;
  text-align: center;
}

.auth-login-header h1 {
  color: var(--text-main);
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.auth-login-header p {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.auth-login-form,
.usuarios-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.auth-login-form {
  padding: 0 16px 13px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-form-group label {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 900;
}

.auth-form-group input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 14px;
  height: 38px;
  outline: none;
  padding: 0 10px;
}

.auth-form-group input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.auth-login-button {
  width: 100%;
}

.auth-login-message {
  border-radius: 8px;
  min-height: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 900;
}

.auth-login-message-erro,
.auth-login-message-ok {
  border: 1px solid;
  padding: 8px 9px;
}

.auth-login-message-erro {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.auth-login-message-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.auth-session-bar {
  align-items: center;
  background: #0f172a;
  border-bottom: 1px solid #111827;
  color: #ffffff;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 38px;
  padding: 6px clamp(8px, 1vw, 14px);
}

.auth-session-info {
  align-items: center;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.auth-session-info strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-session-info span {
  background: rgba(219, 234, 254, 0.14);
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: 999px;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  white-space: nowrap;
}

.auth-session-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.auth-session-actions a,
.auth-session-actions button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  min-height: 26px;
  padding: 4px 9px;
  text-decoration: none;
}

.auth-session-actions a:hover,
.auth-session-actions button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.auth-denied-card {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin: 18px auto;
  max-width: 620px;
  padding: 16px;
}

.auth-denied-card h1 {
  color: var(--text-main);
  font-size: 22px;
  line-height: 1.15;
  margin: 10px 0 6px;
}

.auth-denied-card p {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.auth-denied-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.gestao-acesso-top {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 11px 12px;
}

.gestao-acesso-top h1 {
  color: var(--text-main);
  font-size: 20px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.gestao-acesso-top p {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.gestao-icon-sprite {
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

.gestao-icon,
.gestao-title-icon {
  fill: none;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.gestao-icon {
  height: 15px;
  width: 15px;
}

.gestao-title-icon {
  background: var(--gestao-accent-soft, #eff6ff);
  border: 1px solid var(--gestao-accent-border, #bfdbfe);
  border-radius: 999px;
  color: var(--gestao-accent, #2563eb);
  height: 28px;
  padding: 6px;
  width: 28px;
}

.gestao-acesso-tabs {
  align-items: center;
  background: #eef2f7;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: inline-flex;
  gap: 4px;
  padding: 5px;
}

.gestao-tab {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  justify-content: center;
  min-height: 34px;
  padding: 5px 10px 5px 6px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.gestao-tab .gestao-icon {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  color: #64748b;
  height: 24px;
  padding: 5px;
  width: 24px;
}

.gestao-tab:hover {
  background: #ffffff;
  border-color: #dbe3ee;
  color: var(--text-main);
}

.gestao-tab.active {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.1);
  color: var(--primary);
}

.gestao-tab.active .gestao-icon {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.gestao-tab[data-tab="cursos"].active {
  color: #047857;
}

.gestao-tab[data-tab="perfis"].active {
  color: #0f766e;
}

.gestao-tab[data-tab="perfis"].active .gestao-icon {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.gestao-tab[data-tab="cursos"].active .gestao-icon {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.gestao-tab[data-tab="disciplinas"].active {
  color: #b45309;
}

.gestao-tab[data-tab="disciplinas"].active .gestao-icon {
  background: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
}

.gestao-painel {
  display: none;
}

.gestao-painel.active {
  display: block;
}

.gestao-painel-usuarios,
.gestao-modal-usuarios {
  --gestao-accent: #2563eb;
  --gestao-accent-soft: #eff6ff;
  --gestao-accent-border: #bfdbfe;
}

.gestao-painel-perfis,
.gestao-modal-perfis {
  --gestao-accent: #0f766e;
  --gestao-accent-soft: #f0fdfa;
  --gestao-accent-border: #99f6e4;
}

.gestao-painel-cursos,
.gestao-modal-cursos {
  --gestao-accent: #059669;
  --gestao-accent-soft: #ecfdf5;
  --gestao-accent-border: #a7f3d0;
}

.gestao-painel-disciplinas,
.gestao-modal-disciplinas {
  --gestao-accent: #d97706;
  --gestao-accent-soft: #fffbeb;
  --gestao-accent-border: #fde68a;
}

.gestao-panel-card {
  border-color: #dbe3ee;
  min-height: calc(100vh - 112px);
}

.gestao-grid {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(292px, 380px) minmax(0, 1fr);
}

.gestao-form-card,
.gestao-table-card {
  min-width: 0;
}

.gestao-card-header {
  align-items: center;
  background: #fbfdff;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  margin-bottom: 9px;
  padding: 8px 9px;
}

.gestao-card-header h2 {
  align-items: center;
  display: flex;
  gap: 9px;
  margin-bottom: 2px;
}

.gestao-card-header .table-subtitle {
  margin-top: 2px;
}

.gestao-panel-kicker {
  background: var(--gestao-accent-soft, #eff6ff);
  border: 1px solid var(--gestao-accent-border, #bfdbfe);
  border-radius: 999px;
  color: var(--gestao-accent, #2563eb);
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  margin: 0 0 2px 37px;
  padding: 4px 7px;
  text-transform: uppercase;
}

.gestao-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.gestao-action-btn,
.gestao-table-btn {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  justify-content: center;
}

.gestao-table-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.gestao-action-btn {
  border-radius: 7px;
  font-weight: 900;
}

.gestao-header-actions .btn-principal.gestao-action-btn,
.gestao-modal .btn-principal.gestao-action-btn {
  background: var(--gestao-accent, var(--primary));
  border-color: var(--gestao-accent, var(--primary));
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.gestao-header-actions .btn-principal.gestao-action-btn:hover,
.gestao-modal .btn-principal.gestao-action-btn:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.gestao-header-actions .btn-secundario.gestao-action-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.gestao-action-btn .gestao-icon,
.gestao-table-btn .gestao-icon {
  height: 14px;
  width: 14px;
}

.gestao-table-btn-status {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 27px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  transition: 0.2s ease;
}

.gestao-table-btn-status-danger {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.gestao-table-btn-status-danger:hover {
  background: #ffedd5;
  box-shadow: 0 6px 12px rgba(194, 65, 12, 0.10);
  transform: translateY(-1px);
}

.gestao-table-btn-status-success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.gestao-table-btn-status-success:hover {
  background: #dcfce7;
  box-shadow: 0 6px 12px rgba(4, 120, 87, 0.10);
  transform: translateY(-1px);
}

.gestao-modal-confirmacao {
  max-width: 560px;
}

.gestao-modal-icon-alerta {
  background: #fff7ed;
  color: #c2410c;
}

.gestao-confirmacao-box {
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.72), rgba(255, 255, 255, 0.96));
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 12px;
}

.gestao-confirmacao-box strong {
  color: #7c2d12;
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 5px;
}

.gestao-confirmacao-box p {
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.gestao-confirmar-btn-danger {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

.gestao-confirmar-btn-danger:hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

.usuarios-help {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
}

.usuarios-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.gestao-table-wrapper {
  border-radius: 8px;
  max-height: calc(100vh - 190px);
}

.gestao-table {
  min-width: 780px;
}

.gestao-table th:last-child,
.gestao-table td:last-child {
  text-align: center;
  white-space: nowrap;
  width: 210px;
}

.gestao-table td:first-child {
  color: var(--text-main);
  font-weight: 800;
}

.gestao-table tbody tr:hover td {
  background: var(--gestao-accent-soft, #f8fbff);
}

.gestao-modal-overlay {
  animation: gestaoOverlayIn 0.18s ease-out;
  backdrop-filter: blur(6px);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.16), transparent 34%),
    rgba(15, 23, 42, 0.66);
  padding: 18px;
}

.gestao-modal-overlay.is-closing {
  animation: gestaoOverlayOut 0.18s ease-in forwards;
}

.gestao-modal {
  animation: gestaoModalIn 0.2s cubic-bezier(0.2, 0.85, 0.25, 1.15);
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-top: 4px solid var(--gestao-accent, #2563eb);
  border-radius: 14px;
  box-shadow:
    0 28px 90px rgba(15, 23, 42, 0.32),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
  max-height: calc(100vh - 36px);
  max-width: 800px;
  overflow: hidden;
  transform-origin: center;
}

.gestao-modal-overlay.is-closing .gestao-modal {
  animation: gestaoModalOut 0.18s ease-in forwards;
}

.gestao-modal .gestao-modal-header {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%),
    linear-gradient(135deg, var(--gestao-accent-soft, #eff6ff), #ffffff);
  border-bottom: 1px solid #e2e8f0;
  gap: 14px;
  padding: 15px 17px;
  position: relative;
}

.gestao-modal .gestao-modal-header::after {
  background: var(--gestao-accent, #2563eb);
  bottom: -1px;
  content: "";
  height: 2px;
  left: 17px;
  opacity: 0.85;
  position: absolute;
  width: 72px;
}

.gestao-modal-heading {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
}

.gestao-modal-icon {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), var(--gestao-accent-soft, #eff6ff));
  border: 1px solid var(--gestao-accent-border, #bfdbfe);
  border-radius: 999px;
  box-shadow:
    0 10px 22px color-mix(in srgb, var(--gestao-accent, #2563eb) 18%, transparent),
    0 1px 0 rgba(255, 255, 255, 0.85) inset;
  color: var(--gestao-accent, #2563eb);
  display: inline-flex;
  flex: 0 0 auto;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.gestao-modal-icon .gestao-title-icon {
  background: transparent;
  border: 0;
  border-radius: 0;
  height: 24px;
  padding: 0;
  width: 24px;
}

.gestao-modal .modal-title {
  color: #0f172a;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.05;
  margin: 0 0 4px;
}

.gestao-modal .modal-subtitle {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.gestao-modal .modal-fechar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  color: #64748b;
  flex: 0 0 auto;
  font-size: 19px;
  height: 34px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  width: 34px;
}

.gestao-modal .modal-fechar:hover {
  background: #f8fafc;
  border-color: var(--gestao-accent-border, #cbd5e1);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  transform: translateY(-1px);
}

.gestao-modal .modal-body {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  max-height: calc(100vh - 138px);
  overflow-y: auto;
  padding: 16px 18px 17px;
}

.gestao-modal .form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gestao-modal .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gestao-modal .form-group-full {
  grid-column: 1 / -1;
}

.gestao-modal .usuarios-form {
  gap: 11px;
}

.gestao-modal .form-group label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.gestao-modal input,
.gestao-modal select,
.gestao-modal textarea {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86) inset;
  color: #0f172a;
  font-size: 13px;
  font-weight: 650;
  height: 38px;
  outline: none;
  padding: 0 11px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
  width: 100%;
}

.gestao-modal textarea {
  height: auto;
  line-height: 1.35;
  min-height: 70px;
  padding: 9px 11px;
  resize: vertical;
}

.gestao-modal input:hover,
.gestao-modal select:hover,
.gestao-modal textarea:hover {
  background: #ffffff;
  border-color: #94a3b8;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 5px 14px rgba(15, 23, 42, 0.05);
}

.gestao-modal input:focus,
.gestao-modal select:focus,
.gestao-modal textarea:focus {
  background: #ffffff;
  border-color: var(--gestao-accent, var(--primary));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--gestao-accent, #2563eb) 16%, transparent),
    0 8px 18px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.gestao-modal .usuarios-help {
  background: #f8fafc;
  border-color: #dbe3ee;
  font-weight: 800;
}

.gestao-modal .usuarios-actions {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

.gestao-modal .usuarios-actions .btn-secundario {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
  color: #334155;
}

.gestao-modal .usuarios-actions .btn-secundario:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.gestao-modal .usuarios-actions .btn-principal {
  min-width: 142px;
}

.gestao-modal .usuarios-actions .gestao-action-btn {
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.gestao-modal .mensagem-sucesso,
.gestao-modal .mensagem-erro {
  margin-top: 0;
}

.gestao-table-perfis {
  min-width: 860px;
}

.gestao-table-perfis td:nth-child(2) {
  color: #475569;
  font-weight: 700;
  max-width: 360px;
}

.perfil-count-pill {
  align-items: center;
  background: var(--gestao-accent-soft, #f8fafc);
  border: 1px solid var(--gestao-accent-border, #dbe3ee);
  border-radius: 999px;
  color: var(--gestao-accent, #2563eb);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.perfil-count-pill-empty {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.gestao-modal-perfis {
  max-width: 920px;
}

.perfil-modal-content {
  display: grid;
  gap: 12px;
}

.perfil-modal-summary {
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.72), rgba(255, 255, 255, 0.96)),
    #ffffff;
  border: 1px solid var(--gestao-accent-border, #99f6e4);
  border-radius: 11px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 150px;
  padding: 11px;
}

.perfil-permissoes-card {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.perfil-permissoes-top {
  align-items: center;
  background: #fbfdff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
}

.perfil-permissoes-top div {
  display: grid;
  gap: 2px;
}

.perfil-permissoes-top strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
}

.perfil-permissoes-top span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.perfil-permissoes-hint {
  background: var(--gestao-accent-soft, #f0fdfa);
  border: 1px solid var(--gestao-accent-border, #99f6e4);
  border-radius: 999px;
  color: var(--gestao-accent, #0f766e) !important;
  flex: 0 0 auto;
  padding: 5px 8px;
  white-space: nowrap;
}

.perfil-permissoes-lista {
  background: #f8fafc;
  display: grid;
  gap: 9px;
  max-height: 352px;
  overflow-y: auto;
  padding: 10px;
}

.perfil-permissao-grupo {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
}

.perfil-permissao-categoria {
  background:
    linear-gradient(135deg, var(--gestao-accent-soft, #f0fdfa), #ffffff);
  border-bottom: 1px solid #e2e8f0;
  color: var(--gestao-accent, #0f766e);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  padding: 8px 10px;
  text-transform: uppercase;
}

.perfil-permissao-table {
  border-collapse: collapse;
  width: 100%;
}

.perfil-permissao-table th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 950;
  padding: 7px 10px;
  text-align: left;
  text-transform: uppercase;
}

.perfil-permissao-table th:last-child,
.perfil-permissao-table td:last-child {
  text-align: center;
  width: 92px;
}

.perfil-permissao-table td {
  border-bottom: 1px solid #edf2f7;
  padding: 8px 10px;
  vertical-align: middle;
}

.perfil-permissao-table tr:last-child td {
  border-bottom: 0;
}

.perfil-permissao-table tbody tr {
  transition: background 0.18s ease;
}

.perfil-permissao-table tbody tr:hover {
  background: #fbfdff;
}

.perfil-permissao-table tbody tr.is-important {
  background: linear-gradient(90deg, rgba(240, 253, 250, 0.85), #ffffff 52%);
}

.perfil-permissao-table tbody tr.is-important:hover {
  background: linear-gradient(90deg, rgba(204, 251, 241, 0.48), #ffffff 58%);
}

.perfil-permissao-table tbody tr.is-disabled {
  opacity: 0.68;
}

.perfil-permissao-texto {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.perfil-permissao-texto strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.perfil-permissao-texto small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.perfil-important-pill {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  color: #0e7490;
  display: inline-flex;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  margin-left: 6px;
  padding: 3px 5px;
  text-transform: uppercase;
  vertical-align: middle;
}

.perfil-important-pill-alert {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.perfil-switch {
  display: inline-flex;
  height: 24px;
  position: relative;
  width: 42px;
}

.perfil-switch input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.perfil-switch span {
  background: #cbd5e1;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12) inset;
  inset: 0;
  position: absolute;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.perfil-switch span::after {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.22);
  content: "";
  height: 18px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 0.18s ease;
  width: 18px;
}

.perfil-switch input:checked + span {
  background: var(--gestao-accent, #0f766e);
  border-color: var(--gestao-accent, #0f766e);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gestao-accent, #0f766e) 12%, transparent);
}

.perfil-switch input:checked + span::after {
  transform: translateX(18px);
}

.perfil-switch input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--gestao-accent, #0f766e) 55%, transparent);
  outline-offset: 2px;
}

@keyframes gestaoOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gestaoOverlayOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes gestaoModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gestaoModalOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gestao-modal-overlay,
  .gestao-modal-overlay.is-closing,
  .gestao-modal,
  .gestao-modal-overlay.is-closing .gestao-modal {
    animation: none;
  }

  .gestao-modal input:focus,
  .gestao-modal select:focus,
  .gestao-modal .modal-fechar:hover,
  .gestao-modal .usuarios-actions .btn-secundario:hover,
  .gestao-header-actions .btn-principal.gestao-action-btn:hover,
  .gestao-modal .btn-principal.gestao-action-btn:hover {
    transform: none;
  }
}

@media (max-width: 1200px) {
  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-shortcut-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

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

@media (max-width: 700px) {
  .page-top-actions {
    align-items: stretch;
  }

  .page-top-actions-left,
  .page-top-actions-right {
    width: 100%;
  }

  .mini-link,
  .mini-chip {
    min-height: 30px;
  }

  .app-brand-mini {
    height: 32px;
  }

  .dashboard-top {
    flex-direction: column;
  }

  .dashboard-top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .auth-session-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-session-actions {
    flex-wrap: wrap;
  }

  .gestao-acesso-top {
    align-items: stretch;
    flex-direction: column;
  }

  .gestao-acesso-tabs {
    justify-content: stretch;
    width: 100%;
  }

  .gestao-tab {
    flex: 1;
  }

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

  .gestao-modal-overlay {
    padding: 10px;
  }

  .gestao-modal {
    max-height: calc(100vh - 20px);
  }

  .gestao-modal .gestao-modal-header {
    align-items: flex-start;
    padding: 12px;
  }

  .gestao-modal-heading {
    align-items: flex-start;
  }

  .gestao-modal .modal-body {
    max-height: calc(100vh - 128px);
    padding: 12px;
  }

  .gestao-modal .form-grid {
    grid-template-columns: 1fr;
  }

  .perfil-modal-summary {
    grid-template-columns: 1fr;
  }

  .perfil-permissoes-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .perfil-permissoes-hint {
    white-space: normal;
  }

  .gestao-modal .usuarios-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .gestao-modal .usuarios-actions .gestao-action-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .dashboard-kpis,
  .dashboard-operational-grid,
  .dashboard-shortcut-grid {
    grid-template-columns: 1fr;
  }

  .auth-brand-strip {
    min-height: 104px;
    padding: 14px 12px 12px;
  }

  .auth-brand-wordmark-wrap {
    padding: 7px 12px;
    width: min(264px, 100%);
  }

  .brand-wordmark-login {
    --brand-size: 33px;
  }

}

/* Base responsiva global: preserva o desktop e adapta componentes compartilhados. */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

.table-wrapper,
.table-wrapper-compact,
.gestao-table-wrapper {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}

.table-compact,
.gestao-table {
  width: 100%;
}

@media (max-width: 1400px) {
  :root {
    --page-padding: 10px;
  }

  .page-shell,
  .page-shell-wide {
    max-width: 100%;
  }

  .dashboard-kpis,
  .dashboard-operational-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 1024px) {
  :root {
    --page-padding: 9px;
  }

  .main-content,
  .main-content-compact {
    padding: var(--page-padding);
  }

  .dashboard-top {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .dashboard-brand-row {
    align-items: flex-start;
  }

  .dashboard-top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .dashboard-panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .dashboard-shortcut-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .gestao-acesso-tabs {
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .gestao-tab {
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  :root {
    --page-padding: 8px;
  }

  .page-top-actions,
  .page-top-actions-left,
  .page-top-actions-right,
  .table-header,
  .dashboard-top-actions,
  .gestao-header-actions {
    align-items: stretch;
    width: 100%;
  }

  .page-top-actions,
  .table-header,
  .gestao-card-header {
    flex-direction: column;
  }

  .mini-link,
  .mini-chip,
  .btn-principal,
  .btn-secundario {
    min-height: 36px;
  }

  .app-brand-mini {
    height: 36px;
    padding-inline: 8px;
  }

  .brand-wordmark-mini {
    --brand-size: 17px;
  }

  .brand-wordmark-dashboard {
    --brand-size: 27px;
    min-height: 46px;
    padding-inline: 13px;
  }

  .btn-principal.pequeno,
  .btn-secundario.pequeno {
    min-height: 34px;
  }

  .dashboard-title-group h1 {
    font-size: 22px;
  }

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

  .dashboard-kpi,
  .dashboard-operational-item {
    min-height: 86px;
  }

  .gestao-panel-card {
    min-height: auto;
  }

  .gestao-acesso-tabs {
    justify-content: flex-start;
  }

  .gestao-table-wrapper {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .main-content,
  .main-content-compact {
    padding: 7px;
  }

  .page-top-actions-left,
  .page-top-actions-right,
  .table-header-actions,
  .dashboard-top-actions,
  .gestao-header-actions,
  .auth-session-actions {
    flex-direction: column;
  }

  .mini-link,
  .mini-chip,
  .table-header-actions > *,
  .dashboard-top-actions > *,
  .gestao-header-actions > *,
  .auth-session-actions > *,
  .form-actions > *,
  .modal-actions > * {
    width: 100%;
  }

  .app-brand-mini {
    align-self: flex-start;
    width: auto;
  }

  .dashboard-kpis,
  .dashboard-operational-grid,
  .dashboard-shortcut-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-shortcut {
    min-height: 52px;
  }

  .gestao-modal-overlay,
  .modal-overlay {
    padding: 8px;
  }

  .gestao-modal,
  .modal-box {
    max-height: calc(100vh - 16px);
    width: min(100%, calc(100vw - 16px));
  }

  .gestao-modal .modal-body,
  .modal-body {
    max-height: calc(100vh - 126px);
    overflow-y: auto;
  }
}

@media (max-width: 420px) {
  .main-content,
  .main-content-compact {
    padding: 6px;
  }

  .dashboard-title-group h1 {
    font-size: 20px;
  }

  .dashboard-kpi strong {
    font-size: 28px;
  }

  .dashboard-operational-item strong {
    font-size: 24px;
  }

  .mini-link,
  .mini-chip,
  .btn-principal,
  .btn-secundario {
    font-size: 12px;
  }
}

/* Responsividade especifica para dashboard, gestao e formularios de uso frequente. */
@media (max-width: 1200px) {
  .dashboard-kpis,
  .dashboard-operational-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-shortcut-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .dashboard-top {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-top-actions {
    justify-content: flex-start;
  }

  .dashboard-shortcut {
    min-height: 58px;
  }

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

  .gestao-panel-card {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .dashboard-kpi,
  .dashboard-operational-item {
    min-height: 82px;
  }

  .dashboard-kpi strong {
    font-size: 30px;
  }

  .dashboard-operational-item strong {
    font-size: 25px;
  }

  .dashboard-shortcut {
    align-items: center;
    min-height: 56px;
  }

  .gestao-modal .form-grid,
  .gestao-modal .usuarios-form,
  .usuarios-form {
    grid-template-columns: 1fr;
  }

  .gestao-modal input,
  .gestao-modal select,
  .gestao-modal textarea,
  .auth-form-group input {
    min-height: 40px;
  }
}

@media (max-width: 560px) {
  .dashboard-kpis,
  .dashboard-operational-grid,
  .dashboard-shortcut-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-header {
    align-items: flex-start;
  }

  .dashboard-shortcut-icon {
    height: 38px;
    width: 38px;
  }

  .dashboard-shortcut strong {
    font-size: 12px;
  }

  .dashboard-shortcut span {
    font-size: 11px;
  }

  .btn-principal,
  .btn-secundario,
  .mini-link,
  .mini-chip {
    min-height: 38px;
  }

  .btn-principal.pequeno,
  .btn-secundario.pequeno {
    min-height: 36px;
  }
}

/* Responsividade de tabelas: scroll horizontal tratado sem quebrar o desktop. */
.table-wrapper,
.table-wrapper-compact,
.gestao-table-wrapper {
  overscroll-behavior-x: contain;
  scrollbar-color: #94a3b8 #e2e8f0;
  scrollbar-width: thin;
}

.table-wrapper::-webkit-scrollbar,
.table-wrapper-compact::-webkit-scrollbar,
.gestao-table-wrapper::-webkit-scrollbar {
  height: 9px;
  width: 9px;
}

.table-wrapper::-webkit-scrollbar-track,
.table-wrapper-compact::-webkit-scrollbar-track,
.gestao-table-wrapper::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.table-wrapper-compact::-webkit-scrollbar-thumb,
.gestao-table-wrapper::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border: 2px solid #e2e8f0;
  border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.table-wrapper-compact::-webkit-scrollbar-thumb:hover,
.gestao-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.table-compact th,
.table-compact td,
.gestao-table th,
.gestao-table td {
  overflow-wrap: normal;
}

.table-compact th:last-child,
.table-compact td:last-child,
.gestao-table th:last-child,
.gestao-table td:last-child {
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .table-wrapper,
  .table-wrapper-compact,
  .gestao-table-wrapper {
    background:
      linear-gradient(90deg, #ffffff 30%, rgba(255, 255, 255, 0)) left center / 24px 100% no-repeat,
      linear-gradient(270deg, #ffffff 30%, rgba(255, 255, 255, 0)) right center / 24px 100% no-repeat,
      linear-gradient(90deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0)) left center / 10px 100% no-repeat,
      linear-gradient(270deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0)) right center / 10px 100% no-repeat,
      #ffffff;
    max-height: none;
  }

  .table-compact,
  .gestao-table {
    min-width: 860px;
  }

  .gestao-table-perfis {
    min-width: 900px;
  }
}

@media (max-width: 768px) {
  .table-compact thead th,
  .gestao-table thead th {
    font-size: 11px;
    padding: 8px 9px;
  }

  .table-compact tbody td,
  .gestao-table tbody td {
    font-size: 12px;
    padding: 8px 9px;
  }

  .acoes-tabela,
  .gestao-table td:last-child {
    align-items: center;
    gap: 5px;
  }

  .btn-mini-relatorio,
  .btn-mini-editar-cancelado,
  .btn-mini-anotacao,
  .gestao-table-btn {
    min-height: 30px;
    padding: 6px 8px;
  }
}

@media (max-width: 560px) {
  .table-wrapper,
  .table-wrapper-compact,
  .gestao-table-wrapper {
    border-radius: 7px;
  }

  .table-compact,
  .gestao-table {
    min-width: 780px;
  }

  .gestao-table-perfis {
    min-width: 860px;
  }
}

/* Responsividade de modais compartilhados e modais da gestao operacional. */
.modal-overlay,
.gestao-modal-overlay {
  overflow-y: auto;
}

.modal-box,
.gestao-modal {
  display: flex;
  flex-direction: column;
}

.modal-header,
.gestao-modal .gestao-modal-header {
  flex: 0 0 auto;
}

.modal-body,
.gestao-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
}

.modal-actions,
.gestao-modal .usuarios-actions {
  flex: 0 0 auto;
}

@media (max-width: 1024px) {
  .modal-overlay,
  .gestao-modal-overlay {
    align-items: center;
    padding: 12px;
  }

  .modal-box,
  .gestao-modal {
    max-height: calc(100vh - 24px);
    width: min(100%, calc(100vw - 24px));
  }

  .gestao-modal {
    max-width: 760px;
  }

  .gestao-modal-perfis {
    max-width: 880px;
  }

  .gestao-modal .modal-body {
    max-height: calc(100vh - 134px);
  }
}

@media (max-width: 768px) {
  .modal-overlay,
  .gestao-modal-overlay {
    align-items: stretch;
    padding: 9px;
  }

  .modal-box,
  .gestao-modal {
    border-radius: 10px;
    max-height: calc(100vh - 18px);
    width: min(100%, calc(100vw - 18px));
  }

  .modal-header,
  .gestao-modal .gestao-modal-header {
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
  }

  .gestao-modal .gestao-modal-header {
    flex-direction: row;
  }

  .gestao-modal-heading {
    gap: 9px;
  }

  .gestao-modal-icon {
    height: 38px;
    width: 38px;
  }

  .gestao-modal-icon .gestao-title-icon {
    height: 20px;
    width: 20px;
  }

  .modal-title,
  .gestao-modal .modal-title {
    font-size: 17px;
  }

  .modal-subtitle,
  .gestao-modal .modal-subtitle {
    font-size: 11.5px;
    line-height: 1.3;
  }

  .modal-fechar,
  .gestao-modal .modal-fechar {
    height: 36px;
    min-width: 36px;
    width: 36px;
  }

  .modal-body,
  .gestao-modal .modal-body {
    max-height: calc(100vh - 122px);
    overflow-y: auto;
    padding: 11px 12px;
  }

  .gestao-modal .form-grid,
  .gestao-modal .usuarios-form,
  .perfil-modal-summary {
    grid-template-columns: 1fr;
  }

  .gestao-modal input,
  .gestao-modal select,
  .gestao-modal textarea {
    min-height: 40px;
  }

  .gestao-modal textarea {
    min-height: 86px;
  }

  .gestao-modal .usuarios-actions,
  .modal-actions {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    bottom: 0;
    margin: 0;
    padding-top: 10px;
    position: sticky;
    z-index: 4;
  }
}

@media (max-width: 560px) {
  .modal-overlay,
  .gestao-modal-overlay {
    padding: 6px;
  }

  .modal-box,
  .gestao-modal {
    border-radius: 9px;
    max-height: calc(100vh - 12px);
    width: min(100%, calc(100vw - 12px));
  }

  .modal-header,
  .gestao-modal .gestao-modal-header {
    padding: 10px;
  }

  .gestao-modal .gestao-modal-header {
    gap: 8px;
  }

  .gestao-modal-icon {
    display: none;
  }

  .modal-body,
  .gestao-modal .modal-body {
    max-height: calc(100vh - 112px);
    padding: 10px;
  }

  .gestao-modal .usuarios-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 7px;
  }

  .gestao-modal .usuarios-actions > *,
  .modal-actions > * {
    min-height: 38px;
    width: 100%;
  }

  .perfil-permissoes-lista {
    max-height: 46vh;
  }
}

/* Ajustes finais para toque e consistencia em dispositivos sem hover. */
@media (hover: none) {
  .dashboard-card:hover,
  .app-brand-mini:hover,
  .dashboard-operational-item:hover,
  .dashboard-shortcut:hover,
  .dashboard-shortcut:hover .dashboard-shortcut-icon,
  .gestao-header-actions .btn-principal.gestao-action-btn:hover,
  .gestao-modal .btn-principal.gestao-action-btn:hover,
  .gestao-modal .modal-fechar:hover,
  .gestao-modal .usuarios-actions .btn-secundario:hover {
    transform: none;
  }

  .btn-principal:hover {
    background: var(--primary);
  }

  .btn-secundario:hover {
    background: #e2e8f0;
  }
}

@media (max-width: 640px) {
  .dashboard-card,
  .dashboard-kpi,
  .dashboard-operational-item,
  .dashboard-shortcut,
  .filtro-card,
  .card-resumo,
  .modal-section,
  .gestao-card-header {
    overflow-wrap: anywhere;
  }

  .dashboard-shortcut,
  .dashboard-card,
  .gestao-tab,
  .btn-principal,
  .btn-secundario,
  .modal-fechar {
    touch-action: manipulation;
  }
}

/* Tema claro/escuro global. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-body: #0b1120;
  --bg-card: #111827;
  --bg-soft: #0f172a;
  --border-color: #334155;
  --border-light: #1f2937;
  --text-main: #e5e7eb;
  --text-soft: #94a3b8;
  --text-white: #f8fafc;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --accent: #38bdf8;
  --brand-black: #f8fafc;
  --brand-navy: #93c5fd;
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.14), transparent 32%),
    #0b1120;
  color: var(--text-main);
}

.theme-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.13);
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  min-height: 34px;
  padding: 4px 6px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.theme-toggle-floating {
  position: fixed;
  right: 12px;
  top: 10px;
  z-index: 1200;
}

.theme-toggle-inline {
  flex: 0 0 auto;
}

.theme-toggle:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}

.theme-toggle svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 15px;
}

.theme-toggle-icon {
  align-items: center;
  border-radius: 999px;
  color: #64748b;
  display: inline-flex;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
}

.theme-toggle-track {
  align-items: center;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  display: inline-flex;
  height: 24px;
  padding: 2px;
  width: 44px;
}

.theme-toggle-thumb {
  align-items: center;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  color: #f59e0b;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  transform: translateX(0);
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease;
  width: 18px;
}

.theme-toggle[data-theme="dark"] .theme-toggle-track {
  background: #172554;
  border-color: #1d4ed8;
}

.theme-toggle[data-theme="dark"] .theme-toggle-thumb {
  color: #bfdbfe;
  transform: translateX(18px);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(15, 23, 42, 0.94);
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .theme-toggle-icon {
  color: #94a3b8;
}

html[data-theme="dark"] .theme-toggle-icon-dark {
  color: #bfdbfe;
}

html[data-theme="light"] .theme-toggle-icon-light {
  color: #f59e0b;
}

html[data-theme="dark"] .mini-link,
html[data-theme="dark"] .app-brand-mini,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .dashboard-operational-item,
html[data-theme="dark"] .dashboard-shortcut,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .filtro-card,
html[data-theme="dark"] .card-resumo,
html[data-theme="dark"] .auth-login-card,
html[data-theme="dark"] .gestao-panel-card,
html[data-theme="dark"] .gestao-card-header,
html[data-theme="dark"] .gestao-modal,
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .modal-padrao,
html[data-theme="dark"] .modal-section,
html[data-theme="dark"] .relatorio-bloco,
html[data-theme="dark"] .anotacoes-contexto-card,
html[data-theme="dark"] .ultima-anotacao-card,
html[data-theme="dark"] .modal-turma-metrica,
html[data-theme="dark"] .modal-anotacoes-pill {
  background: #111827;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .dashboard-operational-item {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

html[data-theme="dark"] .dashboard-shortcut-secondary,
html[data-theme="dark"] .gestao-tab,
html[data-theme="dark"] .relatorio-info-item,
html[data-theme="dark"] .perfil-modal-summary-card,
html[data-theme="dark"] .perfil-permissao-row {
  background: #0f172a;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .dashboard-top,
html[data-theme="dark"] .auth-brand-strip,
html[data-theme="dark"] .table-compact thead,
html[data-theme="dark"] .gestao-table thead,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .gestao-modal .gestao-modal-header,
html[data-theme="dark"] .modal-anotacoes-header,
html[data-theme="dark"] .modal-turma-header {
  background: #020617;
  border-color: #1e293b;
  color: #f8fafc;
}

html[data-theme="dark"] .brand-wordmark-dashboard,
html[data-theme="dark"] .auth-brand-wordmark-wrap {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.9);
}

html[data-theme="dark"] .brand-wordmark-dashboard,
html[data-theme="dark"] .auth-brand-wordmark-wrap .brand-wordmark {
  --brand-black: #050505;
  --brand-navy: #111899;
}

html[data-theme="dark"] .mini-chip {
  background: #172554;
  border-color: #1d4ed8;
  color: #bfdbfe;
}

html[data-theme="dark"] .dashboard-title-group .mini-chip {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(147, 197, 253, 0.32);
  color: #dbeafe;
}

html[data-theme="dark"] .dashboard-kpi .dashboard-metric-head span,
html[data-theme="dark"] .dashboard-operational-item .dashboard-metric-head span,
html[data-theme="dark"] .dashboard-shortcut span,
html[data-theme="dark"] .dashboard-panel-header p,
html[data-theme="dark"] .table-subtitle,
html[data-theme="dark"] .modal-subtitle,
html[data-theme="dark"] .card-resumo-titulo,
html[data-theme="dark"] .filtro-card-titulo,
html[data-theme="dark"] .auth-login-header p,
html[data-theme="dark"] .gestao-panel-kicker,
html[data-theme="dark"] small {
  color: #94a3b8;
}

html[data-theme="dark"] .dashboard-kpi strong,
html[data-theme="dark"] .dashboard-operational-item strong,
html[data-theme="dark"] .dashboard-shortcut strong,
html[data-theme="dark"] .dashboard-panel-header h2,
html[data-theme="dark"] .table-header h2,
html[data-theme="dark"] .auth-login-header h1,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .card-resumo strong,
html[data-theme="dark"] .relatorio-info-item strong,
html[data-theme="dark"] label {
  color: #f8fafc;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input-filtro,
html[data-theme="dark"] .modal-form input,
html[data-theme="dark"] .modal-form select,
html[data-theme="dark"] .modal-form textarea,
html[data-theme="dark"] .gestao-modal input,
html[data-theme="dark"] .gestao-modal select,
html[data-theme="dark"] .gestao-modal textarea,
html[data-theme="dark"] .auth-form-group input {
  background: #0f172a;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .auth-form-group input:focus {
  background: #111827;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-wrapper-compact,
html[data-theme="dark"] .gestao-table-wrapper,
html[data-theme="dark"] .relatorio-table-wrap {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] .table-compact,
html[data-theme="dark"] .gestao-table,
html[data-theme="dark"] .relatorio-mini-table {
  background: #111827;
  color: #e5e7eb;
}

html[data-theme="dark"] .table-compact tbody tr,
html[data-theme="dark"] .gestao-table tbody tr,
html[data-theme="dark"] .relatorio-mini-table tbody tr {
  border-color: #1f2937;
}

html[data-theme="dark"] .table-compact tbody tr:hover,
html[data-theme="dark"] .gestao-table tbody tr:hover {
  background: rgba(96, 165, 250, 0.08);
}

html[data-theme="dark"] .table-compact td,
html[data-theme="dark"] .gestao-table td,
html[data-theme="dark"] .relatorio-mini-table td {
  border-color: #1f2937;
  color: #e5e7eb;
}

html[data-theme="dark"] .sem-registros,
html[data-theme="dark"] .resumo-filtros,
html[data-theme="dark"] .resumo-filtros p {
  color: #94a3b8;
}

html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .gestao-modal-overlay {
  background: rgba(2, 6, 23, 0.72);
}

html[data-theme="dark"] .modal-actions,
html[data-theme="dark"] .anotacoes-form-actions,
html[data-theme="dark"] .gestao-modal .usuarios-actions {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] .btn-secundario {
  background: #1f2937;
  color: #e5e7eb;
}

html[data-theme="dark"] .btn-secundario:hover {
  background: #334155;
}

html[data-theme="dark"] .btn-principal {
  background: #2563eb;
  color: #ffffff;
}

html[data-theme="dark"] .btn-principal:hover {
  background: #1d4ed8;
}

html[data-theme="dark"] .badge-aberto {
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

html[data-theme="dark"] .badge-andamento,
html[data-theme="dark"] .badge-pix {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

html[data-theme="dark"] .badge-aguardando,
html[data-theme="dark"] .badge-especie {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

html[data-theme="dark"] .badge-cartao {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

html[data-theme="dark"] .whatsapp-link {
  color: #86efac;
}

html[data-theme="dark"] .whatsapp-link-icone {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(134, 239, 172, 0.35);
  color: #bbf7d0;
}

@media (max-width: 640px) {
  .theme-toggle-floating {
    right: 8px;
    top: 8px;
  }

  .theme-toggle-inline {
    align-self: flex-start;
  }
}

/* Acabamento extra do tema: estado ativo, sombras e bordas por tema. */
html[data-theme="dark"] {
  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.24);
  --shadow-modal: 0 26px 70px rgba(0, 0, 0, 0.36);
  --theme-ring: rgba(96, 165, 250, 0.20);
}

.theme-toggle {
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  gap: 5px;
  min-height: 32px;
  padding: 4px 5px;
}

.theme-toggle:hover {
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--theme-ring);
  outline-offset: 3px;
}

.theme-toggle svg {
  height: 14px;
  width: 14px;
}

.theme-toggle-icon {
  min-height: 21px;
  min-width: 21px;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.theme-toggle-track {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  height: 23px;
  width: 42px;
}

.theme-toggle-thumb {
  box-shadow:
    0 2px 7px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  height: 17px;
  width: 17px;
}

.theme-toggle[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(17px);
}

.theme-toggle[data-theme="light"] .theme-toggle-icon-light,
.theme-toggle[data-theme="dark"] .theme-toggle-icon-dark {
  background: rgba(96, 165, 250, 0.12);
}

.theme-toggle[data-theme="light"] .theme-toggle-icon-dark,
.theme-toggle[data-theme="dark"] .theme-toggle-icon-light {
  opacity: 0.58;
}

html[data-theme="light"] .theme-toggle-icon-light {
  background: rgba(245, 158, 11, 0.12);
}

html[data-theme="dark"] .theme-toggle-icon-dark {
  background: rgba(96, 165, 250, 0.13);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 30%),
    linear-gradient(180deg, #101827 0%, #0f172a 48%, #0b1220 100%);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(17, 24, 39, 0.88);
  border-color: rgba(71, 85, 105, 0.86);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .theme-toggle:hover {
  border-color: rgba(96, 165, 250, 0.58);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .theme-toggle-track {
  background: linear-gradient(135deg, #172554, #1e3a8a);
  border-color: rgba(96, 165, 250, 0.35);
}

html[data-theme="dark"] .theme-toggle-thumb {
  background: #dbeafe;
}

html[data-theme="dark"] .dashboard-top,
html[data-theme="dark"] .auth-brand-strip,
html[data-theme="dark"] .table-compact thead,
html[data-theme="dark"] .gestao-table thead,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .gestao-modal .gestao-modal-header,
html[data-theme="dark"] .modal-anotacoes-header,
html[data-theme="dark"] .modal-turma-header {
  background: linear-gradient(180deg, #0b1220 0%, #07111f 100%);
  border-color: #1f2a3d;
}

html[data-theme="dark"] .mini-link,
html[data-theme="dark"] .app-brand-mini,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .dashboard-operational-item,
html[data-theme="dark"] .dashboard-shortcut,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .filtro-card,
html[data-theme="dark"] .card-resumo,
html[data-theme="dark"] .auth-login-card,
html[data-theme="dark"] .gestao-panel-card,
html[data-theme="dark"] .gestao-card-header,
html[data-theme="dark"] .gestao-modal,
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .modal-padrao,
html[data-theme="dark"] .modal-section,
html[data-theme="dark"] .relatorio-bloco,
html[data-theme="dark"] .anotacoes-contexto-card,
html[data-theme="dark"] .ultima-anotacao-card,
html[data-theme="dark"] .modal-turma-metrica,
html[data-theme="dark"] .modal-anotacoes-pill {
  border-color: #2f3b4f;
  box-shadow: var(--shadow-card);
}

html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .modal-padrao,
html[data-theme="dark"] .gestao-modal {
  box-shadow: var(--shadow-modal);
}

html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .dashboard-operational-item {
  background: linear-gradient(180deg, #121c2f 0%, #101827 100%);
}

html[data-theme="dark"] .dashboard-shortcut {
  background: linear-gradient(180deg, #121c2f 0%, #111827 100%);
}

html[data-theme="dark"] .table-compact tbody tr:nth-child(even),
html[data-theme="dark"] .gestao-table tbody tr:nth-child(even),
html[data-theme="dark"] .relatorio-mini-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.38);
}

html[data-theme="dark"] .table-compact tbody tr:hover,
html[data-theme="dark"] .gestao-table tbody tr:hover {
  background: rgba(96, 165, 250, 0.10);
}

html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .gestao-modal-overlay {
  backdrop-filter: blur(3px);
  background: rgba(2, 6, 23, 0.66);
}

html[data-theme="dark"] .dashboard-status,
html[data-theme="dark"] .auth-brand-year {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
}

/* Refinamento final focado em tabelas e modais. */
:root {
  --table-row-bg: #ffffff;
  --table-row-alt: #f5f8fc;
  --table-row-hover: #e8f1ff;
  --table-cell-border: #cbd5e1;
  --table-head-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
  --modal-surface: #ffffff;
  --modal-header-bg: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  --modal-footer-bg: #f8fafc;
  --modal-input-bg: #ffffff;
  --modal-input-border: #9fb0c7;
}

html[data-theme="dark"] {
  --table-row-bg: #111a2b;
  --table-row-alt: #0d1626;
  --table-row-hover: rgba(96, 165, 250, 0.16);
  --table-cell-border: #3d4d66;
  --table-head-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
  --modal-surface: #111a2b;
  --modal-header-bg: linear-gradient(180deg, #162238 0%, #111a2b 100%);
  --modal-footer-bg: #0d1626;
  --modal-input-bg: #0a1220;
  --modal-input-border: #53657f;
}

html[data-theme] .table-wrapper,
html[data-theme] .table-wrapper-compact,
html[data-theme] .gestao-table-wrapper,
html[data-theme] .relatorio-table-wrap {
  background: var(--table-row-bg);
  border: 1px solid var(--table-cell-border);
  box-shadow: var(--shadow-card-token);
}

html[data-theme] .table-compact thead th,
html[data-theme] .gestao-table thead th,
html[data-theme] .relatorio-mini-table thead th {
  background: var(--color-table-head-bg);
  border-bottom: 1px solid var(--table-cell-border);
  box-shadow: var(--table-head-shadow);
  color: var(--color-table-head-text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

html[data-theme] .table-compact tbody td,
html[data-theme] .gestao-table tbody td,
html[data-theme] .relatorio-mini-table tbody td {
  background: var(--table-row-bg);
  border-color: var(--table-cell-border);
  color: var(--color-text);
}

html[data-theme] .table-compact tbody tr:nth-child(even) td,
html[data-theme] .gestao-table tbody tr:nth-child(even) td,
html[data-theme] .relatorio-mini-table tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}

html[data-theme] .table-compact tbody tr:hover td,
html[data-theme] .gestao-table tbody tr:hover td,
html[data-theme] .relatorio-mini-table tbody tr:hover td {
  background: var(--table-row-hover);
}

html[data-theme] .modal-box,
html[data-theme] .modal-padrao,
html[data-theme] .gestao-modal,
html[data-theme] .modal-relatorio-aluno,
html[data-theme] .modal-cancelamento-aluno,
html[data-theme] .modal-anotacoes-turma,
html[data-theme] .modal-turma-alunos {
  background: var(--modal-surface);
  border: 1px solid var(--table-cell-border);
  box-shadow: var(--shadow-modal-token);
  color: var(--color-text);
}

html[data-theme] .modal-header,
html[data-theme] .gestao-modal .gestao-modal-header,
html[data-theme] .modal-anotacoes-header,
html[data-theme] .modal-turma-header {
  background: var(--modal-header-bg);
  border-bottom: 1px solid var(--table-cell-border);
}

html[data-theme] .modal-body,
html[data-theme] .modal-relatorio-body,
html[data-theme] .modal-anotacoes-body,
html[data-theme] .modal-turma-body {
  background: var(--modal-surface);
  color: var(--color-text);
}

html[data-theme] .modal-actions,
html[data-theme] .anotacoes-form-actions,
html[data-theme] .gestao-modal .usuarios-actions {
  background: var(--modal-footer-bg);
  border-top: 1px solid var(--table-cell-border);
}

html[data-theme] .modal-form input,
html[data-theme] .modal-form select,
html[data-theme] .modal-form textarea,
html[data-theme] .gestao-modal input,
html[data-theme] .gestao-modal select,
html[data-theme] .gestao-modal textarea {
  background: var(--modal-input-bg);
  border-color: var(--modal-input-border);
  color: var(--color-text);
}

html[data-theme] .modal-form input:hover,
html[data-theme] .modal-form select:hover,
html[data-theme] .modal-form textarea:hover,
html[data-theme] .gestao-modal input:hover,
html[data-theme] .gestao-modal select:hover,
html[data-theme] .gestao-modal textarea:hover {
  border-color: var(--color-border-strong);
}

/* Camada final de contraste: vence regras antigas e estabiliza a paleta. */
:root {
  --color-bg: #eef3f9;
  --color-bg-gradient: linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-soft: #f3f6fb;
  --color-surface-hover: #eaf2ff;
  --color-border: #cfd9e8;
  --color-border-strong: #aebdd0;
  --color-text: #0b1220;
  --color-heading: #020617;
  --color-muted: #475569;
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-primary-soft: #dbeafe;
  --color-primary-border: #93c5fd;
  --color-success-bg: #dcfce7;
  --color-success-text: #14532d;
  --color-success-border: #86efac;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #78350f;
  --color-warning-border: #fbbf24;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #991b1b;
  --color-danger-border: #fca5a5;
  --color-info-bg: #dbeafe;
  --color-info-text: #1e3a8a;
  --color-info-border: #93c5fd;
  --color-table-head-bg: #0b1220;
  --color-table-head-text: #ffffff;
  --color-input-bg: #ffffff;
  --color-input-border: #aebdd0;
  --color-input-focus: rgba(29, 78, 216, 0.18);
  --color-overlay: rgba(2, 6, 23, 0.58);
  --color-scroll-track: #dbe3ee;
  --color-scroll-thumb: #64748b;
  --shadow-card-token: 0 8px 22px rgba(15, 23, 42, 0.10);
  --shadow-modal-token: 0 24px 64px rgba(15, 23, 42, 0.22);
  --shadow-soft-token: 0 6px 18px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
  --color-bg: #080f1d;
  --color-bg-gradient:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 31%),
    linear-gradient(180deg, #0d1728 0%, #09111f 54%, #070d19 100%);
  --color-surface: #111a2b;
  --color-surface-raised: #152033;
  --color-surface-soft: #0c1424;
  --color-surface-hover: rgba(96, 165, 250, 0.14);
  --color-border: #344158;
  --color-border-strong: #4b5d76;
  --color-text: #f1f5f9;
  --color-heading: #ffffff;
  --color-muted: #c0cbda;
  --color-primary: #8bbcff;
  --color-primary-hover: #60a5fa;
  --color-primary-soft: rgba(96, 165, 250, 0.22);
  --color-primary-border: rgba(147, 197, 253, 0.46);
  --color-success-bg: rgba(34, 197, 94, 0.22);
  --color-success-text: #dcfce7;
  --color-success-border: rgba(134, 239, 172, 0.44);
  --color-warning-bg: rgba(245, 158, 11, 0.24);
  --color-warning-text: #fef3c7;
  --color-warning-border: rgba(251, 191, 36, 0.48);
  --color-danger-bg: rgba(248, 113, 113, 0.22);
  --color-danger-text: #fee2e2;
  --color-danger-border: rgba(252, 165, 165, 0.46);
  --color-info-bg: rgba(96, 165, 250, 0.22);
  --color-info-text: #dbeafe;
  --color-info-border: rgba(147, 197, 253, 0.46);
  --color-table-head-bg: #030712;
  --color-table-head-text: #ffffff;
  --color-input-bg: #0b1322;
  --color-input-border: #4b5d76;
  --color-input-focus: rgba(139, 188, 255, 0.24);
  --color-overlay: rgba(2, 6, 23, 0.74);
  --color-scroll-track: #0b1322;
  --color-scroll-thumb: #64748b;
  --shadow-card-token: 0 12px 28px rgba(0, 0, 0, 0.30);
  --shadow-modal-token: 0 28px 74px rgba(0, 0, 0, 0.50);
  --shadow-soft-token: 0 10px 24px rgba(0, 0, 0, 0.26);
}

html[data-theme] body,
html[data-theme] .auth-page {
  background: var(--color-bg-gradient);
  color: var(--color-text);
}

html[data-theme] .mini-link,
html[data-theme] .app-brand-mini,
html[data-theme] .dashboard-top,
html[data-theme] .dashboard-card,
html[data-theme] .dashboard-kpi,
html[data-theme] .dashboard-panel,
html[data-theme] .dashboard-operational-item,
html[data-theme] .dashboard-shortcut,
html[data-theme] .table-card,
html[data-theme] .form-card,
html[data-theme] .filtro-card,
html[data-theme] .filtro-card-compact,
html[data-theme] .card-resumo,
html[data-theme] .card-resumo-compact,
html[data-theme] .auth-login-card,
html[data-theme] .gestao-panel-card,
html[data-theme] .gestao-card-header,
html[data-theme] .gestao-modal,
html[data-theme] .modal-box,
html[data-theme] .modal-padrao,
html[data-theme] .modal-section,
html[data-theme] .relatorio-bloco,
html[data-theme] .anotacoes-contexto-card,
html[data-theme] .ultima-anotacao-card,
html[data-theme] .modal-turma-metrica,
html[data-theme] .modal-anotacoes-pill {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-card-token);
  color: var(--color-text);
}

html[data-theme] .dashboard-kpi,
html[data-theme] .dashboard-operational-item,
html[data-theme] .dashboard-shortcut,
html[data-theme] .modal-section,
html[data-theme] .relatorio-bloco {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
}

html[data-theme] .dashboard-top,
html[data-theme] .auth-brand-strip,
html[data-theme] .modal-header,
html[data-theme] .gestao-modal .gestao-modal-header,
html[data-theme] .modal-anotacoes-header,
html[data-theme] .modal-turma-header {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
  border-color: var(--color-border);
}

html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] h4,
html[data-theme] strong,
html[data-theme] .modal-title,
html[data-theme] .table-header h2,
html[data-theme] .dashboard-panel-header h2,
html[data-theme] .gestao-card-header h2,
html[data-theme] .dashboard-shortcut strong {
  color: var(--color-heading);
}

html[data-theme] p,
html[data-theme] small,
html[data-theme] label,
html[data-theme] .table-subtitle,
html[data-theme] .modal-subtitle,
html[data-theme] .dashboard-panel-header p,
html[data-theme] .dashboard-kpi small,
html[data-theme] .dashboard-operational-item small,
html[data-theme] .dashboard-shortcut span,
html[data-theme] .card-resumo-titulo,
html[data-theme] .filtro-card-titulo {
  color: var(--color-muted);
}

html[data-theme] a,
html[data-theme] .whatsapp-link,
html[data-theme] .mini-link:hover {
  color: var(--color-primary);
}

html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea,
html[data-theme] .input-filtro,
html[data-theme] .input-filtro-compact,
html[data-theme] .modal-form input,
html[data-theme] .modal-form select,
html[data-theme] .modal-form textarea,
html[data-theme] .gestao-modal input,
html[data-theme] .gestao-modal select,
html[data-theme] .gestao-modal textarea,
html[data-theme] .auth-form-group input {
  background: var(--color-input-bg);
  border-color: var(--color-input-border);
  color: var(--color-text);
}

html[data-theme] input:focus,
html[data-theme] select:focus,
html[data-theme] textarea:focus,
html[data-theme] .input-filtro:focus,
html[data-theme] .input-filtro-compact:focus,
html[data-theme] .modal-form input:focus,
html[data-theme] .modal-form select:focus,
html[data-theme] .modal-form textarea:focus,
html[data-theme] .gestao-modal input:focus,
html[data-theme] .gestao-modal select:focus,
html[data-theme] .gestao-modal textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-input-focus);
}

html[data-theme] .btn-principal,
html[data-theme] button.btn-principal,
html[data-theme] .gestao-header-actions .btn-principal.gestao-action-btn,
html[data-theme] .gestao-modal .btn-principal.gestao-action-btn {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

html[data-theme] .btn-principal:hover,
html[data-theme] button.btn-principal:hover,
html[data-theme] .gestao-header-actions .btn-principal.gestao-action-btn:hover,
html[data-theme] .gestao-modal .btn-principal.gestao-action-btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

html[data-theme] .btn-secundario,
html[data-theme] button.btn-secundario {
  background: var(--color-surface-soft);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme] .btn-secundario:hover,
html[data-theme] button.btn-secundario:hover,
html[data-theme] .dashboard-shortcut:hover,
html[data-theme] .dashboard-operational-item:hover,
html[data-theme] .gestao-tab:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary-border);
}

html[data-theme] .table-wrapper,
html[data-theme] .table-wrapper-compact,
html[data-theme] .gestao-table-wrapper,
html[data-theme] .relatorio-table-wrap {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme] .table-compact thead th,
html[data-theme] .gestao-table thead th,
html[data-theme] .relatorio-mini-table thead th {
  background: var(--color-table-head-bg);
  color: var(--color-table-head-text);
}

html[data-theme] .table-compact tbody td,
html[data-theme] .gestao-table tbody td,
html[data-theme] .relatorio-mini-table tbody td {
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme] .table-compact tbody tr:nth-child(even) td,
html[data-theme] .gestao-table tbody tr:nth-child(even) td,
html[data-theme] .relatorio-mini-table tbody tr:nth-child(even) td {
  background: var(--color-surface-soft);
}

html[data-theme] .table-compact tbody tr:hover td,
html[data-theme] .gestao-table tbody tr:hover td,
html[data-theme] .relatorio-mini-table tbody tr:hover td {
  background: var(--color-surface-hover);
}

html[data-theme] .modal-overlay,
html[data-theme] .gestao-modal-overlay {
  background: var(--color-overlay);
}

html[data-theme] .modal-actions,
html[data-theme] .anotacoes-form-actions,
html[data-theme] .gestao-modal .usuarios-actions {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme] .mini-chip,
html[data-theme] .dashboard-status,
html[data-theme] .auth-brand-year,
html[data-theme] .badge-frequencia-historico,
html[data-theme] .badge-aberto,
html[data-theme] .badge-cartao {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info-text);
}

html[data-theme] .badge-andamento,
html[data-theme] .badge-pix,
html[data-theme] .badge-frequencia-salvo,
html[data-theme] .dashboard-status-ok {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

html[data-theme] .badge-aguardando,
html[data-theme] .badge-especie,
html[data-theme] .badge-frequencia-novo {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

html[data-theme] .dashboard-status-erro,
html[data-theme] .badge-erro {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

html[data-theme] .theme-toggle {
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  border-color: var(--color-border-strong);
}

html[data-theme] .theme-toggle-track {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-border);
}

html[data-theme] .theme-toggle-thumb {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

/* Refinamento final de contraste e nitidez da paleta global. */
:root {
  --color-bg: #eef3f9;
  --color-bg-gradient: linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-soft: #f3f6fb;
  --color-surface-hover: #eaf2ff;
  --color-border: #cfd9e8;
  --color-border-strong: #aebdd0;
  --color-text: #0b1220;
  --color-heading: #020617;
  --color-muted: #475569;
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-primary-soft: #dbeafe;
  --color-primary-border: #93c5fd;
  --color-success-bg: #dcfce7;
  --color-success-text: #14532d;
  --color-success-border: #86efac;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #78350f;
  --color-warning-border: #fbbf24;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #991b1b;
  --color-danger-border: #fca5a5;
  --color-info-bg: #dbeafe;
  --color-info-text: #1e3a8a;
  --color-info-border: #93c5fd;
  --color-table-head-bg: #0b1220;
  --color-table-head-text: #ffffff;
  --color-input-bg: #ffffff;
  --color-input-border: #aebdd0;
  --color-input-focus: rgba(29, 78, 216, 0.18);
  --color-overlay: rgba(2, 6, 23, 0.58);
  --color-scroll-track: #dbe3ee;
  --color-scroll-thumb: #64748b;
  --shadow-card-token: 0 8px 22px rgba(15, 23, 42, 0.10);
  --shadow-modal-token: 0 24px 64px rgba(15, 23, 42, 0.22);
  --shadow-soft-token: 0 6px 18px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
  --color-bg: #080f1d;
  --color-bg-gradient:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 31%),
    linear-gradient(180deg, #0d1728 0%, #09111f 54%, #070d19 100%);
  --color-surface: #111a2b;
  --color-surface-raised: #152033;
  --color-surface-soft: #0c1424;
  --color-surface-hover: rgba(96, 165, 250, 0.14);
  --color-border: #344158;
  --color-border-strong: #4b5d76;
  --color-text: #f1f5f9;
  --color-heading: #ffffff;
  --color-muted: #c0cbda;
  --color-primary: #8bbcff;
  --color-primary-hover: #60a5fa;
  --color-primary-soft: rgba(96, 165, 250, 0.22);
  --color-primary-border: rgba(147, 197, 253, 0.46);
  --color-success-bg: rgba(34, 197, 94, 0.22);
  --color-success-text: #dcfce7;
  --color-success-border: rgba(134, 239, 172, 0.44);
  --color-warning-bg: rgba(245, 158, 11, 0.24);
  --color-warning-text: #fef3c7;
  --color-warning-border: rgba(251, 191, 36, 0.48);
  --color-danger-bg: rgba(248, 113, 113, 0.22);
  --color-danger-text: #fee2e2;
  --color-danger-border: rgba(252, 165, 165, 0.46);
  --color-info-bg: rgba(96, 165, 250, 0.22);
  --color-info-text: #dbeafe;
  --color-info-border: rgba(147, 197, 253, 0.46);
  --color-table-head-bg: #030712;
  --color-table-head-text: #ffffff;
  --color-input-bg: #0b1322;
  --color-input-border: #4b5d76;
  --color-input-focus: rgba(139, 188, 255, 0.24);
  --color-overlay: rgba(2, 6, 23, 0.74);
  --color-scroll-track: #0b1322;
  --color-scroll-thumb: #64748b;
  --shadow-card-token: 0 12px 28px rgba(0, 0, 0, 0.30);
  --shadow-modal-token: 0 28px 74px rgba(0, 0, 0, 0.50);
  --shadow-soft-token: 0 10px 24px rgba(0, 0, 0, 0.26);
}

html[data-theme] body,
html[data-theme] .auth-page {
  background: var(--color-bg-gradient);
  color: var(--color-text);
}

html[data-theme] .mini-link,
html[data-theme] .app-brand-mini,
html[data-theme] .dashboard-top,
html[data-theme] .dashboard-card,
html[data-theme] .dashboard-kpi,
html[data-theme] .dashboard-panel,
html[data-theme] .dashboard-operational-item,
html[data-theme] .dashboard-shortcut,
html[data-theme] .table-card,
html[data-theme] .form-card,
html[data-theme] .filtro-card,
html[data-theme] .filtro-card-compact,
html[data-theme] .card-resumo,
html[data-theme] .card-resumo-compact,
html[data-theme] .auth-login-card,
html[data-theme] .gestao-panel-card,
html[data-theme] .gestao-card-header,
html[data-theme] .gestao-modal,
html[data-theme] .modal-box,
html[data-theme] .modal-padrao,
html[data-theme] .modal-section,
html[data-theme] .relatorio-bloco,
html[data-theme] .anotacoes-contexto-card,
html[data-theme] .ultima-anotacao-card,
html[data-theme] .modal-turma-metrica,
html[data-theme] .modal-anotacoes-pill {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-card-token);
  color: var(--color-text);
}

html[data-theme] .dashboard-kpi,
html[data-theme] .dashboard-operational-item,
html[data-theme] .dashboard-shortcut,
html[data-theme] .modal-section,
html[data-theme] .relatorio-bloco {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
}

html[data-theme] .dashboard-top,
html[data-theme] .auth-brand-strip,
html[data-theme] .modal-header,
html[data-theme] .gestao-modal .gestao-modal-header,
html[data-theme] .modal-anotacoes-header,
html[data-theme] .modal-turma-header {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
  border-color: var(--color-border);
}

html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] h4,
html[data-theme] strong,
html[data-theme] .modal-title,
html[data-theme] .table-header h2,
html[data-theme] .dashboard-panel-header h2,
html[data-theme] .gestao-card-header h2,
html[data-theme] .dashboard-shortcut strong {
  color: var(--color-heading);
}

html[data-theme] p,
html[data-theme] small,
html[data-theme] label,
html[data-theme] .table-subtitle,
html[data-theme] .modal-subtitle,
html[data-theme] .dashboard-panel-header p,
html[data-theme] .dashboard-kpi small,
html[data-theme] .dashboard-operational-item small,
html[data-theme] .dashboard-shortcut span,
html[data-theme] .card-resumo-titulo,
html[data-theme] .filtro-card-titulo {
  color: var(--color-muted);
}

html[data-theme] a,
html[data-theme] .whatsapp-link,
html[data-theme] .mini-link:hover {
  color: var(--color-primary);
}

html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea,
html[data-theme] .input-filtro,
html[data-theme] .input-filtro-compact,
html[data-theme] .modal-form input,
html[data-theme] .modal-form select,
html[data-theme] .modal-form textarea,
html[data-theme] .gestao-modal input,
html[data-theme] .gestao-modal select,
html[data-theme] .gestao-modal textarea,
html[data-theme] .auth-form-group input {
  background: var(--color-input-bg);
  border-color: var(--color-input-border);
  color: var(--color-text);
}

html[data-theme] input:focus,
html[data-theme] select:focus,
html[data-theme] textarea:focus,
html[data-theme] .input-filtro:focus,
html[data-theme] .input-filtro-compact:focus,
html[data-theme] .modal-form input:focus,
html[data-theme] .modal-form select:focus,
html[data-theme] .modal-form textarea:focus,
html[data-theme] .gestao-modal input:focus,
html[data-theme] .gestao-modal select:focus,
html[data-theme] .gestao-modal textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-input-focus);
}

html[data-theme] .btn-principal,
html[data-theme] button.btn-principal,
html[data-theme] .gestao-header-actions .btn-principal.gestao-action-btn,
html[data-theme] .gestao-modal .btn-principal.gestao-action-btn {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

html[data-theme] .btn-principal:hover,
html[data-theme] button.btn-principal:hover,
html[data-theme] .gestao-header-actions .btn-principal.gestao-action-btn:hover,
html[data-theme] .gestao-modal .btn-principal.gestao-action-btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

html[data-theme] .btn-secundario,
html[data-theme] button.btn-secundario {
  background: var(--color-surface-soft);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme] .btn-secundario:hover,
html[data-theme] button.btn-secundario:hover,
html[data-theme] .dashboard-shortcut:hover,
html[data-theme] .dashboard-operational-item:hover,
html[data-theme] .gestao-tab:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary-border);
}

html[data-theme] .table-wrapper,
html[data-theme] .table-wrapper-compact,
html[data-theme] .gestao-table-wrapper,
html[data-theme] .relatorio-table-wrap {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme] .table-compact thead th,
html[data-theme] .gestao-table thead th,
html[data-theme] .relatorio-mini-table thead th {
  background: var(--color-table-head-bg);
  color: var(--color-table-head-text);
}

html[data-theme] .table-compact tbody td,
html[data-theme] .gestao-table tbody td,
html[data-theme] .relatorio-mini-table tbody td {
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme] .table-compact tbody tr:nth-child(even) td,
html[data-theme] .gestao-table tbody tr:nth-child(even) td,
html[data-theme] .relatorio-mini-table tbody tr:nth-child(even) td {
  background: var(--color-surface-soft);
}

html[data-theme] .table-compact tbody tr:hover td,
html[data-theme] .gestao-table tbody tr:hover td,
html[data-theme] .relatorio-mini-table tbody tr:hover td {
  background: var(--color-surface-hover);
}

html[data-theme] .modal-overlay,
html[data-theme] .gestao-modal-overlay {
  background: var(--color-overlay);
}

html[data-theme] .modal-actions,
html[data-theme] .anotacoes-form-actions,
html[data-theme] .gestao-modal .usuarios-actions {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme] .mini-chip,
html[data-theme] .dashboard-status,
html[data-theme] .auth-brand-year,
html[data-theme] .badge-frequencia-historico,
html[data-theme] .badge-aberto,
html[data-theme] .badge-cartao {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info-text);
}

html[data-theme] .badge-andamento,
html[data-theme] .badge-pix,
html[data-theme] .badge-frequencia-salvo,
html[data-theme] .dashboard-status-ok {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

html[data-theme] .badge-aguardando,
html[data-theme] .badge-especie,
html[data-theme] .badge-frequencia-novo {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

html[data-theme] .dashboard-status-erro,
html[data-theme] .badge-erro {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

html[data-theme] .theme-toggle {
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  border-color: var(--color-border-strong);
}

html[data-theme] .theme-toggle-track {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-border);
}

html[data-theme] .theme-toggle-thumb {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

/* Padronizacao global de cores para temas claro e escuro. */
:root {
  --color-bg: #f3f6fb;
  --color-bg-gradient: linear-gradient(180deg, #f7faff 0%, #f3f6fb 100%);
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-surface-hover: #eff6ff;
  --color-border: #dbe3ee;
  --color-border-strong: #cbd5e1;
  --color-text: #0f172a;
  --color-heading: #0f172a;
  --color-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: #dbeafe;
  --color-primary-border: #bfdbfe;
  --color-success-bg: #dcfce7;
  --color-success-text: #166534;
  --color-success-border: #bbf7d0;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;
  --color-warning-border: #fde68a;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #b91c1c;
  --color-danger-border: #fecaca;
  --color-info-bg: #dbeafe;
  --color-info-text: #1d4ed8;
  --color-info-border: #bfdbfe;
  --color-table-head-bg: #0f172a;
  --color-table-head-text: #ffffff;
  --color-input-bg: #ffffff;
  --color-input-border: #cbd5e1;
  --color-input-focus: rgba(37, 99, 235, 0.16);
  --color-overlay: rgba(15, 23, 42, 0.55);
  --color-scroll-track: #e2e8f0;
  --color-scroll-thumb: #94a3b8;
  --shadow-card-token: 0 8px 22px rgba(15, 23, 42, 0.08);
  --shadow-modal-token: 0 22px 58px rgba(15, 23, 42, 0.18);
  --shadow-soft-token: 0 6px 18px rgba(15, 23, 42, 0.07);
}

html[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-bg-gradient:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 30%),
    linear-gradient(180deg, #101827 0%, #0f172a 48%, #0b1220 100%);
  --color-surface: #111827;
  --color-surface-raised: #121c2f;
  --color-surface-soft: #0f172a;
  --color-surface-hover: rgba(96, 165, 250, 0.10);
  --color-border: #2f3b4f;
  --color-border-strong: #3a465a;
  --color-text: #e7edf7;
  --color-heading: #f8fafc;
  --color-muted: #a5b4c8;
  --color-primary: #72a7ff;
  --color-primary-hover: #4d8df7;
  --color-primary-soft: rgba(96, 165, 250, 0.16);
  --color-primary-border: rgba(147, 197, 253, 0.32);
  --color-success-bg: rgba(34, 197, 94, 0.16);
  --color-success-text: #bbf7d0;
  --color-success-border: rgba(134, 239, 172, 0.32);
  --color-warning-bg: rgba(245, 158, 11, 0.18);
  --color-warning-text: #fde68a;
  --color-warning-border: rgba(251, 191, 36, 0.34);
  --color-danger-bg: rgba(248, 113, 113, 0.16);
  --color-danger-text: #fecaca;
  --color-danger-border: rgba(252, 165, 165, 0.32);
  --color-info-bg: rgba(96, 165, 250, 0.16);
  --color-info-text: #bfdbfe;
  --color-info-border: rgba(147, 197, 253, 0.32);
  --color-table-head-bg: #0b1220;
  --color-table-head-text: #f8fafc;
  --color-input-bg: #0f172a;
  --color-input-border: #3a465a;
  --color-input-focus: rgba(114, 167, 255, 0.18);
  --color-overlay: rgba(2, 6, 23, 0.66);
  --color-scroll-track: #0f172a;
  --color-scroll-thumb: #475569;
  --shadow-card-token: 0 10px 26px rgba(0, 0, 0, 0.24);
  --shadow-modal-token: 0 26px 68px rgba(0, 0, 0, 0.42);
  --shadow-soft-token: 0 8px 22px rgba(0, 0, 0, 0.20);
}

html[data-theme] body,
html[data-theme] .auth-page {
  background: var(--color-bg-gradient);
  color: var(--color-text);
}

html[data-theme] .main-content,
html[data-theme] .page-shell,
html[data-theme] .page-shell-wide {
  color: var(--color-text);
}

html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] h4,
html[data-theme] .modal-title,
html[data-theme] .table-header h2,
html[data-theme] .dashboard-panel-header h2,
html[data-theme] .gestao-card-header h2,
html[data-theme] .card-resumo strong,
html[data-theme] .dashboard-kpi strong,
html[data-theme] .dashboard-operational-item strong {
  color: var(--color-heading);
}

html[data-theme] p,
html[data-theme] small,
html[data-theme] label,
html[data-theme] .table-subtitle,
html[data-theme] .modal-subtitle,
html[data-theme] .dashboard-panel-header p,
html[data-theme] .dashboard-kpi small,
html[data-theme] .dashboard-operational-item small,
html[data-theme] .dashboard-shortcut span,
html[data-theme] .card-resumo-titulo,
html[data-theme] .filtro-card-titulo,
html[data-theme] .gestao-modal .modal-subtitle,
html[data-theme] .gestao-card-header .table-subtitle {
  color: var(--color-muted);
}

html[data-theme] .mini-link,
html[data-theme] .app-brand-mini,
html[data-theme] .dashboard-top,
html[data-theme] .dashboard-card,
html[data-theme] .dashboard-kpi,
html[data-theme] .dashboard-panel,
html[data-theme] .dashboard-operational-item,
html[data-theme] .dashboard-shortcut,
html[data-theme] .table-card,
html[data-theme] .form-card,
html[data-theme] .filtro-card,
html[data-theme] .filtro-card-compact,
html[data-theme] .card-resumo,
html[data-theme] .card-resumo-compact,
html[data-theme] .auth-login-card,
html[data-theme] .gestao-panel-card,
html[data-theme] .gestao-card-header,
html[data-theme] .gestao-modal,
html[data-theme] .modal-box,
html[data-theme] .modal-padrao,
html[data-theme] .modal-section,
html[data-theme] .relatorio-bloco,
html[data-theme] .anotacoes-contexto-card,
html[data-theme] .ultima-anotacao-card,
html[data-theme] .modal-turma-metrica,
html[data-theme] .modal-anotacoes-pill {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-card-token);
  color: var(--color-text);
}

html[data-theme] .dashboard-kpi,
html[data-theme] .dashboard-operational-item,
html[data-theme] .dashboard-shortcut,
html[data-theme] .modal-section,
html[data-theme] .relatorio-bloco {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
}

html[data-theme] .dashboard-shortcut:hover,
html[data-theme] .mini-link:hover,
html[data-theme] .gestao-tab:hover,
html[data-theme] .dashboard-operational-item:hover {
  background: var(--color-surface-hover);
}

html[data-theme] input,
html[data-theme] select,
html[data-theme] textarea,
html[data-theme] .input-filtro,
html[data-theme] .input-filtro-compact,
html[data-theme] .modal-form input,
html[data-theme] .modal-form select,
html[data-theme] .modal-form textarea,
html[data-theme] .gestao-modal input,
html[data-theme] .gestao-modal select,
html[data-theme] .gestao-modal textarea,
html[data-theme] .auth-form-group input {
  background: var(--color-input-bg);
  border-color: var(--color-input-border);
  color: var(--color-text);
}

html[data-theme] input::placeholder,
html[data-theme] textarea::placeholder {
  color: var(--color-muted);
}

html[data-theme] input:focus,
html[data-theme] select:focus,
html[data-theme] textarea:focus,
html[data-theme] .input-filtro:focus,
html[data-theme] .input-filtro-compact:focus,
html[data-theme] .modal-form input:focus,
html[data-theme] .modal-form select:focus,
html[data-theme] .modal-form textarea:focus,
html[data-theme] .gestao-modal input:focus,
html[data-theme] .gestao-modal select:focus,
html[data-theme] .gestao-modal textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-input-focus);
}

html[data-theme] .btn-principal,
html[data-theme] button.btn-principal,
html[data-theme] .gestao-header-actions .btn-principal.gestao-action-btn,
html[data-theme] .gestao-modal .btn-principal.gestao-action-btn {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

html[data-theme] .btn-principal:hover,
html[data-theme] button.btn-principal:hover,
html[data-theme] .gestao-header-actions .btn-principal.gestao-action-btn:hover,
html[data-theme] .gestao-modal .btn-principal.gestao-action-btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

html[data-theme] .btn-secundario,
html[data-theme] button.btn-secundario,
html[data-theme] .gestao-header-actions .btn-secundario.gestao-action-btn,
html[data-theme] .gestao-modal .usuarios-actions .btn-secundario {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme] .btn-secundario:hover,
html[data-theme] button.btn-secundario:hover,
html[data-theme] .gestao-header-actions .btn-secundario.gestao-action-btn:hover,
html[data-theme] .gestao-modal .usuarios-actions .btn-secundario:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

html[data-theme] .table-wrapper,
html[data-theme] .table-wrapper-compact,
html[data-theme] .gestao-table-wrapper,
html[data-theme] .relatorio-table-wrap {
  background: var(--color-surface);
  border-color: var(--color-border);
  scrollbar-color: var(--color-scroll-thumb) var(--color-scroll-track);
}

html[data-theme] .table-wrapper::-webkit-scrollbar-track,
html[data-theme] .table-wrapper-compact::-webkit-scrollbar-track,
html[data-theme] .gestao-table-wrapper::-webkit-scrollbar-track,
html[data-theme] .relatorio-table-wrap::-webkit-scrollbar-track {
  background: var(--color-scroll-track);
}

html[data-theme] .table-wrapper::-webkit-scrollbar-thumb,
html[data-theme] .table-wrapper-compact::-webkit-scrollbar-thumb,
html[data-theme] .gestao-table-wrapper::-webkit-scrollbar-thumb,
html[data-theme] .relatorio-table-wrap::-webkit-scrollbar-thumb {
  background: var(--color-scroll-thumb);
  border-color: var(--color-scroll-track);
}

html[data-theme] .table-compact,
html[data-theme] .gestao-table,
html[data-theme] .relatorio-mini-table {
  color: var(--color-text);
}

html[data-theme] .table-compact thead th,
html[data-theme] .gestao-table thead th,
html[data-theme] .relatorio-mini-table thead th {
  background: var(--color-table-head-bg);
  color: var(--color-table-head-text);
}

html[data-theme] .table-compact tbody td,
html[data-theme] .gestao-table tbody td,
html[data-theme] .relatorio-mini-table tbody td {
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme] .table-compact tbody tr:nth-child(even) td,
html[data-theme] .gestao-table tbody tr:nth-child(even) td,
html[data-theme] .relatorio-mini-table tbody tr:nth-child(even) td {
  background: var(--color-surface-soft);
}

html[data-theme] .table-compact tbody tr:hover td,
html[data-theme] .gestao-table tbody tr:hover td,
html[data-theme] .relatorio-mini-table tbody tr:hover td {
  background: var(--color-surface-hover);
}

html[data-theme] .modal-overlay,
html[data-theme] .gestao-modal-overlay {
  background: var(--color-overlay);
}

html[data-theme] .modal-header,
html[data-theme] .gestao-modal .gestao-modal-header,
html[data-theme] .modal-anotacoes-header,
html[data-theme] .modal-turma-header {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
  border-color: var(--color-border);
}

html[data-theme] .modal-body,
html[data-theme] .modal-relatorio-body,
html[data-theme] .modal-anotacoes-body,
html[data-theme] .modal-turma-body {
  background: var(--color-surface);
  color: var(--color-text);
}

html[data-theme] .modal-actions,
html[data-theme] .anotacoes-form-actions,
html[data-theme] .gestao-modal .usuarios-actions {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme] .modal-fechar {
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme] .modal-fechar:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

html[data-theme] .mini-chip,
html[data-theme] .dashboard-status,
html[data-theme] .auth-brand-year,
html[data-theme] .badge-frequencia-historico,
html[data-theme] .badge-aberto,
html[data-theme] .badge-cartao {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info-text);
}

html[data-theme] .badge-andamento,
html[data-theme] .badge-pix,
html[data-theme] .dashboard-status-ok {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

html[data-theme] .badge-aguardando,
html[data-theme] .badge-especie,
html[data-theme] .badge-frequencia-novo {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

html[data-theme] .dashboard-status-erro,
html[data-theme] .badge-frequencia-salvo {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}

html[data-theme] .theme-toggle {
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border-color: var(--color-border);
}

html[data-theme] .theme-toggle-track {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-border);
}

html[data-theme] .theme-toggle-thumb {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

/* Toggle de tema simplificado, sem icones. */
.theme-toggle {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(203, 213, 225, 0.82);
  box-shadow:
    0 6px 16px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  gap: 0;
  min-height: 28px;
  padding: 3px 4px;
}

.theme-toggle svg,
.theme-toggle-icon {
  display: none;
}

.theme-toggle-track {
  background: linear-gradient(135deg, #e2e8f0, #dbeafe);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  height: 22px;
  padding: 2px;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  width: 42px;
}

.theme-toggle-thumb {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  box-shadow:
    0 2px 6px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  height: 16px;
  transform: translateX(0);
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  width: 16px;
}

.theme-toggle:hover {
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.theme-toggle[data-theme="dark"] .theme-toggle-track {
  background: linear-gradient(135deg, #1e293b, #1e3a8a);
  border-color: rgba(96, 165, 250, 0.38);
}

.theme-toggle[data-theme="dark"] .theme-toggle-thumb {
  background: #bfdbfe;
  border-color: rgba(191, 219, 254, 0.5);
  box-shadow:
    0 2px 8px rgba(37, 99, 235, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transform: translateX(20px);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(17, 24, 39, 0.72);
  border-color: rgba(71, 85, 105, 0.74);
}

/* Refinamento visual do alternador e da hierarquia dos temas. */
body,
.main-content,
.auth-page,
.mini-link,
.mini-chip,
.app-brand-mini,
.dashboard-top,
.dashboard-kpi,
.dashboard-operational-item,
.dashboard-shortcut,
.table-card,
.form-card,
.filtro-card,
.card-resumo,
.modal-box,
.modal-padrao,
.modal-section,
.gestao-modal,
.gestao-panel-card,
.table-wrapper,
.table-wrapper-compact,
.gestao-table-wrapper,
input,
select,
textarea,
.btn-principal,
.btn-secundario {
  transition:
    background-color 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease;
}

.theme-toggle {
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  gap: 5px;
  min-height: 32px;
  padding: 4px 5px;
}

.theme-toggle:hover {
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.28);
  outline-offset: 3px;
}

.theme-toggle svg {
  height: 14px;
  width: 14px;
}

.theme-toggle-icon {
  min-height: 21px;
  min-width: 21px;
}

.theme-toggle-track {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  height: 23px;
  width: 42px;
}

.theme-toggle-thumb {
  box-shadow:
    0 2px 7px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  height: 17px;
  width: 17px;
}

.theme-toggle[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(17px);
}

html[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #111827;
  --bg-soft: #111c2f;
  --border-color: #2f3b4f;
  --border-light: #253044;
  --text-main: #e7edf7;
  --text-soft: #a5b4c8;
  --primary: #72a7ff;
  --primary-hover: #4d8df7;
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.22);
  --color-bg: #080f1d;
  --color-bg-gradient:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 31%),
    linear-gradient(180deg, #0d1728 0%, #09111f 54%, #070d19 100%);
  --color-surface: #111a2b;
  --color-surface-raised: #152033;
  --color-surface-soft: #0c1424;
  --color-surface-hover: rgba(96, 165, 250, 0.14);
  --color-border: #344158;
  --color-border-strong: #4b5d76;
  --color-text: #f1f5f9;
  --color-heading: #ffffff;
  --color-muted: #c0cbda;
  --color-primary: #8bbcff;
  --color-primary-hover: #60a5fa;
  --color-primary-soft: rgba(96, 165, 250, 0.22);
  --color-primary-border: rgba(147, 197, 253, 0.46);
  --color-table-head-bg: #030712;
  --color-table-head-text: #ffffff;
  --color-input-bg: #0b1322;
  --color-input-border: #4b5d76;
  --color-overlay: rgba(2, 6, 23, 0.74);
  --shadow-card-token: 0 12px 28px rgba(0, 0, 0, 0.30);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .auth-page {
  background: var(--color-bg-gradient);
  color: var(--color-text);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(17, 24, 39, 0.88);
  border-color: rgba(71, 85, 105, 0.86);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .theme-toggle:hover {
  border-color: rgba(96, 165, 250, 0.58);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .theme-toggle-track {
  background: linear-gradient(135deg, #172554, #1e3a8a);
  border-color: rgba(96, 165, 250, 0.35);
}

html[data-theme="dark"] .theme-toggle-thumb {
  background: #dbeafe;
}

html[data-theme="dark"] .mini-link,
html[data-theme="dark"] .app-brand-mini,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .dashboard-operational-item,
html[data-theme="dark"] .dashboard-shortcut,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .filtro-card,
html[data-theme="dark"] .card-resumo,
html[data-theme="dark"] .auth-login-card,
html[data-theme="dark"] .gestao-panel-card,
html[data-theme="dark"] .gestao-card-header,
html[data-theme="dark"] .gestao-modal,
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .modal-padrao,
html[data-theme="dark"] .modal-section,
html[data-theme="dark"] .relatorio-bloco,
html[data-theme="dark"] .anotacoes-contexto-card,
html[data-theme="dark"] .ultima-anotacao-card,
html[data-theme="dark"] .modal-turma-metrica,
html[data-theme="dark"] .modal-anotacoes-pill {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-card-token);
  color: var(--color-text);
}

html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .dashboard-operational-item {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
}

html[data-theme="dark"] .dashboard-shortcut {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
}

html[data-theme="dark"] .dashboard-top,
html[data-theme="dark"] .auth-brand-strip,
html[data-theme="dark"] .table-compact thead,
html[data-theme="dark"] .gestao-table thead,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .gestao-modal .gestao-modal-header,
html[data-theme="dark"] .modal-anotacoes-header,
html[data-theme="dark"] .modal-turma-header {
  background: linear-gradient(180deg, var(--color-surface-raised) 0%, var(--color-surface) 100%);
  border-color: var(--color-border);
}

html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .table-wrapper-compact,
html[data-theme="dark"] .gestao-table-wrapper,
html[data-theme="dark"] .relatorio-table-wrap {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme="dark"] .table-compact tbody tr:nth-child(even),
html[data-theme="dark"] .gestao-table tbody tr:nth-child(even),
html[data-theme="dark"] .relatorio-mini-table tbody tr:nth-child(even) {
  background: var(--color-surface-soft);
}

html[data-theme="dark"] .table-compact tbody tr:hover,
html[data-theme="dark"] .gestao-table tbody tr:hover {
  background: var(--color-surface-hover);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input-filtro,
html[data-theme="dark"] .modal-form input,
html[data-theme="dark"] .modal-form select,
html[data-theme="dark"] .modal-form textarea,
html[data-theme="dark"] .gestao-modal input,
html[data-theme="dark"] .gestao-modal select,
html[data-theme="dark"] .gestao-modal textarea,
html[data-theme="dark"] .auth-form-group input {
  background: var(--color-input-bg);
  border-color: var(--color-input-border);
  color: var(--color-text);
}

html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .gestao-modal-overlay {
  backdrop-filter: blur(3px);
  background: var(--color-overlay);
}

html[data-theme="dark"] .btn-secundario {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme="dark"] .btn-secundario:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary-border);
}

html[data-theme="dark"] .dashboard-status,
html[data-theme="dark"] .auth-brand-year {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
}

/* Nitidez final do topo no tema claro. */
html:not([data-theme="dark"]) .dashboard-top,
html[data-theme="light"] .dashboard-top,
html:not([data-theme="dark"]) .auth-session-bar,
html[data-theme="light"] .auth-session-bar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 253, 0.98) 100%);
  border: 1px solid #b9c7da;
  box-shadow:
    0 9px 22px rgba(15, 23, 42, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: #0b1220;
}

html:not([data-theme="dark"]) .auth-session-bar,
html[data-theme="light"] .auth-session-bar {
  border-bottom-color: #b9c7da;
}

html:not([data-theme="dark"]) .dashboard-title-group h1,
html[data-theme="light"] .dashboard-title-group h1,
html:not([data-theme="dark"]) .auth-session-info strong,
html[data-theme="light"] .auth-session-info strong {
  color: #020617;
  font-weight: 900;
  text-shadow: none;
}

html:not([data-theme="dark"]) .dashboard-title-group p,
html[data-theme="light"] .dashboard-title-group p,
html:not([data-theme="dark"]) .auth-session-info,
html[data-theme="light"] .auth-session-info {
  color: #334155;
}

html:not([data-theme="dark"]) .dashboard-title-group .mini-chip,
html[data-theme="light"] .dashboard-title-group .mini-chip,
html:not([data-theme="dark"]) .auth-session-info span,
html[data-theme="light"] .auth-session-info span,
html:not([data-theme="dark"]) .mini-chip,
html[data-theme="light"] .mini-chip {
  background: #dbeafe;
  border-color: #7db5ff;
  color: #153e91;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

html:not([data-theme="dark"]) .mini-link,
html[data-theme="light"] .mini-link,
html:not([data-theme="dark"]) .app-brand-mini,
html[data-theme="light"] .app-brand-mini,
html:not([data-theme="dark"]) .dashboard-top .btn-secundario,
html[data-theme="light"] .dashboard-top .btn-secundario,
html:not([data-theme="dark"]) .auth-session-actions a,
html[data-theme="light"] .auth-session-actions a,
html:not([data-theme="dark"]) .auth-session-actions button,
html[data-theme="light"] .auth-session-actions button {
  background: #ffffff;
  border-color: #b9c7da;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

html:not([data-theme="dark"]) .mini-link:hover,
html[data-theme="light"] .mini-link:hover,
html:not([data-theme="dark"]) .app-brand-mini:hover,
html[data-theme="light"] .app-brand-mini:hover,
html:not([data-theme="dark"]) .dashboard-top .btn-secundario:hover,
html[data-theme="light"] .dashboard-top .btn-secundario:hover,
html:not([data-theme="dark"]) .auth-session-actions a:hover,
html[data-theme="light"] .auth-session-actions a:hover,
html:not([data-theme="dark"]) .auth-session-actions button:hover,
html[data-theme="light"] .auth-session-actions button:hover {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

html:not([data-theme="dark"]) .page-top-actions,
html[data-theme="light"] .page-top-actions {
  color: #0b1220;
}

/* Consistencia final do cabecalho superior nos dois temas. */
:root {
  --topbar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.985) 0%, rgba(242, 247, 253, 0.985) 100%);
  --topbar-border: #aebdd0;
  --topbar-text: #020617;
  --topbar-muted: #334155;
  --topbar-chip-bg: #dbeafe;
  --topbar-chip-border: #7db5ff;
  --topbar-chip-text: #153e91;
  --topbar-action-bg: #ffffff;
  --topbar-action-hover: #eff6ff;
  --topbar-action-border: #b9c7da;
  --topbar-action-text: #0f172a;
  --topbar-shadow:
    0 10px 24px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] {
  --topbar-bg: linear-gradient(180deg, #111c2f 0%, #0c1424 100%);
  --topbar-border: #344158;
  --topbar-text: #ffffff;
  --topbar-muted: #cbd5e1;
  --topbar-chip-bg: rgba(96, 165, 250, 0.18);
  --topbar-chip-border: rgba(147, 197, 253, 0.44);
  --topbar-chip-text: #dbeafe;
  --topbar-action-bg: rgba(255, 255, 255, 0.08);
  --topbar-action-hover: rgba(96, 165, 250, 0.16);
  --topbar-action-border: rgba(203, 213, 225, 0.20);
  --topbar-action-text: #f8fafc;
  --topbar-shadow:
    0 12px 28px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme] .dashboard-top,
html[data-theme] .auth-session-bar {
  background: var(--topbar-bg);
  border-color: var(--topbar-border);
  box-shadow: var(--topbar-shadow);
  color: var(--topbar-text);
}

html[data-theme] .auth-session-bar {
  border-bottom-color: var(--topbar-border);
}

html[data-theme] .dashboard-title-group h1,
html[data-theme] .auth-session-info strong {
  color: var(--topbar-text);
  font-weight: 900;
  text-shadow: none;
}

html[data-theme] .dashboard-title-group p,
html[data-theme] .auth-session-info {
  color: var(--topbar-muted);
}

html[data-theme] .dashboard-title-group .mini-chip,
html[data-theme] .auth-session-info span,
html[data-theme] .page-top-actions .mini-chip {
  background: var(--topbar-chip-bg);
  border-color: var(--topbar-chip-border);
  color: var(--topbar-chip-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

html[data-theme] .dashboard-top-actions,
html[data-theme] .auth-session-actions,
html[data-theme] .page-top-actions-right {
  border-left: 1px solid color-mix(in srgb, var(--topbar-border) 72%, transparent);
  padding-left: 8px;
}

html[data-theme] .page-top-actions-left {
  color: var(--topbar-text);
}

html[data-theme] .mini-link,
html[data-theme] .app-brand-mini,
html[data-theme] .dashboard-top .btn-secundario,
html[data-theme] .auth-session-actions a,
html[data-theme] .auth-session-actions button {
  background: var(--topbar-action-bg);
  border-color: var(--topbar-action-border);
  color: var(--topbar-action-text);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

html[data-theme] .mini-link:hover,
html[data-theme] .app-brand-mini:hover,
html[data-theme] .dashboard-top .btn-secundario:hover,
html[data-theme] .auth-session-actions a:hover,
html[data-theme] .auth-session-actions button:hover {
  background: var(--topbar-action-hover);
  border-color: var(--topbar-chip-border);
  color: var(--color-primary);
}

html[data-theme="dark"] .dashboard-top-actions,
html[data-theme="dark"] .auth-session-actions,
html[data-theme="dark"] .page-top-actions-right {
  border-left-color: rgba(203, 213, 225, 0.16);
}

@media (max-width: 760px) {
  html[data-theme] .dashboard-top-actions,
  html[data-theme] .auth-session-actions,
  html[data-theme] .page-top-actions-right {
    border-left: 0;
    padding-left: 0;
  }
}

/* Topo fixo e camadas sticky globais. */
:root {
  --sticky-top-offset: 0px;
  --sticky-top-gap: 7px;
  --sticky-header-top: var(--sticky-top-offset);
  --sticky-filter-top: calc(var(--sticky-top-offset) + 47px);
  --sticky-top-z: 90;
  --sticky-filter-z: 70;
}

body:has(.auth-session-bar) {
  --sticky-top-offset: 39px;
  --sticky-filter-top: calc(var(--sticky-top-offset) + 47px);
}

.page-top-actions,
.dashboard-top,
.auth-session-bar {
  backdrop-filter: blur(12px) saturate(1.05);
  position: sticky;
  top: var(--sticky-header-top);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  z-index: var(--sticky-top-z);
}

.page-top-actions {
  background: color-mix(in srgb, var(--topbar-bg, var(--color-surface, #ffffff)) 84%, var(--color-surface, #ffffff) 16%);
  border: 1px solid var(--topbar-border, var(--color-border, #cfd9e8));
  border-bottom-color: color-mix(in srgb, var(--topbar-border, #aebdd0) 86%, var(--color-primary, #1d4ed8) 14%);
  border-radius: 8px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.38) inset,
    0 8px 18px rgba(15, 23, 42, 0.09);
  margin-bottom: var(--sticky-top-gap);
  padding: 5px 7px;
}

.dashboard-top {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 9px 22px rgba(15, 23, 42, 0.10);
  top: var(--sticky-header-top);
}

.auth-session-bar {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 18px rgba(15, 23, 42, 0.10);
  top: 0;
}

html[data-theme="dark"] .page-top-actions,
html[data-theme="dark"] .dashboard-top,
html[data-theme="dark"] .auth-session-bar {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 24px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .dashboard-period-filter {
  color: #f8fafc;
}

html[data-theme="dark"] .dashboard-period-trigger {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.9));
  border-color: rgba(96, 165, 250, 0.26);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 24px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .dashboard-period-trigger span,
html[data-theme="dark"] .dashboard-period-trigger small,
html[data-theme="dark"] .dashboard-period-header-range span {
  color: #cbd5e1;
}

html[data-theme="dark"] .dashboard-period-trigger[data-periodo-ativo="true"] {
  background:
    linear-gradient(135deg, rgba(30, 64, 175, 0.24), rgba(15, 23, 42, 0.96));
  border-color: rgba(96, 165, 250, 0.42);
}

html[data-theme="dark"] .dashboard-period-trigger[data-periodo-ativo="true"] span {
  color: #93c5fd;
}

html[data-theme="dark"] .dashboard-period-trigger strong,
html[data-theme="dark"] .dashboard-period-sheet-header h2 {
  color: #f8fafc;
}

html[data-theme="dark"] .dashboard-period-sheet {
  background:
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
  border-color: rgba(96, 165, 250, 0.18);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.48),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

html[data-theme="dark"] .dashboard-period-handle {
  background: rgba(148, 163, 184, 0.46);
}

html[data-theme="dark"] .dashboard-period-sheet-header,
html[data-theme="dark"] .dashboard-period-sheet-actions {
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .dashboard-period-sheet-header {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.16) 0, transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.92));
}

html[data-theme="dark"] .dashboard-period-sheet-actions {
  background: rgba(15, 23, 42, 0.92);
}

html[data-theme="dark"] .dashboard-period-header-range {
  background:
    linear-gradient(135deg, rgba(30, 64, 175, 0.2), rgba(15, 23, 42, 0.88));
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

html[data-theme="dark"] .dashboard-period-clear {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
}

html[data-theme="dark"] .dashboard-period-clear:hover {
  background: rgba(37, 99, 235, 0.20);
  color: #dbeafe;
}

html[data-theme="dark"] .dashboard-period-header-range strong,
html[data-theme="dark"] .dashboard-calendar-nav strong,
html[data-theme="dark"] .dashboard-calendar-day {
  color: #f8fafc;
}

html[data-theme="dark"] .dashboard-calendar-weekdays span {
  color: #cbd5e1;
}

html[data-theme="dark"] .dashboard-calendar {
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 16px 36px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .dashboard-calendar-nav,
html[data-theme="dark"] .dashboard-calendar-weekdays {
  background: rgba(15, 23, 42, 0.64);
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .dashboard-calendar-nav strong {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.22);
}

html[data-theme="dark"] .dashboard-calendar-day:hover,
html[data-theme="dark"] .dashboard-calendar-day.is-range {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}

html[data-theme="dark"] .dashboard-calendar-day.is-start,
html[data-theme="dark"] .dashboard-calendar-day.is-end,
html[data-theme="dark"] .dashboard-calendar-day.is-single {
  background: #2563eb;
  color: #ffffff;
  box-shadow:
    0 10px 20px rgba(37, 99, 235, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .dashboard-period-sheet-actions {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.86));
}

html[data-theme="dark"] .dashboard-period-message {
  color: #fecaca;
}

html[data-theme="dark"] .gestao-modal-icon-alerta {
  background: rgba(249, 115, 22, 0.14);
  color: #fdba74;
}

html[data-theme="dark"] .gestao-confirmacao-box {
  background:
    linear-gradient(135deg, rgba(124, 45, 18, 0.28), rgba(15, 23, 42, 0.86));
  border-color: rgba(251, 146, 60, 0.32);
}

html[data-theme="dark"] .gestao-confirmacao-box strong {
  color: #fed7aa;
}

html[data-theme="dark"] .gestao-confirmacao-box p {
  color: #fdba74;
}

html[data-theme="dark"] .gestao-table-btn-status-danger {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(251, 146, 60, 0.34);
  color: #fdba74;
}

html[data-theme="dark"] .gestao-table-btn-status-danger:hover {
  background: rgba(249, 115, 22, 0.22);
}

html[data-theme="dark"] .gestao-table-btn-status-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(74, 222, 128, 0.32);
  color: #86efac;
}

html[data-theme="dark"] .gestao-table-btn-status-success:hover {
  background: rgba(34, 197, 94, 0.22);
}

.modal-overlay,
.gestao-modal-overlay {
  z-index: 300;
}

@media (max-width: 760px) {
  :root {
    --sticky-filter-top: calc(var(--sticky-top-offset) + 44px);
  }

  body:has(.auth-session-bar) {
    --sticky-top-offset: 38px;
    --sticky-filter-top: calc(var(--sticky-top-offset) + 44px);
  }

  .page-top-actions {
    padding: 5px;
  }

  .dashboard-period-filter {
    width: 100%;
  }

  .dashboard-period-trigger {
    min-width: 0;
    width: 100%;
  }

  .dashboard-period-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .dashboard-period-sheet {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    max-width: none;
    width: 100%;
  }

  .dashboard-period-sheet-header {
    gap: 10px;
    padding: 13px 14px 11px;
  }

  .dashboard-period-heading {
    gap: 6px;
  }

  .dashboard-period-sheet-header h2 {
    font-size: 17px;
  }

  .dashboard-period-header-range {
    padding: 8px 10px;
  }

  .dashboard-period-header-actions {
    gap: 5px;
  }

  .dashboard-period-clear {
    min-height: 30px;
    padding: 0 10px;
  }

  .dashboard-period-sheet-body {
    padding-bottom: 10px;
  }

  .dashboard-calendar-nav {
    grid-template-columns: 38px 1fr 38px;
    min-height: 46px;
  }

  .dashboard-calendar-nav strong {
    min-width: 0;
    width: min(190px, 100%);
  }

  .dashboard-calendar-day,
  .dashboard-calendar-empty {
    min-height: 42px;
  }

  .dashboard-period-header-range strong {
    font-size: 13px;
  }

  .gestao-table-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gestao-table-actions .gestao-table-btn {
    width: 100%;
  }
}
