/* miObraSocial – Estilos base (mobile-first)
   Idea: simple, legible y con buen contraste para gente mayor.
*/
:root{
  --brand:#7b0f16;           /* bordó institucional aproximado */
  --brand-2:#4b0a0f;
  --bg:#f6f7f9;
  --card:#ffffff;
  --text:#1a1d21;
  --muted:#6b7280;
  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#dc2626;

  /* ✅ compat: en algunos bloques se usaba --good por error */
  --good: var(--ok);

  --radius:18px;
  --shadow:0 8px 24px rgba(0,0,0,.08);
  --pad:16px;
  --tap:48px; /* tamaño mínimo cómodo para tocar */
  --maxw:980px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:var(--bg);
}

a{color:inherit}
button, input, select, textarea{font:inherit}

.container{
  max-width:var(--maxw);
  margin:0 auto;
  padding:12px 12px 90px;
}

.header{
  position:sticky;
  top:0;
  z-index:220; /* ✅ arriba de sticky bars (50) y de casi todo */
  background:linear-gradient(180deg,var(--brand),var(--brand-2));
  color:white;
  padding:14px 12px;
  box-shadow:0 8px 20px rgba(0,0,0,.15);
}

.header .row{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand img{
  width:38px;height:38px;
  border-radius:12px;
  background:white;
}

.brand .title{
  font-size:20px;
  font-weight:800;
  letter-spacing:.2px;
  line-height:1.1;
}
.brand .subtitle{
  font-size:12px;
  opacity:.9;
}

.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:var(--pad);
}

.h1{font-size:22px; margin:0 0 6px}
.p{margin:0; color:var(--muted); line-height:1.35}

/* ✅ Utilities (unificación de “muted” / separadores) */
.muted{ color: var(--muted); }
.muted2{ color: rgba(0,0,0,.55); }
.softLine, .softline, .sep{
  height:1px;
  background: rgba(0,0,0,.08);
  border-radius:2px;
}

.form{
  display:grid;
  gap:12px;
  margin-top:14px;
}

.label{
  font-weight:700;
  margin-bottom:6px;
}
.field{
  display:grid;
  gap:6px;
}

.input, .select, .textarea{
  width:100%;
  border:1px solid rgba(0,0,0,.12);
  border-radius:14px;
  padding:12px 12px;
  min-height:var(--tap);
  background:white;
}

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

.btn{
  border:0;
  border-radius:14px;
  padding:12px 14px;
  min-height:var(--tap);
  cursor:pointer;
  font-weight:800;
  box-shadow:0 6px 16px rgba(0,0,0,.10);
}
.btn-primary{background:var(--brand); color:white}
.btn-ghost{background:#eef0f3; color:var(--text)}
.btn-danger{background:var(--bad); color:white}

.helper{
  font-size:13px;
  color:var(--muted);
}

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

.tile{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  gap:8px;
  min-height:110px;
  padding:14px;
  border-radius:18px;
  background:white;
  box-shadow:var(--shadow);
  border:1px solid rgba(0,0,0,.06);
}

.tile .t{font-weight:900; font-size:16px}
.tile .s{color:var(--muted); font-size:13px}
.tile .ic{
  width:38px; height:38px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:rgba(123,15,22,.10);
  color:var(--brand);
  font-weight:900;
}

.footer-nav{
  position:fixed;
  left:0; right:0; bottom:0;
  background:white;
  border-top:1px solid rgba(0,0,0,.08);
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  display:flex;
  justify-content:center;
}
.footer-nav .wrap{
  width:min(var(--maxw), 100%);
  display:flex;
  gap:10px;
}
.navbtn{
  flex:1;
  border:0;
  background:#f2f4f7;
  border-radius:16px;
  min-height:var(--tap);
  font-weight:900;
  cursor:pointer;
}
.navbtn.active{
  background:rgba(123,15,22,.12);
  color:var(--brand);
}

#toasts{
  position:fixed;
  left:12px;
  right:12px;
  bottom:86px;
  display:grid;
  gap:10px;
  z-index:50;
}
.toast{
  background:#111827;
  color:white;
  padding:12px 14px;
  border-radius:14px;
  box-shadow:0 10px 26px rgba(0,0,0,.22);
  font-weight:700;
}
.toast.ok{background:#065f46}
.toast.bad{background:#7f1d1d}

@media (min-width:820px){
  .container{padding-bottom:12px}
  .footer-nav{display:none}
  .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Login: bloque de marca (logo + títulos) */
.login-brand{
  display:grid;
  place-items:center;
  gap:10px;
  padding:8px 0 2px;
}
.login-brand img{
  width:84px;
  height:auto;
  border-radius:20px;
  box-shadow:0 10px 26px rgba(0,0,0,.10);
}

/* Tiles: soporte para íconos SVG/IMG dentro del contenedor .ic */
.tile .ic{
  width:42px; height:42px;
}
.tile .ic svg, .tile .ic img{
  width:24px;
  height:24px;
}

/* Logo inline: tamaño y color por contexto */
.logo-slot{
  display:grid;
  place-items:center;
}
.app-logo-svg{
  width:100%;
  height:100%;
  display:block;
}

/* Header: el logo va en blanco */
.header .logo-slot{
  width:38px;
  height:38px;
  color:#ffffff;
}

/* Login: logo un poco más grande y en color institucional */
.login-brand .login-logo{
  width:84px;
  height:84px;
  color:var(--brand);
  margin-bottom: 2px;
}

/* Familia: tira horizontal de selección */
.family-card .row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  margin-bottom:10px;
}
.family-strip{
  display:flex;
  gap:10px;
  overflow:auto;
  padding-bottom:4px;
  -webkit-overflow-scrolling: touch;
}
.fam-chip{
  min-width:140px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius:14px;
  padding:10px 12px;
  text-align:left;
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}
.fam-chip .top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
}
.fam-chip .badge{
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(255,255,255,.10);
  color: var(--muted);
  font-weight:800;
}
.fam-chip .name{
  font-weight:900;
  line-height:1.15;
}
.fam-chip.active{
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.10);
}

/* Familia: feedback visual fuerte (se ve quién está seleccionado) */
.fam-chip{
  position: relative;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.fam-chip:active{
  transform: scale(.99);
}
.fam-chip .avatar{
  width:28px;
  height:28px;
  border-radius:10px;
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:12px;
  background: rgba(0,0,0,.06);
}
.fam-chip .check{
  margin-left:auto;
  font-weight:900;
  opacity:0;
  transform: scale(.9);
}
.fam-chip.active{
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, white);
  box-shadow: 0 14px 28px rgba(0,0,0,.10);
}
.fam-chip.active .avatar{
  background: color-mix(in srgb, var(--brand) 16%, white);
}
.fam-chip.active .badge{
  background: color-mix(in srgb, var(--brand) 12%, white);
  color: var(--brand);
}
.fam-chip.active .check{
  opacity:1;
  color: var(--brand);
}

/* --- Historial / listas --- */
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.06);
  font-weight:900;
  font-size:12px;
  line-height:1;
}
.pill.ok{ background: color-mix(in srgb, var(--good) 18%, white); color: var(--good); }
.pill.warn{ background: color-mix(in srgb, var(--warn) 18%, white); color: var(--warn); }
.pill.bad{ background: color-mix(in srgb, var(--bad) 14%, white); color: var(--bad); }
.pill.muted{ background: rgba(0,0,0,.05); color: var(--muted); }

.ul{
  margin:8px 0 0 0;
  padding:0 0 0 18px;
  color: var(--text);
}
.ul li{ margin:6px 0; }

.spinner{
  display:inline-block;
  width:14px;
  height:14px;
  border:2px solid rgba(0,0,0,.16);
  border-top-color: rgba(0,0,0,.42);
  border-radius:50%;
  animation: spin .8s linear infinite;
  vertical-align:-2px;
}
@keyframes spin{ to{ transform: rotate(360deg);} }

.skeleton{
  border-radius:12px;
  background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.09), rgba(0,0,0,.05));
  background-size: 220% 100%;
  animation: sk 1.1s ease-in-out infinite;
}
.skeleton.sk1{ height:18px; width:62%; }
.skeleton.sk2{ height:12px; width:46%; margin-top:10px; }
.skeleton.sk3{ height:12px; width:88%; margin-top:12px; }
@keyframes sk{ 0%{ background-position: 0% 0; } 100%{ background-position: 100% 0; } }

.credencial-header {
  position: relative;
  padding-right: 260px; /* espacio para los botones */
}

.credencial-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 640px) {
  .credencial-header {
    padding-right: 0;
  }

  .credencial-actions {
    position: static;
    margin-top: 12px;
  }
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

.page-subtitle {
  margin-top: 6px;
  font-size: 1rem;
  color: #6b7280; /* gris suave */
}
