:root {
  --bg: #eef6f4;
  --surface: #ffffff;
  --text: #10201d;
  --muted: #5f706c;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --line: #d8e5e1;
  --shadow: 0 16px 44px rgba(17, 55, 49, .12);
  --nav-h: 76px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(180deg, #f8fbfa 0, var(--bg) 310px),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: rgba(248, 251, 250, .92);
  border-bottom: 1px solid rgba(216, 229, 225, .9);
  backdrop-filter: blur(12px);
}

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

.brand-lockup > div {
  min-width: 0;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.02rem;
  line-height: 1.15;
}

.brand-lockup p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  background: var(--surface);
  cursor: pointer;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + 28px);
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
}

.school-hero-panel {
  min-height: 176px;
  display: grid;
  align-items: center;
}

.school-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.school-hero-logo {
  width: 128px;
  height: 128px;
  max-width: 128px;
  max-height: 128px;
  object-fit: contain;
}

.school-hero-name {
  max-width: 900px;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.school-hero-meta {
  display: none;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel h2 {
  max-width: 760px;
  font-size: 2.6rem;
  line-height: 1.05;
}

.lede {
  max-width: 780px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.module-tile {
  --tile-color: var(--primary);
  --tile-bg: #e8f4f1;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
}

.module-tile svg {
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 8px;
  color: var(--tile-color);
  background: var(--tile-bg);
}

.module-tile span {
  font-size: .9rem;
  font-weight: 800;
}

.module-tile.primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.module-tile.primary svg {
  color: #ffffff;
  background: rgba(255, 255, 255, .16);
}

.module-tile[data-module="dashboard_sistemas"] {
  --tile-color: #4f46e5;
  --tile-bg: #e0e7ff;
}

.module-tile[data-module="planteles"] {
  --tile-color: #16a34a;
  --tile-bg: #dcfce7;
}

.module-tile[data-module="personalizacion"] {
  --tile-color: #0284c7;
  --tile-bg: #e0f2fe;
}

.module-tile[data-module="personal"] {
  --tile-color: #0f766e;
  --tile-bg: #ccfbf1;
}

.module-tile[data-module="grupos"] {
  --tile-color: #7c3aed;
  --tile-bg: #ede9fe;
}

.module-tile[data-module="alumnos"] {
  --tile-color: #2563eb;
  --tile-bg: #dbeafe;
}

.module-tile[data-module="reportes"] {
  --tile-color: #dc2626;
  --tile-bg: #fee2e2;
}

.module-tile[data-module="credenciales_alumno"] {
  --tile-color: #c2410c;
  --tile-bg: #ffedd5;
}

.module-tile[data-module="biometricos"] {
  --tile-color: #9333ea;
  --tile-bg: #f3e8ff;
}

.module-tile[data-module="pagos"] {
  --tile-color: #16a34a;
  --tile-bg: #dcfce7;
}

.module-tile[data-module="calificaciones"] {
  --tile-color: #7c3aed;
  --tile-bg: #ede9fe;
}

.module-tile[data-module="actividades_extra"] {
  --tile-color: #ea580c;
  --tile-bg: #ffedd5;
}

.module-tile[data-module="usuarios"] {
  --tile-color: #0891b2;
  --tile-bg: #cffafe;
}

.systems-only {
  border-color: #badbd6;
  background: #f7fcfb;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  padding: 10px max(14px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(14px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, .95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav-icon {
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #60736f;
}

.nav-icon svg {
  width: 28px;
  height: 28px;
}

.nav-icon.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
}

.bottom-nav .nav-icon:nth-child(1) {
  color: #0f766e;
}

.bottom-nav .nav-icon:nth-child(2),
.bottom-nav .nav-icon[data-module="escaneo_qr"] {
  color: #2563eb;
}

.bottom-nav .nav-icon:nth-child(3),
.bottom-nav .nav-icon[data-module="alumnos"] {
  color: #7c3aed;
}

.bottom-nav .nav-icon:nth-child(4),
.bottom-nav .nav-icon[data-module="reportes"] {
  color: #dc2626;
}

.bottom-nav .nav-icon.active {
  color: #ffffff;
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
}

textarea {
  min-height: 118px;
  padding-top: 10px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .22);
  outline-offset: 2px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
}

.secondary-button {
  color: var(--primary);
  background: #e8f4f1;
}

.disabled {
  opacity: .55;
  pointer-events: none;
}

.primary-button svg,
.secondary-button svg {
  width: 21px;
  height: 21px;
}

.status-text {
  margin-top: 12px;
  color: var(--muted);
  font-size: .9rem;
  min-height: 20px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 22px;
}

.login-brand {
  margin-bottom: 22px;
}

.login-linkbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .82rem;
}

.login-linkbar a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.legal-accept {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.35;
}

.legal-accept input {
  width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.legal-accept a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: underline;
}

.remember-user {
  display: inline-grid;
  grid-template-columns: 22px auto;
  align-items: center;
  justify-self: start;
  gap: 10px;
  margin: 0;
  color: var(--text);
  font-size: .86rem;
  font-weight: 800;
}

.remember-user input {
  width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.legal-shell {
  padding-bottom: 32px;
}

.legal-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.legal-panel h2 {
  font-size: 2.2rem;
  line-height: 1.1;
}

.legal-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.legal-panel section {
  display: grid;
  gap: 8px;
}

.legal-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.legal-note {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  font-weight: 800;
}

.public-body {
  background:
    linear-gradient(180deg, #f8fbfa 0, #eef6f4 360px),
    #eef6f4;
}

.public-shell,
.manual-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.public-hero {
  min-height: calc(100vh - 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  align-items: center;
  gap: 28px;
  padding: 24px 0;
}

.marketing-hero {
  width: 100vw;
  min-height: min(680px, calc(100svh - 132px));
  position: relative;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  overflow: hidden;
  margin-left: -50vw;
  padding: 56px max(24px, calc((100vw - 1088px) / 2));
  isolation: isolate;
  color: #ffffff;
  background: #173a38;
}

.marketing-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 30, 29, .92) 0%, rgba(8, 30, 29, .72) 38%, rgba(8, 30, 29, .18) 68%, rgba(8, 30, 29, .05) 100%);
}

.marketing-hero-media {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.marketing-hero-content {
  width: min(650px, 100%);
}

.marketing-hero .eyebrow,
.marketing-hero .lede {
  color: #ffffff;
}

.marketing-hero h2 {
  font-size: 5.2rem;
}

.marketing-hero .lede {
  max-width: 620px;
  font-size: 1.12rem;
  line-height: 1.55;
}

.marketing-hero .secondary-button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, .7);
  background: rgba(5, 24, 23, .38);
}

.marketing-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 24px;
  color: rgba(255, 255, 255, .9);
  font-size: .82rem;
  font-weight: 700;
}

.marketing-hero-facts span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.marketing-hero-facts span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67e8c8;
}

.public-hero h2,
.manual-hero h2 {
  max-width: 780px;
  font-size: 4rem;
  line-height: 1;
}

.public-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.public-product {
  min-height: 420px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.product-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
}

.product-screen {
  min-height: 300px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fcfb;
}

.screen-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.screen-chip {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #0f766e;
  font-weight: 900;
}

.screen-chip:nth-child(2) {
  background: #2563eb;
}

.screen-chip:nth-child(3) {
  background: #7c3aed;
}

.screen-chip:nth-child(4) {
  background: #ea580c;
}

.screen-lines {
  display: grid;
  align-content: center;
  gap: 12px;
}

.screen-line {
  height: 48px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.screen-line:nth-child(1) {
  width: 92%;
}

.screen-line:nth-child(2) {
  width: 76%;
}

.screen-line:nth-child(3) {
  width: 84%;
}

.public-band,
.manual-band {
  margin-top: 26px;
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.public-feature,
.manual-step {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.public-feature svg {
  width: 34px;
  height: 34px;
  color: var(--primary);
}

.public-feature h3,
.manual-step h3 {
  margin: 0;
  font-size: 1rem;
}

.public-feature p,
.manual-step p {
  color: var(--muted);
  line-height: 1.45;
}

.public-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.public-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.public-list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.manual-hero {
  display: grid;
  gap: 14px;
  padding: 24px 0 10px;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.manual-figure {
  width: 100%;
  margin: 0;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fcfb;
}

.manual-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-shell > *,
.dashboard-hero > *,
.section-head > * {
  min-width: 0;
}

.dashboard-hero,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-hero {
  padding: 20px;
}

.dashboard-hero h2,
.section-head h2 {
  font-size: 1.25rem;
}

.section-head.compact {
  margin-bottom: 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-tile {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-tile span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.stat-tile strong {
  font-size: 2rem;
  line-height: 1;
}

.form-panel,
.list-panel {
  padding: 18px;
}

.plantel-form {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.module-checks {
  padding-top: 4px;
}

.checks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-tile {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  cursor: pointer;
}

.check-tile input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--primary);
}

.check-tile strong,
.check-tile small {
  display: block;
}

.check-tile strong {
  color: var(--text);
  font-size: .88rem;
}

.check-tile small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .76rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.import-columns {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdfc;
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.import-columns strong {
  color: var(--text);
}

.list-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px;
  gap: 10px;
}

.list-tools.users-tools {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) 140px;
}

.list-tools.request-tools {
  grid-template-columns: minmax(220px, 1fr) 180px;
}

.planteles-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.plantel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.usuario-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.request-actions {
  flex-wrap: wrap;
  max-width: 360px;
}

.request-actions .primary-button,
.request-actions .secondary-button {
  min-height: 36px;
  padding: 0 10px;
  font-size: .78rem;
}

.authorization-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.authorization-dialog::backdrop {
  background: rgba(15, 23, 42, .52);
}

.authorization-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.authorization-summary {
  padding: 12px;
  border-left: 4px solid var(--primary);
  color: var(--muted);
  background: #eefaf7;
  overflow-wrap: anywhere;
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.row-delete {
  color: #8a2438;
  background: #fff4f6;
}

.plantel-main {
  min-width: 0;
}

.plantel-main strong,
.plantel-main span,
.plantel-main small {
  display: block;
  overflow-wrap: anywhere;
}

.plantel-main strong {
  font-size: .96rem;
}

.plantel-main span,
.plantel-main small,
.plantel-meta {
  color: var(--muted);
  font-size: .82rem;
}

.plantel-main span {
  margin-top: 4px;
}

.copy-line {
  max-width: 100%;
  display: block;
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
}

.biometric-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.plantel-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: .76rem;
  font-weight: 800;
}

.status-pill.ok {
  color: #07584f;
  background: #dcf5f0;
}

.status-pill.off {
  color: #6d3844;
  background: #f8e1e7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--primary);
  background: #eefaf7;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

.muted-line {
  color: var(--muted);
  font-size: .78rem;
}

.activity-row {
  align-items: start;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.switch-row {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  cursor: pointer;
}

.switch-row input {
  width: 24px;
  min-height: 24px;
  accent-color: var(--primary);
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  color: var(--text);
  font-size: .9rem;
}

.switch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.upload-title {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-title svg {
  width: 30px;
  height: 30px;
  color: var(--primary);
  flex: 0 0 auto;
}

.upload-title strong,
.upload-title small {
  display: block;
}

.upload-title strong {
  font-size: .9rem;
}

.upload-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .76rem;
}

.preview-box {
  position: relative;
  min-height: 120px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #c8d9d5;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbfa;
  font-size: .82rem;
  aspect-ratio: 4 / 3;
}

.card-preview {
  aspect-ratio: 1.58 / 1;
}

.signature-preview {
  aspect-ratio: 3 / 1;
  min-height: 92px;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.file-trigger {
  width: 100%;
}

.file-input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.personal-form-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.photo-card {
  display: grid;
  gap: 10px;
}

.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-actions .primary-button,
.photo-actions .secondary-button {
  width: 100%;
  padding-inline: 10px;
}

.camera-dialog {
  width: min(560px, calc(100% - 20px));
  max-height: calc(100dvh - 20px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}

.camera-dialog::backdrop {
  background: rgba(15, 23, 42, .72);
}

.camera-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.camera-header h2 {
  font-size: 1.25rem;
}

.camera-stage {
  width: min(100%, 420px);
  max-height: 62dvh;
  aspect-ratio: 3 / 4;
  justify-self: center;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #081816;
}

.camera-stage video,
.camera-stage canvas,
.camera-placeholder {
  width: 100%;
  height: 100%;
}

.camera-stage video,
.camera-stage canvas {
  display: block;
  object-fit: cover;
}

.camera-stage.camera-front video,
.camera-stage.camera-front canvas {
  transform: scaleX(-1);
}

.camera-placeholder {
  display: grid;
  place-items: center;
  color: #d7e7e3;
}

.camera-placeholder svg {
  width: 64px;
  height: 64px;
}

.camera-status {
  margin: 0;
  text-align: center;
}

.camera-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.camera-actions .camera-native {
  flex: 1 1 190px;
}

.camera-actions .camera-shoot,
.camera-actions .camera-repeat,
.camera-actions .camera-use {
  flex: 1 1 130px;
}

.person-photo,
.person-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #c8d9d5;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbfa;
  font-weight: 800;
}

.person-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 220px;
  font-size: .86rem;
}

.person-photo img,
.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-row-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.person-avatar {
  width: 52px;
  height: 52px;
  border-style: solid;
  font-size: 1rem;
  background: #edf7f4;
}

.student-row-main {
  grid-template-columns: 52px minmax(0, 1fr) 92px;
}

.student-qr {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.student-qr-box {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.student-qr-box img,
.student-qr-box canvas {
  width: 76px;
  height: 76px;
  display: block;
}

.student-qr-fallback {
  padding: 5px;
  color: var(--ink);
  font-size: .52rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-align: center;
}

.scan-action-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.scan-action-panel .primary-button {
  min-width: 128px;
}

.scan-mode-switch {
  min-height: 44px;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.scan-mode {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.scan-mode.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
}

.scan-info-panel {
  align-items: flex-start;
}

.scanner-panel {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  background: #061311;
}

.scanner-video {
  width: 100%;
  min-height: 320px;
  max-height: 62vh;
  display: block;
  object-fit: cover;
  background: #061311;
}

.scanner-reticle {
  position: absolute;
  inset: 22%;
  border: 3px solid rgba(255, 255, 255, .86);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .28);
  pointer-events: none;
}

.scanner-panel .status-text {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(6, 19, 17, .78);
}

.report-hero {
  align-items: flex-start;
}

.report-actions {
  min-width: fit-content;
}

.report-filter-panel .form-grid {
  align-items: end;
}

.report-submit {
  align-self: end;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

.report-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  font-size: .86rem;
}

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

.report-table th {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f5fbf9;
}

.report-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.report-table strong {
  font-size: .9rem;
}

.report-group-row td {
  color: var(--primary);
  font-weight: 800;
  background: #edf7f4;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.grade-input {
  min-width: 90px;
}

.grade-note {
  min-width: 220px;
}

.credential-list .plantel-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.credential-check {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.credential-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.credential-print-body {
  min-height: 100vh;
  background: #f3f6f5;
}

.credential-output-actions {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px max(16px, calc((100% - 980px) / 2));
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.credential-output-actions > div {
  display: grid;
  gap: 2px;
}

.credential-output-actions > div span {
  color: var(--muted);
  font-size: .82rem;
}

.credential-output-actions .status-text {
  grid-column: 1 / -1;
  margin: 0;
}

.credential-print-sheet {
  width: min(210mm, 100%);
  margin: 0 auto;
  padding: 8mm;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-items: start;
  justify-content: center;
  gap: 8mm;
}

.cred-print-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4mm;
  break-inside: avoid;
  page-break-inside: avoid;
}

.cred-print-card {
  width: 54mm;
  height: 86mm;
  position: relative;
  overflow: hidden;
  border: 1px solid #cfd8d5;
  border-radius: 2mm;
  color: #111827;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.cred-print-front {
  display: grid;
  grid-template-rows: 22mm 1fr 28mm;
}

.cred-print-front::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.8mm;
  background: linear-gradient(90deg, #0f766e, #2563eb 58%, #d3a24c);
}

.cred-print-front-top {
  position: relative;
  padding: 2mm;
  background: #f7fbfa;
}

.cred-print-brandline {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2mm;
  min-height: 18mm;
  padding: 1mm;
  background: #ffffff;
  border-radius: 1.5mm;
}

.cred-print-logo {
  width: 13mm;
  height: 9mm;
  max-height: 9mm;
  object-fit: contain;
}

.cred-print-heading {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: .5mm;
}

.cred-print-front-img {
  width: 100%;
  height: 9mm;
  max-height: 9mm;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.cred-print-brandline strong,
.cred-print-brandline span {
  display: block;
  overflow-wrap: anywhere;
}

.cred-print-brandline strong {
  font-size: 7.4pt;
  line-height: 1.05;
}

.cred-print-brandline span {
  font-size: 5.5pt;
  line-height: 1.1;
  color: #475569;
}

.cred-print-front-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20mm;
  gap: 2mm;
  padding: 3mm 3mm 1.4mm;
}

.cred-print-badge {
  display: inline-block;
  margin-bottom: 2mm;
  color: var(--primary);
  font-size: 7pt;
  font-weight: 900;
  text-transform: uppercase;
}

.cred-print-main h2 {
  margin: 0 0 2mm;
  font-size: 10pt;
  line-height: 1.08;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.cred-print-main p {
  margin-top: 1.1mm;
  color: #334155;
  font-size: 6.6pt;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cred-print-side {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 1mm;
}

.cred-print-photo {
  width: 20mm;
  height: 23mm;
  display: block;
  object-fit: cover;
  border: 1px solid #cfd8d5;
  border-radius: 1.4mm;
  background: #eef6f4;
}

.cred-print-side strong {
  width: 100%;
  color: #0f172a;
  font-size: 6.6pt;
  line-height: 1.12;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.cred-print-side strong span {
  display: block;
  width: 100%;
  text-align: center;
}

.cred-print-front-bottom {
  display: grid;
  grid-template-columns: 22mm minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2mm;
  padding: 0 3mm 4mm;
}

.cred-print-qr {
  width: 20mm;
  height: 20mm;
  display: grid;
  place-items: center;
  padding: 1mm;
  border: 1px dashed #94a3b8;
  background: #ffffff;
}

.cred-print-qr img,
.cred-print-qr canvas {
  width: 18mm !important;
  height: 18mm !important;
}

.cred-print-meta span {
  display: block;
  color: #475569;
  font-size: 6.2pt;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.cred-print-programaspyme {
  grid-column: 1 / -1;
  display: block;
  color: #334155;
  font-size: 6pt;
  line-height: 1;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
}

.cred-print-back {
  display: grid;
  grid-template-rows: 18mm minmax(0, 1fr) 26mm;
  padding: 3mm;
}

.cred-print-back > :not(.cred-print-back-img) {
  position: relative;
  z-index: 1;
}

.cred-print-back-top {
  display: flex;
  justify-content: flex-end;
  align-items: start;
}

.cred-print-back-img {
  position: absolute;
  z-index: 0;
  inset: 6mm;
  width: calc(100% - 12mm);
  height: calc(100% - 12mm);
  object-fit: contain;
  object-position: center;
  opacity: .14;
}

.cred-print-back-logo {
  width: 12mm;
  height: 12mm;
  object-fit: contain;
}

.cred-print-back-text {
  display: grid;
  align-content: center;
  text-align: center;
}

.cred-print-back-text strong {
  margin-bottom: 3mm;
  font-size: 8.2pt;
}

.cred-print-back-text p {
  color: #334155;
  font-size: 7.4pt;
  line-height: 1.32;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cred-print-signature {
  display: grid;
  align-content: end;
  justify-items: center;
  color: #334155;
  font-size: 6.7pt;
  text-align: center;
}

.cred-print-signature-box {
  width: 37mm;
  height: 14mm;
  display: grid;
  place-items: end center;
  overflow: hidden;
}

.cred-print-signature-img {
  max-width: 37mm;
  max-height: 14mm;
  object-fit: contain;
}

.cred-print-signature-line {
  width: 38mm;
  height: 1px;
  margin: 1mm 0;
  background: #64748b;
}

.qr-print-sheet {
  grid-template-columns: repeat(3, 48mm);
  gap: 6mm;
}

.cred-print-qr-only {
  width: 48mm;
  min-height: 64mm;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 1.5mm;
  padding: 4mm;
  break-inside: avoid;
  page-break-inside: avoid;
  border: 1px solid #cfd8d5;
  border-radius: 2mm;
  background: #ffffff;
}

.cred-print-qr-only-box {
  width: 34mm;
  height: 34mm;
  display: grid;
  place-items: center;
  padding: 1.5mm;
  border: 1px solid var(--line);
  background: #ffffff;
}

.cred-print-qr-only-box img,
.cred-print-qr-only-box canvas {
  width: 31mm !important;
  height: 31mm !important;
}

.cred-print-qr-only strong,
.cred-print-qr-only span,
.cred-print-qr-only small {
  display: block;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

.cred-print-qr-only strong {
  font-size: 8pt;
  text-transform: uppercase;
}

.cred-print-qr-only span,
.cred-print-qr-only small {
  color: #475569;
  font-size: 6.5pt;
}

@media (max-width: 860px) {
  .public-hero h2,
  .manual-hero h2 {
    font-size: 3.2rem;
  }

  .marketing-hero h2 {
    font-size: 4.2rem;
  }

  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-hero,
  .public-split,
  .dual-form-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-grid,
  .form-grid,
  .checks-grid,
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-2,
  .span-3 {
    grid-column: span 2;
  }

  .personal-form-layout {
    grid-template-columns: 150px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .hero-panel h2 {
    font-size: 1.9rem;
  }

  .legal-panel h2 {
    font-size: 1.7rem;
  }

  .app-topbar {
    gap: 10px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .brand-lockup h1,
  .brand-lockup p {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .topbar-actions .icon-button {
    width: 40px;
    height: 40px;
  }

  .app-shell {
    padding-inline: 12px;
  }

  .hero-panel {
    padding: 18px;
  }

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

  .public-shell,
  .manual-shell {
    padding-inline: 12px;
  }

  .public-hero {
    min-height: auto;
    padding-top: 10px;
  }

  .marketing-hero {
    min-height: min(680px, calc(100svh - 104px));
    padding: 42px 20px;
  }

  .marketing-hero::after {
    background: rgba(8, 30, 29, .72);
  }

  .marketing-hero-media {
    object-position: 65% center;
  }

  .marketing-hero h2 {
    font-size: 2.65rem;
  }

  .marketing-hero .lede {
    font-size: 1rem;
  }

  .marketing-hero-facts {
    display: grid;
  }

  .authorization-form {
    padding: 16px;
  }

  .public-product {
    min-height: 0;
  }

  .screen-toolbar {
    grid-template-columns: repeat(2, 1fr);
  }

  .public-grid,
  .manual-grid {
    grid-template-columns: 1fr;
  }

  .public-hero-actions .primary-button,
  .public-hero-actions .secondary-button {
    width: 100%;
  }

  .hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    flex: 1 1 auto;
  }

  .module-tile {
    min-height: 104px;
  }

  .dashboard-hero,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-hero h2,
  .section-head h2 {
    overflow-wrap: anywhere;
  }

  .stat-grid,
  .form-grid,
  .checks-grid,
  .media-grid,
  .list-tools {
    grid-template-columns: 1fr;
  }

  .list-tools.users-tools {
    grid-template-columns: 1fr;
  }

  .list-tools.request-tools {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

  .personal-form-layout {
    grid-template-columns: 1fr;
  }

  .person-photo {
    max-width: 220px;
    min-height: 0;
  }

  .credential-output-actions {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .credential-output-actions .primary-button {
    width: 100%;
  }

  .camera-dialog {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
  }

  .camera-shell {
    gap: 10px;
    padding: 12px;
  }

  .camera-stage {
    max-height: 56dvh;
  }

  .camera-actions .camera-native,
  .camera-actions .camera-shoot,
  .camera-actions .camera-repeat,
  .camera-actions .camera-use {
    flex-basis: 100%;
  }

  .plantel-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
  }

  .usuario-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .biometric-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .credential-list .plantel-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .plantel-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
  }

  .usuario-row .plantel-meta {
    grid-row: auto;
  }

  .row-actions {
    justify-content: start;
  }

  .request-actions {
    width: 100%;
    max-width: none;
  }

  .request-actions .primary-button,
  .request-actions .secondary-button {
    flex: 1 1 calc(50% - 5px);
  }

  .form-actions .primary-button,
  .form-actions .secondary-button {
    width: 100%;
  }

  .report-actions {
    width: 100%;
    min-width: 0;
  }

  .report-actions .primary-button,
  .report-actions .secondary-button {
    flex: 1 1 100%;
  }

  .student-row-main {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .student-qr {
    grid-column: 1 / -1;
    justify-self: start;
    grid-template-columns: 76px auto;
    align-items: center;
  }

  .scanner-panel,
  .scanner-video {
    min-height: 280px;
  }

  .scanner-reticle {
    inset: 16% 10%;
  }

  .scan-action-panel .primary-button {
    width: 100%;
  }

  .scan-action-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scan-mode-switch {
    width: 100%;
  }

  .bottom-nav {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .nav-icon {
    min-width: 0;
    height: 52px;
  }

  .nav-icon svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 10px;
  }

  .module-tile {
    min-height: 96px;
    gap: 14px;
    padding: 12px;
  }

  .stat-tile {
    min-height: 84px;
    padding: 14px;
  }

  .stat-tile strong {
    font-size: 1.65rem;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    flex-basis: 100%;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --shadow: none;
  }

  body {
    background: #ffffff;
  }

  .app-topbar,
  .bottom-nav,
  .credential-output-actions,
  .report-actions,
  .report-filter-panel,
  #selectorPanel {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .panel,
  .stat-tile {
    box-shadow: none;
  }

  .dashboard-shell {
    gap: 10px;
  }

  .table-wrap {
    overflow: visible;
  }

  .report-table {
    min-width: 0;
    font-size: 10px;
  }

  .report-table th,
  .report-table td {
    padding: 5px 6px;
  }

  .credential-print-body {
    background: #ffffff;
  }

  .credential-print-sheet {
    width: 210mm;
    margin: 0;
    padding: 7mm;
    gap: 5mm;
  }

  .cred-print-card,
  .cred-print-qr-only {
    box-shadow: none;
  }

  @page {
    size: A4;
    margin: 7mm;
  }
}
