/* Aylin — hoja de estilos única.
   Paleta del consultorio: tinta #4A453E, taupe #9A8F82, crema #FAF7F2.
   Diseño pensado primero para el celular (la doctora la usa en la mano). */

:root {
  --tinta: #4A453E;
  --taupe: #9A8F82;
  --crema: #FAF7F2;
  --papel: #FFFFFF;
  --borde: #E7E1D8;
  --suave: #F2EDE5;
  --verde: #6F7D6A;
  --ladrillo: #B5654A;
  --sombra: 0 1px 2px rgba(74, 69, 62, .06), 0 4px 16px rgba(74, 69, 62, .06);
  --radio: 12px;
  --ancho: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--crema);
  color: var(--tinta);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--tinta); text-decoration-color: var(--taupe); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0 0 .4rem; line-height: 1.25; font-weight: 620; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 .6rem; }

.sutil { color: var(--taupe); font-size: .875rem; }
.vacio { color: var(--taupe); font-style: italic; margin: .3rem 0 0; }
.en-rojo { color: var(--ladrillo); }
.en-linea { display: inline; }

/* ---------- Barra superior ---------- */

.barra {
  background: var(--papel);
  border-bottom: 1px solid var(--borde);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.marca { display: flex; align-items: center; gap: .55rem; text-decoration: none; }
.monograma { width: 30px; height: 30px; }
.marca-texto { font-weight: 640; letter-spacing: -.01em; }

.menu {
  display: flex;
  gap: .15rem;
  order: 3;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }

.menu a {
  padding: .4rem .7rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--taupe);
  font-size: .92rem;
  white-space: nowrap;
}
.menu a:hover { background: var(--suave); color: var(--tinta); }
.menu a.activo { background: var(--tinta); color: var(--crema); }

.salir { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.quien { font-size: .85rem; color: var(--taupe); }

/* ---------- Estructura ---------- */

.contenido {
  width: 100%;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 1.1rem 1rem 2.5rem;
  flex: 1;
}

.encabezado {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1.1rem;
}
.acciones { display: flex; gap: .5rem; flex-wrap: wrap; }

.tarjeta {
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.tarjeta-mensaje { max-width: 34rem; margin: 3rem auto; text-align: center; }

.pie {
  text-align: center;
  padding: 1rem;
  font-size: .8rem;
  color: var(--taupe);
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Tarjetas de dato (dashboard) ---------- */

.tarjetas-dato {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}

.dato {
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: .8rem .9rem;
}
.dato-etiqueta { display: block; font-size: .78rem; color: var(--taupe); text-transform: uppercase; letter-spacing: .04em; }
.dato-valor { display: block; font-size: 1.45rem; margin-top: .15rem; font-weight: 640; }

/* ---------- Listas de citas ---------- */

.lista-citas { list-style: none; margin: .5rem 0 0; padding: 0; }

.fila-cita {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  padding: .65rem 0;
  border-top: 1px solid var(--borde);
}
.fila-cita:first-child { border-top: 0; }

.cita-hora { min-width: 7.5rem; display: flex; flex-direction: column; }
.cita-fecha { font-size: .78rem; color: var(--taupe); }
.cita-datos { display: flex; flex-direction: column; flex: 1; min-width: 9rem; }
.cita-paciente { font-weight: 560; text-decoration: none; }
.cita-paciente:hover { text-decoration: underline; }
.cita-acciones { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ---------- Etiquetas de estado ---------- */

.badge {
  font-size: .75rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-agendada   { background: var(--suave);  color: var(--tinta); border-color: var(--borde); }
.badge-confirmada { background: var(--tinta);  color: var(--crema); }
.badge-atendida   { background: var(--verde);  color: #fff; }
.badge-cancelada  { background: transparent;   color: var(--taupe); border-color: var(--borde); text-decoration: line-through; }
.badge-no_asistio { background: var(--ladrillo); color: #fff; }

.marca-ok { font-size: .75rem; color: var(--verde); }

/* ---------- Botones ---------- */

.boton, button.boton {
  display: inline-block;
  padding: .5rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--borde);
  background: var(--papel);
  color: var(--tinta);
  font: inherit;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
}
.boton:hover { background: var(--suave); }

.boton-principal { background: var(--tinta); color: var(--crema); border-color: var(--tinta); }
.boton-principal:hover { background: #3b372f; }

.boton-peligro { color: var(--ladrillo); border-color: #E4C9BF; }
.boton-peligro:hover { background: #FBF1ED; }

.boton-mini {
  font-size: .78rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--borde);
  background: var(--papel);
  color: var(--tinta);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.boton-mini:hover { background: var(--suave); }

.boton-texto {
  background: none;
  border: 0;
  color: var(--taupe);
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  padding: .2rem;
}

/* ---------- Formularios ---------- */

label { display: block; font-size: .85rem; color: var(--taupe); margin: .7rem 0 .2rem; }

input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=date], input[type=datetime-local], input[type=number], input[type=search],
select, textarea {
  width: 100%;
  padding: .58rem .7rem;
  border: 1px solid var(--borde);
  border-radius: 9px;
  background: var(--papel);
  color: var(--tinta);
  font: inherit;
  font-size: 1rem; /* 16px evita que iOS haga zoom al enfocar */
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--taupe);
  outline-offset: 1px;
  border-color: var(--taupe);
}

textarea { min-height: 5rem; resize: vertical; }

.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.campo-ancho { grid-column: 1 / -1; }

.casilla { display: flex; align-items: flex-start; gap: .5rem; margin: .8rem 0; }
.casilla input { width: auto; margin-top: .25rem; }
.casilla label { margin: 0; color: var(--tinta); font-size: .95rem; }

.pie-form { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; align-items: center; }

.alerta {
  background: #FBF1ED;
  border: 1px solid #E4C9BF;
  color: #8C4630;
  padding: .6rem .8rem;
  border-radius: 9px;
  font-size: .9rem;
}

.aviso {
  background: var(--suave);
  border: 1px solid var(--borde);
  padding: .6rem .8rem;
  border-radius: 9px;
  font-size: .88rem;
}

/* ---------- Login ---------- */

.pantalla-login { display: flex; justify-content: center; padding: 2.5rem 0; }

.tarjeta-login {
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: 16px;
  box-shadow: var(--sombra);
  padding: 2rem 1.6rem;
  width: min(24rem, 100%);
  text-align: center;
}
.tarjeta-login form { text-align: left; }
.tarjeta-login .boton { width: 100%; margin-top: 1.2rem; }
.monograma-grande { width: 58px; height: 58px; margin-bottom: .6rem; }
.nota-legal { font-size: .75rem; color: var(--taupe); margin-top: 1.2rem; }

/* ---------- Tablas ---------- */

.tabla-envoltura { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--borde); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--taupe); font-weight: 600; }
tbody tr:hover { background: var(--crema); }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ---------- Ficha del paciente ---------- */

.ficha-cabecera { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.datos-linea { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; color: var(--taupe); font-size: .9rem; }

.reservado {
  border-left: 3px solid var(--ladrillo);
  background: #FDF7F4;
  padding: .6rem .8rem;
  border-radius: 0 9px 9px 0;
}
.reservado h3 { font-size: .95rem; margin-bottom: .3rem; }

.linea-tiempo { list-style: none; margin: .6rem 0 0; padding: 0; }
.linea-tiempo > li { border-top: 1px solid var(--borde); padding: .8rem 0; }
.linea-tiempo > li:first-child { border-top: 0; }
.consulta-fecha { font-weight: 600; }
.consulta-campo { margin: .35rem 0 0; }
.consulta-campo strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--taupe); display: block; }

/* ---------- Calendario ---------- */

#calendario { --fc-border-color: var(--borde); --fc-today-bg-color: var(--suave); }
.fc .fc-toolbar-title { font-size: 1.05rem; }
.fc .fc-button {
  background: var(--papel);
  border-color: var(--borde);
  color: var(--tinta);
  text-transform: none;
  box-shadow: none;
}
.fc .fc-button:hover { background: var(--suave); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { background: var(--tinta); border-color: var(--tinta); color: var(--crema); }
.fc-event { cursor: pointer; border: none; }
.fc .fc-toolbar { flex-wrap: wrap; gap: .5rem; }

@media (max-width: 640px) {
  .fc .fc-toolbar { justify-content: center; }
  h1 { font-size: 1.3rem; }
  .contenido { padding: .9rem .8rem 2.5rem; }
}

/* ---------- Impresión ---------- */

@media print {
  .barra, .pie, .acciones, .cita-acciones { display: none; }
  body { background: #fff; }
  .tarjeta { box-shadow: none; border-color: #ccc; }
}
