* {
  box-sizing: border-box;
}

:root {
  --bg: #d7e6d7;
  --surface: #ffffff;
  --surface-soft: #f4faf4;
  --line: #e4dfd8;
  --text: #37443d;
  --muted: #68786f;
  --primary: #e99aa0;
  --primary-strong: #dc7f87;
  --mustard: #efd28d;
  --mustard-dark: #75622f;
  --entry: #efd28d;
  --exit: #e99aa0;
  --shadow: 0 12px 28px rgba(74, 69, 66, .10);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #e5f0e4 0%, var(--bg) 58%, #c8d9c8 100%);
  color: var(--text);
}

body:not(.login-body) {
  padding-bottom: 28px;
}

input,
select,
button {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(233, 154, 160, .32);
  outline-offset: 2px;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #e5f0e4, #d3e3d2 74%);
}

.login-card {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-logo {
  display: block;
  width: min(310px, 100%);
  height: auto;
  margin: 0 auto 20px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 500;
  color: #c96f77;
  text-align: center;
}

.login-card p {
  margin: 0 0 26px;
  color: var(--muted);
  text-align: center;
  font-weight: 400;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #3c3c3c;
  font-size: 14px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

input::placeholder {
  color: #8494a5;
}

.login-card button {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border-radius: 8px;
  background: var(--mustard);
  color: #2d2d2d;
  font-weight: 500;
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}

.login-card button:hover {
  background: #e8c676;
  box-shadow: 0 10px 22px rgba(239, 210, 141, .30);
}

.login-card button:active {
  transform: translateY(1px);
}

.alert {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
}

.error {
  border: 1px solid #f1bdc2;
  background: #f4d8dc;
  color: #9b545b;
}

.success {
  border: 1px solid #e8d7a4;
  background: #f3dfad;
  color: #7a6333;
}

.form-links {
  margin-top: 18px;
  text-align: center;
}

.form-links a {
  color: #9b545b;
  font-weight: 500;
  text-decoration: none;
}

.form-links a:hover {
  text-decoration: underline;
}

.approval-link-box {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #e8d7a4;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.approval-link-box span {
  color: var(--muted);
  font-size: 13px;
}

.approval-link-box a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--mustard);
  color: var(--text);
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 80px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 4px solid var(--primary);
  background: rgba(255, 255, 255, .96);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  justify-self: start;
}

.brand-logo {
  width: clamp(126px, 18vw, 230px);
  height: auto;
  flex: 0 0 auto;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 500;
  color: var(--primary);
}

.topbar span {
  display: inline-flex;
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

#relogio {
  align-items: center;
  justify-self: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #ead8a7;
  border-radius: 999px;
  background: #f3dfad;
  color: #7a6333;
  box-shadow: 0 8px 18px rgba(239, 210, 141, .20);
  white-space: nowrap;
  text-align: center;
}

#relogio::before {
  display: none;
  content: none;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  flex: 0 0 auto;
}

.menu-filtros {
  position: relative;
}

.menu-filtros summary {
  width: 44px;
  height: 42px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.menu-filtros summary::-webkit-details-marker {
  display: none;
}

.menu-filtros summary span {
  width: 18px;
  height: 2px;
  display: block;
  margin: 0;
  border-radius: 999px;
  background: var(--muted);
}

.menu-filtros[open] summary {
  background: var(--surface-soft);
}

.menu-filtros .filtros {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 15;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
}

.menu-filtros .filtros button {
  width: 100%;
}

.logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.logout:hover {
  border-color: #bdd0dc;
  background: var(--surface-soft);
}

.modo-box,
.retro-head,
.retro-controls,
.contador-box,
.status-line,
.grid-alunos {
  width: min(1180px, calc(100% - 28px));
  margin-inline: auto;
}

.modo-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(27, 43, 58, .07);
}

.modo {
  min-height: 66px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 500;
  letter-spacing: 0;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.modo:hover {
  background: var(--surface-soft);
}

.modo.active[data-tipo=E] {
  background: var(--entry);
  color: #2d2d2d;
  box-shadow: 0 8px 18px rgba(239, 210, 141, .28);
}

.modo.active[data-tipo=S] {
  background: var(--exit);
  color: #37443d;
  box-shadow: 0 8px 18px rgba(233, 154, 160, .24);
}

.modo:active {
  transform: scale(.99);
}

.contador-box {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.contador-final {
  margin-top: 24px;
  margin-bottom: 6px;
}

.contador-item {
  min-width: min(360px, 100%);
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 18px;
  border: 1px solid #ead8a7;
  border-radius: 8px;
  background: #fff7d6;
  color: #6f5830;
  box-shadow: 0 10px 22px rgba(239, 210, 141, .18);
  text-align: center;
}

.contador-item span {
  font-size: 15px;
  font-weight: 500;
}

.contador-item strong {
  min-width: 46px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--mustard);
  color: #2d2d2d;
  font-size: 24px;
  font-weight: 600;
}

.filtros {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px rgba(27, 43, 58, .06);
}

.filtros button {
  min-width: 124px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--mustard);
  color: #2d2d2d;
  font-weight: 500;
}

.filtros button:hover {
  background: #e8c676;
}

.retro-head {
  margin-top: 18px;
}

.retro-head h1 {
  margin: 0 0 6px;
  color: #37443d;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
}

.retro-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.retro-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr) minmax(140px, .9fr) minmax(180px, 1fr) minmax(220px, 1.3fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px rgba(27, 43, 58, .06);
}

.retro-field {
  min-width: 0;
}

.retro-field label {
  margin-bottom: 7px;
  color: var(--muted);
}

.retro-field-search {
  min-width: 210px;
}

.retro-controls button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--mustard);
  color: #2d2d2d;
  font-weight: 500;
}

.retro-controls button:hover {
  background: #e8c676;
}

.retro-modo-box {
  margin-top: 14px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  margin-top: 14px;
  padding: 0 4px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 24px);
}

.bloqueio-horario {
  min-height: calc(100vh - 190px);
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: #25332e;
  background: #edf5ee;
  border-top: 3px solid #e89aa2;
}

.bloqueio-horario[hidden] {
  display: none;
}

.bloqueio-horario strong {
  font-size: 32px;
  letter-spacing: 0;
}

.bloqueio-horario span {
  max-width: 620px;
  font-size: 20px;
  line-height: 1.5;
}

.operacao-bloqueada .modo-box,
.operacao-bloqueada .status-line,
.operacao-bloqueada .grid-alunos,
.operacao-bloqueada .contador-box {
  display: none;
}

#status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  width: min(760px, 100%);
  padding: 10px 18px;
  border: 1px solid #ead8a7;
  border-radius: 999px;
  background: #f3dfad;
  color: #6f5830;
  box-shadow: 0 12px 24px rgba(239, 210, 141, .22);
  text-align: center;
  font-weight: 500;
}

.grid-alunos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  padding-top: 6px;
}

.aluno-card {
  position: relative;
  min-height: 238px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: 0 8px 18px rgba(27, 43, 58, .07);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.aluno-card:hover {
  border-color: #e7c879;
  box-shadow: 0 16px 28px rgba(27, 43, 58, .12);
  transform: translateY(-2px);
}

.aluno-card.menino {
  border-color: #c9dced;
  background: #eaf4fb;
}

.aluno-card.menina {
  border-color: #efd0db;
  background: #fbedf2;
}

.aluno-card:active {
  transform: translateY(0) scale(.99);
}

.aluno-card:disabled {
  cursor: wait;
  opacity: .76;
}

.aluno-card.enviado-entrada {
  border-color: rgba(239, 210, 141, .88);
  background: #fff7d6;
}

.aluno-card.enviado-saida {
  border-color: rgba(233, 154, 160, .72);
  background: #f4d8dc;
}

.aluno-card.em-saida {
  border-color: rgba(233, 154, 160, .72);
  background: #f4d8dc;
}

.foto-wrap {
  width: 100%;
}

.foto,
.sem-foto {
  width: 118px;
  height: 118px;
  margin: 0 auto 14px;
  border-radius: 50%;
}

.foto {
  display: block;
  object-fit: cover;
  border: 5px solid #f7f4ee;
  background: #edf6ed;
}

.sem-foto {
  display: grid;
  place-items: center;
  border: 5px solid #f7f4ee;
  background: linear-gradient(145deg, #e5f0e4, #ffffff);
  color: #c96f77;
  font-size: 44px;
  font-weight: 500;
}

.nome {
  min-height: 44px;
  margin-bottom: 9px;
  color: #2d2d2d;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.turma {
  display: inline-flex;
  align-self: center;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e9dfd3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.card-status {
  min-height: 18px;
  margin-top: auto;
  padding-top: 10px;
  color: #c96f77;
  font-size: 12px;
  font-weight: 500;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 34px 18px;
  border: 1px dashed #d7cec4;
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: #c96f77;
  font-size: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(520px, 92vw);
  padding: 14px 18px;
  border-radius: 8px;
  background: #37443d;
  color: #fff;
  box-shadow: 0 18px 34px rgba(11, 23, 34, .26);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.admin-page {
  padding-bottom: 34px;
  background: #eef6ee;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 4px solid var(--primary);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.admin-brand h1 {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 26px;
  font-weight: 500;
}

.admin-brand span {
  color: var(--muted);
  font-size: 14px;
}

.admin-nav {
  display: flex;
  gap: 10px;
}

.admin-nav a,
.admin-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-button:hover {
  background: var(--surface-soft);
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 0;
}

.admin-section {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 18px rgba(74, 69, 66, .07);
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-section h2 {
  margin: 0 0 4px;
  color: #2d2d2d;
  font-size: 22px;
  font-weight: 500;
}

.admin-section p {
  margin: 0;
  color: var(--muted);
}

.report-schedule {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.admin-date-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.report-filters label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-date-form input {
  width: 170px;
}

.admin-date-form button,
.integracao-form button,
.report-filters button,
.admin-print-button,
.usuario-create button,
.usuario-row button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--mustard);
  color: #2d2d2d;
  font-weight: 500;
}

.admin-date-form button:hover,
.integracao-form button:hover,
.report-filters button:hover,
.admin-print-button:hover,
.usuario-create button:hover,
.usuario-row button:hover {
  background: #e8c676;
}

.integracao-form .danger-button,
.usuario-row .danger-button {
  background: #f4d8dc;
  color: #9b545b;
}

.integracao-form .danger-button:hover,
.usuario-row .danger-button:hover {
  background: #efc8ce;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-metrics div {
  min-height: 76px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid #ead8a7;
  border-radius: 8px;
  background: #fff7d6;
  color: #6f5830;
  text-align: center;
}

.admin-metrics span {
  font-size: 13px;
  font-weight: 500;
}

.admin-metrics strong {
  color: #2d2d2d;
  font-size: 28px;
  font-weight: 600;
}

.calendar-shell {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.calendar-header {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  gap: 10px;
}

.calendar-header strong {
  color: #2d2d2d;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.calendar-header a,
.download-periodos a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--mustard);
  color: #2d2d2d;
  font-weight: 500;
  text-decoration: none;
}

.calendar-header a:hover,
.download-periodos a:hover {
  background: #e8c676;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
}

.calendar-empty,
.calendar-day {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.calendar-empty {
  background: #f8faf8;
}

.calendar-day {
  border: 1px solid var(--line);
  background: #f4faf4;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
}

.calendar-day:hover {
  border-color: #e7c879;
  background: #fff7d6;
}

.calendar-day.today {
  border-color: rgba(233, 154, 160, .72);
}

.calendar-day.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #37443d;
}

.download-periodos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #ead8a7;
  border-radius: 8px;
  background: #fff7d6;
}

.download-periodos span {
  color: #6f5830;
  font-weight: 600;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: #ffffff;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f4faf4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--text);
  font-size: 14px;
}

.print-report-header {
  display: none;
}

.turma-group-row td {
  background: #fff7d6;
  color: #6f5830;
  font-weight: 700;
}

.status-pill {
  min-width: 82px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.present {
  background: #dff2df;
  color: #3f7548;
}

.status-pill.absent {
  background: #f4d8dc;
  color: #9b545b;
}

.aula-col {
  width: 48px;
  text-align: center !important;
}

.aula-pill {
  min-width: 30px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.aula-pill.present {
  background: #dff2df;
  color: #3f7548;
}

.aula-pill.absent {
  background: #f4d8dc;
  color: #9b545b;
}

.usuario-create,
.usuario-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) minmax(180px, 1fr) minmax(150px, .8fr) minmax(130px, .7fr) auto;
  gap: 10px;
  align-items: center;
}

.usuario-create {
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.usuarios-lista {
  display: grid;
  gap: 10px;
}

.usuario-row {
  grid-template-columns: minmax(220px, 1.4fr) 140px 130px auto 170px auto auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.usuario-row-empty {
  display: block;
  color: var(--muted);
}

.usuario-identidade {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.usuario-identidade strong,
.usuario-identidade span {
  overflow-wrap: anywhere;
}

.usuario-identidade span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  body:not(.login-body) {
    padding-bottom: 18px;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-brand {
    width: 100%;
  }

  .admin-nav {
    width: 100%;
  }

  .admin-nav a {
    flex: 1;
  }

  .admin-section {
    padding: 14px;
  }

  .admin-section-head,
  .admin-date-form,
  .report-filters {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .admin-date-form input,
  .admin-date-form button,
  .report-filters button,
  .admin-print-button,
  .admin-button {
    width: 100%;
  }

  .admin-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-header {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    gap: 5px;
  }

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

  .download-periodos {
    align-items: stretch;
    flex-direction: column;
  }

  .download-periodos a {
    width: 100%;
  }

  .usuario-create,
  .usuario-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 76px;
    padding: 12px 14px;
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 118px;
  }

  #relogio {
    width: 100%;
    min-height: 42px;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
  }

  .modo-box,
  .retro-head,
  .retro-controls,
  .contador-box,
  .status-line,
  .grid-alunos {
    width: calc(100% - 18px);
  }

  .modo-box {
    margin-top: 10px;
  }

  .retro-controls {
    grid-template-columns: 1fr auto;
  }

  .retro-field,
  .retro-field-search {
    min-width: 0;
  }

  .retro-field-search,
  .retro-controls button {
    grid-column: 1 / -1;
  }

  .modo {
    min-height: 58px;
  }

  .grid-alunos {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
  }

  .aluno-card {
    min-height: 222px;
    padding: 12px 10px;
  }

  .foto,
  .sem-foto {
    width: 98px;
    height: 98px;
  }

  .login-card {
    padding: 26px;
  }

}

@media (max-width: 390px) {
  .topbar h1 {
    font-size: 19px;
  }

  .topbar span {
    font-size: 12px;
  }

  .brand-logo {
    width: 96px;
  }

  .logout {
    min-width: 66px;
    padding-inline: 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  #relogio {
    font-size: 12px;
  }

  .menu-filtros summary {
    width: 42px;
  }

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

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

  .admin-topbar,
  .report-controls-section,
  .report-results-section > .admin-section-head,
  .report-filters,
  .admin-print-button,
  .admin-nav {
    display: none !important;
  }

  body,
  .admin-page {
    background: #ffffff;
    padding: 0;
    color: #111111;
  }

  .admin-shell {
    width: 100%;
    margin: 0;
  }

  .admin-section {
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: #ffffff;
  }

  .print-report-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d8d8d8;
  }

  .print-report-logo {
    width: 76px;
    height: auto;
    flex: 0 0 auto;
  }

  .print-report-header h1 {
    margin: 0 0 3px;
    color: #111111;
    font-size: 19px;
    font-weight: 700;
  }

  .print-report-header p {
    margin: 0;
    color: #444444;
    font-size: 11px;
  }

  .admin-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .admin-table {
    min-width: 0;
    border: 1px solid #d8d8d8;
  }

  .admin-table thead {
    display: table-header-group;
  }

  .admin-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .admin-table th,
  .admin-table td {
    padding: 5px 6px;
    border-color: #d8d8d8;
    color: #111111;
    font-size: 9px;
    line-height: 1.25;
  }

  .admin-table th {
    background: #eeeeee !important;
    color: #111111;
  }

  .turma-group-row td {
    background: #f3f3f3 !important;
    color: #111111;
    font-size: 10px;
  }

  .status-pill,
  .aula-pill {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    color: #111111 !important;
    font-size: 9px;
    font-weight: 700;
  }

  .aula-col {
    width: 28px;
  }
}

/* ── Modal de Confirmação ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 23, 34, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
  padding: 16px;
}

.modal-overlay.show {
  background: rgba(11, 23, 34, .52);
}

.modal-box {
  background: var(--surface, #fff);
  border-radius: 8px;
  box-shadow: 0 24px 48px rgba(11, 23, 34, .22);
  padding: 28px 24px 22px;
  width: min(380px, 100%);
  text-align: center;
  transform: translateY(12px) scale(.97);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}

.modal-overlay.show .modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 10px;
}

.modal-titulo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #1b2b3a);
  margin-bottom: 6px;
  text-transform: capitalize;
}

.modal-nome {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text, #1b2b3a);
  margin-bottom: 4px;
}

.modal-turma {
  font-size: .88rem;
  color: var(--text-muted, #6b7c8a);
  margin-bottom: 16px;
}

.modal-datahora {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}

.modal-data-resumo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.modal-data-resumo span,
.modal-datahora label {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}

.modal-data-resumo strong {
  color: var(--text);
  font-size: .98rem;
  font-weight: 700;
}

.modal-datahora input {
  height: 48px;
}

.modal-acoes {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 13px 0;
  border-radius: 8px;
  border: none;
  font-size: .97rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .14s ease, transform .12s ease;
}

.modal-btn:active {
  transform: scale(.97);
}

.modal-btn-cancelar {
  background: #eef0f2;
  color: #4a5568;
}

.modal-btn-cancelar:hover {
  background: #e2e6ea;
}

.modal-btn-confirmar {
  background: #3a8f5e;
  color: #fff;
}

.modal-btn-confirmar.saida {
  background: #c0424e;
}

.modal-btn-confirmar:hover {
  opacity: .9;
}
