:root {
  --ui-sidebar-bg: #e2e8f0;
  --ui-teal: #15979d;
  --ui-teal-hover: #127f84;
  --ui-card-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  --ui-card-shadow-hover: 0 20px 40px rgba(15, 23, 42, 0.12);
  --ui-card-bg: #ffffff;
  --ui-card-text: #0f172a;
  --ui-card-muted: #64748b;
}

/* Forca visual do botao Excluir da lista de alunos */
.btn-delete-student,
.btn-delete-student.btn,
.table-actions .btn-delete-student {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.btn-delete-student:hover,
.btn-delete-student:focus-visible,
.table-actions .btn-delete-student:hover,
.table-actions .btn-delete-student:focus-visible {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

[data-theme="dark"] {
  --bg: #050816;
  --surface: #0b1220;
  --surface-soft: #111827;
  --surface-strong: #172033;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.16);
  --ui-sidebar-bg: #08101d;
  --ui-card-bg: #0f172a;
  --ui-card-text: #f8fafc;
  --ui-card-muted: #94a3b8;
  --ui-card-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  --ui-card-shadow-hover: 0 22px 44px rgba(0, 0, 0, 0.42);
}

[hidden] {
  display: none !important;
}

.app-shell {
  gap: 0;
}

.app-sidebar.sidebar {
  background: var(--ui-sidebar-bg);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .app-sidebar.sidebar {
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

.sidebar-top {
  display: grid;
  gap: 1rem;
}

.sidebar-branding {
  display: grid;
  justify-items: center;
  gap: 0.95rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.brand-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.brand-copy {
  text-align: center;
}

.brand-copy strong {
  font-size: 1.05rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .nav-button {
  color: #cbd5e1;
}

[data-theme="dark"] .nav-button:hover {
  background: rgba(148, 163, 184, 0.08);
}

.nav-button.is-active {
  background: linear-gradient(135deg, var(--ui-teal), #2ca6a9);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(14, 165, 164, 0.18);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  opacity: 0.88;
}

.nav-button.is-active .nav-icon {
  filter: brightness(0) invert(1);
}

.app-topbar.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 72px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .app-topbar.topbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-search.global-search {
  position: relative;
  width: 260px;
  max-width: 260px;
}

.topbar-search.global-search > .input,
#global-search-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px 10px 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: none;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}

.topbar .global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 20;
}

.btn-theme,
.btn-logout {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.btn-theme {
  background: #e2e8f0;
  color: #0f172a;
  border-color: var(--border);
}

[data-theme="dark"] .btn-theme {
  background: #172033;
  color: #e5e7eb;
}

.btn-logout {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.btn-logout:hover,
.btn-logout:focus-visible {
  background: #b91c1c;
  border-color: #b91c1c;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #cbd5f5;
  color: #1e3a8a;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .avatar {
  background: #1d4ed8;
  color: #eff6ff;
}

@media print {
  .app-sidebar,
  .app-topbar,
  [data-action="print-page"],
  .student-modal-backdrop,
  .student-modal-close {
    display: none !important;
  }

  .app-shell,
  .app-main,
  #app-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.route-matricula .student-modal-overlay {
    position: static !important;
    inset: auto !important;
    padding: 0 !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
  }

  body.route-matricula .student-modal {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    box-shadow: none !important;
    border: 0 !important;
    margin: 0 !important;
  }
}

.dashboard-clean,
.dashboard-only-cards {
  display: grid;
  gap: 1rem;
}

.dashboard-premium-grid.dashboard-premium-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
}

.dashboard-card.dashboard-card-gradient {
  min-height: 118px;
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--ui-card-bg);
  color: var(--ui-card-text);
  transform: translateY(0);
  transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

.dashboard-card.dashboard-card-gradient:hover {
  transform: translateY(-4px);
  box-shadow: var(--ui-card-shadow-hover);
}

.dashboard-card.dashboard-card-gradient .eyebrow {
  background: color-mix(in srgb, var(--surface-soft) 75%, var(--surface));
  color: var(--ui-teal);
}

.dashboard-card.dashboard-card-gradient h2,
.dashboard-card.dashboard-card-gradient strong,
.dashboard-card.dashboard-card-gradient p {
  color: var(--ui-card-text);
}

.dashboard-card.dashboard-card-gradient p {
  margin-top: 0.2rem;
  color: var(--ui-card-muted);
  opacity: 1;
  font-size: 0.9rem;
}

.dashboard-card-students {
  box-shadow: var(--ui-card-shadow);
}

.dashboard-card-students:hover {
  box-shadow: var(--ui-card-shadow-hover);
}

.dashboard-card-classes {
  box-shadow: var(--ui-card-shadow);
}

.dashboard-card-classes:hover {
  box-shadow: var(--ui-card-shadow-hover);
}

.dashboard-card.dashboard-card-gradient h2 {
  margin-top: 0.7rem;
  font-size: 1.05rem;
  line-height: 1.25;
}

.dashboard-card .dashboard-metric {
  margin: 0.85rem 0 0.15rem;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.dashboard-card.dashboard-card-gradient::after {
  content: "";
  position: absolute;
  inset: auto 22px 14px 22px;
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.35), rgba(148, 163, 184, 0));
}

.dashboard-card.dashboard-card-gradient {
  position: relative;
}

.student-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.student-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.student-modal {
  width: min(1080px, 100%);
  margin: auto;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18), 0 10px 24px rgba(15, 23, 42, 0.08);
  overflow: visible;
}

[data-theme="dark"] .student-modal {
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45), 0 10px 28px rgba(0, 0, 0, 0.28);
}

.student-modal-header,
.student-modal-footer {
  background: var(--surface);
}

.student-modal-header {
  padding: 1.35rem 1.55rem;
}

.student-modal-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
}

.student-modal-header p {
  margin-top: 0.25rem;
  color: var(--muted);
}

.student-modal-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 1.55rem;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22);
}

.student-modal-close:hover,
.student-modal-close:focus-visible {
  background: #b91c1c;
}

.student-modal-form,
.student-modal-body {
  overflow: visible;
  max-height: none;
}

.student-modal-body {
  padding: 1.1rem 1.55rem 0.5rem;
}

.student-stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1.45rem 1.75rem 0.4rem;
}

.student-stepper::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 2.1rem;
  height: 1px;
  background: var(--border);
}

.student-stage-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.35rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.student-stage-top {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 1.3rem;
  margin-bottom: 1.65rem;
}

.student-photo {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid var(--surface);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.student-summary-card {
  border-radius: 16px;
  background: var(--ui-card-bg);
  min-height: 132px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.student-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-summary-name {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.15rem;
  line-height: 1.2;
}

.student-summary-grid span,
.student-review-grid span {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.student-summary-grid strong,
.student-review-grid strong {
  color: var(--ui-card-text);
  font-size: 0.97rem;
  line-height: 1.35;
}

[data-theme="dark"] .student-summary-card {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.student-stage-heading {
  margin-bottom: 0.9rem;
}

.student-stage-heading h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.student-stage-fields,
.family-grid-single,
.student-additional-grid {
  display: grid;
  gap: 1rem;
}

.student-stage-fields,
.family-grid-single {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-additional-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field.field-full {
  grid-column: 1 / -1;
}

.field > span {
  display: inline-block;
  margin-bottom: 0.4rem;
  color: #475569;
  font-size: 0.9rem;
}

.input,
input.input,
select.input,
textarea.input {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

textarea.input.input-textarea {
  min-height: 118px;
  padding-top: 0.8rem;
  resize: vertical;
}

.photo-upload-action {
  width: 120px;
  margin-top: 0.7rem;
}

.photo-upload-action span {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.student-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.student-review-grid > div {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--ui-card-bg);
}

.student-profile-sheet {
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background:
    radial-gradient(1000px 360px at 8% -20%, color-mix(in srgb, var(--ui-soft-blue) 26%, transparent), transparent 62%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #ffffff), var(--surface));
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.student-profile-sheet .section-heading {
  margin-bottom: 0.85rem;
}

body.route-matricula .student-profile-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

body.route-matricula .student-profile-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.48rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.student-profile-sheet-body {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1rem;
}

.student-profile-photo-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.student-profile-photo {
  width: 120px;
  height: 160px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.student-profile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.62rem;
}

.student-profile-grid > div {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 86%, var(--surface));
}

.student-profile-grid > div span {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.student-profile-grid > div strong {
  font-size: 0.94rem;
}

.student-profile-sheet-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.95rem;
  padding-top: 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
}

.student-profile-sheet-footer .btn-danger {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.student-profile-sheet-footer .btn-danger:hover,
.student-profile-sheet-footer .btn-danger:focus-visible {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

body.route-matricula .student-profile-sheet {
  border-radius: 18px;
  padding: 1.35rem 1.35rem 1rem;
}

body.route-matricula .student-profile-sheet-body {
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

body.route-matricula .student-profile-photo {
  height: 148px;
}

body.route-matricula .student-profile-grouped-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.62rem;
}

body.route-matricula .student-profile-grouped-grid > div:not(.student-profile-section-title) {
  min-height: 60px;
  border-radius: 10px;
}

body.route-matricula .student-profile-section-title {
  grid-column: 1 / -1;
  min-height: auto !important;
  margin: 0.45rem 0 0.05rem;
  padding: 0.1rem 0 0.25rem !important;
  border: 0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body.route-matricula .student-profile-section-title:first-child {
  margin-top: 0;
}

body.route-matricula .student-profile-section-title .eyebrow {
  margin: 0 0 0.05rem;
  color: var(--ui-teal);
  font-size: 0.66rem;
}

body.route-matricula .student-profile-section-title strong {
  font-size: 0.95rem;
}

body.route-matricula .student-profile-sheet-footer {
  gap: 0.48rem;
  flex-wrap: wrap;
  align-items: center;
}

.student-profile-action-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0f766e;
  border-radius: 12px;
  background: #0f766e;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  opacity: 1;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.student-profile-action-icon:hover,
.student-profile-action-icon:focus-visible {
  transform: translateY(-1px);
  background: #14b8a6;
  border-color: #14b8a6;
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(20, 184, 166, 0.28);
}

.student-profile-action-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
}

.student-profile-action-icon.action-back {
  border-color: rgba(220, 38, 38, 0.18);
  background: #dc2626;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.16);
}

.student-profile-action-icon.action-back:hover,
.student-profile-action-icon.action-back:focus-visible {
  background: #b91c1c;
}

@media (max-width: 1080px) {
  body.route-matricula .student-profile-grouped-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body.route-matricula .student-profile-sheet {
    padding: 1rem;
  }

  body.route-matricula .student-profile-sheet-body {
    grid-template-columns: 1fr;
  }

  body.route-matricula .student-profile-grouped-grid {
    grid-template-columns: 1fr;
  }

  body.route-matricula .student-profile-sheet-footer {
    justify-content: center;
  }

  body.route-matricula .student-profile-heading {
    align-items: flex-start;
  }

  body.route-matricula .student-profile-sheet-actions {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }

  .student-profile-action-icon {
    width: 40px;
    height: 40px;
  }
}

.students-table-card .table-actions .btn-danger {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.students-table-card .table-actions .btn-danger:hover,
.students-table-card .table-actions .btn-danger:focus-visible {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

.student-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.55rem 1.35rem;
}

.student-modal-footer-left,
.student-modal-footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.student-modal-footer .btn {
  min-width: 120px;
  border-radius: 10px;
}

.student-modal-footer .btn-primary {
  background: var(--ui-teal);
  border-color: var(--ui-teal);
}

.student-modal-footer .btn-primary:hover {
  background: var(--ui-teal-hover);
  border-color: var(--ui-teal-hover);
}

.student-modal-footer .btn-secondary {
  background: #f8fafc;
}

.settings-shell,
.settings-form,
.settings-grid {
  display: grid;
  gap: 1rem;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-section {
  padding: 1.35rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--ui-card-shadow);
}

.settings-section-wide {
  grid-column: 1 / -1;
}

.settings-branding {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.settings-logo-preview {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  display: grid;
  place-items: center;
}

.settings-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.settings-action-card {
  --settings-card-accent: #2563eb;
  --settings-card-accent-soft: rgba(37, 99, 235, 0.12);
  appearance: none;
  width: 100%;
  min-height: 184px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98)),
    var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.settings-action-card:hover,
.settings-action-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--settings-card-accent) 54%, transparent);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  outline: none;
}

.settings-action-card-icon {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--settings-card-accent-soft);
  color: var(--settings-card-accent);
}

.settings-action-card-icon::before {
  content: "";
  width: 23px;
  height: 23px;
  background: currentColor;
  mask: var(--settings-card-icon) center / contain no-repeat;
  -webkit-mask: var(--settings-card-icon) center / contain no-repeat;
}

.settings-action-card-body {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.settings-action-card-body .eyebrow {
  width: fit-content;
  color: var(--settings-card-accent);
  background: var(--settings-card-accent-soft);
}

.settings-action-card-body strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
}

.settings-action-card-body > span:last-child {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.settings-action-card-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--settings-card-accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.settings-action-card[data-settings-tone="blue"] {
  --settings-card-accent: #2563eb;
  --settings-card-accent-soft: rgba(37, 99, 235, 0.12);
}

.settings-action-card[data-settings-tone="teal"] {
  --settings-card-accent: #0f766e;
  --settings-card-accent-soft: rgba(15, 118, 110, 0.12);
}

.settings-action-card[data-settings-tone="rose"] {
  --settings-card-accent: #be123c;
  --settings-card-accent-soft: rgba(190, 18, 60, 0.11);
}

.settings-action-card[data-settings-tone="amber"] {
  --settings-card-accent: #b45309;
  --settings-card-accent-soft: rgba(180, 83, 9, 0.12);
}

.settings-action-card[data-settings-tone="cyan"] {
  --settings-card-accent: #0369a1;
  --settings-card-accent-soft: rgba(3, 105, 161, 0.12);
}

.settings-action-card[data-settings-tone="green"] {
  --settings-card-accent: #15803d;
  --settings-card-accent-soft: rgba(21, 128, 61, 0.12);
}

.settings-action-card[data-settings-tone="violet"] {
  --settings-card-accent: #7c3aed;
  --settings-card-accent-soft: rgba(124, 58, 237, 0.12);
}

.settings-action-card[data-settings-icon="shield"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 5v6c0 5 3.4 9.7 8 11 4.6-1.3 8-6 8-11V5l-8-3Zm0 2.2 6 2.25V11c0 3.88-2.48 7.57-6 8.85C8.48 18.57 6 14.88 6 11V6.45l6-2.25Z'/%3E%3C/svg%3E");
}

.settings-action-card[data-settings-icon="image"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2ZM5 5h14v9.1l-3.2-3.2a2 2 0 0 0-2.8 0L5 18.9V5Zm2.8 14 6.6-6.6L19 17v2H7.8ZM8.5 10A1.5 1.5 0 1 0 8.5 7a1.5 1.5 0 0 0 0 3Z'/%3E%3C/svg%3E");
}

.settings-action-card[data-settings-icon="identity"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 2v12h16V6H4Zm3 3h6v2H7V9Zm0 4h10v2H7v-2Zm11-4h-3v2h3V9Z'/%3E%3C/svg%3E");
}

.settings-action-card[data-settings-icon="lock"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17 9V7A5 5 0 0 0 7 7v2H5v13h14V9h-2ZM9 7a3 3 0 0 1 6 0v2H9V7Zm8 13H7v-9h10v9Z'/%3E%3C/svg%3E");
}

.settings-action-card[data-settings-icon="palette"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a9 9 0 0 0 0 18h1.5a2.5 2.5 0 0 0 0-5H12a1.5 1.5 0 0 1 0-3h1.7A6.3 6.3 0 0 0 20 6.7C18.35 4.45 15.5 3 12 3Zm-4 8a1.25 1.25 0 1 1 0-2.5A1.25 1.25 0 0 1 8 11Zm3-3a1.25 1.25 0 1 1 0-2.5A1.25 1.25 0 0 1 11 8Zm4 1a1.25 1.25 0 1 1 0-2.5A1.25 1.25 0 0 1 15 9Z'/%3E%3C/svg%3E");
}

.settings-action-card[data-settings-icon="users"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0 2c-3.86 0-7 2.24-7 5v2h14v-2c0-2.76-3.14-5-7-5Zm8.5-.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm0 1.5c-.55 0-1.08.05-1.58.16A5.18 5.18 0 0 1 18 18v2h4v-1.7c0-2.38-2-4.3-4.5-4.3Z'/%3E%3C/svg%3E");
}

.settings-action-card[data-settings-icon="payments"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6h18a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Zm0 4h18V8H3v2Zm3 5v2h6v-2H6Z'/%3E%3C/svg%3E");
}

.settings-action-card[data-settings-icon="grades"] {
  --settings-card-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h14a2 2 0 0 1 2 2v16l-4-2-4 2-4-2-4 2V5a2 2 0 0 1 2-2Zm2 2v12.76l2-1 4 2 4-2 2 1V5H7Zm2 4h8v2H9V9Zm0 4h6v2H9v-2Z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .settings-action-card {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98)),
    var(--surface);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .settings-action-card:hover,
[data-theme="dark"] .settings-action-card:focus-visible {
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
}

.table-wrap {
  overflow-x: auto;
}

.table,
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th,
.data-table thead th {
  padding: 0.95rem 1rem;
  text-align: left;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.table tbody td,
.data-table tbody td {
  padding: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: transparent;
  color: var(--text);
}

.table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td,
.data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--surface));
}

.table-actions {
  white-space: nowrap;
}

.action-icon-grid {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.38rem;
  padding: 0.28rem;
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
}

.action-icon-grid form {
  display: inline-flex;
  margin: 0;
}

.action-icon-grid details {
  display: inline-flex;
}

.action-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 86%, #ffffff);
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.action-icon:is(summary) {
  list-style: none;
}

.action-icon:is(summary)::-webkit-details-marker {
  display: none;
}

.action-icon:hover,
.action-icon:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.action-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-icon.action-edit {
  background: rgba(15, 142, 134, 0.09);
  color: #0f8e86;
}

.action-icon.action-delete {
  border-color: rgba(220, 38, 38, 0.16) !important;
  background: rgba(220, 38, 38, 0.1) !important;
  color: #dc2626 !important;
}

.action-icon.action-delete:hover,
.action-icon.action-delete:focus-visible {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.action-icon.action-asaas {
  background: rgba(37, 99, 235, 0.09);
  color: #2563eb;
}

.action-icon.action-paid {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.action-icon.action-paid:hover,
.action-icon.action-paid:focus-visible {
  background: #16a34a;
  color: #ffffff;
}

body.route-financeiro .finance-table-actions {
  width: 168px;
  min-width: 168px;
  text-align: right;
}

body.route-financeiro .finance-action-grid {
  gap: 0.34rem;
}

body.route-matricula .student-action-grid {
  display: inline-grid;
  grid-template-columns: repeat(6, 32px);
  align-items: center;
  justify-items: center;
  justify-content: flex-end;
  gap: 0.34rem;
  padding: 0.32rem;
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--surface));
  white-space: nowrap;
}

body.route-matricula .student-name-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

body.route-matricula .student-name-line span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.58rem;
  border: 1px solid rgba(15, 142, 134, 0.24);
  border-radius: 999px;
  background: rgba(15, 142, 134, 0.14);
  color: #0f8e86;
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(15, 142, 134, 0.08);
}

[data-theme="dark"] body.route-matricula .student-name-line span {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(45, 212, 191, 0.15);
  color: #5eead4;
}

body.route-matricula .student-list-table th.student-actions-head,
body.route-matricula .student-list-table td.table-actions {
  width: 246px;
  min-width: 246px;
  text-align: right;
}

body.route-matricula .student-action-grid form {
  display: inline-flex;
  margin: 0;
}

body.route-matricula .student-action-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 86%, #ffffff);
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

body.route-matricula .student-action-icon:hover,
body.route-matricula .student-action-icon:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

body.route-matricula .student-action-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.route-matricula .student-action-icon.action-view {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

body.route-matricula .student-action-icon.action-edit {
  color: #0f8e86;
  background: rgba(15, 142, 134, 0.09);
}

body.route-matricula .student-action-icon.action-print {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.09);
}

body.route-matricula .student-action-icon.action-transfer {
  color: #ea580c;
  background: rgba(234, 88, 12, 0.09);
}

body.route-matricula .student-action-icon.action-occurrence {
  color: #c2410c;
  background: rgba(194, 65, 12, 0.09);
}

body.route-matricula .student-action-icon.action-activate {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

body.route-matricula .student-action-icon.action-activate:hover,
body.route-matricula .student-action-icon.action-activate:focus-visible {
  background: #16a34a;
  color: #ffffff;
}

body.route-matricula .student-action-icon.action-delete,
body.route-matricula .student-action-icon.action-deactivate,
body.route-matricula .student-action-icon.btn-delete-student {
  border-color: rgba(220, 38, 38, 0.16) !important;
  background: rgba(220, 38, 38, 0.1) !important;
  color: #dc2626 !important;
}

body.route-matricula .student-action-icon.action-delete:hover,
body.route-matricula .student-action-icon.action-deactivate:hover,
body.route-matricula .student-action-icon.btn-delete-student:hover,
body.route-matricula .student-action-icon.action-delete:focus-visible,
body.route-matricula .student-action-icon.action-deactivate:focus-visible,
body.route-matricula .student-action-icon.btn-delete-student:focus-visible {
  background: #dc2626 !important;
  color: #ffffff !important;
}

.students-table-card,
.module-card,
.card {
  border-radius: 20px;
}

[data-theme="dark"] .settings-section,
[data-theme="dark"] .student-stage-card {
  box-shadow: var(--ui-card-shadow);
}

[data-theme="dark"] .student-summary-card,
[data-theme="dark"] .student-review-grid > div,
[data-theme="dark"] .photo-upload-action span,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .input,
[data-theme="dark"] input.input,
[data-theme="dark"] select.input,
[data-theme="dark"] textarea.input {
  background: #0f172a;
}

@media (max-width: 900px) {
  .dashboard-premium-grid.dashboard-premium-grid-two {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-search.global-search {
    width: min(260px, 100%);
  }

  .student-stage-top,
  .student-summary-grid,
  .student-stage-fields,
  .family-grid-single,
  .student-additional-grid,
  .student-review-grid,
  .student-profile-sheet-body,
  .student-profile-grid,
  .settings-grid,
  .settings-branding {
    grid-template-columns: 1fr;
  }

  .student-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .student-modal-footer-left,
  .student-modal-footer-right {
    width: 100%;
  }

  .student-modal-footer .btn {
    flex: 1 1 100%;
  }
}

/* Final premium override */
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.ghost-button,
.primary-button,
.danger-button,
.logout-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  min-height: 40px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  font-weight: 600 !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease !important;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-success:hover,
.btn-danger:hover,
.ghost-button:hover,
.primary-button:hover,
.danger-button:hover,
.logout-button:hover {
  transform: translateY(-1px);
}

.btn-primary,
.primary-button {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18) !important;
}

.btn-secondary,
.ghost-button {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #dbe4ee !important;
}

.btn-success {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  box-shadow: 0 10px 18px rgba(22, 163, 74, 0.16) !important;
}

.btn-danger,
.danger-button,
.logout-button {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18) !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .ghost-button {
  background: #172033 !important;
  color: #e5e7eb !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
}

.dashboard-soft-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 1rem !important;
  max-width: 980px !important;
}

.master-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  max-width: 1260px !important;
}

.dashboard-soft-card {
  min-height: 170px !important;
  padding: 22px !important;
  border-radius: 22px !important;
  border: 1px solid var(--border) !important;
  background: #ffffff !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08) !important;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease !important;
}

.dashboard-soft-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, rgba(37, 99, 235, 0.2) 0%, rgba(21, 151, 157, 0.15) 45%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(105%);
  transition: transform 0.35s ease;
  z-index: 0;
  pointer-events: none;
}

.dashboard-soft-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-soft-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12) !important;
}

.dashboard-soft-card:hover::after {
  transform: translateX(0);
}

.dashboard-soft-head {
  display: grid;
  gap: 0.3rem;
}

.dashboard-soft-head h2,
.dashboard-soft-metric {
  color: #0f172a !important;
}

.dashboard-soft-head h2 {
  font-size: 1.08rem !important;
}

.dashboard-soft-card p {
  margin-top: 0.35rem !important;
  color: #64748b !important;
  font-size: 0.92rem !important;
}

.dashboard-soft-metric {
  display: block;
  margin: 1rem 0 0.15rem;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.dashboard-chart {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-chart-donut {
  min-height: 120px;
}

.dashboard-donut {
  --chart-fill: 45%;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: conic-gradient(#2563eb var(--chart-fill), #e2e8f0 0);
  display: grid;
  place-items: center;
}

.dashboard-donut-center {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
  text-align: center;
}

.dashboard-donut-center strong {
  color: #0f172a;
  font-size: 1.1rem;
  line-height: 1;
}

.dashboard-donut-center span {
  color: #64748b;
  font-size: 0.72rem;
}

.dashboard-chart-bars {
  min-height: 120px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0.8rem;
}

.dashboard-bar-group {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}

.dashboard-bar {
  width: 28px;
  height: 90px;
  display: flex;
  align-items: end;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dashboard-bar::after {
  content: "";
  width: 100%;
  height: var(--bar-height, 50%);
  border-radius: inherit;
  background: linear-gradient(180deg, var(--bar-fill-start, #60a5fa), var(--bar-fill-end, #2563eb));
}

.dashboard-bar-group span {
  color: #64748b;
  font-size: 0.78rem;
}

.dashboard-bar-count {
  color: #0f172a;
  font-size: 0.78rem;
  line-height: 1;
}

.dashboard-main {
  display: grid;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
}

.dashboard-main-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-main-head h1 {
  margin: 0.25rem 0 0;
  color: #0f172a;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
  line-height: 1.12;
}

.dashboard-main-head p {
  margin: 0.45rem 0 0;
  max-width: 680px;
  color: #64748b;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-kpi-card,
.dashboard-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-kpi-card::before,
.dashboard-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, rgba(20, 138, 131, 0.12), rgba(96, 165, 250, 0.1));
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.dashboard-kpi-card {
  min-height: 174px;
  padding: 1.05rem;
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.dashboard-kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -34px auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(20, 138, 131, 0.12);
}

.dashboard-kpi-warning::after {
  background: rgba(245, 158, 11, 0.16);
}

.dashboard-kpi-danger::after {
  background: rgba(220, 38, 38, 0.14);
}

.dashboard-kpi-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-panel > * {
  position: relative;
  z-index: 1;
}

.dashboard-kpi-label {
  color: #0f8e86;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-kpi-card strong {
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
}

.dashboard-kpi-card p,
.dashboard-kpi-card small,
.dashboard-panel p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.dashboard-kpi-card a,
.dashboard-panel-head a {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.78rem;
  border-radius: 999px;
  background: rgba(20, 138, 131, 0.1);
  color: #0f8e86;
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
}

.dashboard-operations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-panel {
  min-height: 260px;
  padding: 1rem;
}

.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-panel-head h2 {
  margin: 0.2rem 0 0;
  color: #0f172a;
  font-size: 1.05rem;
}

.dashboard-list {
  display: grid;
  gap: 0.75rem;
}

.dashboard-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: #f8fafc;
}

.dashboard-list-row div > strong {
  display: block;
  color: #0f172a;
  font-size: 0.94rem;
}

.dashboard-list-row p {
  margin-top: 0.18rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-agenda-board {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98)),
    var(--surface);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.dashboard-agenda-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-agenda-board-head h2 {
  margin: 0.2rem 0 0;
  color: var(--text);
  font-size: 1.05rem;
}

.dashboard-agenda-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.dashboard-agenda-actions a,
.dashboard-agenda-actions button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.72rem;
  border: 1px solid rgba(20, 138, 131, 0.22);
  border-radius: 8px;
  background: rgba(20, 138, 131, 0.08);
  color: var(--ui-teal);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-agenda-actions a:hover,
.dashboard-agenda-actions a:focus-visible,
.dashboard-agenda-actions button:hover,
.dashboard-agenda-actions button:focus-visible {
  background: rgba(20, 138, 131, 0.14);
  border-color: rgba(20, 138, 131, 0.36);
  outline: none;
}

.dashboard-agenda-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.dashboard-agenda-lane {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(92px, 0.22fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 56%, var(--surface));
}

.dashboard-agenda-lane > div:first-child {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.18rem;
}

.dashboard-agenda-lane > div:first-child span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-agenda-lane > div:first-child strong {
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
}

.dashboard-agenda-empty {
  min-height: 76px;
  display: grid;
  align-items: center;
  margin: 0;
  padding: 0.75rem;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-event-row small {
  display: -webkit-box;
  margin-top: 0.22rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-event-strip {
  min-width: 0;
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
}

.dashboard-event-chip {
  appearance: none;
  min-width: 0;
  width: min(190px, 78vw);
  min-height: 76px;
  flex: 0 0 min(190px, 78vw);
  display: grid;
  align-content: start;
  gap: 0.24rem;
  padding: 0.68rem;
  border: 1px solid rgba(20, 138, 131, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.82), rgba(255, 255, 255, 0.94));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-event-chip:hover,
.dashboard-event-chip:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(20, 138, 131, 0.5);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  outline: none;
}

.dashboard-event-chip > span {
  width: fit-content;
  padding: 0.22rem 0.42rem;
  border-radius: 999px;
  background: rgba(20, 138, 131, 0.12);
  color: var(--ui-teal);
  font-size: 0.7rem;
  font-weight: 850;
}

.dashboard-event-chip strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-event-chip small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-event-modal .finance-modal-body {
  display: block;
}

.dashboard-event-detail {
  display: grid;
  gap: 1rem;
}

.dashboard-event-detail-meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.dashboard-event-detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.68rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 74%, var(--surface));
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.dashboard-event-detail p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

[data-theme="dark"] .dashboard-event-chip {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
  border-color: rgba(45, 212, 191, 0.22);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .dashboard-event-chip:hover,
[data-theme="dark"] .dashboard-event-chip:focus-visible {
  border-color: rgba(45, 212, 191, 0.42);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .dashboard-agenda-board {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98)),
    var(--surface);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .dashboard-agenda-lane {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
}

.calendar-audience-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 58%, var(--surface));
}

.calendar-audience-head {
  display: grid;
  gap: 0.22rem;
}

.calendar-audience-head strong {
  color: var(--text);
  font-size: 0.98rem;
}

.calendar-audience-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.calendar-audience-option {
  min-width: 0;
}

.calendar-audience-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.calendar-audience-option > span {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 0.22rem;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.calendar-audience-option strong {
  font-size: 0.88rem;
  line-height: 1.18;
}

.calendar-audience-option small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.calendar-audience-option input:checked + span,
.calendar-audience-option input:focus-visible + span {
  border-color: rgba(20, 138, 131, 0.55);
  background: color-mix(in srgb, var(--surface) 70%, rgba(20, 184, 166, 0.14));
  box-shadow: 0 10px 24px rgba(20, 138, 131, 0.12);
  transform: translateY(-1px);
}

.calendar-audience-targets {
  display: grid;
  gap: 0.75rem;
}

.calendar-audience-targets label,
.calendar-audience-all {
  display: grid;
  gap: 0.42rem;
  padding: 0.8rem;
  border: 1px dashed rgba(20, 138, 131, 0.35);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 78%, rgba(20, 184, 166, 0.08));
}

.calendar-audience-targets label > span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-audience-all {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-date-pill,
.dashboard-risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 42px;
  padding: 0 0.65rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-cta-start), var(--brand-cta-end));
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-risk-pill {
  background: linear-gradient(135deg, #dc2626, #f97316);
}

.dashboard-empty-state {
  padding: 1rem;
  border: 1px dashed rgba(20, 138, 131, 0.35);
  border-radius: 14px;
  background: rgba(20, 138, 131, 0.06);
}

.dashboard-empty-state strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #0f172a;
}

.dashboard-billing-chart {
  display: grid;
  gap: 1rem;
  margin: 0.2rem 0 1rem;
}

.billing-chart-plot {
  position: relative;
  min-height: 260px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 1rem;
  padding: 1rem 0.85rem 0.85rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.billing-chart-grid {
  position: absolute;
  inset: 1rem 0.85rem 3.15rem;
  background: linear-gradient(to top, rgba(148, 163, 184, 0.22) 1px, transparent 1px) 0 0 / 100% 25%;
  pointer-events: none;
}

.billing-chart-column {
  position: relative;
  z-index: 1;
  min-height: 210px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 0.55rem;
}

.billing-chart-column strong {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.billing-chart-bar {
  width: min(58px, 70%);
  height: 168px;
  display: flex;
  align-items: end;
  padding: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.1);
}

.billing-chart-bar span {
  width: 100%;
  height: max(8px, var(--bar-height, 0%));
  border-radius: inherit;
  animation: dashboard-vertical-bar-grow 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.billing-chart-total .billing-chart-bar span {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.billing-chart-paid .billing-chart-bar span {
  background: linear-gradient(180deg, #2dd4bf, #0f8e86);
}

.billing-chart-overdue .billing-chart-bar span {
  background: linear-gradient(180deg, #fb7185, #dc2626);
}

.billing-chart-column small {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.billing-chart-caption {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.billing-chart-caption div {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "dot title"
    "dot meta";
  align-items: center;
  gap: 0.08rem 0.55rem;
  padding: 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: #f8fafc;
}

.billing-dot {
  grid-area: dot;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.billing-dot-total {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.billing-dot-paid {
  background: #0f8e86;
  box-shadow: 0 0 0 4px rgba(15, 142, 134, 0.12);
}

.billing-dot-overdue {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.billing-chart-caption strong {
  grid-area: title;
  color: #0f172a;
  font-size: 0.86rem;
}

.billing-chart-caption small {
  grid-area: meta;
  color: #64748b;
  font-size: 0.76rem;
}

@keyframes dashboard-vertical-bar-grow {
  from {
    height: 0;
  }
}

.dashboard-finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.dashboard-finance-summary div {
  padding: 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
}

.dashboard-finance-summary span {
  display: block;
  color: #64748b;
  font-size: 0.76rem;
}

.dashboard-finance-summary strong {
  display: block;
  margin-top: 0.2rem;
  color: #0f172a;
  font-size: 0.95rem;
}

@media (max-width: 1100px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-main-head,
  .dashboard-panel-head {
    display: grid;
  }

  .dashboard-operations-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .dashboard-kpi-grid,
  .dashboard-finance-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-list-row {
    grid-template-columns: 1fr;
  }

  .billing-chart-plot {
    gap: 0.65rem;
    padding: 0.85rem 0.6rem;
  }

  .billing-chart-bar {
    width: min(46px, 80%);
    height: 150px;
  }

  .billing-chart-caption {
    grid-template-columns: 1fr;
  }

  .dashboard-date-pill,
  .dashboard-risk-pill {
    width: fit-content;
  }
}

.dashboard-agenda-card {
  grid-column: 1 / -1;
}

.dashboard-agenda-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.dashboard-agenda-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: rgba(20, 138, 131, 0.1);
  color: #0f8e86;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-agenda-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.dashboard-agenda-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(241, 245, 249, 0.72);
}

.dashboard-agenda-item time {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-cta-start), var(--brand-cta-end));
  color: #ffffff;
  line-height: 1;
}

.dashboard-agenda-item time strong {
  font-size: 1.2rem;
}

.dashboard-agenda-item time span {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-agenda-item div > strong,
.dashboard-agenda-empty strong {
  display: block;
  color: #0f172a;
  font-size: 0.94rem;
}

.dashboard-agenda-item p {
  margin: 0.2rem 0 0 !important;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-agenda-empty {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed rgba(20, 138, 131, 0.36);
  border-radius: 16px;
  background: rgba(20, 138, 131, 0.07);
}

[data-theme="dark"] .dashboard-soft-card {
  background: #0f172a !important;
}

[data-theme="dark"] .dashboard-soft-card::after {
  background: linear-gradient(270deg, rgba(59, 130, 246, 0.3) 0%, rgba(20, 184, 166, 0.22) 45%, rgba(15, 23, 42, 0) 100%);
}

[data-theme="dark"] .dashboard-soft-head h2,
[data-theme="dark"] .dashboard-soft-metric,
[data-theme="dark"] .dashboard-donut-center strong {
  color: #f8fafc !important;
}

[data-theme="dark"] .dashboard-soft-card p,
[data-theme="dark"] .dashboard-donut-center span,
[data-theme="dark"] .dashboard-bar-group span,
[data-theme="dark"] .dashboard-bar-count {
  color: #94a3b8 !important;
}

[data-theme="dark"] .dashboard-donut {
  background: conic-gradient(#3b82f6 var(--chart-fill), #1e293b 0) !important;
}

[data-theme="dark"] .dashboard-donut-center {
  background: #0f172a !important;
}

[data-theme="dark"] .dashboard-bar {
  background: #1e293b !important;
}

.student-modal-overlay {
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto !important;
  padding: 24px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  z-index: 2000 !important;
}

.student-modal {
  width: min(1360px, calc(100vw - 16px)) !important;
  max-height: calc(100dvh - 48px) !important;
  min-height: auto !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.student-modal-form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.student-modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  max-height: none !important;
}

.student-step-panel {
  display: none !important;
}

.student-step-panel.is-active {
  display: block !important;
}

.student-modal-footer {
  border-top: 1px solid var(--border);
  flex: 0 0 auto !important;
}

body.has-student-modal-open .app-sidebar.sidebar {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
  pointer-events: auto !important;
}

/* Guardrails de rolagem global */
html,
body {
  overflow-x: hidden;
}

body {
  overflow-y: auto;
}

@media (max-width: 1199px) {
  .student-modal {
    width: min(1200px, calc(100vw - 12px)) !important;
    min-height: auto !important;
  }
}

/* Ficha de matricula compacta para desktop */
@media (min-width: 1200px) {
  .student-modal-header {
    padding: 1rem 1.3rem !important;
  }

  .student-modal-header h2 {
    font-size: 1.45rem !important;
  }

  .student-modal-header p {
    margin-top: 0.1rem !important;
    font-size: 0.88rem !important;
  }

  .student-stepper {
    padding: 1rem 1.3rem 0.35rem !important;
  }

  .student-modal-body {
    padding: 0.85rem 1.3rem 0.35rem !important;
  }

  .student-stage-card {
    padding: 1rem !important;
  }

  .student-stage-top {
    margin-bottom: 1rem !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    gap: 1rem !important;
  }

  .student-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    margin-top: 0.8rem !important;
  }

  .student-stage-fields,
  .family-grid-single,
  .student-additional-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .student-review-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.7rem !important;
  }

  .input,
  input.input,
  select.input,
  textarea.input {
    min-height: 42px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  textarea.input.input-textarea {
    min-height: 92px !important;
  }

  .student-modal-footer {
    padding: 0.85rem 1.3rem 1rem !important;
  }
}

@media (max-width: 900px) {
  .dashboard-soft-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-agenda-head,
  .dashboard-agenda-list {
    grid-template-columns: 1fr;
  }

  .dashboard-agenda-link {
    width: fit-content;
  }
}

/* Remove subtitulos azuis extras nas paginas internas */
#app-content .eyebrow,
#app-content .panel-tag {
  display: none !important;
}

/* Paleta do anexo: gradiente verde-agua */
:root {
  --brand-cta-start: #148a83;
  --brand-cta-end: #64d0e7;
  --brand-cta-shadow: rgba(20, 138, 131, 0.28);
}

.btn-primary,
.primary-button,
.btn-success,
.student-modal-footer .btn-primary {
  background: linear-gradient(90deg, var(--brand-cta-start), var(--brand-cta-end)) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px var(--brand-cta-shadow) !important;
}

.btn-primary:hover,
.primary-button:hover,
.btn-success:hover,
.student-modal-footer .btn-primary:hover,
.btn-primary:focus-visible,
.primary-button:focus-visible,
.btn-success:focus-visible {
  filter: brightness(1.03) saturate(1.02);
  transform: translateY(-1px);
}

.dashboard-soft-card {
  background: linear-gradient(125deg, var(--brand-cta-start), var(--brand-cta-end)) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

.dashboard-soft-head h2,
.dashboard-soft-metric,
.dashboard-soft-card p,
.dashboard-bar-group span,
.dashboard-bar-count {
  color: #ffffff !important;
}

.dashboard-donut {
  background: conic-gradient(rgba(255, 255, 255, 0.95) var(--chart-fill), rgba(255, 255, 255, 0.26) 0) !important;
}

.dashboard-donut-center {
  background: rgba(8, 25, 38, 0.38) !important;
}

.dashboard-donut-center strong,
.dashboard-donut-center span {
  color: #ffffff !important;
}

.dashboard-bar {
  background: rgba(255, 255, 255, 0.26) !important;
}

.dashboard-bar::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.72)) !important;
}

/* Ajuste solicitado: cards padrao + gradiente apenas no hover */
.dashboard-soft-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .dashboard-soft-card {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

.dashboard-soft-card:hover,
.dashboard-soft-card:focus-within {
  background: linear-gradient(125deg, var(--brand-cta-start), var(--brand-cta-end)) !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

.dashboard-soft-card:hover .dashboard-soft-head h2,
.dashboard-soft-card:hover .dashboard-soft-metric,
.dashboard-soft-card:hover p,
.dashboard-soft-card:hover .dashboard-bar-group span,
.dashboard-soft-card:hover .dashboard-bar-count {
  color: #ffffff !important;
}

.dashboard-soft-card:hover .dashboard-agenda-link {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.dashboard-soft-card:hover .dashboard-agenda-item {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.14) !important;
}

.dashboard-soft-card:hover .dashboard-agenda-item div > strong,
.dashboard-soft-card:hover .dashboard-agenda-empty strong {
  color: #ffffff !important;
}

.dashboard-soft-card:hover .dashboard-donut {
  background: conic-gradient(rgba(255, 255, 255, 0.95) var(--chart-fill), rgba(255, 255, 255, 0.26) 0) !important;
}

.dashboard-soft-card:hover .dashboard-donut-center {
  background: rgba(8, 25, 38, 0.38) !important;
}

.dashboard-soft-card:hover .dashboard-donut-center strong,
.dashboard-soft-card:hover .dashboard-donut-center span {
  color: #ffffff !important;
}

.dashboard-soft-card:hover .dashboard-bar {
  background: rgba(255, 255, 255, 0.26) !important;
}

.dashboard-soft-card:hover .dashboard-bar::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.72)) !important;
}

/* Botoes de menu e paginas no gradiente do padrao */
.nav-button,
.btn,
.btn-primary,
.btn-secondary,
.primary-button,
.ghost-button,
.btn-success {
  background: linear-gradient(90deg, var(--brand-cta-start), var(--brand-cta-end)) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px var(--brand-cta-shadow) !important;
}

.nav-button:hover,
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.primary-button:hover,
.ghost-button:hover,
.btn-success:hover {
  filter: brightness(1.04) saturate(1.02);
}

/* Menu lateral: destaque claro da pagina atual */
.nav-button {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.nav-button.is-active {
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22) !important;
}

.nav-button.is-active[data-nav-icon="home"] {
  background: linear-gradient(90deg, #2563eb, #60a5fa) !important;
}

.nav-button.is-active[data-nav-icon="students"] {
  background: linear-gradient(90deg, #0f8e86, #2ec7b8) !important;
}

.nav-button.is-active[data-nav-icon="classes"] {
  background: linear-gradient(90deg, #7c3aed, #a78bfa) !important;
}

.nav-button.is-active[data-nav-icon="finance"] {
  background: linear-gradient(90deg, #15803d, #4ade80) !important;
}

.nav-button.is-active[data-nav-icon="calendar"] {
  background: linear-gradient(90deg, #ea580c, #fb923c) !important;
}

.nav-button.is-active[data-nav-icon="grades"] {
  background: linear-gradient(90deg, #0891b2, #67e8f9) !important;
}

.nav-button.is-active[data-nav-icon="attendance"] {
  background: linear-gradient(90deg, #16a34a, #86efac) !important;
}

.nav-button.is-active[data-nav-icon="docs"] {
  background: linear-gradient(90deg, #c2410c, #fdba74) !important;
}

.nav-button.is-active[data-nav-icon="settings"],
.nav-button.is-active[data-nav-icon="master"] {
  background: linear-gradient(90deg, #475569, #94a3b8) !important;
}

.nav-button.is-active[data-nav-icon="certificate"] {
  background: linear-gradient(90deg, #0f766e, #1d4ed8) !important;
}

/* Regra final: manter uma unica cor ativa e apenas mover entre itens */
.app-sidebar .nav-button.is-active {
  background: linear-gradient(90deg, var(--brand-cta-start), var(--brand-cta-end)) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* Trava de rolagem no desktop: apenas o conteudo rola */
@media (min-width: 1181px) {
  html,
  body {
    height: 100% !important;
    overflow: hidden !important;
  }

  body > .app-shell {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }

  .app-sidebar.sidebar {
    position: sticky !important;
    top: 0 !important;
    height: 100dvh !important;
    overflow-y: auto !important;
  }

  .app-main {
    height: 100dvh !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
}

.sidebar-subnav {
  display: grid;
  gap: 6px;
  margin: -4px 0 6px 34px;
}

.nav-subbutton {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  min-height: 34px;
  padding: 8px 12px;
  text-align: left;
}

.nav-subbutton:hover,
.nav-subbutton.is-active {
  background: rgba(59, 130, 246, 0.22);
  color: #ffffff;
}

.certificate-tabs,
.certificate-view-actions,
.certificate-validation-demo,
.certificate-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.certificate-tabs {
  margin: 18px 0;
}

.certificate-variable-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.certificate-variable-grid span {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.certificate-paper {
  background: #f8fafc;
  margin: 18px auto;
  max-width: 980px;
  padding: 22px;
}

.certificate-border {
  min-height: 620px;
  border: 8px double #1d4ed8;
  background: #ffffff;
  display: grid;
  gap: 26px;
  padding: 42px;
  text-align: center;
}

.certificate-model-premium .certificate-border {
  border-color: #7c3aed;
}

.certificate-model-infantil .certificate-border {
  border-color: #f59e0b;
}

.certificate-model-corporativo .certificate-border {
  border-color: #0f766e;
}

.certificate-model-simples .certificate-border {
  border: 2px solid #cbd5e1;
}

.certificate-top {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.certificate-top img {
  max-height: 74px;
  max-width: 160px;
  object-fit: contain;
}

.certificate-paper h1 {
  color: #0f172a;
  font-size: 42px;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.certificate-body {
  color: #334155;
  font-size: 20px;
  line-height: 1.8;
  margin: 0 auto;
  max-width: 760px;
}

.signature-preview {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.signature-preview div {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.signature-preview span {
  border-top: 1px solid #475569;
  display: block;
  width: min(260px, 100%);
}

.signature-preview small,
.certificate-footer small,
.certificate-footer span {
  color: #64748b;
}

.certificate-footer {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
}

.certificate-footer img {
  height: 140px;
  width: 140px;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  text-transform: capitalize;
}

.status-emitido {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.status-cancelado {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.status-segunda_via {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.status-present {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.status-absent {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.status-late {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.status-justified {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.public-validation-shell {
  background: #eef2f7;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.public-validation-card {
  max-width: 680px;
  width: min(680px, 100%);
}

.validation-result {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.validation-result div {
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
}

@media (max-width: 760px) {
  .sidebar-subnav {
    margin-left: 12px;
  }

  .certificate-border {
    min-height: auto;
    padding: 24px;
  }

  .certificate-paper h1 {
    font-size: 30px;
  }

  .certificate-body {
    font-size: 16px;
  }

  .signature-preview,
  .certificate-footer {
    grid-template-columns: 1fr;
    display: grid;
    text-align: center;
    justify-items: center;
  }
}

@media print {
  .certificate-view-actions,
  .app-sidebar,
  .app-topbar,
  .certificate-tabs {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .app-content,
  .certificate-paper {
    display: block;
    margin: 0;
    padding: 0;
    width: 100%;
  }
}

/* Sidebar fixo: apenas o conteudo principal rola (sem alterar visual) */
@media (min-width: 1181px) {
  .app-shell {
    height: 100vh;
    overflow: hidden;
    align-items: stretch;
  }

  .app-sidebar.sidebar {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    overflow-y: auto !important;
    align-self: start;
  }

  .app-main {
    height: 100vh;
    overflow-y: auto;
  }
}


/* Acabamento premium: hover mais suave nos cards */
.dashboard-soft-card {
  background-size: 140% 140% !important;
  background-position: 0% 50% !important;
  transition:
    transform 0.26s ease,
    box-shadow 0.28s ease,
    background-position 0.45s ease,
    color 0.25s ease !important;
}

.dashboard-soft-card:hover,
.dashboard-soft-card:focus-within {
  background-position: 100% 50% !important;
}

.dashboard-soft-card {
  transition-delay: 0ms !important;
}

.dashboard-soft-card:hover,
.dashboard-soft-card:focus-within {
  transition-delay: 80ms !important;
}

/* Correcao de contraste no estado normal vs hover dos cards */
.dashboard-soft-card .dashboard-soft-head h2,
.dashboard-soft-card .dashboard-soft-metric {
  color: #0f172a !important;
}

.dashboard-soft-card p,
.dashboard-soft-card .dashboard-bar-group span,
.dashboard-soft-card .dashboard-bar-count {
  color: #475569 !important;
}

[data-theme="dark"] .dashboard-soft-card .dashboard-soft-head h2,
[data-theme="dark"] .dashboard-soft-card .dashboard-soft-metric {
  color: #f8fafc !important;
}

[data-theme="dark"] .dashboard-soft-card p,
[data-theme="dark"] .dashboard-soft-card .dashboard-bar-group span,
[data-theme="dark"] .dashboard-soft-card .dashboard-bar-count,
[data-theme="dark"] .dashboard-soft-card .dashboard-donut-center span {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .dashboard-soft-card .dashboard-donut-center strong {
  color: #f8fafc !important;
}

[data-theme="dark"] .dashboard-soft-card .dashboard-donut-center {
  background: #0f172a !important;
}

.dashboard-soft-card .dashboard-donut {
  background: conic-gradient(#2fb7c8 var(--chart-fill), #8fc2cf 0) !important;
}

.dashboard-soft-card-danger .dashboard-donut,
.dashboard-donut.dashboard-donut-danger {
  background: conic-gradient(#dc2626 var(--chart-fill), #fecaca 0) !important;
}

.dashboard-soft-card-danger .eyebrow {
  color: #b91c1c !important;
}

.dashboard-soft-card-danger::after {
  background: linear-gradient(270deg, rgba(220, 38, 38, 0.22) 0%, rgba(248, 113, 113, 0.16) 45%, rgba(255, 255, 255, 0) 100%) !important;
}

.dashboard-soft-card .dashboard-donut-center {
  background: #ffffff !important;
}

.dashboard-soft-card .dashboard-donut-center strong {
  color: #0f172a !important;
}

.dashboard-soft-card .dashboard-donut-center span {
  color: #475569 !important;
}

.dashboard-soft-card .dashboard-bar {
  background: #8fb8c2 !important;
}

.dashboard-soft-card .dashboard-bar::after {
  background: linear-gradient(180deg, var(--bar-fill-start, #5dd1df), var(--bar-fill-end, #0f8e86)) !important;
}

.dashboard-soft-card:hover .dashboard-soft-head h2,
.dashboard-soft-card:hover .dashboard-soft-metric,
.dashboard-soft-card:hover p,
.dashboard-soft-card:hover .dashboard-bar-group span,
.dashboard-soft-card:hover .dashboard-bar-count,
.dashboard-soft-card:hover .dashboard-donut-center strong,
.dashboard-soft-card:hover .dashboard-donut-center span {
  color: #ffffff !important;
}

.dashboard-soft-card:hover .dashboard-donut {
  background: conic-gradient(rgba(214, 232, 240, 0.96) var(--chart-fill), rgba(10, 24, 40, 0.28) 0) !important;
}

.dashboard-soft-card-danger:hover .dashboard-donut,
.dashboard-soft-card-danger:hover .dashboard-donut.dashboard-donut-danger {
  background: conic-gradient(rgba(254, 226, 226, 0.98) var(--chart-fill), rgba(127, 29, 29, 0.3) 0) !important;
}

.dashboard-soft-card-danger:hover,
.dashboard-soft-card-danger:focus-within {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  box-shadow: 0 22px 44px rgba(127, 29, 29, 0.34) !important;
}

.dashboard-soft-card-danger:hover .eyebrow,
.dashboard-soft-card-danger:focus-within .eyebrow {
  color: #fee2e2 !important;
}

.dashboard-soft-card:hover .dashboard-donut-center {
  background: rgba(9, 21, 37, 0.38) !important;
}

.dashboard-soft-card:hover .dashboard-bar {
  background: rgba(255, 255, 255, 0.28) !important;
}

.dashboard-soft-card:hover .dashboard-bar::after {
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.72)) !important;
}

/* Sidebar premium: impacto profissional + identidade no topo */
.app-sidebar.sidebar {
  background: linear-gradient(180deg, #0f1f3b 0%, #12284a 46%, #0b1830 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.08),
    12px 0 30px rgba(9, 18, 37, 0.25) !important;
}

.sidebar-top {
  align-content: start !important;
}

.sidebar-branding {
  justify-items: center !important;
  text-align: center !important;
  gap: 0.75rem !important;
  padding-bottom: 1rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.brand-logo {
  width: 84px !important;
  height: 84px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow:
    0 12px 22px rgba(2, 10, 24, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

.brand-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
}

.brand-copy {
  display: grid !important;
  gap: 0.2rem !important;
  justify-items: center !important;
}

.brand-copy strong {
  color: #f8fbff !important;
  font-size: 1.06rem !important;
  font-weight: 700 !important;
}

.brand-copy small {
  color: rgba(226, 236, 250, 0.8) !important;
  font-size: 0.74rem !important;
  font-weight: 500 !important;
}

.nav-button {
  color: rgba(235, 243, 255, 0.92) !important;
  border-color: transparent !important;
  background: transparent !important;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.nav-button.is-active {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.26) !important;
}

.sidebar-bottom .user-card {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.sidebar-bottom .user-card strong,
.sidebar-bottom .user-card span,
.sidebar-bottom .user-card small {
  color: #e7effd !important;
}

/* Ficha sem rolagem durante preenchimento (desktop) */
@media (min-width: 1200px) {
  .student-modal-overlay {
    overflow: hidden !important;
    align-items: stretch !important;
    padding: 0 !important;
  }

  .student-modal {
    width: min(1360px, 100vw) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    margin: 0 auto !important;
  }

  .student-modal-form {
    height: 100% !important;
    overflow: hidden !important;
  }

  .student-modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0.65rem 1rem 0.3rem !important;
  }

  .student-step-panel {
    height: auto !important;
  }

  .student-step-panel .student-stage-card {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    padding: 0.9rem !important;
  }

  .student-modal-header {
    padding: 0.85rem 1rem !important;
  }

  .student-stepper {
    padding: 0.75rem 1rem 0.2rem !important;
  }

  .student-stage-top {
    margin-bottom: 0.8rem !important;
    gap: 0.8rem !important;
  }

  .student-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
    margin-top: 0.55rem !important;
  }

  .student-stage-fields,
  .family-grid-single,
  .student-additional-grid,
  .student-review-grid {
    gap: 0.55rem !important;
  }

  .input,
  input.input,
  select.input,
  textarea.input {
    min-height: 40px !important;
  }

  textarea.input.input-textarea {
    min-height: 68px !important;
    max-height: 68px !important;
    resize: none !important;
  }

  .student-modal-footer {
    padding: 0.65rem 1rem 0.85rem !important;
  }
}

/* Hotfix: remove faixa branca na ficha de matricula */
body.route-matricula #app-content,
body.route-matricula #app-content.fade-enter-active,
body.route-matricula #app-content.fade-enter {
  transform: none !important;
}

body.route-matricula .student-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 16px !important;
}

body.route-matricula .student-modal {
  margin: auto !important;
}

/* Ficha premium compacta: futurista, translúcida e sobreposta */
@media (min-width: 1200px) {
  body.route-matricula .student-modal-overlay {
    padding: 24px !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(8, 15, 30, 0.62) !important;
    backdrop-filter: blur(6px) !important;
  }

  body.route-matricula .student-modal {
    width: min(1120px, calc(100vw - 72px)) !important;
    height: min(820px, calc(100dvh - 36px)) !important;
    max-height: min(820px, calc(100dvh - 36px)) !important;
    min-height: min(820px, calc(100dvh - 36px)) !important;
    margin: auto !important;
    border-radius: 28px !important;
    border: 1px solid #d8e2ef !important;
    background: #f8fbff !important;
    box-shadow:
      0 28px 60px rgba(4, 10, 24, 0.42),
      0 10px 28px rgba(15, 23, 42, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
    overflow: hidden !important;
  }

  body.route-matricula .student-modal-form {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.route-matricula .student-modal-body {
    overflow: auto !important;
    overflow-x: hidden !important;
    padding: 0.45rem 0.9rem 0.25rem !important;
  }

  body.route-matricula .student-modal-header {
    padding: 0.55rem 0.9rem !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
    background: #f8fbff !important;
    border-top-left-radius: 28px !important;
    border-top-right-radius: 28px !important;
  }

  body.route-matricula .student-modal-header > div {
    width: 100% !important;
    text-align: center !important;
    padding-right: 2.4rem !important;
  }

  body.route-matricula .student-modal-header h2 {
    margin: 0 !important;
    font-size: 1.75rem !important;
  }

  body.route-matricula .student-modal-header p {
    display: none !important;
  }

  body.route-matricula .student-stepper {
    position: relative !important;
    --student-step-progress: 0%;
    width: min(880px, 97%) !important;
    margin: 0 auto !important;
    padding: 0.35rem 0.3rem 0.1rem !important;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
    justify-content: center !important;
    gap: 0.1rem !important;
  }

  body.route-matricula .student-stepper::before {
    content: "";
    position: absolute;
    left: 7%;
    top: 0.86rem;
    width: 86%;
    height: 2px;
    transform: none;
    background: linear-gradient(
      to right,
      #21b8bd 0%,
      #21b8bd var(--student-step-progress),
      rgba(100, 116, 139, 0.35) var(--student-step-progress),
      rgba(100, 116, 139, 0.35) 100%
    );
  }

  body.route-matricula .student-step {
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    aspect-ratio: 1 / 1;
    justify-self: center !important;
    border-radius: 50% !important;
    padding: 0 !important;
    font-size: 0 !important;
    border: 1px solid #cbd5e1 !important;
    background: #eef3f9 !important;
    position: relative !important;
    z-index: 2 !important;
  }

  body.route-matricula .student-step::before {
    width: 100%;
    display: block;
    text-align: center;
    margin-top: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
  }

  body.route-matricula .student-step:nth-child(1)::before { content: "1"; }
  body.route-matricula .student-step:nth-child(2)::before { content: "2"; }
  body.route-matricula .student-step:nth-child(3)::before { content: "3"; }
  body.route-matricula .student-step:nth-child(4)::before { content: "4"; }

  body.route-matricula .student-step.is-active {
    background: linear-gradient(135deg, #14b8a6, #60d4f5) !important;
    border-color: #35c7d4 !important;
  }

  body.route-matricula .student-step.is-complete {
    background: linear-gradient(135deg, #0f8e86, #2fb7c8) !important;
    border-color: #21a9b6 !important;
  }

  body.route-matricula .student-step.is-active::before,
  body.route-matricula .student-step.is-complete::before {
    color: #ffffff !important;
  }

  body.route-matricula .student-step:nth-child(1)::after { content: "Aluno"; }
  body.route-matricula .student-step:nth-child(2)::after { content: "Familia"; }
  body.route-matricula .student-step:nth-child(3)::after { content: "Informacoes adicionais"; }
  body.route-matricula .student-step:nth-child(4)::after { content: "Revisao"; }

  body.route-matricula .student-step::after {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 156px;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #334155;
    white-space: normal;
  }

  /* Foto em destaque 3D na quina superior da ficha */
  body.route-matricula .student-stage-top {
    position: relative !important;
    display: block !important;
    margin-bottom: 0.1rem !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.route-matricula .student-step-panel[data-step-panel="0"] .student-stage-heading {
    margin-top: 4.8rem !important;
    margin-bottom: 0.7rem !important;
  }

  body.route-matricula .student-step-panel[data-step-panel="0"] .student-stage-fields {
    margin-top: 1.4rem !important;
  }

  body.route-matricula .student-photo-column {
    position: absolute !important;
    top: -6.5rem !important;
    left: -3.6rem !important;
    right: auto !important;
    width: 112px !important;
    z-index: 60 !important;
    transform: perspective(900px) rotateY(8deg) rotateX(3deg);
    transform-origin: top left;
  }

  body.route-matricula .student-photo-picker {
    position: relative !important;
    display: inline-grid !important;
    justify-items: center !important;
    background: #ffffff !important;
    border: 1px solid #d7e2ef !important;
    border-radius: 18px !important;
    padding: 6px !important;
    box-shadow: 0 12px 20px rgba(10, 20, 36, 0.24) !important;
    cursor: pointer;
  }

  body.route-matricula .student-photo-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.route-matricula .student-photo-column::before {
    display: none !important;
  }

  body.route-matricula .student-photo {
    width: 96px !important;
    height: 132px !important;
    border-radius: 16px !important;
    border: 1px solid #d9e4f1 !important;
    background: #ffffff !important;
    box-shadow:
      0 14px 20px rgba(10, 20, 36, 0.18),
      0 6px 12px rgba(15, 23, 42, 0.1) !important;
  }

  body.route-matricula .student-photo-add {
    position: absolute;
    right: -9px;
    bottom: -9px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 18px rgba(2, 10, 24, 0.34);
  }

  body.route-matricula .student-summary-card {
    display: none !important;
  }

  body.route-matricula .student-stage-fields,
  body.route-matricula .family-grid-single,
  body.route-matricula .student-address-grid,
  body.route-matricula .student-additional-grid,
  body.route-matricula .student-review-grid {
    gap: 0.34rem !important;
  }

  body.route-matricula .student-address-grid {
    display: grid !important;
    grid-template-columns: minmax(110px, 0.75fr) minmax(150px, 1fr) minmax(220px, 2fr) minmax(90px, 0.65fr) !important;
    gap: 0.34rem !important;
    margin-bottom: 0.45rem !important;
  }

  body.route-matricula .student-address-grid .field {
    min-width: 0 !important;
  }

  body.route-matricula .student-address-grid .input {
    min-height: 32px !important;
    height: 32px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  body.route-matricula .input,
  body.route-matricula input.input,
  body.route-matricula select.input,
  body.route-matricula textarea.input {
    min-height: 34px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  body.route-matricula textarea.input.input-textarea {
    min-height: 54px !important;
    max-height: 54px !important;
    resize: none !important;
  }

  @media (max-width: 900px) {
    body.route-matricula .student-address-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }

  body.route-matricula .student-modal-footer {
    padding: 0.5rem 0.9rem 0.65rem !important;
    border-bottom-left-radius: 28px !important;
    border-bottom-right-radius: 28px !important;
  }

  /* Botoes da ficha com estilo unico (evita duplicidade visual) */
  body.route-matricula .student-modal-footer .btn {
    min-height: 38px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body.route-matricula .student-modal-footer .btn-secondary {
    background: #eef4fb !important;
    border: 1px solid #d7e2ef !important;
    color: #1e293b !important;
  }

  body.route-matricula .student-modal-footer .btn-primary,
  body.route-matricula .student-modal-footer .btn-success {
    background: linear-gradient(90deg, var(--brand-cta-start), var(--brand-cta-end)) !important;
    border: 0 !important;
    color: #ffffff !important;
  }

  body.route-matricula .student-modal-footer .btn-danger {
    background: #dc2626 !important;
    border: 0 !important;
    color: #ffffff !important;
  }

  body.route-matricula .students-table-card .table-actions .btn-danger {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
  }

  body.route-matricula .students-table-card .table-actions .btn-danger:hover,
  body.route-matricula .students-table-card .table-actions .btn-danger:focus-visible {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
  }
}

/* Padrao global: todos os botoes de excluir em vermelho */
.btn-danger,
.danger-button,
button.btn-danger,
a.btn-danger,
form .btn-danger {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

/* Barra de rolagem discreta do menu lateral */
.app-sidebar.sidebar,
.app-sidebar.sidebar .sidebar-top,
.app-sidebar.sidebar .sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.22) transparent;
}

.app-sidebar.sidebar::-webkit-scrollbar,
.app-sidebar.sidebar .sidebar-top::-webkit-scrollbar,
.app-sidebar.sidebar .sidebar-nav::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.app-sidebar.sidebar::-webkit-scrollbar-track,
.app-sidebar.sidebar .sidebar-top::-webkit-scrollbar-track,
.app-sidebar.sidebar .sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.app-sidebar.sidebar::-webkit-scrollbar-thumb,
.app-sidebar.sidebar .sidebar-top::-webkit-scrollbar-thumb,
.app-sidebar.sidebar .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.18);
  border-radius: 999px;
}

.app-sidebar.sidebar:hover::-webkit-scrollbar-thumb,
.app-sidebar.sidebar .sidebar-top:hover::-webkit-scrollbar-thumb,
.app-sidebar.sidebar .sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.32);
}

[data-theme="dark"] .app-sidebar.sidebar,
[data-theme="dark"] .app-sidebar.sidebar .sidebar-top,
[data-theme="dark"] .app-sidebar.sidebar .sidebar-nav {
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

[data-theme="dark"] .app-sidebar.sidebar::-webkit-scrollbar-thumb,
[data-theme="dark"] .app-sidebar.sidebar .sidebar-top::-webkit-scrollbar-thumb,
[data-theme="dark"] .app-sidebar.sidebar .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.16);
}

.finance-edit-details {
  display: inline-block;
  position: relative;
}

.modal-action-details {
  display: inline-flex;
}

.modal-action-details > summary {
  list-style: none;
}

.modal-action-details > summary::-webkit-details-marker {
  display: none;
}

.course-subject-picker {
  display: grid;
  gap: 0.55rem;
}

.course-subject-picker > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.course-subject-picker > div {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.course-subject-picker label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 34px;
  padding: 0 0.72rem;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
  color: var(--text);
  font-size: 0.86rem;
}

.finance-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 1.2rem;
}

.finance-modal-overlay.is-open {
  display: flex;
}

.finance-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
}

.finance-modal {
  position: relative;
  z-index: 1;
  width: min(1080px, 96vw);
  max-height: calc(100dvh - 64px);
  margin: auto 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.finance-modal-header {
  min-height: 64px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
}

.finance-modal-header h3 {
  margin: 0.2rem 0 0;
  color: var(--text);
}

.finance-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.finance-modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  overflow: auto;
  min-height: 0;
  padding: 1rem;
}

.teacher-modal-body {
  display: block;
}

.pedagogy-metrics {
  padding: 0.95rem;
}

.pedagogy-metrics .metric-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.pedagogy-metrics .metric-stack div {
  min-height: 74px;
  display: grid;
  align-content: center;
  padding: 0.72rem 0.9rem;
}

.pedagogy-metrics .metric-stack small {
  margin: 0 0 0.25rem;
}

.pedagogy-metrics .metric-stack strong {
  font-size: 1.35rem;
  line-height: 1;
}

.finance-entry-panel {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 55%, var(--surface));
}

.finance-entry-income {
  border-color: rgba(20, 138, 131, 0.24);
}

.finance-entry-expense {
  border-color: rgba(220, 38, 38, 0.2);
}

.finance-entry-wide {
  grid-column: 1 / -1;
}

.recurring-payment-card {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #148a83 28%, var(--border));
  border-radius: 15px;
  background: linear-gradient(135deg, color-mix(in srgb, #148a83 7%, var(--surface)), var(--surface));
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.recurring-payment-card:has(input:checked) {
  border-color: color-mix(in srgb, #148a83 65%, var(--border));
  box-shadow: 0 10px 28px rgba(20, 138, 131, 0.1);
}

.recurring-switch-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.85rem !important;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.recurring-switch-copy {
  display: grid;
  gap: 0.2rem;
}

.recurring-switch-copy strong {
  color: var(--text);
  font-size: 0.94rem;
}

.recurring-switch-copy small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.recurring-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
}

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

.recurring-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, var(--surface-soft));
  transition: background 180ms ease;
}

.recurring-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
  transition: transform 180ms ease;
}

.recurring-switch input:checked + .recurring-switch-track {
  background: #148a83;
}

.recurring-switch input:checked + .recurring-switch-track::after {
  transform: translateX(20px);
}

.recurring-switch input:focus-visible + .recurring-switch-track {
  outline: 3px solid color-mix(in srgb, #148a83 30%, transparent);
  outline-offset: 2px;
}

.recurring-installment-panel {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(220px, 1.45fr);
  gap: 0.85rem;
  align-items: stretch;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid color-mix(in srgb, #148a83 18%, var(--border));
  background: color-mix(in srgb, #148a83 4%, var(--surface));
}

.recurring-installment-panel[hidden] {
  display: none;
}

.recurring-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  gap: 0.15rem 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid color-mix(in srgb, #148a83 18%, var(--border));
  border-radius: 11px;
  background: var(--surface);
}

.recurring-summary span {
  grid-row: 1 / 3;
  align-self: center;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  background: color-mix(in srgb, #148a83 12%, var(--surface));
  color: #0f766e;
  font-size: 0.75rem;
  font-weight: 800;
}

.recurring-summary strong { color: var(--text); font-size: 0.86rem; }
.recurring-summary small { color: var(--muted); font-size: 0.74rem; }

.status-badge-overdue {
  border-color: #b91c1c !important;
  background: #dc2626 !important;
  color: #fff !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.24);
}

.status-badge-asaas-paid {
  border-color: #86efac !important;
  background: #dcfce7 !important;
  color: #15803d !important;
  font-weight: 800;
}

.status-badge-asaas-overdue {
  border-color: #b91c1c !important;
  background: #dc2626 !important;
  color: #fff !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.22);
}

.status-badge-asaas-open {
  border-color: #bae6fd !important;
  background: #f0f9ff !important;
  color: #0369a1 !important;
  font-weight: 750;
}

.status-badge-asaas-cancelled {
  border-color: #e2e8f0 !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
  font-weight: 750;
}

.finance-student-code {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.own-financial-responsible-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.85rem !important;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid color-mix(in srgb, #148a83 30%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, #148a83 6%, var(--surface));
  cursor: pointer;
}

.own-financial-responsible-card input {
  width: 19px;
  height: 19px;
  accent-color: #148a83;
}

.own-financial-responsible-card > span { display: grid; gap: 0.2rem; }
.own-financial-responsible-card strong { color: var(--text); }
.own-financial-responsible-card small { color: var(--muted); font-weight: 500; }

@media (max-width: 620px) {
  .recurring-installment-panel { grid-template-columns: 1fr; }
  .recurring-summary { grid-template-columns: 1fr; }
  .recurring-summary span { grid-row: auto; justify-self: start; }
}

@media (max-width: 860px) {
  .finance-modal-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .finance-modal-overlay {
    align-items: stretch;
    padding: 0.6rem;
  }

  .finance-modal {
    width: 100%;
    max-height: calc(100dvh - 1.2rem);
    margin: 0;
  }

  .finance-modal-body {
    padding: 0.75rem;
  }
}

.finance-edit-details > summary {
  list-style: none;
  cursor: pointer;
}

.finance-edit-details > summary::-webkit-details-marker {
  display: none;
}

.finance-edit-form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(520px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
  text-align: left;
}

.finance-edit-form label:first-of-type,
.finance-edit-form label:last-of-type {
  grid-column: 1 / -1;
}

.finance-edit-form label span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.finance-edit-form input,
.finance-edit-form select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
  color: var(--text);
}

.finance-edit-form .btn {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .finance-edit-form {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 8px;
  }
}

/* Endereco compacto na ficha de matricula */
body.route-matricula .student-address-grid {
  display: grid !important;
  grid-template-columns: 0.75fr 1fr 1.8fr 0.7fr !important;
  gap: 8px !important;
  align-items: end !important;
  margin: 0 0 10px !important;
}

body.route-matricula .student-address-grid .field {
  min-width: 0 !important;
  grid-column: auto !important;
}

body.route-matricula .student-address-grid .field span {
  display: block !important;
  margin-bottom: 4px !important;
  font-size: 0.82rem !important;
  line-height: 1.1 !important;
}

body.route-matricula .student-address-grid .input {
  height: 34px !important;
  min-height: 34px !important;
  padding: 5px 9px !important;
}

@media (max-width: 760px) {
  body.route-matricula .student-address-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.btn-danger:hover,
.btn-danger:focus-visible,
.danger-button:hover,
.danger-button:focus-visible,
button.btn-danger:hover,
button.btn-danger:focus-visible,
a.btn-danger:hover,
a.btn-danger:focus-visible,
form .btn-danger:hover,
form .btn-danger:focus-visible {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

.boletim-sheet-head {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}

.boletim-sheet-institution {
  text-align: center;
}

.boletim-sheet-institution h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.boletim-sheet-meta {
  display: grid;
  gap: 0.25rem;
  text-align: left;
}

.boletim-sheet-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media print {
  body.route-boletins .boletim-setup-card {
    display: none !important;
  }

  body.route-boletins .boletim-sheet-card {
    border: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.route-boletins .boletim-sheet-head {
    margin-bottom: 10px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }

  body.route-boletins .boletim-sheet-meta {
    text-align: left !important;
  }

  body.route-boletins .actions,
  body.route-boletins .hero-actions,
  body.route-boletins .btn {
    display: none !important;
  }
}

/* Login refinado (isolado na rota login) */
body.route-login {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(135deg, rgba(238, 249, 251, 0.86), rgba(231, 244, 243, 0.72)),
    url("../img/background.jpeg") center / cover no-repeat fixed !important;
}

body.route-login .auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 32px 20px;
}

body.route-login .auth-panel-brand {
  display: none !important;
}

body.route-login .auth-panel-form {
  width: min(440px, 100%);
  min-height: auto;
  align-self: center;
  justify-self: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.route-login .auth-view-login-refined {
  width: 100%;
  min-height: auto;
  display: grid;
  place-items: center;
  gap: 0;
}

.login-refined-card {
  width: 100%;
  border-radius: 24px;
  border: 1px solid rgba(219, 229, 242, 0.92);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  padding: 1.65rem 1.45rem 1.35rem;
  backdrop-filter: blur(14px);
}

.login-refined-brand {
  display: grid;
  justify-items: center;
  gap: 0.24rem;
  margin-bottom: 0.95rem;
}

.login-refined-mark {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 2.05rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(90deg, var(--brand-cta-start), var(--brand-cta-end));
  box-shadow: 0 14px 26px rgba(20, 138, 131, 0.28);
}

.login-refined-mark img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.login-refined-brand strong {
  color: #0f172a;
  font-size: 1.02rem;
  line-height: 1;
}

.login-refined-brand span {
  color: #64748b;
  font-size: 0.8rem;
}

body.route-login .login-refined-form label > span {
  color: #334155;
}

body.route-login .login-refined-form input {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

body.route-login .login-refined-form input::placeholder {
  color: #94a3b8;
}

.login-refined-password-wrap {
  position: relative;
}

.login-refined-password-wrap input {
  padding-right: 78px !important;
}

.login-refined-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: #eef2ff;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 8px;
  cursor: pointer;
}

.login-refined-password-toggle:hover,
.login-refined-password-toggle:focus-visible {
  background: #dbeafe;
  outline: none;
}

body.route-login .auth-links {
  align-items: center;
}

body.route-login .auth-text-link {
  color: #0f8e86;
}

body.route-login .actions .btn-primary {
  width: 100%;
  border: 0;
  background: linear-gradient(90deg, var(--brand-cta-start), var(--brand-cta-end));
  color: #ffffff;
  border-radius: 999px;
}

.ficha-filter-card .filters-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.7fr) minmax(180px, 0.9fr) minmax(180px, 0.9fr);
  gap: 0.85rem;
  align-items: end;
}

.ficha-filter-card .filter-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
}

body.route-disciplinas .subject-filter-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

body.route-disciplinas .subject-filter-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

body.route-presencas .diary-filter-actions {
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.2rem;
}

body.route-boletins .grades-filter-actions {
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.2rem;
}

@media (max-width: 980px) {
  .ficha-filter-card .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ficha-filter-card .filter-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .ficha-filter-card .filters-grid {
    grid-template-columns: 1fr;
  }

  .ficha-filter-card .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.route-disciplinas .subject-filter-grid {
    grid-template-columns: 1fr;
  }

  body.route-disciplinas .subject-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.route-presencas .diary-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.route-boletins .grades-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Menu por categorias */
.sidebar-nav {
  gap: 0.48rem !important;
}

.nav-group {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.nav-group[open],
.nav-group:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav-group.is-active {
  border-color: rgba(100, 208, 231, 0.36);
  box-shadow: 0 12px 24px rgba(8, 18, 35, 0.18);
}

.nav-group-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.85rem;
  color: rgba(235, 243, 255, 0.9);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  list-style: none;
}

.nav-group-summary::-webkit-details-marker {
  display: none;
}

.nav-group-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.74;
  transform: rotate(45deg);
  transition: transform 0.22s ease;
}

.nav-group[open] .nav-group-chevron {
  transform: rotate(225deg);
}

.nav-group .sidebar-subnav {
  margin: 0;
  padding: 0 0.45rem 0.55rem;
  animation: nav-dropdown-in 0.18s ease;
}

.nav-subbutton {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: rgba(226, 232, 240, 0.84);
  font-size: 0.84rem;
  font-weight: 650;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-subbutton:hover {
  transform: translateX(3px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-subbutton.is-active {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.22);
}

.nav-subbutton .nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.nav-subbutton.is-active .nav-icon {
  filter: brightness(0) invert(1);
}

@keyframes nav-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .dashboard-kpi-card,
[data-theme="dark"] .dashboard-panel {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.dashboard-kpi-card,
.dashboard-panel {
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.dashboard-kpi-card:hover,
.dashboard-panel:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 138, 131, 0.36);
  background: #f0fdfa;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.14);
}

.dashboard-kpi-card:hover::before,
.dashboard-panel:hover::before {
  opacity: 1;
}

[data-theme="dark"] .dashboard-kpi-card:hover,
[data-theme="dark"] .dashboard-panel:hover {
  border-color: rgba(45, 212, 191, 0.28);
  background: #102337;
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.46);
}

[data-theme="dark"] .dashboard-main-head h1,
[data-theme="dark"] .dashboard-kpi-card strong,
[data-theme="dark"] .dashboard-panel-head h2,
[data-theme="dark"] .dashboard-list-row div > strong,
[data-theme="dark"] .dashboard-empty-state strong,
[data-theme="dark"] .dashboard-finance-summary strong,
[data-theme="dark"] .billing-chart-column strong,
[data-theme="dark"] .billing-chart-caption strong {
  color: #f8fafc;
}

[data-theme="dark"] .dashboard-main-head p,
[data-theme="dark"] .dashboard-kpi-card p,
[data-theme="dark"] .dashboard-kpi-card small,
[data-theme="dark"] .dashboard-panel p,
[data-theme="dark"] .dashboard-finance-summary span,
[data-theme="dark"] .billing-chart-column small,
[data-theme="dark"] .billing-chart-caption small {
  color: #cbd5e1;
}

[data-theme="dark"] .dashboard-list-row,
[data-theme="dark"] .dashboard-finance-summary div,
[data-theme="dark"] .billing-chart-plot,
[data-theme="dark"] .billing-chart-caption div {
  background: #111c2f;
  border-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .dashboard-empty-state {
  background: rgba(20, 184, 166, 0.09);
  border-color: rgba(100, 208, 231, 0.24);
}

[data-theme="dark"] .billing-chart-grid {
  background: linear-gradient(to top, rgba(148, 163, 184, 0.14) 1px, transparent 1px) 0 0 / 100% 25%;
}

[data-theme="dark"] .billing-chart-column strong {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .billing-chart-bar {
  background: #243044;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.24);
}

body.route-matricula .student-documents-card,
body.route-matricula .student-occurrences-card {
  margin-top: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}

body.route-matricula .student-documents-card .section-heading,
body.route-matricula .student-occurrences-card .section-heading {
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

body.route-matricula .student-documents-card .section-heading p,
body.route-matricula .student-occurrences-card .section-heading p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

body.route-matricula .document-upload-form,
body.route-matricula .student-occurrence-form {
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
}

body.route-matricula .document-upload-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

body.route-matricula .student-profile-modal-body > .section-heading {
  display: none;
}

body.route-matricula .document-issue-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

body.route-matricula .document-upload-grid .input {
  min-height: 44px;
}

body.route-matricula .document-upload-action {
  display: flex;
  justify-content: flex-end;
}

body.route-matricula .document-upload-action .btn {
  min-height: 44px;
  white-space: nowrap;
}

.document-template-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
  gap: 1rem;
  align-items: start;
}

.document-variable-panel {
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 76%, var(--surface));
  padding: 1rem;
}

.document-variable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.document-variable-list code {
  border: 1px solid color-mix(in srgb, var(--ui-teal) 28%, transparent);
  border-radius: 999px;
  background: rgba(15, 142, 134, 0.08);
  color: var(--ui-teal);
  font-size: 0.78rem;
  padding: 0.28rem 0.48rem;
}

.issued-document-preview {
  margin-top: 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 74%, var(--surface));
  padding: 1rem;
}

.issued-document-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.issued-document-paper {
  min-height: 280px;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  padding: 2rem;
  line-height: 1.75;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.issued-document-school-header {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
  text-align: left;
}

.issued-document-school-header img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.issued-document-school-header div {
  display: grid;
  gap: 0.18rem;
}

.issued-document-school-header strong {
  color: #0f172a;
  font-size: 1.18rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.issued-document-school-header span {
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.35;
}

.student-print-sheet {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 210mm;
  min-height: 297mm;
  padding: 16mm;
  background: #ffffff;
  color: #0f172a;
  font-family: Arial, Helvetica, sans-serif;
  pointer-events: none;
}

.student-print-header {
  display: grid;
  grid-template-columns: 24mm minmax(0, 1fr);
  gap: 5mm;
  align-items: center;
  padding-bottom: 5mm;
  border-bottom: 1.5px solid #cbd5e1;
}

.student-print-header img {
  width: 22mm;
  height: 22mm;
  object-fit: contain;
}

.student-print-header div {
  display: grid;
  gap: 1.2mm;
}

.student-print-header strong {
  font-size: 15pt;
  line-height: 1.15;
  text-transform: uppercase;
}

.student-print-header span {
  color: #475569;
  font-size: 8.8pt;
  line-height: 1.25;
}

.student-print-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 8mm;
  margin: 7mm 0 5mm;
}

.student-print-title h1 {
  margin: 0;
  color: #0f172a;
  font-size: 18pt;
  line-height: 1.1;
}

.student-print-title span {
  color: #64748b;
  font-size: 9pt;
}

.student-print-identity {
  display: grid;
  grid-template-columns: 31mm minmax(0, 1fr);
  gap: 5mm;
  margin-bottom: 5mm;
}

.student-print-photo {
  width: 31mm;
  height: 40mm;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 3mm;
  background: #f8fafc;
  color: #64748b;
  font-size: 9pt;
  overflow: hidden;
}

.student-print-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.student-print-identity-grid,
.student-print-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.2mm;
}

.student-print-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-print-identity-grid > div,
.student-print-grid > div {
  min-height: 15mm;
  padding: 2.4mm 3mm;
  border: 1px solid #dbe4ef;
  border-radius: 2.5mm;
  background: #f8fafc;
}

.student-print-identity-grid span,
.student-print-grid span {
  display: block;
  margin-bottom: 1.2mm;
  color: #64748b;
  font-size: 7.4pt;
  line-height: 1.1;
  text-transform: uppercase;
}

.student-print-identity-grid strong,
.student-print-grid strong {
  display: block;
  color: #0f172a;
  font-size: 9.5pt;
  line-height: 1.25;
  word-break: break-word;
}

.student-print-section {
  margin-top: 5mm;
  break-inside: avoid;
}

.student-print-section h2 {
  margin: 0 0 2.5mm;
  padding-bottom: 1.6mm;
  border-bottom: 1px solid #dbe4ef;
  color: #0f766e;
  font-size: 11pt;
  line-height: 1.2;
}

.student-print-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18mm;
  margin-top: 18mm;
  padding-top: 10mm;
}

.student-print-signatures div {
  border-top: 1px solid #334155;
  text-align: center;
}

.student-print-signatures span {
  display: block;
  margin-top: 2mm;
  color: #475569;
  font-size: 8.5pt;
}

.print-target-root {
  display: none;
}

body.route-matricula .documents-table-wrap {
  margin-top: 1rem;
}

body.route-matricula .document-file-link {
  color: var(--ui-teal);
  font-weight: 700;
}

body.route-matricula .document-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body.route-matricula .document-edit-details {
  position: relative;
}

body.route-matricula .document-edit-details > summary {
  list-style: none;
  cursor: pointer;
}

body.route-matricula .document-edit-details > summary::-webkit-details-marker {
  display: none;
}

body.route-matricula .document-edit-form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 15;
  width: min(360px, 86vw);
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

body.route-matricula .document-edit-form .input {
  min-height: 42px;
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-details[open]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-details[open] > summary {
  background: #0f766e;
  color: #ffffff;
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  z-index: 1200;
  width: min(760px, calc(100vw - 56px)) !important;
  max-height: min(84vh, 680px);
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 32px 72px rgba(15, 23, 42, 0.26);
  transform: translate(-50%, -50%);
  white-space: normal;
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form label {
  min-width: 0;
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form label:first-of-type {
  grid-column: 1 / -1;
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form label:last-of-type {
  grid-column: auto;
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form input,
body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form select {
  min-height: 48px;
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  font-size: 0.98rem;
}

body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form .btn {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 150px;
}

body.route-configuracoes .document-actions {
  text-align: right;
}

body.route-configuracoes .document-actions .action-icon-grid {
  position: relative;
}

body.route-configuracoes .document-edit-details {
  position: relative;
}

body.route-configuracoes .document-edit-details > summary {
  list-style: none;
  cursor: pointer;
}

body.route-configuracoes .document-edit-details > summary::-webkit-details-marker {
  display: none;
}

body.route-configuracoes .document-edit-details[open]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

body.route-configuracoes .document-edit-form {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1200;
  width: min(860px, calc(100vw - 56px));
  max-height: min(92vh, 860px);
  display: grid;
  gap: 1rem;
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 32px 72px rgba(15, 23, 42, 0.26);
  transform: translate(-50%, -50%);
  white-space: normal;
}

body.route-configuracoes .document-edit-details[open] > summary {
  background: #0f766e;
  color: #ffffff;
}

body.route-configuracoes .document-edit-details[open] > summary svg {
  stroke: currentColor;
}

body.route-configuracoes .document-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

body.route-configuracoes .document-edit-header h3 {
  margin: 0.18rem 0 0;
  color: var(--text);
  font-size: 1.2rem;
}

body.route-configuracoes .document-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

body.route-configuracoes .document-edit-text {
  grid-column: 1 / -1;
}

body.route-configuracoes .document-edit-form .input {
  min-height: 42px;
}

body.route-configuracoes .document-edit-form textarea.input {
  min-height: 420px !important;
  height: 48vh !important;
  max-height: 560px !important;
  resize: vertical !important;
}

body.route-configuracoes .document-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.2rem;
}

body.route-matricula .student-occurrence-grid {
  display: grid;
  grid-template-columns: minmax(135px, 0.55fr) minmax(150px, 0.65fr) minmax(240px, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

body.route-matricula .student-occurrence-description {
  grid-column: 1 / -2;
}

body.route-matricula .student-occurrence-action {
  display: flex;
  justify-content: flex-end;
}

body.route-matricula .student-occurrence-action .btn {
  min-height: 44px;
  white-space: nowrap;
}

body.route-matricula .student-occurrence-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

body.route-matricula .student-occurrence-item {
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
}

body.route-matricula .student-occurrence-date {
  display: grid;
  gap: 0.12rem;
  align-content: center;
  min-height: 54px;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20, 138, 131, 0.14), rgba(14, 165, 233, 0.12));
}

body.route-matricula .student-occurrence-date strong,
body.route-matricula .student-occurrence-item > div > strong {
  color: var(--ui-card-text);
}

body.route-matricula .student-occurrence-date span {
  color: var(--ui-teal);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

body.route-matricula .student-occurrence-item p {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

body.route-matricula .student-occurrence-item form {
  margin: 0;
}

@media (max-width: 1080px) {
  .dashboard-agenda-lanes {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-audience-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.route-matricula .document-upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.route-matricula .document-issue-grid,
  .document-template-layout {
    grid-template-columns: 1fr;
  }

  body.route-matricula .student-occurrence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.route-matricula .document-upload-action,
  body.route-matricula .student-occurrence-action {
    justify-content: flex-start;
  }

  body.route-matricula .student-occurrence-description {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .dashboard-agenda-board-head,
  .dashboard-agenda-lane {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-agenda-board-head {
    display: grid;
  }

  .dashboard-agenda-actions {
    justify-content: flex-start;
  }

  .dashboard-event-chip {
    width: min(210px, 82vw);
    flex-basis: min(210px, 82vw);
  }

  .calendar-audience-panel {
    padding: 0.8rem;
  }

  .calendar-audience-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-audience-option > span {
    min-height: 68px;
  }

  body.route-matricula .document-upload-grid,
  body.route-matricula .document-issue-grid,
  body.route-matricula .student-occurrence-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.route-matricula .document-actions,
  body.route-matricula .student-action-grid {
    justify-content: flex-start;
  }

  body.route-matricula .student-action-icon {
    width: 34px;
    height: 34px;
  }

  body.route-matricula .student-occurrence-description {
    grid-column: auto;
  }

  body.route-matricula .student-occurrence-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  body.route-matricula .document-edit-form {
    position: static;
    width: 100%;
    margin-top: 0.55rem;
  }

  body.route-matricula [data-modal-id="student-finance-modal"] .finance-edit-form {
    width: min(94vw, 680px) !important;
    grid-template-columns: 1fr;
    max-height: 86vh;
  }

  body.route-configuracoes .document-edit-form {
    position: fixed;
    left: 50%;
    top: 50%;
    width: min(94vw, 720px);
    max-height: 86vh;
    margin-top: 0;
    transform: translate(-50%, -50%);
  }

  body.route-configuracoes .document-edit-grid {
    grid-template-columns: 1fr;
  }

  .issued-document-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body.is-printing-target > :not(.print-target-root) {
    display: none !important;
  }

  body.is-printing-target .print-target-root {
    display: block !important;
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  body.is-printing-target * {
    visibility: hidden !important;
  }

  body.is-printing-target .is-print-target,
  body.is-printing-target .is-print-target * {
    visibility: visible !important;
  }

  body.is-printing-target .is-print-target {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body.is-printing-target .student-print-sheet.is-print-target {
    position: static !important;
    inset: auto !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }

  body.is-printing-target .student-print-sheet.is-print-target,
  body.is-printing-target .student-print-sheet.is-print-target * {
    visibility: visible !important;
  }

  body.is-printing-target .student-print-sheet.is-print-target .student-print-section {
    break-inside: avoid;
  }
}


/* Hotfix global de modais: mantem cabecalho e botao fechar sempre visiveis. */
body.route-matricula .student-modal-body {
  padding-top: 1.35rem !important;
}

body.route-matricula .student-step-panel[data-step-panel="0"] .student-stage-card {
  padding-top: 1.45rem !important;
}

body.route-matricula .student-step-panel[data-step-panel="0"] .student-stage-top {
  display: grid !important;
  grid-template-columns: 112px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 1rem !important;
  min-height: 0 !important;
  margin: 0 0 1rem !important;
  overflow: visible !important;
}

body.route-matricula .student-step-panel[data-step-panel="0"] .student-photo-column {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 112px !important;
  z-index: auto !important;
  transform: none !important;
}

body.route-matricula .student-step-panel[data-step-panel="0"] .student-stage-heading {
  margin-top: 0.65rem !important;
  margin-bottom: 0.9rem !important;
}

body.route-matricula .student-step-panel[data-step-panel="0"] .student-stage-fields {
  margin-top: 0 !important;
}

body.route-matricula .student-stepper {
  padding-bottom: 2.05rem !important;
}

body.route-matricula .student-step::after {
  top: 44px !important;
}

body.has-student-modal-open .app-topbar.topbar,
body.has-student-modal-open .app-sidebar.sidebar {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none !important;
}

.finance-modal-overlay.is-open {
  z-index: 99999 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow: auto !important;
  padding: 72px 24px 32px !important;
}

.finance-modal-overlay.is-open .finance-modal {
  width: min(1120px, calc(100vw - 48px)) !important;
  max-height: calc(100dvh - 104px) !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transform: none !important;
}

.finance-modal-overlay.is-open .finance-modal-header {
  position: relative !important;
  flex: 0 0 auto !important;
  min-height: 68px !important;
  align-items: flex-start !important;
  padding: 1rem 1.15rem !important;
  z-index: 2 !important;
}

.finance-modal-overlay.is-open .finance-modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.finance-modal-overlay.is-open .finance-modal-close {
  flex: 0 0 36px !important;
  display: grid !important;
  place-items: center !important;
  z-index: 3 !important;
}

@media (max-width: 620px) {
  .finance-modal-overlay.is-open {
    padding: 16px !important;
  }

  .finance-modal-overlay.is-open .finance-modal {
    width: 100% !important;
    max-height: calc(100dvh - 32px) !important;
  }
}

/* Mantem o menu lateral navegavel quando modais estao abertos no desktop. */
@media (min-width: 1181px) {
  body.has-app-modal-open .app-sidebar.sidebar {
    position: sticky !important;
    z-index: 100000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .finance-modal-overlay.is-open,
  .student-modal-overlay.is-open,
  body.route-matricula .student-modal-overlay.is-open {
    left: var(--sidebar-width) !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: 100dvh !important;
    max-width: none !important;
  }

  .finance-modal-overlay.is-open .finance-modal {
    width: min(1120px, calc(100vw - var(--sidebar-width) - 48px)) !important;
  }

  .student-modal-overlay.is-open .student-modal,
  body.route-matricula .student-modal-overlay.is-open .student-modal {
    width: min(1120px, calc(100vw - var(--sidebar-width) - 48px)) !important;
  }
}
