/* El espacio de la clínica.
   Paleta y tipografía de las maquetas, sin cambiar nada: verde bosque para lo
   principal, ámbar para los avisos, teja para lo urgente, tinta sobre crema.
   Sobrio y tranquilo — lo mira una recepcionista con prisa, no un analista. */

:root {
  --crema:  #FBF8F3;
  --papel:  #FFFDF9;
  --panel:  #F5F1E9;
  --tinta:  #12262B;
  --gris:   #6B7C82;
  --suave:  #8E9BA0;
  --filete: #E2DAD0;
  --borde:  #C9C0B4;

  --verde:  #2E6B52;
  --ambar:  #C9922E;
  --teja:   #B4573A;
  --azul:   #33627F;      /* llamar */
  --ciruela:#6A4E79;      /* contestar */

  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans:  "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--crema);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--verde); text-decoration: none; }
a:hover { color: #1F4C3A; text-decoration: underline; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.15;
}
h2 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 500; }

/* --- la barra de arriba ------------------------------------------------- */

.barra {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 40px 11px; border-bottom: 1px solid var(--filete);
}
.marca { font-family: var(--serif); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.menu { display: flex; gap: 26px; font-size: 15px; align-items: baseline; }
.menu a { color: var(--gris); }
.menu .aqui {
  font-weight: 600; color: var(--tinta);
  border-bottom: 2px solid var(--verde); padding-bottom: 3px;
}
.quien { color: var(--suave); font-size: 14px; }

.hoja { padding: 28px 40px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1500px; }
/* El planning se lleva todo el ancho: cuantas más columnas quepan, mejor. */
.hoja.ancha { max-width: none; }

.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.cuenta { text-align: right; white-space: nowrap; }
.cuenta .cifra { font-family: var(--serif); font-size: 32px; font-weight: 500; color: var(--verde); line-height: 1; }
.cuenta .pie { font-size: 14px; color: var(--gris); padding-top: 3px; }
.entradilla { font-size: 15px; color: var(--gris); line-height: 1.55; max-width: 78ch; }
.entradilla strong, .nota strong { color: var(--tinta); font-weight: 600; }

/* --- leyendas ----------------------------------------------------------- */

.leyenda {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  padding: 12px 16px; background: var(--panel);
  border: 1px solid var(--filete); border-radius: 3px;
}
.leyenda span, .leyc span { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gris); }
.leyc { display: flex; flex-wrap: wrap; gap: 7px 24px; }
.taco { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }
.taco.urgente { box-shadow: inset 0 0 0 2px var(--crema), 0 0 0 1px var(--teja); }

/* --- las tareas --------------------------------------------------------- */

.tarea { display: flex; gap: 20px; padding: 12px 0; border-top: 1px solid var(--filete); align-items: flex-start; }
.tarea.hecha { opacity: .42; }
.tarea.hecha .titulo { text-decoration: line-through; }
.reloj { width: 88px; flex-shrink: 0; text-align: right; padding-top: 1px; }
.reloj .dia  { font-size: 14.5px; color: var(--gris); }
.reloj .hora { font-size: 17px; font-variant-numeric: tabular-nums; }
.cuerpo { flex-grow: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 92ch; }
.clase { display: flex; align-items: center; gap: 8px; }
.clase span:last-child {
  font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
}
.titulo { font-size: 17px; font-weight: 600; line-height: 1.3; }
.dato { font-size: 15.5px; font-variant-numeric: tabular-nums; }
.nota { font-size: 14px; color: var(--gris); line-height: 1.45; max-width: 80ch; }
.tel { display: flex; align-items: center; gap: 7px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.sola { font-size: 13px; color: var(--verde); font-style: italic; }

/* --- botones ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px;
  border: 1px solid var(--borde); border-radius: 3px; background: transparent;
  color: var(--tinta); font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--verde); color: var(--verde); }
.btn.lleno { background: var(--verde); border-color: var(--verde); color: var(--crema); }
.btn.lleno:hover { background: #26583F; color: var(--crema); }
.btn.grande { height: 48px; width: 100%; justify-content: center; font-size: 16px; }

.acc {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 1px solid transparent; border-radius: 3px;
  background: transparent; color: var(--suave); cursor: pointer; padding: 0;
  font-family: var(--sans); font-size: 13px;
}
.acc:hover { border-color: var(--filete); color: var(--verde); background: var(--papel); }
.acc.quitar:hover { color: var(--teja); }
.acc.primero:hover { color: var(--ambar); }

/* --- tablas ------------------------------------------------------------- */

.tabla { width: 100%; border-collapse: collapse; }
.tabla th {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gris); text-align: left; padding: 0 8px 9px 0; border-bottom: 1px solid var(--borde);
}
.tabla td { padding: 11px 8px 11px 0; border-bottom: 1px solid var(--filete); font-size: 15px; vertical-align: middle; }
.tabla tr.ofrecido { background: rgba(201,146,46,.10); }
.tabla tr.citado td { opacity: .42; }
.tabla tr.citado .nom { text-decoration: line-through; }
.nom { font-size: 15.5px; font-weight: 600; }
.sub { font-size: 13px; color: var(--gris); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

.pastilla {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  background: #EFEAE0; color: var(--gris);
}
.pastilla.ofrecido { background: var(--ambar); color: var(--crema); }
.pastilla.citado   { background: var(--verde); color: var(--crema); }

/* --- formularios -------------------------------------------------------- */

.campo, input[type=text], input[type=password], input[type=tel], select {
  font-family: var(--sans); font-size: 14.5px; color: var(--tinta);
  background: var(--papel); border: 1px solid var(--filete); border-radius: 3px;
  height: 34px; padding: 0 8px; width: 100%;
}
.campo:focus, input:focus, select:focus {
  outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(46,107,82,.10);
}
label.rotulo {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gris);
}
.alta { background: var(--panel); border: 1px solid var(--filete); border-radius: 3px; padding: 18px 20px; }
.rejilla-disp { display: grid; grid-template-columns: 62px repeat(5, 52px); gap: 5px; align-items: center; }
.franja {
  height: 30px; border: 1px solid var(--filete); border-radius: 3px;
  background: var(--papel); font-family: var(--sans); font-size: 13px; font-weight: 600; cursor: pointer;
}
.franja[aria-pressed=true] { background: var(--verde); border-color: var(--verde); color: var(--crema); }
.franja:hover { border-color: var(--verde); }

/* --- entrar ------------------------------------------------------------- */

.entrar { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px; }
.entrar .caja { width: 372px; display: flex; flex-direction: column; gap: 34px; }
.entrar input { height: 46px; font-size: 16px; padding: 0 14px; }
.error {
  font-size: 14.5px; color: var(--teja); background: rgba(180,87,58,.10);
  border: 1px solid rgba(180,87,58,.3); border-radius: 3px; padding: 10px 12px;
}

/* --- el planning -------------------------------------------------------- */

.pestanas { display: flex; gap: 7px; }
.pestana {
  height: 38px; padding: 0 18px; border: 1px solid var(--borde); border-radius: 3px;
  background: transparent; color: var(--tinta); font-family: var(--sans);
  font-size: 15px; font-weight: 600; cursor: pointer; position: relative;
}
.pestana.aqui { background: var(--verde); border-color: var(--verde); color: var(--crema); }
.pestana .punto { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ambar); }

.parrilla { display: grid; gap: 2px; align-items: stretch; }
.parrilla .cab { font-size: 12.5px; font-weight: 600; padding: 0 3px 4px;
                 border-bottom: 1px solid var(--borde); align-self: end; }
.parrilla .hh { font-size: 10.5px; color: var(--suave); text-align: right;
                padding-right: 5px; font-variant-numeric: tabular-nums; line-height: 13px; }
.parrilla .hh.tras-corte { border-top: 1px dashed var(--borde); }

.rej { display: grid; gap: 3px; }
.rej .cab { font-size: 13.5px; font-weight: 600; padding: 0 4px 5px; border-bottom: 1px solid var(--borde); }
.rej .hh { font-size: 11.5px; color: var(--suave); text-align: right; padding: 6px 6px 0 0; font-variant-numeric: tabular-nums; }
.cel {
  padding: 2px 5px; border-radius: 2px; border-left: 3px solid var(--filete);
  font-size: 12px; overflow: hidden; line-height: 1.25; min-width: 0;
}
.cel .txt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cel.reserva { background: #EFEAE0; border-left-color: var(--suave); color: var(--gris); font-style: italic; }

/* Tachar desde la propia agenda: la celda ES el botón. */
.cel .entarea, .cel .entarea button {
  all: unset; display: block; width: 100%;
  cursor: pointer; font-family: var(--sans); font-size: 12px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cel .entarea button:hover { text-decoration: underline; }
.cel .entarea .tic { font-weight: 700; margin-right: 4px; }
/* Ojo: `.marca` ya era el nombre de la clínica en la barra de arriba. */
.cel .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cel .etq { margin-top: 3px; font-size: 10px; font-weight: 600; color: #A8752A; line-height: 1.3; white-space: normal; }
.cel.ocupada  { background: #F3EFE7; border-left-color: #D9D0C4; }
.cel.libre    { background: transparent; border-left-color: #EDE7DD; color: #B3BCC0; font-style: italic; }
.cel.fuera    { background: #F7F4EE; border-left-color: #F0EBE3; }
.cel.ofrecido { background: rgba(201,146,46,.20); border-left-color: var(--ambar); color: #8A6520; font-weight: 600; }
.cel.sincubrir{ background: rgba(180,87,58,.18); border-left-color: var(--teja); color: #8C4029; font-weight: 600; }
.cel.nueva    { background: rgba(46,107,82,.16); border-left-color: var(--verde); color: #1F4C3A; font-weight: 600; }

@keyframes parp { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
.parpadea { animation: parp 1.6s ease-in-out infinite; }

.corte { display: flex; align-items: center; gap: 12px; padding: 9px 0 6px; }
.corte .linea { height: 1px; background: var(--filete); }
.corte .txt { font-size: 12px; color: var(--suave); font-style: italic; white-space: nowrap; }

.cierre { border-top: 1px solid var(--filete); padding-top: 16px; font-size: 14.5px; color: var(--gris); line-height: 1.55; max-width: 82ch; }

/* --- el papel ----------------------------------------------------------- */

.papel { border-top: 1px dashed var(--borde); padding-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.papel .rot { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); }
.pcols { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 16px; }
.pcol h4 {
  margin: 0 0 7px; font-size: 12px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; padding-bottom: 5px; border-bottom: 1px solid var(--borde);
}
.pcol.cualquiera h4 { color: var(--verde); border-bottom-color: var(--verde); }
.pnom { padding: 4px 0; border-bottom: 1px dotted #D9D0C4; font-size: 14px; }
.pnom small { display: block; font-size: 11.5px; color: var(--suave); }
.pnom.ofrecido { color: var(--ambar); font-weight: 600; }
.pnom.citado { opacity: .4; text-decoration: line-through; }
.pvacio { font-size: 12.5px; color: #A9B4B7; font-style: italic; padding: 4px 0; }

/* El ancla al volver de un botón: que no quede pegada al borde de arriba. */
.tarea[id], .tabla tr[id] { scroll-margin-top: 90px; }
html { scroll-behavior: auto; }

/* Dos tareas en la misma casilla —quitar a uno, meter a otro— van una debajo
   de la otra. Antes se pintaba un nombre encima del otro y no se leía nada. */
.cel .entarea + .entarea { border-top: 1px solid rgba(18,38,43,.15); margin-top: 1px; padding-top: 1px; }
.cel .entarea button.quitar, .cel .entarea button.libre { color: #8C4029; }
.cel .entarea button.meter, .cel .entarea button.confirmar { color: #1F4C3A; }
.cel .entarea button.ya { opacity: .5; text-decoration: line-through; }
