:root {
  --bg: #eaf0f7;
  --bg-deep: #e0e8f2;
  --surface: #ffffff;
  --ink: #132033;
  --muted: #5a6a80;
  --line: #c9d5e4;
  --line-soft: #e2eaf3;
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-mid: #2563eb;
  --brand-soft: #dbeafe;
  --brand-glow: rgba(37, 99, 235, 0.2);
  --accent: #f59e0b;
  --accent-soft: #fff7ed;
  --ok: #157a45;
  --warn: #b45309;
  --danger: #b42318;
  --info: #1d4ed8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(19, 32, 51, 0.04), 0 12px 28px rgba(19, 32, 51, 0.07);
  --shadow-lg: 0 20px 50px rgba(19, 32, 51, 0.14);
  --sidebar: #0b1220;
  --sidebar-mid: #111c33;
  --sidebar-text: #c5d4ea;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 260px;
  --space-1: .35rem;
  --space-2: .65rem;
  --space-3: 1rem;
  --space-4: 1.25rem;
  --space-5: 1.75rem;
  --page-gap: 1rem;
  --tile-pad: 1.15rem 1.25rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(37, 99, 235, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at -10% 30%, rgba(245, 158, 11, 0.06), transparent 50%),
    linear-gradient(165deg, #f4f7fb 0%, var(--bg) 45%, var(--bg-deep) 100%);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-mid); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ——— Shell ——— */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background:
    linear-gradient(165deg, rgba(37, 99, 235, 0.28) 0%, transparent 38%),
    linear-gradient(180deg, var(--sidebar-mid) 0%, var(--sidebar) 100%);
  color: var(--sidebar-text);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  z-index: 40;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.35rem 1rem 1.1rem;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .35rem .55rem 1.35rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 1rem;
  text-decoration: none;
  color: #fff;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.2);
  flex-shrink: 0;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,.95);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.brand.has-logo .brand-text strong { font-size: 1.15rem; }

.sistema-logo-block {
  display: flex;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fbff;
}
.sistema-logo-preview {
  width: 120px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}
.sistema-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.brand-text span {
  display: block;
  font-size: .72rem;
  opacity: .65;
  font-weight: 500;
  margin-top: .15rem;
  letter-spacing: .02em;
}

.nav { flex: 1; }
.nav .section {
  margin: 1rem .65rem .4rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .45;
  font-weight: 700;
}
.nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--sidebar-text);
  padding: .62rem .75rem;
  border-radius: 10px;
  margin-bottom: .15rem;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 550;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  position: relative;
}
.nav-ico {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  max-width: 1.25rem;
  max-height: 1.25rem;
  opacity: .75;
  flex-shrink: 0;
  display: block;
}
.nav a:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  text-decoration: none;
  transform: translateX(2px);
}
.nav a:hover .nav-ico { opacity: 1; }
.nav a.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, .4), rgba(255,255,255,.06));
  color: #fff;
  box-shadow: inset 3px 0 0 #60a5fa;
}
.nav a.active .nav-ico { opacity: 1; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .65rem;
  margin-bottom: .35rem;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #60a5fa, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.sidebar-user-meta { min-width: 0; }
.sidebar-user-meta strong {
  display: block;
  color: #fff;
  font-size: .85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-meta span {
  display: block;
  font-size: .72rem;
  opacity: .55;
  text-transform: capitalize;
}
.nav-logout-form {
  margin: 0;
  width: 100%;
}
.nav-logout {
  display: flex !important;
  align-items: center;
  gap: .7rem;
  padding: .62rem .75rem;
  border-radius: 10px;
  color: #fca5a5 !important;
  opacity: .9;
  text-decoration: none !important;
  font-size: .92rem;
  font-weight: 550;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.nav-logout .nav-ico {
  opacity: .9;
  color: #fca5a5;
}
.nav-logout:hover {
  background: rgba(180, 35, 24, .2) !important;
  color: #fecaca !important;
}
.btn:focus-visible,
.nav a:focus-visible,
.nav-logout:focus-visible,
.menu-toggle:focus-visible,
.tabs a:focus-visible,
.bday-tab:focus-visible,
.modo-option:focus-within span {
  outline: 3px solid var(--brand, #3b82f6);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .main { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ——— Main ——— */
.main {
  padding: 1.1rem 1.4rem 1.75rem;
  min-width: 0;
  animation: fadeIn .35s ease;
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
}
.main > .topbar,
.main > .flash,
.main > .panel,
.main > .grid,
.main > .tabs,
.main > .steps,
.main > .alert,
.main > .page-stack {
  margin-bottom: 0;
}
body.dash-fit .app-shell {
  height: 100vh;
  overflow: hidden;
}
body.dash-fit .main {
  height: 100vh;
  overflow: hidden;
  padding: .9rem 1.1rem 1rem;
  gap: .65rem;
}
body.dash-fit .topbar {
  flex-shrink: 0;
}
body.dash-fit .topbar h1 {
  font-size: 1.28rem;
}
body.dash-fit .flash {
  flex-shrink: 0;
  padding: .55rem .8rem;
}
body.dash-fit .dash-screen {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0;
}
.topbar-left {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.topbar .eyebrow {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 .25rem;
}
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .85rem .45rem .45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.user-chip .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 800;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--ink);
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 24, .45);
  z-index: 35;
  backdrop-filter: blur(2px);
}

/* ——— Feedback ——— */
.flash {
  padding: .9rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 0;
  border: 1px solid transparent;
  font-weight: 550;
  font-size: .92rem;
  animation: slideDown .3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.flash-success { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ——— Grid / KPI / tiles ——— */
.grid { display: grid; gap: var(--page-gap); align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .panel { margin-bottom: 0; height: 100%; }

.page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
}
.page-stack > .panel,
.page-stack > .grid,
.page-stack > .alert,
.page-stack > .tabs {
  margin-bottom: 0;
}
.section-label {
  margin: .15rem 0 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--tile-pad);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-mid), #60a5fa);
  opacity: 0;
  transition: opacity .2s ease;
}
.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #93c5fd;
}
.kpi:hover::before { opacity: 1; }
.kpi a { color: inherit; text-decoration: none; display: block; }
.kpi a:hover { text-decoration: none; }
.kpi .label {
  color: var(--muted);
  font-size: .78rem;
  margin-bottom: .45rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi .value {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.1;
}
.kpi .hint { color: var(--muted); font-size: .8rem; margin-top: .4rem; font-weight: 500; }
.kpi-accent .value { color: var(--brand); }
.kpi-warn .value { color: var(--warn); }
.kpi-money .value { color: var(--brand-dark); }

/* ——— Panels / telhas ——— */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--tile-pad);
  margin-bottom: var(--page-gap);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
body.dash-fit .panel.dash-panel {
  margin-bottom: 0;
}
.panel > .table-wrap,
.panel > .form-grid,
.panel > .check-list,
.panel > .check-list-grid,
.panel > form {
  min-width: 0;
}
.panel h2, .panel h3 {
  margin: 0 0 .85rem;
  font-size: 1.02rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.panel.is-collapsed .panel-head {
  margin-bottom: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 1rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2, .panel-head h3 { margin: 0; border: 0; padding: 0; }
.panel-head a:not(.btn) {
  font-size: .84rem;
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--muted);
  background: linear-gradient(180deg, #f5f8fc, #fff);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.empty-state strong { display: block; color: var(--ink); margin-bottom: .25rem; }

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  margin: 0 -.35rem;
  padding: 0 .35rem;
  border-radius: var(--radius-sm);
}
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
}
table.data th, table.data td {
  padding: .8rem .65rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}
table.data th {
  color: var(--muted);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #f5f8fc;
  position: sticky;
  top: 0;
}
table.data th:first-child { border-radius: 8px 0 0 8px; }
table.data th:last-child { border-radius: 0 8px 0 0; }
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover td { background: #eff6ff; }
table.data td a { font-weight: 650; }

/* ——— Badges / Buttons ——— */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .22rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: .01em;
}
.badge-ok { background: #dbeafe; color: #1e40af; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #eef2f0; color: #4b5c54; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .62rem 1.1rem;
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(180deg, var(--brand-mid), var(--brand));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 14px var(--brand-glow);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover {
  filter: brightness(1.05);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--brand-glow);
}
.btn:active { transform: none; }
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.btn-secondary:hover {
  background: #f3f6fb;
  color: var(--ink);
  filter: none;
  box-shadow: none;
}
.btn-danger {
  background: linear-gradient(180deg, #dc2626, var(--danger));
  box-shadow: 0 6px 14px rgba(180, 35, 24, .2);
}
.btn-accent {
  background: linear-gradient(180deg, #f59e0b, var(--accent));
  box-shadow: 0 6px 14px rgba(217, 119, 6, .22);
}
.btn-sm { padding: .4rem .75rem; font-size: .8rem; border-radius: 8px; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }

.aluno-row-actions {
  justify-content: flex-end;
  gap: .3rem;
  flex-wrap: nowrap;
  align-items: center;
}
.contrato-select {
  width: auto;
  max-width: 11.5rem;
  min-width: 7.5rem;
  padding: .35rem .45rem;
  font-size: .72rem;
  line-height: 1.2;
  border-radius: 8px;
  margin: 0;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .85rem 1.1rem 1rem;
  border-top: 1px solid var(--line);
}
.pager-info,
.pager-page {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 600;
}
.pager-nav {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.pager-nav .btn[disabled] {
  pointer-events: none;
}

/* ——— Forms ——— */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.15rem; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .35rem; }
label {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .35rem;
  font-weight: 700;
  letter-spacing: .01em;
}
input, select, textarea {
  width: 100%;
  padding: .72rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
input:hover, select:hover, textarea:hover { border-color: #b0c2b8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
input.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}
input.is-valid {
  border-color: #16a34a;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: .65rem;
  margin: 0 0 .55rem;
  font-weight: 550 !important;
  color: var(--ink) !important;
  font-size: .9rem !important;
  letter-spacing: 0 !important;
  cursor: pointer;
  line-height: 1.35;
}
.check-row:last-child { margin-bottom: 0; }
.check-list {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem;
  background: #fff;
}
.check-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem 1rem;
  background: #fff;
}
.check-row .help {
  margin: 0;
  font-weight: 500;
}
.dias-semana-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.dia-chip {
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  cursor: pointer;
  font-weight: 550 !important;
  color: var(--ink) !important;
  letter-spacing: 0 !important;
  font-size: .85rem !important;
}
.dia-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.dia-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: .45rem .55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.dia-chip input:checked + span {
  border-color: var(--accent, #1f4b7a);
  background: var(--accent-soft, #e8f0f8);
  color: var(--accent, #1f4b7a);
  font-weight: 650;
}
.dia-chip input:focus-visible + span {
  outline: 2px solid var(--accent, #1f4b7a);
  outline-offset: 2px;
}
.hora-aula-row {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.hora-aula-row input[type="time"] {
  flex: 1;
  min-width: 0;
}
.lote-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin-bottom: .75rem;
}
.lote-alunos {
  max-height: 280px;
}

.info-list {
  display: grid;
  gap: .7rem;
}
.info-list > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: .65rem;
  align-items: center;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line-soft);
}
.info-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.info-list strong { font-weight: 650; color: var(--ink); }

.fin-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
.fin-kpi {
  background: #f8fbff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: .7rem .75rem;
}
.fin-kpi span {
  display: block;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .25rem;
}
.fin-kpi strong {
  font-size: .98rem;
  font-weight: 750;
  color: var(--ink);
}
.fin-kpi.accent strong { color: var(--brand-dark); }
.fin-kpi.ok strong { color: var(--ok); }
.fin-kpi.warn strong { color: var(--warn); }

.fin-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.fin-screen > .panel.tile {
  padding: .85rem 1rem;
}
.fin-screen .page-toolbar {
  width: 100%;
}
.fin-filter-turma {
  min-width: 180px;
  max-width: 280px;
}
.fin-date {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.fin-date span { flex: none; }
.fin-date input[type="date"] {
  width: auto;
  min-width: 9.5rem;
  max-width: 11rem;
  padding: .55rem .65rem;
  margin: 0;
}
.fin-resumo {
  margin: 0;
}
.fin-resumo .kpi .value {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
}
.fin-screen .dash-bottom {
  grid-template-columns: 1fr 1.15fr;
}
.fin-screen .dash-panel .table-wrap {
  max-height: 22rem;
  overflow: auto;
}

.panel-danger-zone {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff7f7, #fff);
}
.panel-danger-zone .panel-head {
  border-bottom-color: #fecaca;
}
.panel-danger-zone .panel-head h2 { color: var(--danger); }

@media (max-width: 720px) {
  .info-list > div { grid-template-columns: 1fr; gap: .2rem; }
  .fin-kpis { grid-template-columns: 1fr 1fr; }
}
.help { color: var(--muted); font-size: .8rem; margin-top: .3rem; }

.smtp-panel { margin-top: 1.25rem; }
.smtp-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.smtp-section-head h2 {
  margin: 0;
  border: 0;
  padding: 0;
  font-size: 1.15rem;
}
.smtp-kicker {
  margin: 0 0 .2rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.smtp-badge {
  display: inline-flex;
  align-items: center;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.smtp-badge--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.smtp-badge--warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.smtp-row-port {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 1rem 1.15rem;
}
.smtp-status-line {
  margin: .25rem 0 0;
  font-size: .8rem;
  color: var(--muted);
}
.smtp-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.smtp-preview-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  max-width: min(560px, calc(100vw - 2rem));
  width: 100%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.smtp-preview-dialog::backdrop {
  background: rgba(15, 23, 42, .45);
}
.smtp-preview-card {
  margin: 0;
  padding: 1.1rem 1.2rem 1.25rem;
}
.smtp-preview-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.smtp-preview-card h3 {
  margin: 0;
  font-size: 1rem;
}
.smtp-preview-meta {
  display: grid;
  gap: .35rem;
  margin-bottom: .85rem;
  font-size: .86rem;
  color: var(--text);
}
.smtp-preview-body {
  margin: 0;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  white-space: pre-wrap;
  font-size: .86rem;
  line-height: 1.5;
  color: #334155;
}
@media (max-width: 720px) {
  .smtp-row-port { grid-template-columns: 1fr; }
  .smtp-section-head { flex-direction: column; }
}

.alert {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1.1rem;
  background: var(--accent-soft);
  border: 1px solid #fdba74;
  color: #9a3412;
  font-weight: 550;
}
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
  padding: .3rem;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.tabs a {
  padding: .5rem 1rem;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .88rem;
  transition: background .15s ease, color .15s ease;
}
.tabs a:hover { color: var(--ink); text-decoration: none; background: rgba(255,255,255,.8); }
.tabs a.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.search-results {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 240px;
  overflow: auto;
  margin-top: .5rem;
  box-shadow: var(--shadow);
  background: #fff;
}
.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .8rem .9rem;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: background .12s ease;
}
.search-results button:last-child { border-bottom: 0; }
.search-results button:hover { background: var(--brand-soft); }

.steps {
  display: flex;
  gap: .55rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.step {
  flex: 1;
  min-width: 100px;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  font-size: .84rem;
  font-weight: 700;
  color: var(--muted);
  position: relative;
}
.step.on {
  background: var(--brand-soft);
  border-color: #93c5fd;
  color: var(--brand-dark);
  box-shadow: 0 4px 14px var(--brand-glow);
}
.step.done {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: .95rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line-soft);
}
.panel > .page-toolbar:first-child {
  margin-top: -.15rem;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.filter-bar input,
.filter-bar select {
  width: auto;
  min-width: 140px;
  max-width: 240px;
}

.stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .9rem;
}
.stat-list li:last-child { border-bottom: 0; }

/* ——— Auth ——— */
.auth-body {
  background: #060a12;
}
.auth-page--centered {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
  overflow: hidden;
}
.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 0%, rgba(37, 99, 235, .32), transparent 60%),
    radial-gradient(ellipse 40% 35% at 85% 80%, rgba(245, 158, 11, .1), transparent 55%),
    radial-gradient(ellipse 35% 30% at 10% 70%, rgba(59, 130, 246, .12), transparent 50%),
    linear-gradient(165deg, #10192c 0%, #0a1220 45%, #060a12 100%);
}
.auth-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.04'%3E%3Cpath d='M0 36h72M36 0v72'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}
.auth-backdrop::after {
  content: "";
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -40%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .18), transparent 68%);
  filter: blur(40px);
  animation: authGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes authGlow {
  from { opacity: .55; transform: translate(-50%, -40%) scale(.92); }
  to { opacity: 1; transform: translate(-50%, -36%) scale(1.06); }
}
.auth-stage {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: authCardIn .55s cubic-bezier(.22, 1, .36, 1);
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.auth-hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .55rem;
}
.auth-hero-logo {
  display: block;
  width: min(280px, 78vw);
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(0, 38, 255, .28));
}
.auth-hero-tag {
  margin: 0;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8fa3bf;
  font-weight: 600;
}
.auth-card {
  width: 100%;
  padding: 1.7rem 1.6rem 1.45rem;
  border-radius: 22px;
  color: #d7e3f4;
  background: linear-gradient(165deg, rgba(22, 32, 52, .88) 0%, rgba(10, 16, 28, .94) 100%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow:
    0 1px 0 rgba(255,255,255,.07) inset,
    0 28px 60px rgba(0, 0, 0, .42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.auth-card ul {
  margin: 0 0 1.25rem;
  padding-left: 1.15rem;
  color: #e8eef8;
  line-height: 1.55;
}
.auth-card li {
  margin-bottom: .55rem;
  color: #e8eef8;
}
.auth-card li strong {
  color: #ffffff;
  font-weight: 700;
}
.auth-card p {
  color: #e2eaf4;
  line-height: 1.55;
}
.auth-card a {
  color: #93c5fd;
}
.auth-card a:hover {
  color: #bfdbfe;
}
.auth-card-mark {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}
.auth-card-name {
  font-family: var(--display);
  font-size: 1.35rem;
  color: #fff;
  letter-spacing: -.01em;
}
.auth-card-head {
  margin: 0 0 1.35rem;
  text-align: center;
}
.auth-card-head h1,
.auth-card h1 {
  font-family: var(--display);
  margin: 0 0 .4rem;
  font-size: 1.42rem;
  letter-spacing: -.025em;
  color: #f3f7ff;
}
.auth-card-head p,
.auth-card > p {
  color: #d5e0ef;
  margin: 0 0 1rem;
  font-size: .95rem;
  line-height: 1.55;
}
.auth-form { margin: 0; }
.auth-field { margin-bottom: 1rem; }
.auth-field:last-of-type { margin-bottom: 1.25rem; }
.auth-field label {
  display: block;
  margin-bottom: .4rem;
  color: #b6c5db;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.auth-field input {
  width: 100%;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(255, 255, 255, .045);
  color: #f1f5f9;
  box-shadow: none;
}
.auth-field input::placeholder { color: #64748b; }
.auth-field input:hover {
  border-color: rgba(147, 197, 253, .35);
}
.auth-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .22);
  background: rgba(255, 255, 255, .07);
}
.auth-card .btn {
  width: 100%;
  padding: .92rem 1rem;
  margin-top: .1rem;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .015em;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border: 0;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .35);
}
.auth-card .btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.auth-card .flash {
  margin-bottom: 1rem;
  border-radius: 12px;
}
.auth-card .flash-success {
  background: rgba(37, 99, 235, .16);
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, .28);
}
.auth-card .flash-error {
  background: rgba(185, 28, 28, .18);
  color: #fecaca;
  border-color: rgba(252, 165, 165, .28);
}
.auth-links {
  margin: 1.2rem 0 0;
  font-size: .82rem;
  text-align: center;
  color: #7b8fa8;
}
.auth-links a {
  color: #93c5fd;
}
.auth-links a:hover { color: #bfdbfe; }

.install-banner {
  margin-bottom: 1rem;
  border-radius: 12px;
}
.install-banner a {
  color: #bfdbfe;
  font-weight: 700;
  text-decoration: underline;
}
.install-step {
  margin: 0 0 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
}
.install-step:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}
.install-step-title {
  margin: 0 0 .85rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #93c5fd;
}
.install-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}
.install-checks li {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin: 0;
  padding: .65rem .75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(148, 163, 184, .14);
}
.install-checks li.ok { border-color: rgba(74, 222, 128, .28); }
.install-checks li.fail { border-color: rgba(252, 165, 165, .35); }
.install-checks small {
  display: block;
  margin-top: .15rem;
  color: #94a3b8;
  font-size: .78rem;
}
.install-check-mark {
  flex: 0 0 auto;
  width: 1.25rem;
  font-weight: 700;
  color: #4ade80;
}
.install-checks li.fail .install-check-mark { color: #fca5a5; }
.install-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: .75rem;
}
.install-check-label {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin: 0 0 1rem;
  color: #cbd5e1;
  font-size: .88rem;
  line-height: 1.4;
  cursor: pointer;
}
.install-check-label input {
  margin-top: .2rem;
}
.install-help {
  margin: 0 0 1rem;
  font-size: .82rem;
  line-height: 1.45;
  color: #94a3b8;
}
.install-help code,
.install-help strong {
  color: #bfdbfe;
  font-size: .78rem;
}
.install-help strong { font-size: inherit; }
.install-field-hint {
  display: block;
  margin-top: .35rem;
  font-size: .75rem;
  color: #7b8fa8;
  line-height: 1.35;
}
.install-warn {
  margin: 0 0 1rem;
  font-size: .8rem;
  line-height: 1.45;
  color: #fbbf24;
}
.install-test-btn {
  width: 100%;
  margin-bottom: .75rem;
  background: transparent;
  border: 1px solid rgba(147, 197, 253, .35);
  color: #bfdbfe;
  box-shadow: none;
}
.install-test-btn:hover {
  background: rgba(59, 130, 246, .12);
  filter: none;
  transform: none;
}
.install-test-msg {
  margin: 0 0 1rem;
  font-size: .82rem;
  color: #94a3b8;
}
.install-test-msg.ok { color: #86efac; }
.install-test-msg.fail { color: #fca5a5; }
.auth-card .btn-secondary {
  background: transparent;
}

@media (max-width: 520px) {
  .install-row { grid-template-columns: 1fr; }
}

/* ——— Lists on dashboard ——— */
.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mini-list li {
  padding: .55rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .9rem;
  display: flex;
  gap: .65rem;
  align-items: baseline;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list .date {
  font-size: .75rem;
  font-weight: 700;
  color: var(--brand);
  min-width: 4.2rem;
}

/* Dashboard em uma tela — telhas organizadas */
.dash-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1.35fr) minmax(0, 1fr);
  gap: .7rem;
  flex: 1;
  min-height: 0;
}
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
}
.dash-kpis .kpi {
  padding: .8rem .9rem;
  height: 100%;
}
.dash-kpis .kpi .value {
  font-size: 1.28rem;
}
.dash-kpis .kpi .label {
  margin-bottom: .2rem;
  font-size: .68rem;
}
.dash-kpis .kpi .hint {
  font-size: .72rem;
  margin-top: .2rem;
}
.dash-kpis .kpi a,
a.kpi {
  color: inherit;
  text-decoration: none;
  display: block;
  height: 100%;
}
.dash-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: .7rem;
  min-height: 0;
}
.dash-main > .dash-panel {
  min-height: 0;
  overflow: hidden;
}
.dash-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
  min-height: 0;
}
.dash-bottom > .dash-panel {
  min-height: 0;
  overflow: hidden;
}
.dash-panel {
  margin-bottom: 0;
  padding: .85rem .95rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-panel .panel-head {
  margin-bottom: .55rem;
  padding-bottom: .5rem;
  flex-shrink: 0;
}
.dash-panel .panel-head h2 {
  font-size: .95rem;
}
.dash-panel > .table-wrap,
.dash-panel > .bday-screens {
  flex: 1;
  min-height: 0;
}
.dash-empty {
  color: var(--muted);
  font-size: .82rem;
  padding: .85rem .25rem;
  text-align: center;
}
.dash-scroll {
  overflow: auto;
  max-height: none;
  flex: 1;
  min-height: 0;
}
.data-compact th,
.data-compact td {
  padding: .45rem .4rem;
  font-size: .82rem;
}
.bday-panel { overflow: hidden; }
.bday-tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: .65rem;
  background: #eef3f9;
  padding: .25rem;
  border-radius: 10px;
  flex-shrink: 0;
}
.bday-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  white-space: nowrap;
  font-weight: 700;
  padding: .45rem .6rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.bday-tab.is-active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 4px rgba(19, 32, 51, .08);
}
.bday-tab-count {
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--brand-dark);
  font-size: .68rem;
  display: inline-grid;
  place-items: center;
}
.bday-tab.is-active .bday-tab-count {
  background: var(--brand);
  color: #fff;
}
.bday-screens {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: .15rem;
}
.bday-screen { min-height: 0; }
.bday-list {
  list-style: none;
  margin: 0;
  padding: 0 0 .25rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.bday-list-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .6rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f8fbff;
}
.bday-avatar {
  width: 36px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(145deg, #60a5fa, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .72rem;
  flex-shrink: 0;
  overflow: hidden;
}
.bday-avatar.has-photo {
  background: #e2e8f0;
  border: 1px solid var(--line-soft);
}
.bday-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bday-list-item:has(.bday-avatar.has-photo) .bday-name:hover {
  color: var(--brand-dark);
}
.aluno-cell {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}
.aluno-cell a {
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}
.aluno-cell a:hover { color: var(--brand); text-decoration: underline; }
.aluno-thumb {
  width: 36px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(145deg, #60a5fa, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .7rem;
  flex-shrink: 0;
  overflow: hidden;
}
.aluno-thumb.has-photo {
  background: #e2e8f0;
  border: 1px solid var(--line-soft);
}
.aluno-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bday-photo-float {
  position: fixed;
  width: 135px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 16px 40px rgba(19, 32, 51, 0.3);
  background: #e2e8f0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(.94);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.bday-photo-float.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.bday-photo-float img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bday-date-badge {
  width: 64px;
  flex-shrink: 0;
  text-align: center;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: .3rem .2rem;
  line-height: 1.15;
}
.bday-date-badge strong {
  display: block;
  font-size: .68rem;
  color: var(--brand);
  text-transform: uppercase;
}
.bday-date-badge span {
  display: block;
  font-size: .7rem;
  color: var(--muted);
  font-weight: 600;
}
.bday-info { min-width: 0; flex: 1; }
.bday-name {
  display: block;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: .86rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bday-name:hover { color: var(--brand); text-decoration: none; }
.bday-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .2rem;
}
.bday-chip {
  display: inline-flex;
  align-items: center;
  padding: .08rem .4rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .66rem;
  font-weight: 700;
}
.bday-chip.muted {
  background: #eef2f6;
  color: var(--muted);
}
.bday-list-item .btn { flex-shrink: 0; padding: .3rem .55rem; font-size: .75rem; }

/* ——— Foto 3x4 aluno ——— */
.ficha-pessoal {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.35rem 1.75rem;
  align-items: start;
}
.ficha-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ficha-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line-soft);
}
.ficha-kicker {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .2rem;
}
.ficha-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.25;
}
.ficha-section h3 {
  margin: 0 0 .55rem;
  font-size: .72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.ficha-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem .9rem;
}
.ficha-field {
  min-width: 0;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid var(--line-soft);
}
.ficha-field-wide { grid-column: 1 / -1; }
.ficha-field span {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: .2rem;
}
.ficha-field strong {
  display: block;
  font-size: .92rem;
  font-weight: 650;
  color: var(--ink);
  word-break: break-word;
}
.ficha-obs { white-space: pre-wrap; font-weight: 550; }
.ficha-empty { margin: 0; }
.ficha-meta {
  padding-top: .15rem;
  border-top: 1px dashed var(--line-soft);
}
.ficha-meta .ficha-field {
  background: transparent;
  border-style: dashed;
}

.confirm-mat {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: .35rem;
}
.confirm-who {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr auto;
  gap: .75rem;
}
.confirm-who-item {
  min-width: 0;
  padding: .75rem .85rem;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid var(--line-soft);
}
.confirm-who-item span {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.confirm-who-item strong {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.confirm-who-item em {
  display: block;
  margin-top: .2rem;
  font-style: normal;
  font-size: .8rem;
  color: var(--muted);
  word-break: break-word;
}
.confirm-kpis .fin-kpi.accent {
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  border-color: #bfdbfe;
}
.confirm-kpis .fin-kpi.accent strong {
  font-size: 1.1rem;
}
.confirm-pay {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.confirm-pay-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: .65rem;
  align-items: center;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--line-soft);
}
.confirm-pay-row:last-child { border-bottom: 0; }
.confirm-pay-row span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.confirm-pay-row strong { font-weight: 650; color: var(--ink); }
.confirm-pay-row.is-warn {
  background: #fffbeb;
}
.confirm-pay-row.is-warn strong { color: var(--warn); }
.confirm-pay-row.is-ok strong { color: var(--ok); }
.confirm-email {
  padding: .9rem 1rem;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid var(--line-soft);
}
.confirm-actions {
  margin-top: 1.25rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
@media (max-width: 860px) {
  .confirm-who { grid-template-columns: 1fr; }
  .confirm-pay-row { grid-template-columns: 1fr; gap: .2rem; }
  .ficha-grid { grid-template-columns: 1fr; }
  .ficha-field-wide { grid-column: auto; }
}
.foto-aluno-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .65rem;
  max-width: 11rem;
}
.form .foto-aluno-block,
form[data-foto-form].foto-aluno-block.ficha-foto {
  max-width: none;
}
.panel > form[data-foto-form] .foto-aluno-block,
.panel form[data-foto-form] > .foto-aluno-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: center;
  max-width: 28rem;
  padding-bottom: 1rem;
  margin-bottom: .25rem;
  border-bottom: 1px solid var(--line-soft);
}
.foto-aluno-frame {
  width: 7.5rem;
  height: 10rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.foto-aluno-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.foto-aluno-placeholder {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.foto-aluno-actions { min-width: 0; }
.foto-aluno-actions .actions { margin: 0; }

.foto-cam-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: min(420px, 94vw);
  box-shadow: var(--shadow-lg);
}
.foto-cam-dialog::backdrop {
  background: rgba(11, 18, 32, .55);
}
.foto-cam-inner { padding: 1.15rem 1.2rem 1.25rem; }
.foto-cam-inner h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.foto-cam-stage {
  position: relative;
  margin-top: .75rem;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
  aspect-ratio: 3 / 4;
  max-height: 58vh;
}
.foto-cam-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}
.foto-cam-guide {
  pointer-events: none;
  position: absolute;
  inset: 8% 14%;
  border: 2px dashed rgba(255,255,255,.55);
  border-radius: 50% 50% 46% 46% / 42% 42% 58% 58%;
  box-shadow: 0 0 0 999px rgba(0,0,0,.22);
}

@media (max-width: 720px) {
  .ficha-pessoal { grid-template-columns: 1fr; }
  .panel form[data-foto-form] > .foto-aluno-block {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

@media (max-width: 1100px) {
  .dash-main,
  .dash-bottom,
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-main { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dash-kpis,
  .dash-bottom { grid-template-columns: 1fr; }
  .bday-list-item { flex-wrap: wrap; }
  .bday-list-item .btn { width: 100%; }
}

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; }
  .auth-page--centered { padding: 1.75rem 1rem 2rem; }
  .auth-hero-logo { width: min(230px, 72vw); }
  .auth-card { border-radius: 18px; padding: 1.4rem 1.2rem 1.25rem; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { align-items: center; }
  .fin-screen .dash-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 1rem .9rem 2rem; }
  .tabs { width: 100%; border-radius: 14px; }
  .user-chip .chip-text { display: none; }
  .filter-bar input, .filter-bar select { max-width: none; width: 100%; min-width: 0; }
  .check-list-grid { grid-template-columns: 1fr; }
  .fin-date { width: 100%; }
  .fin-date input[type="date"] { flex: 1; max-width: none; width: 100%; }
  .fin-filter-turma { max-width: none; }
}

.usuarios-screen,
.rel-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.baixa-rapida {
  margin: 0;
  display: inline-flex;
}

/* Tela Cursos — organização */
.cursos-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cursos-toolbar {
  padding: .85rem 1rem;
}
.cursos-toolbar-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .9rem;
}
.cursos-toolbar-meta strong {
  color: var(--ink);
  font-weight: 750;
}
.cursos-lists {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: start;
}
.cursos-lists .dash-panel .table-wrap {
  max-height: 22rem;
  overflow: auto;
}
.cursos-filters {
  margin: 0 0 .75rem;
  padding: 0 0 .75rem;
  border-bottom: 1px solid var(--line-soft);
}
.cursos-filters .filter-bar select {
  min-width: 120px;
  max-width: 200px;
}
.form-block {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fbff;
}
.form-block-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .85rem;
}
.form-block-head strong {
  display: block;
  font-size: .95rem;
}
.form-block-head .help {
  display: block;
  margin: .15rem 0 0;
}
.form-block-num {
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-dark, #1d4ed8);
  color: #fff;
  font-size: .8rem;
  font-weight: 750;
}
.modo-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .25rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line-soft);
}
.modo-option {
  margin: 0;
  cursor: pointer;
}
.modo-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.modo-option span {
  display: inline-flex;
  align-items: center;
  padding: .45rem .85rem;
  border-radius: 9px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--muted);
}
.modo-option input:checked + span {
  background: var(--brand-soft, #dbeafe);
  color: var(--brand-dark, #1d4ed8);
}
.modo-option input:disabled + span {
  opacity: .45;
  cursor: not-allowed;
}
@media (max-width: 980px) {
  .cursos-lists { grid-template-columns: 1fr; }
}

/* Prévia do contrato no wizard de matrícula (alinhada a contrato.css) */
.wizard-contrato-preview {
  --ctr-ink: #132033;
  --ctr-muted: #5a6a80;
  --ctr-line: #c9d5e4;
  --ctr-line-soft: #e8eef5;
  --ctr-brand: #1d4ed8;
  --ctr-brand-dark: #1e3a8a;
  --ctr-brand-soft: #eef4ff;
  --ctr-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ctr-serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  margin: .85rem 0 0;
  max-height: min(70vh, 900px);
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(165deg, #f4f7fb 0%, #e8eef5 50%, #dce6f2 100%);
  padding: .75rem .5rem 1rem;
  color: var(--ctr-ink);
  font-family: var(--ctr-font);
  font-size: 11.5px;
  line-height: 1.45;
}
.wizard-contrato-preview .sheet {
  position: relative;
  width: min(210mm, 100%);
  min-height: 0;
  margin: 8px auto;
  background: #fff;
  padding: 12mm 14mm;
  box-shadow: 0 1px 2px rgba(19, 32, 51, .04), 0 16px 40px rgba(19, 32, 51, .1);
  border-radius: 2px;
  overflow: hidden;
}
.wizard-contrato-preview .sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ctr-brand-dark), var(--ctr-brand) 55%, #60a5fa);
}
.wizard-contrato-preview .ctr-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ctr-line);
}
.wizard-contrato-preview .ctr-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wizard-contrato-preview .ctr-brand img {
  max-height: 54px;
  max-width: 120px;
  object-fit: contain;
}
.wizard-contrato-preview .ctr-brand strong {
  display: block;
  font-family: var(--ctr-serif);
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ctr-brand-dark);
  margin-bottom: 3px;
}
.wizard-contrato-preview .ctr-brand span {
  display: block;
  font-size: 10.5px;
  color: var(--ctr-muted);
  line-height: 1.4;
}
.wizard-contrato-preview .ctr-meta {
  text-align: right;
  font-size: 11.5px;
  color: var(--ctr-muted);
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--ctr-brand-soft);
}
.wizard-contrato-preview .ctr-meta .num {
  display: inline-block;
  font-family: var(--ctr-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--ctr-brand-dark);
  background: var(--ctr-brand-soft);
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid #dbeafe;
}
.wizard-contrato-preview h1.ctr-title {
  margin: 4px 0 10px;
  text-align: center;
  font-family: var(--ctr-serif);
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ctr-brand-dark);
}
.wizard-contrato-preview .ctr-intro {
  text-align: justify;
  margin: 0 0 14px;
  font-size: 11px;
  color: #243447;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fafc, #fff);
  border: 1px solid var(--ctr-line-soft);
  border-radius: 8px;
  border-left: 3px solid var(--ctr-brand);
}
.wizard-contrato-preview .ctr-intro-foot {
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 10.5px;
  color: var(--ctr-muted);
  font-style: italic;
}
.wizard-contrato-preview .fase {
  border: 1px solid var(--ctr-line);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.wizard-contrato-preview .fase-h {
  background: linear-gradient(90deg, var(--ctr-brand-dark), #1e4a9e 70%, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .05em;
  padding: 7px 12px;
  text-transform: uppercase;
}
.wizard-contrato-preview .fase-b { padding: 12px 12px 10px; }
.wizard-contrato-preview .fase-grid {
  display: grid;
  gap: 8px 14px;
}
.wizard-contrato-preview .fase-grid.g2 { grid-template-columns: 1.4fr .9fr; }
.wizard-contrato-preview .fase-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.wizard-contrato-preview .fase-grid.aluno {
  grid-template-columns: 1fr 30mm;
  align-items: start;
  gap: 10px 16px;
}
.wizard-contrato-preview .field.field-full { grid-column: 1 / -1; }
.wizard-contrato-preview .field label {
  display: block;
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 3px;
  color: var(--ctr-muted);
}
.wizard-contrato-preview .field .val {
  min-height: 20px;
  border-bottom: 1px solid var(--ctr-line);
  padding: 3px 0 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ctr-ink);
}
.wizard-contrato-preview .foto-box {
  width: 30mm;
  height: 38mm;
  border: 1.5px solid var(--ctr-line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(145deg, #f8fafc 0%, #eef2f7 100%);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--ctr-muted);
  text-align: center;
  box-shadow: inset 0 0 0 3px #fff;
}
.wizard-contrato-preview .foto-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wizard-contrato-preview .clausulas h2 {
  margin: 0 0 12px;
  font-family: var(--ctr-serif);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ctr-brand-dark);
  border-bottom: 2px solid var(--ctr-brand);
  padding-bottom: 6px;
}
.wizard-contrato-preview .clausulas p {
  margin: 0 0 7px;
  text-align: justify;
  font-size: 10.5px;
  line-height: 1.48;
  color: #243447;
}
.wizard-contrato-preview .clausulas .sec {
  font-weight: 700;
  margin: 12px 0 5px;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .05em;
  color: var(--ctr-brand-dark);
  padding: 4px 0 4px 8px;
  border-left: 3px solid var(--ctr-brand);
  background: linear-gradient(90deg, var(--ctr-brand-soft), transparent 70%);
}
.wizard-contrato-preview .assinaturas {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  text-align: center;
}
.wizard-contrato-preview .assinaturas .linha {
  border-top: 1.5px solid var(--ctr-ink);
  margin-top: 48px;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 650;
}
.wizard-contrato-preview .data-local {
  margin-top: 18px;
  font-size: 12px;
  font-family: var(--ctr-serif);
  font-style: italic;
}
@media (max-width: 860px) {
  .wizard-contrato-preview .fase-grid.g4 { grid-template-columns: repeat(2, 1fr); }
  .wizard-contrato-preview .fase-grid.aluno { grid-template-columns: 1fr; }
  .wizard-contrato-preview .foto-box { margin-top: .4rem; }
}

@media print {
  .sidebar, .topbar .actions, .no-print, .menu-toggle, .sidebar-backdrop { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; animation: none; }
  .panel, .kpi { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}
