/* =====================================================================
   GinecoCare · Apps móviles híbridas (paciente / médico)
   Se carga DESPUÉS de app.css y reutiliza sus tokens y componentes.
   ===================================================================== */
.m-body { background: var(--bg); min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.m-body.no-nav { padding-bottom: 24px; }

.m-appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px; min-height: 60px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.m-appbar .m-title { flex: 1; min-width: 0; }
.m-appbar .m-title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-appbar .m-title .m-sub { font-size: 12px; color: var(--muted); }
.m-appbar .m-logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 1px solid var(--border); overflow: hidden; flex-shrink: 0; }
.m-appbar .m-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }

.m-content { padding: 16px; max-width: 720px; margin: 0 auto; }
.m-content > * + * { margin-top: 16px; }

.m-hero {
  border-radius: 22px; padding: 20px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 0% 0%, #2563eb 0%, transparent 60%), linear-gradient(135deg, #1d4ed8 0%, #0b1220 100%);
  box-shadow: 0 12px 30px rgba(29, 78, 216, .28);
}
.m-hero h2 { color: #fff; font-size: 21px; }
.m-hero .m-hero-sub { color: rgba(255,255,255,.75); font-size: 13px; }
.m-hero .btn { --btn-bg: rgba(255,255,255,.14); --btn-fg: #fff; --btn-bd: rgba(255,255,255,.2); }
.m-hero .btn.btn-light { --btn-bg: #fff; --btn-fg: #1d4ed8; --btn-bd: #fff; }

.m-section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.m-section-title h3 { font-size: 15px; }
.m-section-title a { font-size: 13px; font-weight: 600; }

.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
.m-card-body { padding: 16px; }
.m-card + .m-card { margin-top: 12px; }
a.m-card { display: block; color: inherit; }
a.m-card:active { transform: scale(.99); }

.m-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.m-quick a {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 12px; font-weight: 600; text-align: center;
}
.m-quick a .ti { font-size: 24px; color: var(--primary-500); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-soft); }
@media (max-width: 360px) { .m-quick { grid-template-columns: repeat(2, 1fr); } }

.m-list { list-style: none; margin: 0; padding: 0; }
.m-list > li, .m-list > a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); color: inherit; }
.m-list > li:last-child, .m-list > a:last-child { border-bottom: 0; }
.m-list .grow { flex: 1; min-width: 0; }
.m-list .m-li-title { font-weight: 700; }
.m-list .m-li-sub { font-size: 12.5px; color: var(--muted); }
.m-list .ti-chevron-right { color: var(--faint); }

.m-appt { display: flex; gap: 14px; padding: 14px 16px; align-items: stretch; }
.m-appt .m-date {
  width: 58px; flex-shrink: 0; border-radius: 14px; background: var(--primary-soft); color: var(--primary-500);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px;
}
.m-appt .m-date .d { font-size: 22px; font-weight: 800; line-height: 1; }
.m-appt .m-date .m { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.m-appt .m-info { flex: 1; min-width: 0; }
.m-appt .m-info .t { font-weight: 700; }
.m-appt .m-info .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.m-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--border);
}
.m-tabbar a {
  flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px;
  border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative;
}
.m-tabbar a .ti { font-size: 23px; }
.m-tabbar a.active { color: var(--primary-500); }
.m-tabbar a.active .ti { background: var(--primary-soft); border-radius: 12px; padding: 3px 14px; }
.m-tabbar a.fab .ti { background: var(--primary); color: #fff; border-radius: 16px; padding: 8px 14px; margin-top: -18px; box-shadow: 0 8px 20px rgba(29,78,216,.35); }
.m-tabbar .badge-dot { position: absolute; top: 2px; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 8px; background: #ef4444; color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

.m-seg { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; padding-bottom: 2px; }
.m-seg::-webkit-scrollbar { display: none; }
.m-seg a, .m-seg button {
  flex-shrink: 0; padding: 8px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font: 600 13px var(--font); white-space: nowrap; cursor: pointer;
}
.m-seg .active { background: var(--primary); border-color: var(--primary); color: #fff; }

.m-steps { display: flex; gap: 6px; margin-bottom: 14px; }
.m-steps span { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-3); }
.m-steps span.done { background: var(--primary-500); }

.m-choice {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit;
}
.m-choice + .m-choice { margin-top: 10px; }
.m-choice:hover { border-color: var(--primary-500); }
.m-choice.selected { border-color: var(--primary-500); background: var(--primary-soft); }
.m-choice .ti { font-size: 22px; color: var(--primary-500); }

.m-dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.m-dates::-webkit-scrollbar { display: none; }
.m-dates button {
  flex-shrink: 0; width: 64px; padding: 10px 4px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--text); font-family: var(--font);
}
.m-dates button .w { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.m-dates button .d { font-size: 20px; font-weight: 800; }
.m-dates button .n { font-size: 10.5px; color: var(--green); font-weight: 600; }
.m-dates button.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.m-dates button.selected .w, .m-dates button.selected .n { color: rgba(255,255,255,.85); }

.m-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; text-align: center; }
.m-kpi .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m-kpi .l { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.m-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.m-actions .btn { height: 48px; border-radius: 14px; }
.m-sticky-foot {
  position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 20; padding: 12px 0 0;
  background: linear-gradient(0deg, var(--bg) 70%, transparent);
}
.no-nav .m-sticky-foot { bottom: 0; padding-bottom: 12px; }

.m-login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 440px; margin: 0 auto; }
.m-login .m-brand { text-align: center; margin-bottom: 26px; }
.m-login .m-brand img { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 22px; background: #fff; padding: 8px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.m-login .m-brand-custom img { width: auto; height: auto; max-width: min(260px, 80%); max-height: 150px; border-radius: 0; background: none; padding: 0; border: 0; box-shadow: none; object-fit: contain; }
.m-appbar .m-logo-custom { width: auto; max-width: 70px; background: none; border: 0; border-radius: 0; }
.m-appbar .m-logo-custom img { padding: 0; }
.m-login h1 { font-size: 24px; }
.m-login .input { min-height: 52px; font-size: 16px; border-radius: 14px; }
.m-login .btn-lg { height: 54px; border-radius: 15px; }

.m-install { display: none; }
.m-install.show { display: flex; }

@media (min-width: 900px) {
  .m-content { padding: 24px; }
}
