/* ========== Mi Argentina PWA v2 — réplica fiel del APK ========== */
:root {
  --primary: #3a2fa0;
  --primary-dark: #2d2484;
  --primary-light: #e8e6f9;
  --accent: #1e8bc3;
  --accent-light: #4fc3f7;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #888888;
  --text-444: #444444;
  --border: #e0e0e0;
  --bg-screen: #f0f0f5;
  --bg-screen-home: #f5f5f5;
  --bg-card: #ffffff;
  --green: #2e7d32;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --appbar-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-screen);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
body { min-height: 100vh; min-height: 100dvh; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; padding: 0; }
input { font: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ========== Splash ========== */
.splash {
  position: fixed; inset: 0;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  flex-direction: column; gap: 20px;
  transition: opacity 0.25s;
}
.splash img { width: 200px; height: 80px; object-fit: contain; filter: brightness(10); }
.splash .spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== App Bar ========== */
.appbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--appbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 4px;
  padding-right: 4px;
  z-index: 150;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.appbar-btn {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
  flex-shrink: 0;
}
.appbar-btn:active { background: rgba(255,255,255,0.15); }
.appbar-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  user-select: none;
}
.appbar-mi { color: var(--accent-light); }
.appbar-arg { color: #ffffff; }

/* ========== Login ========== */
.login-screen {
  flex: 1;
  display: flex; flex-direction: column;
  background: #fff;
  padding: 24px;
  padding-top: calc(var(--safe-top) + 24px);
  max-width: 520px; margin: 0 auto; width: 100%;
}
.login-screen .logo {
  width: 200px; height: 80px;
  object-fit: contain;
  margin: 40px auto 48px;
}
.mat-field {
  position: relative;
  padding-top: 16px;
  border-bottom: 1px solid var(--border);
}
.mat-field + .mat-field { margin-top: 24px; }
.mat-field input {
  width: 100%; border: none; outline: none;
  background: transparent;
  font-size: 16px; color: var(--text-primary);
  padding: 12px 0 8px;
}
.mat-field .mat-hint {
  position: absolute; left: 0; top: 28px;
  font-size: 16px; color: var(--text-secondary);
  pointer-events: none;
  transition: transform .18s ease, color .18s ease, font-size .18s ease;
  transform-origin: left top;
}
.mat-field.focused .mat-hint { transform: translateY(-20px) scale(0.75); color: var(--primary); }

.btn-primary {
  background: var(--primary); color: #fff;
  height: 52px; border-radius: 26px;
  font-size: 16px; font-weight: 500;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
  transition: opacity .15s, transform .1s;
}
.btn-primary:active { opacity: 0.88; transform: scale(0.98); }
.btn-primary[disabled] { opacity: 0.5; box-shadow: none; }
.btn-outline {
  background: #fff; color: var(--primary);
  height: 52px; border: 2px solid var(--primary);
  border-radius: 26px; font-size: 16px; font-weight: 500; width: 100%;
  transition: background .15s;
}
.btn-outline:active { background: var(--primary-light); }
.login-screen .btn-primary { margin-top: 32px; }
.login-screen .tv-recover { margin-top: 16px; font-size: 14px; color: var(--text-secondary); align-self: flex-start; padding: 4px 0; }
.login-screen .divider { height: 1px; background: var(--border); margin: 32px 0 24px; }
.login-screen .sin-cuenta { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.login-screen .err { color: #b00020; font-size: 13px; padding: 4px 0; min-height: 18px; }

/* ========== Bottom Nav ========== */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -1px 6px rgba(0,0,0,0.08);
  height: calc(60px + var(--safe-bottom));
}
.bottomnav button {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; color: #999;
  font-size: 10px; font-weight: 500;
  padding: 6px 0;
  transition: color .15s;
}
.bottomnav button img {
  width: 26px; height: 26px;
  object-fit: contain;
  filter: grayscale(1) opacity(0.5);
  transition: filter .15s;
}
.bottomnav button.active { color: var(--primary); font-weight: 700; }
.bottomnav button.active img {
  filter: none;
}

/* ========== Main content ========== */
.main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(68px + var(--safe-bottom));
  padding-top: calc(var(--appbar-h) + var(--safe-top));
  background: var(--bg-screen);
}
.main.home-bg { background: var(--bg-screen-home); }

/* ========== HOME SCREEN ========== */
.home-screen {
  display: flex; flex-direction: column;
  min-height: 100%;
}

/* Purple band below appbar with greeting */
.home-header-ext {
  background: var(--primary);
  padding: 12px 16px 70px;
}
.home-greeting {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.1px;
}

/* White body area with rounded top */
.home-body {
  background: var(--bg-screen-home);
  flex: 1;
  margin-top: -56px;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px 0;
}

/* Turnos card */
.home-turnos-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(58,47,160,0.12);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.home-turnos-icon-wrap img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; display: block; }
.home-turnos-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.home-turnos-btn { height: 44px; border-radius: 22px; font-size: 15px; }

/* Credentials card */
.home-creds-card {
  background: #e8f5e9;
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.home-creds-text {
  font-size: 16px;
  font-weight: 700;
  color: #1b5e20;
  flex: 1;
  line-height: 1.3;
}
.home-creds-icon-wrap { flex-shrink: 0; }

/* Section title */
.home-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0 12px;
}

/* Grid */
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.home-card {
  height: 88px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.09);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px;
  gap: 6px;
  transition: transform .1s, box-shadow .1s;
}
.home-card:active { transform: scale(0.94); box-shadow: 0 1px 3px rgba(0,0,0,0.07); }
.home-card img { width: 36px; height: 36px; object-fit: contain; }
.home-card .label {
  font-size: 10px; font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  max-width: 100%;
}

/* Feriado banner */
.home-feriado-card {
  background: #e3f2fd;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 16px;
}
.home-feriado-icon { flex-shrink: 0; }
.home-feriado-text { flex: 1; }
.home-feriado-label { font-size: 12px; color: #1565c0; font-weight: 500; }
.home-feriado-date { font-size: 18px; font-weight: 800; color: #0d47a1; line-height: 1.2; }
.home-feriado-desc { font-size: 12px; color: #1565c0; margin-top: 2px; }

/* ========== SIMPLE VIEW SCREEN (turnos, hijos, cobros, tramites) ========== */
.simple-view-screen { padding: 16px; }

/* Turnos card in view */
.turnos-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  padding: 32px 20px 24px;
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.turnos-card-icon { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto; }
.turnos-card-text { font-size: 16px; font-weight: 700; color: var(--text-primary); text-align: center; }
.turnos-card .btn-primary { max-width: 280px; }

/* Hijos */
.hijos-main-text { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; line-height: 1.4; }
.hijos-sub-text { font-size: 13px; color: var(--text-444); line-height: 1.5; margin-bottom: 20px; }

/* Cobros */
.cobros-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.cobros-text { font-size: 13px; color: var(--text-444); line-height: 1.5; margin-bottom: 16px; }

/* Tramites */
.tramites-header-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  padding: 16px;
  margin-bottom: 12px;
}
.tramites-header-text { font-size: 13px; color: var(--text-444); margin-bottom: 12px; }
.tramites-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  padding: 16px;
  margin-bottom: 12px;
}
.tramites-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.tramites-card-icon { flex-shrink: 0; margin-top: 2px; }
.tramites-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.4; flex: 1; }
.tramites-card-desc { font-size: 13px; color: var(--text-444); line-height: 1.5; margin-bottom: 16px; }
.tramites-mi-link { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 12px; }
.tramites-mi-icon { font-size: 11px; font-weight: 700; color: var(--primary); font-style: italic; padding-top: 1px; }
.tramites-mi-link a { color: var(--primary); font-size: 12px; }

/* ========== Expandable Card ========== */
.exp-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  overflow: hidden;
  margin-bottom: 12px;
  transition: box-shadow .2s;
}
.exp-card.open { box-shadow: 0 3px 12px rgba(58,47,160,0.13); }
.exp-card .exp-header {
  display: flex; align-items: center;
  padding: 16px;
  gap: 12px;
  user-select: none;
}
.exp-card .exp-header img.icon { width: 38px; height: 30px; object-fit: contain; }
.exp-card .exp-header .title { flex: 1; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.exp-card .exp-header .arrow {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(0deg);
  transition: transform .25s;
  color: var(--text-secondary);
  font-size: 22px; line-height: 1; font-weight: 300;
}
.exp-card.open .arrow { transform: rotate(90deg); }
.exp-card .exp-content { display: none; }
.exp-card.open .exp-content { display: block; }
.exp-card .exp-content > * + * { border-top: 1px solid var(--border); }
.exp-card .exp-content > *:first-child { border-top: 1px solid var(--border); }
.exp-card .exp-section { padding: 16px; }
.exp-card .exp-section .btn-primary,
.exp-card .exp-section .btn-outline { height: 48px; border-radius: 24px; font-size: 14px; }
.exp-card .source-block { padding: 12px 16px; }
.exp-card .source-block .source-lbl { font-size: 12px; color: var(--text-444); }
.exp-card .source-block .source-name { font-size: 12px; color: var(--primary); margin-top: 2px; }
.exp-card .info-text { font-size: 13px; color: var(--text-444); line-height: 1.4; margin-bottom: 12px; }
.exp-card .field-row { display: flex; gap: 16px; margin-bottom: 14px; }
.exp-card .field-row > div { flex: 1; min-width: 0; }
.field-lbl { font-size: 12px; color: var(--text-tertiary); }
.field-val { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-top: 3px; word-break: break-word; }
.field-val.green { color: var(--green); }
.exp-card .qr-img {
  width: 200px; height: 200px; object-fit: contain;
  margin: 16px auto 6px; display: block;
}
.exp-card .qr-actualizacion { font-size: 12px; color: var(--text-tertiary); text-align: center; padding: 0 0 14px; }
.exp-card .avisar-row {
  display: flex; align-items: center;
  padding: 14px 16px; gap: 12px;
}
.exp-card .avisar-row img { width: 36px; height: 28px; object-fit: contain; }
.exp-card .avisar-row .avisar-text { font-size: 13px; font-weight: 700; color: var(--primary); flex: 1; }
.exp-card .avisar-row.muted .avisar-text { font-weight: 400; color: var(--text-444); }
.exp-card .lic-intro { padding: 14px 16px; font-size: 13px; color: var(--text-444); line-height: 1.4; }
.exp-card .qr-placeholder { background: #eee; display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px; }
.exp-card .lic-row { display: flex; gap: 16px; margin-bottom: 14px; }
.exp-card .lic-row > div { flex: 1; min-width: 0; }
.exp-card .lic-single { margin-bottom: 18px; }

.docs-screen { padding: 16px; }
.fragment-pad { padding: 16px; }

/* ========== Generic info-section ========== */
.info-section {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  margin-bottom: 12px;
  padding: 16px;
}
.info-section .section-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 12px; display: flex; align-items: center; gap: 12px;
}
.info-section .section-title img { width: 36px; height: 28px; object-fit: contain; }
.info-section .field-row { display: flex; gap: 16px; margin-bottom: 14px; }
.info-section .field-row > div { flex: 1; min-width: 0; }
.info-section .source-lbl { font-size: 12px; color: var(--text-444); margin-top: 8px; }
.info-section .source-name { font-size: 12px; color: var(--primary); margin-top: 2px; }
.info-section .empty { text-align: center; color: var(--text-secondary); padding: 16px; font-size: 14px; }
.info-section .field-val.big { font-size: 20px; color: var(--primary); }

/* ========== List items ========== */
.list-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  padding: 14px 16px; margin-bottom: 10px;
}
.list-item .lead {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary);
  border-radius: 10px; font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.list-item .sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ========== Tab section titles ========== */
.tab-section-title {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 16px;
}

/* ========== Novedades ========== */
.novedad-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  padding: 16px; margin-bottom: 10px;
}
.novedad-date { font-size: 11px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.novedad-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.novedad-body { font-size: 13px; color: var(--text-444); line-height: 1.5; }

/* ========== Salud ========== */
.salud-cobertura-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.salud-icon { width: 36px; height: 36px; object-fit: contain; }
.salud-cobertura-text { font-size: 14px; color: var(--text-444); flex: 1; }
.salud-section-wrap { margin-bottom: 4px; }
.salud-section-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 12px 0 8px; }
.salud-cred-item {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09);
  padding: 14px 16px; margin-bottom: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  cursor: pointer;
}
.salud-cred-item img { width: 36px; height: 36px; object-fit: contain; }
.salud-vacunas-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.salud-vacunas-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.salud-vacunas-desc { font-size: 13px; color: var(--text-444); line-height: 1.5; margin-bottom: 8px; }
.salud-vacunas-note { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; line-height: 1.4; }
.salud-vacunas-note em, .salud-vacunas-note b { font-weight: 700; }
.info-section .btn-outline { height: 44px; border-radius: 22px; font-size: 14px; max-width: 300px; display: block; margin: 0 auto; }

/* ========== PERFIL ========== */
.perfil-screen { display: flex; flex-direction: column; }
.perfil-hero {
  background: var(--primary);
  padding: 24px 20px 32px;
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
}
.perfil-avatar-wrap { position: relative; margin-bottom: 12px; }
.perfil-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.5);
  object-fit: cover;
}
.perfil-avatar-empty {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255,255,255,0.3);
}
.perfil-badge {
  position: absolute; bottom: 0; right: 0;
  width: 22px; height: 22px;
  background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.perfil-name {
  font-size: 18px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 6px;
  justify-content: center;
}
.perfil-check { display: flex; align-items: center; }
.perfil-cuil { font-size: 13px; color: rgba(255,255,255,0.8); margin-top: 4px; }
.perfil-validated { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.perfil-section { padding: 12px 16px 0; }
.perfil-section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.perfil-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
  overflow: hidden; margin-bottom: 12px;
}
.perfil-data-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
}
.perfil-divider { height: 1px; background: var(--border); margin: 0 16px; }
.perfil-data-val { font-size: 15px; color: var(--text-primary); }
.perfil-edit-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.perfil-grid { display: grid; grid-template-columns: 1fr 1fr; }
.perfil-grid-item { padding: 14px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.perfil-grid-item:nth-child(even) { border-right: none; }
.perfil-grid-item:nth-last-child(-n+2) { border-bottom: none; }
.perfil-grid-lbl { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.perfil-grid-val { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ========== DRAWER ========== */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0);
  z-index: 500;
  display: flex;
  transition: background 0.28s ease;
}
.drawer-overlay.open { background: rgba(0,0,0,0.45); }
.drawer {
  width: min(320px, 85vw);
  height: 100%;
  background: #f5f5f5;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.25,0.46,0.45,0.94);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-header {
  background: var(--primary);
  display: flex; align-items: center;
  padding: calc(var(--safe-top) + 14px) 12px 14px;
  gap: 8px; flex-shrink: 0;
}
.drawer-close {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drawer-header-logo { font-size: 20px; font-weight: 700; }
.drawer-mi { color: var(--accent-light); }
.drawer-argentina { color: white; }
.drawer-user {
  background: var(--primary);
  padding: 0 20px 24px;
  display: flex; flex-direction: column;
  align-items: flex-start; flex-shrink: 0;
}
.drawer-avatar-wrap { position: relative; margin-bottom: 10px; }
.drawer-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
}
.drawer-avatar-empty {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.drawer-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 20px; height: 20px;
  background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.drawer-name { font-size: 16px; font-weight: 700; color: #fff; }
.drawer-cuil { font-size: 13px; color: rgba(255,255,255,0.75); margin-top: 3px; }
.drawer-validated { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.drawer-menu { flex: 1; background: #fff; }
.drawer-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  width: 100%;
  border-bottom: 1px solid var(--border);
  font-size: 15px; color: var(--text-primary);
  text-align: left;
  transition: background .15s;
}
.drawer-item:active { background: var(--primary-light); }
.drawer-item-icon {
  width: 28px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drawer-item-label { flex: 1; font-size: 15px; }
.drawer-divider { height: 8px; background: #f0f0f5; }

/* ========== DNI Overlay ========== */
.dni-overlay {
  position: fixed; inset: 0;
  background: var(--bg-screen);
  z-index: 200; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: var(--safe-top);
}
.dni-overlay .btn-close {
  position: absolute; top: calc(var(--safe-top) + 8px); right: 8px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary); background: rgba(255,255,255,0.9);
  border-radius: 50%; font-size: 20px; z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dni-overlay .dni-content { padding: 60px 16px 24px; }
.dni-overlay .nombre-completo { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.flip-zone { perspective: 800px; width: 100%; cursor: pointer; }
.flip-inner { position: relative; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,.2,.2,1); }
.flip-zone.flipped .flip-inner { transform: rotateY(180deg); }
.face { backface-visibility: hidden; }
.face.back { position: absolute; top: 0; left: 0; width: 100%; transform: rotateY(180deg); }
.card-img { width: 100%; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); display: block; }
.actualizacion { font-size: 12px; color: var(--text-tertiary); text-align: center; margin: 10px 0; }
.action-row { display: flex; border-top: 1px solid var(--border); }
.action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 8px;
  font-size: 14px; font-weight: 600; color: var(--primary);
  border-right: 1px solid var(--border);
}
.action-btn:last-child { border-right: none; }
.action-btn img { width: 20px; height: 20px; object-fit: contain; }
.dni-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.qr-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  border-top: 1px solid var(--border);
}
.qr-row-icon { width: 24px; height: 24px; object-fit: contain; }
.qr-row-text { flex: 1; font-size: 14px; font-weight: 600; color: var(--primary); }
.qr-row .arr { color: var(--text-secondary); font-size: 20px; transition: transform .25s; }
.qr-row.open .arr { transform: rotate(90deg); }
.qr-content { display: none; padding: 16px; text-align: center; }
.qr-content.open { display: block; }
.qr-content img { max-width: 200px; margin: 0 auto; border-radius: 8px; }
.qr-content-empty { color: var(--text-secondary); font-size: 14px; }

/* ========== Detalle Overlay ========== */
.detalle-overlay {
  position: fixed; inset: 0; background: var(--bg-screen);
  z-index: 201; overflow-y: auto; padding-top: var(--safe-top);
}
.btn-close-detalle {
  position: absolute; top: calc(var(--safe-top) + 8px); right: 8px;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.9); border-radius: 50%; font-size: 20px; z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.detalle-scroll { padding: 64px 16px 24px; }
.det-foto {
  width: 120px; height: 150px; object-fit: cover;
  border-radius: 8px; margin: 0 auto 16px; display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.det-foto-empty {
  width: 120px; height: 150px; background: #e0e0e0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; margin: 0 auto 16px;
  font-size: 32px; color: #999;
}
.det-barcode-wrap { width: 100%; margin-bottom: 20px; }
.det-barcode { height: 48px; width: 100%; }
.det-row { display: flex; gap: 12px; margin-bottom: 12px; }
.det-block { flex: 1; background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.det-block.full { flex: none; width: 100%; margin-bottom: 8px; background: #fff; border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.det-lbl { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
.det-val { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ========== Licencia Overlay ========== */
.lic-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: var(--safe-top) 16px var(--safe-bottom);
}
.lic-overlay .btn-close {
  position: absolute; top: calc(var(--safe-top) + 8px); right: 8px;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
}
.lic-img-wrap { width: 100%; max-width: 420px; cursor: pointer; }
.lic-img-wrap img { width: 100%; border-radius: 12px; }
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15); border-radius: 50%;
  color: white; font-size: 28px; line-height: 1;
}
.nav-btn.prev { left: 8px; }
.nav-btn.next { right: 8px; }

/* ========== Toast ========== */
#toast {
  position: fixed; bottom: calc(72px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  z-index: 9999; pointer-events: none;
}
.toast-msg {
  background: rgba(30,30,30,0.92);
  color: #fff; padding: 10px 20px;
  border-radius: 24px; font-size: 14px;
  white-space: nowrap; max-width: 90vw;
  opacity: 0; transform: translateY(8px) scale(0.95);
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.toast-msg.show { opacity: 1; transform: none; }

/* ========== iOS install banner ========== */
#ios-install-banner {
  position: fixed; bottom: calc(60px + var(--safe-bottom)); left: 16px; right: 16px;
  background: var(--primary); color: #fff; border-radius: 16px;
  padding: 16px; z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.ios-install-content strong { font-size: 15px; display: block; margin-bottom: 6px; }
.ios-install-content p { font-size: 13px; margin: 0 0 12px; opacity: 0.9; }
#ios-install-close {
  background: rgba(255,255,255,0.2); color: #fff;
  border: none; border-radius: 20px;
  padding: 8px 20px; font-size: 14px; cursor: pointer;
}
