/* ============================================================================
   Credenciales MSP 2026 — Variante A: Institucional Elevado
   Azul MSP profundo + banda tricolor + Manrope
   ============================================================================ */

:root {
  /* Base */
  --bg:            #f5f7fb;
  --surface:       #ffffff;
  --surface-alt:   #f8fafc;
  --text:          #0b1220;
  --text-muted:    #5b6578;
  --border:        #e6eaf2;
  --border-strong: #cfd6e4;

  /* Primary — azul MSP profundo */
  --primary:       #0a2a6b;
  --primary-alt:   #1647b8;
  --primary-tint:  #e6edfb;

  /* Bandera Ecuador */
  --ec-yellow:     #ffce00;
  --ec-blue:       #0033a0;
  --ec-red:        #ce1126;

  /* Estados */
  --success:       #067a4a;
  --success-bg:    #d9f3e6;
  --warning:       #a85d00;
  --warning-bg:    #fff0d6;
  --error:         #ce1126;
  --error-bg:      #fce4e6;

  /* Área Medicina */
  --med-bg:        #dbeafe;
  --med-fg:        #1e40af;
  --med-dot:       #3b82f6;
  /* Área Enfermería */
  --enf-bg:        #dcfce7;
  --enf-fg:        #15803d;
  --enf-dot:       #22c55e;
  /* Área Nutrición */
  --nut-bg:        #fef3c7;
  --nut-fg:        #92400e;
  --nut-dot:       #f59e0b;
  /* Área Obstetricia */
  --obs-bg:        #fae8ff;
  --obs-fg:        #86198f;
  --obs-dot:       #d946ef;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(10,42,107,0.05);
  --shadow:     0 4px 14px -4px rgba(10,42,107,0.12), 0 1px 3px rgba(10,42,107,0.05);
  --shadow-lg:  0 20px 45px -20px rgba(10,42,107,0.28), 0 4px 14px -4px rgba(10,42,107,0.12);

  --radius:     12px;
  --radius-lg:  14px;
  --radius-xl:  18px;

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, .mono, .tabular { font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }

/* ============================================================================
   PORTAL ESTUDIANTE (mobile-first)
   ============================================================================ */

.shell {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  width: 100%;
  max-width: 100%;
}

/* En tablet/desktop, centrar el contenido y darle aire alrededor */
@media (min-width: 640px) {
  body {
    background: linear-gradient(135deg, #e8edf7 0%, #f0f4fc 50%, #e4eaf6 100%);
    padding: 24px 16px;
    min-height: 100vh;
  }
  .shell {
    max-width: 640px;
    margin: 0 auto;
    border-radius: 24px;
    box-shadow: 0 24px 60px -20px rgba(10, 42, 107, 0.22),
                0 8px 20px -6px rgba(10, 42, 107, 0.10);
    overflow: hidden;
    min-height: calc(100vh - 48px);
  }
  /* Evitar que el hero-card se salga del shell redondeado */
  .hero { border-radius: 24px 24px 0 0; }
}

@media (min-width: 1000px) {
  body { padding: 40px 20px; }
  .shell {
    max-width: 720px;
    min-height: calc(100vh - 80px);
  }
}

/* ---------- Hero (login screen) ---------- */
.hero {
  background: linear-gradient(180deg, var(--primary) 0%, #06204f 100%);
  color: #fff;
  padding: 32px 24px 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg,
    var(--ec-yellow) 0%, var(--ec-yellow) 33%,
    var(--ec-blue) 33%, var(--ec-blue) 66%,
    var(--ec-red) 66%, var(--ec-red) 100%);
}

.hero-watermark {
  position: absolute;
  right: -40px; top: -30px;
  font-size: 220px; font-weight: 800;
  letter-spacing: -12px; line-height: 1;
  color: #fff; opacity: 0.08;
  pointer-events: none;
  user-select: none;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: 2px; font-weight: 600;
  opacity: 0.9;
}

.hero-badge-icon {
  width: 22px; height: 22px; border-radius: 5px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  display: grid; place-items: center;
}

.hero h1 {
  margin: 18px 0 6px;
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.6px; line-height: 1.15;
}

.hero .subtitle { font-size: 15px; opacity: 0.88; margin-top: 6px; }
.hero .meta { font-size: 12.5px; opacity: 0.7; margin-top: 3px; letter-spacing: 0.3px; }

.hero-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 22px;
  margin: -22px 20px 0;
  position: relative; z-index: 2;
}

.hero-card h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.hero-card .desc { font-size: 14px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

.hero-footer {
  text-align: center; font-size: 13px; color: var(--text-muted);
  padding: 18px 30px 28px; line-height: 1.55;
}

/* ---------- Dashboard compact header ---------- */
.dash-header {
  background: var(--primary);
  color: #fff;
  padding: 18px 20px 22px;
  position: relative;
  overflow: hidden;
}
.dash-header::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg,
    var(--ec-yellow) 0%, var(--ec-yellow) 33%,
    var(--ec-blue) 33%, var(--ec-blue) 66%,
    var(--ec-red) 66%, var(--ec-red) 100%);
}
.dash-header-row { display: flex; justify-content: space-between; align-items: center; }
.dash-header .eyebrow { font-size: 11px; letter-spacing: 1.6px; font-weight: 600; opacity: 0.82; }
.dash-header .greeting { font-size: 20px; font-weight: 700; margin-top: 4px; letter-spacing: -0.3px; }

.btn-ghost-white {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost-white:hover { background: rgba(255,255,255,0.25); }

/* ---------- Dashboard body ---------- */
.dash-body {
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.card-title-lg {
  font-size: 19px; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.card-desc { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.section-label {
  font-size: 11.5px; letter-spacing: 1.4px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  padding: 0 4px 10px;
}

/* ---------- Credencial (hero piece) ---------- */
.credential {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.credential-top {
  background: var(--primary);
  padding: 14px 16px 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.credential-top .wm {
  position: absolute; right: -20px; top: -10px;
  font-size: 110px; font-weight: 800;
  letter-spacing: -6px; line-height: 1;
  color: #fff; opacity: 0.08;
  pointer-events: none;
}
.credential-top .badge {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 2px; font-weight: 600;
  opacity: 0.88; position: relative;
}
.credential-top .badge-icon {
  width: 18px; height: 18px; border-radius: 4px;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
}
.credential-top .title { margin-top: 6px; font-size: 12px; opacity: 0.82; position: relative; }
.credential-top .sub { margin-top: 2px; font-size: 11px; opacity: 0.65; letter-spacing: 0.3px; position: relative; }

.tricolor-band {
  display: flex; height: 4px;
}
.tricolor-band > div { flex: 1; }
.tricolor-band .y { background: var(--ec-yellow); }
.tricolor-band .b { background: var(--ec-blue); }
.tricolor-band .r { background: var(--ec-red); }

.credential-body {
  padding: 16px;
  display: flex; gap: 14px;
}

.credential-photo {
  width: 78px; height: 98px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
  background: var(--surface-alt);
}
.credential-photo.placeholder {
  color: var(--text-muted);
  font-size: 11px; font-weight: 500;
  text-align: center; padding: 6px;
  line-height: 1.3;
}
.credential-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.credential-photo.med { background: linear-gradient(135deg, var(--med-bg), var(--surface-alt)); color: var(--med-fg); }
.credential-photo.enf { background: linear-gradient(135deg, var(--enf-bg), var(--surface-alt)); color: var(--enf-fg); }
.credential-photo.nut { background: linear-gradient(135deg, var(--nut-bg), var(--surface-alt)); color: var(--nut-fg); }
.credential-photo.obs { background: linear-gradient(135deg, var(--obs-bg), var(--surface-alt)); color: var(--obs-fg); }

.credential-details {
  flex: 1; min-width: 0;
}
.credential-details .role {
  font-size: 9.5px; letter-spacing: 1.4px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
}
.credential-details .name {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.2; margin-top: 3px;
  letter-spacing: -0.3px;
  word-break: break-word;
}
.credential-details .cedula {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.credential-details .grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px;
}
.credential-details .grid-label {
  font-size: 9px; letter-spacing: 1.2px; color: var(--text-muted); font-weight: 600;
}
.credential-details .grid-value {
  font-size: 11.5px; font-weight: 600; color: var(--text); margin-top: 2px;
}
.credential-details .grid-value.blood {
  font-weight: 700;
  color: var(--ec-red);
}
.credential-details .grid-value.blood.empty { color: var(--text-muted); font-weight: 600; }

.credential-footer {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-alt);
}
.credential-footer .vlabel {
  font-size: 9px; letter-spacing: 1.2px; color: var(--text-muted); font-weight: 600;
}
.credential-footer .vvalue {
  font-size: 10.5px; font-weight: 600; color: var(--text); margin-top: 1px;
}
.qr-mock {
  width: 36px; height: 36px; border-radius: 4px; padding: 3px;
  background: var(--text);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
}
.qr-mock > div { background: var(--text); border-radius: 0.5px; }
.qr-mock > div.on { background: var(--surface); }

/* ---------- Progress stepper ---------- */
.progress-list {
  display: flex; flex-direction: column; gap: 10px;
}
.progress-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 14.5px;
}
.progress-step .dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.progress-step.done .dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.progress-step.loading .dot {
  background: var(--primary-tint);
  border-color: var(--primary);
}
.progress-step.waiting .dot {
  background: var(--warning-bg);
  border-color: var(--warning);
}
.progress-step.loading .dot::after {
  content: '';
  width: 8px; height: 8px; background: var(--primary);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}
.progress-step .label { color: var(--text-muted); font-weight: 500; }
.progress-step.done .label { color: var(--text); font-weight: 600; }
.progress-step .hint { font-size: 12.5px; color: var(--warning); font-weight: 600; margin-left: 6px; }
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ---------- Datos precargados (rows) ---------- */
.data-rows {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-alt);
  overflow: hidden;
}
.data-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  background: var(--surface);
}
.data-row { padding: 12px 14px; }
.data-row .k { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.data-row .v { font-size: 14px; font-weight: 600; color: var(--text); text-align: right; word-break: break-word; }

.card-head-row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.link-sm {
  background: none; border: none;
  color: var(--primary-alt);
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  padding: 0;
}
.link-sm:hover { text-decoration: underline; }

/* ---------- Blood type button grid ---------- */
.form-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--text-muted); text-transform: uppercase;
  display: block;
}
.form-label .opt {
  text-transform: none; font-weight: 500; opacity: 0.75;
  letter-spacing: normal;
  font-size: 12.5px;
}

.blood-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 8px;
}
.blood-btn {
  padding: 12px 0;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.blood-btn:hover { border-color: var(--border-strong); }
.blood-btn.active {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary);
}

.input-text {
  width: 100%;
  padding: 13px 16px;
  font-size: 15.5px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-text:focus {
  border-color: var(--primary-alt);
  box-shadow: 0 0 0 3px rgba(22,71,184,0.15);
}
.input-lg {
  padding: 16px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-radius: 12px;
}
.input-text.error { border-color: var(--error); }

.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.input-hint { font-size: 13px; color: var(--text-muted); margin-top: 8px; line-height: 1.45; }
.input-error { font-size: 13.5px; color: var(--error); margin-top: 6px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: -0.1px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(10,42,107,0.25);
}
.btn-primary:hover:not(:disabled) { background: #071f51; box-shadow: 0 6px 18px rgba(10,42,107,0.35); }
.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #a8101f; }
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-block { width: 100%; padding: 15px 18px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }

/* ---------- Upload card ---------- */
.upload-empty {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-alt);
  transition: all 0.2s;
}
.upload-empty:hover, .upload-empty.drag {
  border-color: var(--primary);
  background: var(--primary-tint);
}
.upload-empty .icon-box {
  width: 44px; height: 44px;
  background: var(--primary);
  border-radius: 10px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  color: #fff;
}
.upload-empty .hint { font-size: 14.5px; font-weight: 600; color: var(--text); }
.upload-empty .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.upload-empty input[type=file] { display: none; }

.upload-loading {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 30px 16px;
  text-align: center;
  background: var(--primary-tint);
}
.spinner-lg {
  width: 34px; height: 34px;
  border: 3px solid rgba(10,42,107,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.upload-loading .label { font-size: 14.5px; font-weight: 600; color: var(--primary); }
.upload-loading .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.upload-done {
  display: flex; align-items: center; gap: 14px;
  background: var(--success-bg);
  border: 1px solid rgba(6,122,74,0.25);
  padding: 14px;
  border-radius: 10px;
}
.upload-done .thumb {
  width: 48px; height: 48px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--success);
  overflow: hidden;
}
.upload-done .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-done .info { flex: 1; min-width: 0; }
.upload-done .info .title { font-size: 14px; font-weight: 600; color: var(--success); }
.upload-done .info .name { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.upload-done .replace {
  background: none; border: none;
  color: var(--primary-alt);
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  flex-shrink: 0;
}
.upload-done .replace:hover { text-decoration: underline; }

/* ---------- Upload done - variante foto grande ---------- */
.upload-done.photo-big {
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
}
.upload-done.photo-big .photo-frame {
  width: 160px; height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 3px solid var(--success);
  display: grid; place-items: center;
  color: var(--success);
  box-shadow: 0 6px 20px rgba(6,122,74,0.15);
}
.upload-done.photo-big .photo-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.upload-done.photo-big .info { text-align: center; }
.upload-done.photo-big .info .title {
  font-size: 15px; font-weight: 700; color: var(--success);
}
.upload-done.photo-big .info .name {
  font-size: 12.5px; color: var(--text-muted); margin-top: 3px;
  word-break: break-all;
}
.upload-done.photo-big .replace {
  margin-top: 8px;
  padding: 8px 16px;
  border: 1.5px solid var(--primary-alt);
  border-radius: 8px;
  color: var(--primary-alt);
  background: var(--surface);
  font-size: 13px; font-weight: 600;
  transition: all 0.15s;
}
.upload-done.photo-big .replace:hover {
  background: var(--primary-tint);
  text-decoration: none;
}

/* ---------- Alerta all complete ---------- */
.alert-complete {
  margin-top: 12px; padding: 12px 14px;
  background: var(--success-bg); color: var(--success);
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(6,122,74,0.25);
  line-height: 1.45;
}
.alert-warning {
  padding: 14px;
  background: var(--warning-bg); color: var(--warning);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid rgba(168,93,0,0.25);
  margin-top: 12px;
}

.alert-error {
  padding: 14px 16px;
  background: var(--error-bg); color: var(--error);
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  line-height: 1.5;
  border: 1px solid rgba(206,17,38,0.25);
  margin-bottom: 14px;
}
.alert-error a {
  color: var(--error);
  text-decoration: underline;
  font-weight: 700;
}

/* WhatsApp action button (login error) */
.wa-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  background: #25d366;
  color: #fff;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.wa-link:hover { background: #1fa855; color: #fff; text-decoration: none; }
.wa-link svg { flex-shrink: 0; }

/* ---------- Feedback inline ---------- */
.feedback { font-size: 13px; color: var(--text-muted); }
.feedback.success { color: var(--success); font-weight: 600; }
.feedback.error { color: var(--error); font-weight: 600; }

/* ---------- Bottom sheet modal (móvil) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(7,10,20,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
}
.sheet {
  background: var(--surface);
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  animation: slideUp 0.25s ease;
  max-height: 85vh;
  overflow-y: auto;
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; padding: 20px; }
  .sheet {
    max-width: 500px;
    border-radius: 18px;
    padding: 28px;
    animation: scaleIn 0.2s ease;
  }
  .sheet-handle { display: none; }
}
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sheet h3 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.sheet .desc { font-size: 14px; color: var(--text-muted); margin-top: 6px; margin-bottom: 16px; line-height: 1.5; }
.sheet-textarea {
  width: 100%; min-height: 110px; padding: 14px;
  font-size: 14.5px; font-family: inherit;
  border: 1.5px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  color: var(--text);
  outline: none; resize: none;
  box-sizing: border-box;
  line-height: 1.5;
}
.sheet-textarea:focus { border-color: var(--primary-alt); }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; }
.sheet-actions .btn { flex: 1; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------- Portal cerrado ---------- */
.closed-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center;
  background: var(--bg);
}
.closed-screen .icon { font-size: 56px; margin-bottom: 18px; }
.closed-screen h1 { margin: 0 0 10px; font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.closed-screen p { color: var(--text-muted); max-width: 440px; font-size: 15px; line-height: 1.55; }

@media (min-width: 640px) {
  .closed-screen {
    max-width: 640px; margin: 0 auto;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 24px 60px -20px rgba(10, 42, 107, 0.22);
    min-height: calc(100vh - 48px);
  }
}

/* ---------- Confetti ---------- */
.confetti-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 500;
}
.confetti-piece {
  position: absolute; top: -20px;
  width: 8px; height: 3px;
  border-radius: 2px;
}

/* ---------- Overlay global ---------- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(245,247,251,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
  backdrop-filter: blur(2px);
}
.loading-overlay .spinner-lg {
  border-color: rgba(10,42,107,0.15);
  border-top-color: var(--primary);
  width: 42px; height: 42px;
}

.hidden { display: none !important; }

/* ============================================================================
   Tarjetas informativas del login (servicio + pago)
   ============================================================================ */

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-left: 20px; margin-right: 20px;
  box-shadow: var(--shadow);
}

.info-card-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.info-card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.info-card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.info-card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }

.info-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.info-icon.price { background: var(--primary-tint); color: var(--primary); }
.info-icon.bank { background: #e7f7ef; color: var(--success); }

.price-tag {
  background: linear-gradient(135deg, var(--ec-yellow) 0%, #f5b800 100%);
  color: #3a2a00;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
  box-shadow: 0 2px 6px rgba(255,206,0,0.35);
}

.feature-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.feature-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14.5px;
  color: var(--text);
}
.feature-list .check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}

.pay-grid {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.pay-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px;
  background: var(--surface);
  gap: 10px;
}
.pay-row .k { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.pay-row .v { font-size: 14.5px; font-weight: 600; color: var(--text); text-align: right; word-break: break-word; }
.pay-row .v.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.pay-row.highlight { background: var(--primary-tint); }
.pay-row.highlight .v { color: var(--primary); font-size: 17px; font-weight: 700; }

.copy-btn {
  background: var(--primary); color: #fff;
  border: none;
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-grid; place-items: center;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.15s;
}
.copy-btn:hover { background: var(--primary-alt); }
.copy-btn.copied { background: var(--success); }

.pay-tip {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--primary-tint);
  border: 1px solid rgba(22,71,184,0.2);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--primary);
}
.pay-tip svg { flex-shrink: 0; margin-top: 2px; }
.pay-tip strong { font-weight: 700; }

/* ============================================================================
   Guía visual de cómo tomar la foto
   ============================================================================ */
.foto-guia {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 4px;
}
.foto-guia-img {
  position: relative;
  flex-shrink: 0;
  width: 110px; height: 140px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--success);
  box-shadow: 0 4px 14px rgba(6,122,74,0.18);
}
.foto-guia-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.foto-guia-badge {
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(6,122,74,0.35);
}

.foto-guia-tips {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.foto-guia-tips li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.foto-guia-tips .tick {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: inline-grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.foto-guia-tips .tick.cross {
  background: var(--error);
}

.foto-warning {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--warning-bg);
  border: 1px solid rgba(168,93,0,0.3);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #5a3200;
  margin-top: 12px;
}
.foto-warning .wicon { font-size: 18px; flex-shrink: 0; line-height: 1.3; }
.foto-warning strong { font-weight: 700; }

/* Checks del modal de rechazar foto */
.rechazo-check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.4;
  transition: all 0.15s;
}
.rechazo-check:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.rechazo-check input[type=checkbox] {
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--error);
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.rechazo-check input[type=checkbox]:checked + span,
.rechazo-check:has(input:checked) {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
  font-weight: 600;
}

/* Alerta de foto rechazada en el portal estudiante */
.foto-rechazada-alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--error-bg);
  border: 2px solid var(--error);
  border-radius: 12px;
  color: #6b0b15;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(206,17,38,0.15);
  animation: shakeIn 0.4s ease;
}
@keyframes shakeIn {
  0% { transform: translateX(0); opacity: 0; }
  25% { transform: translateX(-6px); opacity: 1; }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
.foto-rechazada-alert .icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.foto-rechazada-alert .body { flex: 1; min-width: 0; }
.foto-rechazada-alert .title {
  font-size: 15px;
  font-weight: 800;
  color: var(--error);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.foto-rechazada-alert .reason {
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 8px;
}
.foto-rechazada-alert .reason ul {
  margin: 4px 0 0;
  padding-left: 20px;
}
.foto-rechazada-alert .reason li { margin-top: 3px; }
.foto-rechazada-alert .action {
  font-size: 13px;
  font-weight: 600;
  color: var(--error);
}

/* En móvil, la guía se apila */
@media (max-width: 480px) {
  .foto-guia { flex-direction: column; align-items: center; }
  .foto-guia-img { width: 130px; height: 170px; }
  .foto-guia-tips { width: 100%; }
}

/* ============================================================================
   Status card (dashboard)
   ============================================================================ */

.status-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  line-height: 1.5;
}
.status-card.status-info {
  background: #eff4fc;
  border-color: #c8d8f0;
  color: #0a2a6b;
}
.status-card.status-warn {
  background: var(--warning-bg);
  border-color: rgba(168,93,0,0.25);
  color: #6b3a00;
}
.status-card.status-ok {
  background: var(--success-bg);
  border-color: rgba(6,122,74,0.25);
  color: #054d2f;
}
.status-card.status-done {
  background: linear-gradient(135deg, #e6edfb 0%, #f0e7fb 100%);
  border-color: var(--primary-alt);
  color: var(--primary);
}
.status-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.status-body { flex: 1; min-width: 0; }
.status-title {
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.status-text {
  font-size: 14px;
  line-height: 1.5;
}
.status-text strong { font-weight: 700; }

/* Checklist dentro del status card */
.status-checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.chk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 14px;
  font-weight: 500;
}
.chk-item .chk-mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 13px; font-weight: 700;
  border: 1.5px solid currentColor;
}
.chk-item.done {
  color: var(--success);
  background: rgba(6,122,74,0.08);
  border-color: rgba(6,122,74,0.2);
}
.chk-item.done .chk-mark {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.chk-item.pending {
  color: inherit;
  opacity: 0.85;
}
.chk-item.pending .chk-mark {
  background: transparent;
  color: currentColor;
  opacity: 0.5;
}
.chk-label { flex: 1; }

.chk-hint {
  margin-top: 10px;
  font-size: 13px;
  font-style: italic;
  opacity: 0.85;
  line-height: 1.5;
}

/* ============================================================================
   CTA Enviar + Cerrar sesión
   ============================================================================ */

.cta-section {
  margin-top: 6px;
  padding: 4px 0 24px;
}
.btn-cta {
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(10,42,107,0.25);
  min-height: 56px;
}
.btn-cta:disabled {
  background: var(--border-strong);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}
/* Notificación grande arriba del botón Enviar */
.cta-reminder {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  border-radius: 14px;
  margin-bottom: 14px;
  border: 1.5px solid transparent;
  line-height: 1.55;
  animation: reminderFadeIn 0.25s ease;
}
@keyframes reminderFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cta-reminder-icon {
  font-size: 30px;
  line-height: 1;
  flex-shrink: 0;
}
.cta-reminder-body { flex: 1; min-width: 0; }
.cta-reminder-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.cta-reminder-title strong { font-weight: 800; }
.cta-reminder-text {
  font-size: 13.5px;
  line-height: 1.55;
}
.cta-reminder-text strong { font-weight: 700; }

.cta-reminder.ok {
  background: var(--success-bg);
  border-color: rgba(6,122,74,0.35);
  color: #054d2f;
  box-shadow: 0 6px 20px rgba(6,122,74,0.12);
}
.cta-reminder.ok .cta-reminder-title,
.cta-reminder.ok .cta-reminder-title strong { color: var(--success); }

.cta-reminder.warn {
  background: var(--warning-bg);
  border-color: rgba(168,93,0,0.35);
  color: #5a3200;
}
.cta-reminder.warn .cta-reminder-title,
.cta-reminder.warn .cta-reminder-title strong { color: #6b3a00; }

.cta-reminder.info {
  background: #eff4fc;
  border-color: #c8d8f0;
  color: #0a2a6b;
}
.cta-reminder.info .cta-reminder-title,
.cta-reminder.info .cta-reminder-title strong { color: var(--primary); }

.cta-reminder.done {
  background: linear-gradient(135deg, #e6edfb 0%, #f0e7fb 100%);
  border-color: var(--primary-alt);
  color: var(--primary);
}
.cta-reminder.done .cta-reminder-title,
.cta-reminder.done .cta-reminder-title strong { color: var(--primary); }

.logout-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: center;
}
.btn-logout {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  padding: 11px 22px;
  font-family: inherit;
  font-size: 14px; font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-logout:hover {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ============================================================================
   Popup de confirmación (modal-enviado)
   ============================================================================ */

.confirm-modal {
  position: relative;
  max-width: 440px;
  padding: 36px 28px 28px;
  text-align: center;
  border-radius: 20px;
  animation: scaleIn 0.25s ease-out;
}
.modal-close-x {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: none;
  color: var(--text-muted);
  font-size: 22px; font-weight: 400;
  cursor: pointer;
  display: grid; place-items: center;
  line-height: 1;
  transition: all 0.15s;
  z-index: 2;
}
.modal-close-x:hover {
  background: var(--border);
  color: var(--text);
}

.confirm-icon-wrap {
  display: flex; justify-content: center;
  margin-bottom: 18px;
}
.confirm-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: grid; place-items: center;
  animation: pop 0.4s ease-out 0.15s backwards;
}
@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.confirm-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.6px;
  color: var(--text);
}
.confirm-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--success);
  margin: 0 0 14px;
}
.confirm-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.confirm-warning {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--warning-bg);
  border: 1px solid rgba(168,93,0,0.3);
  border-radius: 10px;
  font-size: 13px;
  color: #5a3200;
  text-align: left;
  line-height: 1.5;
}
.confirm-warning .warn-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.3;
}
.confirm-warning strong { color: #3a1f00; font-weight: 700; }

/* Scroll dentro del modal si es muy grande */
@media (max-height: 760px) {
  .confirm-modal { max-height: calc(100vh - 40px); overflow-y: auto; }
  .confirm-icon { width: 64px; height: 64px; }
  .confirm-icon svg { width: 32px; height: 32px; }
  .confirm-title { font-size: 24px; }
}

/* ============================================================================
   Cards bloqueadas (impreso=true)
   ============================================================================ */

.card.locked {
  opacity: 0.65;
  position: relative;
}
.card.locked::after {
  content: '🔒 Tu credencial ya fue impresa';
  position: absolute;
  top: 10px; right: 10px;
  font-size: 11px;
  background: var(--text);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.upload-empty.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.blood-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.input-text:disabled { cursor: not-allowed; }

.input-hint.success { color: var(--success); font-weight: 600; }
.input-hint.error { color: var(--error); font-weight: 600; }

/* ============================================================================
   PANEL ADMIN (desktop)
   ============================================================================ */

.admin-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

/* ---------- Top nav ---------- */
.admin-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-brand { display: flex; align-items: center; gap: 14px; }
.admin-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary);
  display: grid; place-items: center; color: #fff;
  position: relative; overflow: hidden;
}
.admin-logo::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--ec-yellow) 0%, var(--ec-yellow) 33%,
    var(--ec-blue) 33%, var(--ec-blue) 66%,
    var(--ec-red) 66%, var(--ec-red) 100%);
}
.admin-brand-text .title { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.admin-brand-text .sub { font-size: 11px; color: var(--text-muted); margin-top: -1px; }

.admin-nav-right {
  display: flex; align-items: center; gap: 10px;
}
.nav-divider { width: 1px; height: 20px; background: var(--border); }
.nav-email { font-size: 12px; color: var(--text-muted); }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}

.portal-pill {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.portal-pill.on {
  border: 1px solid rgba(6,122,74,0.4);
  background: var(--success-bg);
  color: var(--success);
}
.portal-pill.off {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
}
.portal-pill .dot-pill {
  width: 7px; height: 7px; border-radius: 50%;
}
.portal-pill.on .dot-pill { background: var(--success); box-shadow: 0 0 0 4px rgba(6,122,74,0.2); }
.portal-pill.off .dot-pill { background: var(--text-muted); }

/* ---------- Admin body ---------- */
.admin-body { padding: 24px 28px; flex: 1; }
.admin-container-wide { max-width: 1600px; margin: 0 auto; }

.admin-title-row {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap; gap: 16px;
}
.admin-title-row .eyebrow {
  font-size: 11px; letter-spacing: 1.4px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
}
.admin-title-row h1 { margin: 4px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -0.6px; }
.admin-title-row .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Stats grid ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.stat.highlight {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.stat .label {
  font-size: 10px; letter-spacing: 1.2px; font-weight: 600;
  text-transform: uppercase; color: var(--text-muted);
}
.stat.highlight .label { color: rgba(255,255,255,0.8); }
.stat .value {
  font-size: 26px; font-weight: 700; margin-top: 4px;
  letter-spacing: -0.8px; font-variant-numeric: tabular-nums;
}
.stat .sub {
  font-size: 11px; margin-top: 2px;
  color: var(--text-muted);
}
.stat.highlight .sub { color: rgba(255,255,255,0.85); }
.stat .sub.warn { color: var(--warning); font-weight: 600; }
.stat .progress-bar {
  margin-top: 10px; height: 3px;
  background: var(--border); border-radius: 2px;
  overflow: hidden;
}
.stat.highlight .progress-bar { background: rgba(255,255,255,0.2); }
.stat .progress-bar > div {
  height: 100%; border-radius: 2px;
  transition: width 0.4s;
}
.stat .progress-bar.med > div { background: var(--primary-alt); }
.stat .progress-bar.yel > div { background: var(--ec-yellow); }
.stat .progress-bar.suc > div { background: var(--success); }

/* ---------- Table ---------- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative; flex: 1; max-width: 340px; min-width: 200px;
}
.search-wrap svg { position: absolute; left: 11px; top: 10px; pointer-events: none; }
.search-wrap input {
  width: 100%; padding: 9px 12px 9px 32px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.search-wrap input:focus { border-color: var(--primary-alt); }

.admin-select {
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.table-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }

table.students {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.students th {
  background: var(--surface-alt);
  text-align: left;
  padding: 10px 14px;
  font-size: 10.5px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.students td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.students tr:hover td { background: var(--surface-alt); }
table.students tr:last-child td { border-bottom: none; }

.row-photo {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  background: var(--surface-alt);
}
.row-photo.med { background: linear-gradient(135deg, var(--med-bg), rgba(59,130,246,0.2)); color: var(--med-fg); }
.row-photo.enf { background: linear-gradient(135deg, var(--enf-bg), rgba(34,197,94,0.2)); color: var(--enf-fg); }
.row-photo.nut { background: linear-gradient(135deg, var(--nut-bg), rgba(245,158,11,0.2)); color: var(--nut-fg); }
.row-photo.obs { background: linear-gradient(135deg, var(--obs-bg), rgba(217,70,239,0.2)); color: var(--obs-fg); }
.row-photo img { width: 100%; height: 100%; object-fit: cover; }
.row-photo.empty svg { color: var(--text-muted); }

.row-name-main { font-size: 13px; font-weight: 600; color: var(--text); }
.row-name-sub { font-size: 11.5px; color: var(--text-muted); }
.row-corr-tag {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 3px;
  padding: 1px 6px;
  font-size: 10px;
  background: var(--warning-bg);
  color: var(--warning);
  border-radius: 4px;
  font-weight: 600;
}

.area-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px; font-weight: 600;
}
.area-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.area-pill.med { background: var(--med-bg); color: var(--med-fg); }
.area-pill.med .dot { background: var(--med-dot); }
.area-pill.enf { background: var(--enf-bg); color: var(--enf-fg); }
.area-pill.enf .dot { background: var(--enf-dot); }
.area-pill.nut { background: var(--nut-bg); color: var(--nut-fg); }
.area-pill.nut .dot { background: var(--nut-dot); }
.area-pill.obs { background: var(--obs-bg); color: var(--obs-fg); }
.area-pill.obs .dot { background: var(--obs-dot); }

.blood-cell { font-size: 12px; font-weight: 600; }
.blood-cell.has { color: var(--ec-red); }
.blood-cell.empty { color: var(--text-muted); }

.status-dot-done {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px;
  background: var(--success);
  border-radius: 50%;
  color: #fff;
}
.status-dot-missing {
  width: 14px; height: 14px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 50%;
}

.pago-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.pago-btn.confirmed {
  border: 1px solid rgba(6,122,74,0.4);
  background: var(--success-bg);
  color: var(--success);
}
.pago-btn.pending {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
}
.pago-btn.pending:hover:not(:disabled) {
  background: var(--primary-tint); color: var(--primary);
  border-color: var(--primary-alt);
}
.pago-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.row-action {
  background: none; border: none;
  color: var(--primary-alt);
  font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.row-action:hover { text-decoration: underline; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Admin drawer (slide-in right) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(7,10,20,0.4);
  z-index: 200;
  display: flex; justify-content: flex-end;
}
.drawer {
  width: 440px; max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  animation: slideLeft 0.25s ease;
  padding: 24px;
  box-sizing: border-box;
}
@keyframes slideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-header {
  display: flex; justify-content: space-between; align-items: start;
  margin-bottom: 16px;
}
.drawer-header .eyebrow {
  font-size: 11px; letter-spacing: 1.2px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
}
.drawer-header .name { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; margin-top: 3px; }
.drawer-header .sur { font-size: 14px; color: var(--text-muted); }
.drawer-close {
  background: var(--surface-alt); border: none;
  width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  flex-shrink: 0;
}
.drawer-close:hover { background: var(--border); }

.drawer-photo {
  width: 180px; height: 220px;
  margin: 0 auto 16px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.drawer-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drawer-photo.empty {
  flex-direction: column;
  font-size: 38px; font-weight: 800;
  gap: 6px;
}
.drawer-photo.empty span { letter-spacing: -1px; }
.drawer-photo.empty small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.drawer-photo.empty.med { background: linear-gradient(135deg, var(--med-bg), rgba(59,130,246,0.2)); color: var(--med-fg); }
.drawer-photo.empty.enf { background: linear-gradient(135deg, var(--enf-bg), rgba(34,197,94,0.2)); color: var(--enf-fg); }
.drawer-photo.empty.nut { background: linear-gradient(135deg, var(--nut-bg), rgba(245,158,11,0.2)); color: var(--nut-fg); }
.drawer-photo.empty.obs { background: linear-gradient(135deg, var(--obs-bg), rgba(217,70,239,0.2)); color: var(--obs-fg); }

.drawer-state-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}

.state-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent;
}
.state-pill.sent    { background: var(--primary-tint); color: var(--primary); border-color: rgba(22,71,184,0.2); }
.state-pill.pending { background: var(--surface-alt); color: var(--text-muted); border-color: var(--border); }
.state-pill.ok      { background: var(--success-bg); color: var(--success); border-color: rgba(6,122,74,0.25); }
.state-pill.done    { background: #e6edfb; color: var(--primary); border-color: var(--primary-alt); font-weight: 700; }

/* ---------- Admin login (standalone) ---------- */
.admin-login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #06204f 100%);
  position: relative;
  overflow: hidden;
}
.admin-login-shell::before {
  content: 'MSP';
  position: absolute; right: -80px; top: -40px;
  font-size: 400px; font-weight: 800;
  letter-spacing: -24px; line-height: 1;
  color: #fff; opacity: 0.04;
  pointer-events: none;
  user-select: none;
}
.admin-login-card {
  background: var(--surface);
  padding: 36px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(7,20,60,0.3);
  width: 100%;
  max-width: 420px;
  position: relative; z-index: 2;
}
.admin-login-card .logo-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.admin-login-card h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.admin-login-card .sub { color: var(--text-muted); font-size: 13px; }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(7,10,20,0.5);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 520px; width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 12px;
  display: flex; justify-content: space-between; align-items: start;
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.modal-header .close {
  background: var(--surface-alt); border: none;
  width: 28px; height: 28px; border-radius: 8px;
  cursor: pointer; color: var(--text-muted); font-size: 18px;
}
.modal-body { padding: 0 24px 24px; }
.modal-footer { padding: 12px 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .admin-nav { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .admin-body { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100vw; }
  .nav-email { display: none; }
}
