:root {
  --teal: #13b9a0;
  --teal-oscuro: #0e9480;
  --tinta: #0f172a;
  --muted: #64748b;
  --linea: #e1e7ec;
  --fondo: #f5f7fb;
  --coral: #ffa27a;
  --rosa: #f576ab;
  --azul: #5ac2f2;
  --peligro: #c31411;
  --sombra: 0 0 15px 2px rgba(0, 0, 0, 0.05);
  color-scheme: light;
  font-family: Poppins, "Segoe UI", sans-serif;
  color: var(--tinta);
  background: var(--fondo);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.45; }
a { color: var(--teal-oscuro); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; font-size: 16px; }
.saltar { position: absolute; left: -999px; }
.saltar:focus { left: 12px; top: 12px; background: #fff; padding: 8px; z-index: 30; }
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background: #fff; border-right: 1px solid #eef2f6;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
.marca { display: flex; align-items: center; gap: 10px; color: var(--tinta); font-weight: 600; font-size: 20px; padding: 4px 10px 16px; text-decoration: none; }
.marca:hover { text-decoration: none; }
.nav {
  display: flex; align-items: center; gap: 10px; color: var(--muted);
  padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 500;
}
.nav:hover { background: #f4f7fb; text-decoration: none; color: var(--tinta); }
.nav.activo { background: var(--teal); color: #fff; }
.icono { width: 18px; height: 18px; flex: 0 0 auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.salir-form { margin-top: auto; }
.salir { width: 100%; background: transparent; border: 0; color: var(--muted); text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.salir:hover { background: #f4f7fb; color: var(--tinta); }
.contenido { flex: 1; min-width: 0; }
.barra { min-height: 80px; display: flex; align-items: center; gap: 16px; padding: 12px 28px; }
.barra h1 { margin: 0; font-size: 22px; font-weight: 500; }
.usuario { margin-left: auto; text-align: right; }
.usuario strong { display: block; font-weight: 500; }
.usuario span, .ayuda, .vacio, small { color: var(--muted); }
main { padding: 0 28px 40px; }
.hamburguesa, .cortina { display: none; }
.aviso { background: #e8fdfa; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.kpis, .rejilla-panel, .dos { display: grid; gap: 16px; margin-bottom: 16px; }
.kpis { grid-template-columns: repeat(3, 1fr); }
.rejilla-panel, .dos { grid-template-columns: 1.3fr 0.9fr; }
.kpi, .tarjeta, .tarjeta-auth {
  background: #fff; border-radius: 16px; box-shadow: var(--sombra); padding: 18px;
}
.kpi { display: flex; flex-direction: column; gap: 4px; min-height: 118px; }
.kpi strong { font-size: 22px; font-weight: 500; }
.tarjeta h2, .tarjeta h3 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.tarjeta h2 small { font-weight: 400; color: var(--muted); margin-left: 8px; }
.barra-dato { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 14px; }
.pista { height: 10px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.relleno { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.relleno.coral { background: var(--coral); }
.dona-fila { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; }
.dona {
  width: 132px; height: 132px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--rosa) 0 calc(var(--mujeres) * 1%), var(--azul) 0 calc((var(--mujeres) + var(--hombres)) * 1%), #cbd5e1 0);
  -webkit-mask: radial-gradient(circle 42px at center, transparent 41px, #000 42px);
  mask: radial-gradient(circle 42px at center, transparent 41px, #000 42px);
}
.leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.punto.rosa { background: var(--rosa); }
.punto.azul { background: var(--azul); }
.punto.gris { background: #cbd5e1; }
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lista li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--linea); padding-bottom: 10px; }
.lista span, .lista em { color: var(--muted); font-style: normal; }
.boton, .boton.secundario, .boton.peligro, .boton.chico {
  border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center;
}
.boton { background: var(--teal); color: #fff; }
.boton:hover { background: var(--teal-oscuro); }
.boton.secundario { background: #fff; color: var(--tinta); border: 1px solid var(--linea); }
.boton.peligro { background: #fff; color: var(--peligro); border: 1px solid #f3c7c6; }
.boton.chico { padding: 6px 10px; font-size: 14px; }
a.boton { text-decoration: none; }
.herramientas, .en-linea, .totales { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.formulario, .formulario.compacto { display: grid; gap: 12px; }
.formulario.compacto { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--linea); border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--tinta);
}
textarea { resize: vertical; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.tabla-wrap { overflow-x: auto; }
.estado { font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 999px; background: #f3f4f6; color: var(--muted); }
.estado.confirmada, .estado.aprobado, .estado.en_curso { background: #e8fdfa; color: var(--teal-oscuro); }
.estado.atendida, .estado.cerrado { background: #e5f8ea; color: #157a32; }
.estado.cancelada, .estado.inasistencia, .estado.rechazado, .estado.morosidad { background: #fdecec; color: var(--peligro); }
.estado.control { background: #e8f6fd; color: #0b6f92; }
.arcos { overflow-x: auto; display: grid; gap: 8px; margin-bottom: 12px; }
.arco { display: grid; grid-template-columns: repeat(16, minmax(36px, 1fr)); gap: 6px; min-width: 640px; }
.diente {
  aspect-ratio: 1; border-radius: 10px 10px 16px 16px; border: 1px solid var(--linea);
  background: #fff; cursor: pointer; font-size: 11px; color: var(--tinta);
}
.diente.caries { background: #fdecec; border-color: #ef4643; }
.diente.obturacion { background: #e8f6fd; border-color: var(--azul); }
.diente.corona { background: #fff8df; border-color: #ffc401; }
.diente.ausencia { background: #eef2f6; color: #94a3b8; }
.diente.endodoncia { background: #f7f0fa; border-color: #bb8cc5; }
.diente.implante { background: #e8fdfa; border-color: var(--teal); }
.diente.seleccionado { outline: 2px solid var(--tinta); }
.nota { border-top: 1px solid var(--linea); padding-top: 8px; margin-top: 8px; }
.nota header { color: var(--muted); font-size: 13px; }
.resumen p { margin-top: 0; }
tr.bajo { background: #fff6f0; }
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.tarjeta-auth { width: min(440px, 100%); }
.tarjeta-auth.ancha { width: min(560px, 100%); }
.tarjeta-auth h1 { margin: 12px 0 4px; font-size: 28px; font-weight: 600; }
.tarjeta-auth > p { margin-top: 0; color: var(--muted); }
@media (max-width: 980px) {
  .kpis, .rejilla-panel, .dos { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.abierto { transform: none; box-shadow: 0 0 24px rgba(15, 23, 42, .12); }
  .sidebar.abierto + .cortina { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); border: 0; z-index: 15; }
  .hamburguesa { display: inline-flex; border: 0; background: #fff; border-radius: 10px; width: 40px; height: 40px; cursor: pointer; }
  .barra, main { padding-left: 16px; padding-right: 16px; }
  .usuario span { display: none; }
  .barra-dato { grid-template-columns: 1fr auto; }
  .pista { display: none; }
}
