/* =====================================================================
   AVIDENTIX — Refresh visual v7 (minimalista)
   Se carga DESPUÉS de avidentix.css y solo redefine colores y estilos.
   Para volver al diseño anterior basta quitar el <link> de este archivo.
   ===================================================================== */
:root {
  --rd-ink:      #1F3347;
  --rd-ink-soft: #66788B;
  --rd-cream:    #F4F8FB;
  --rd-line:     #DCE6EE;
  /* Azules: se conservan EXACTAMENTE los de la versión anterior (avidentix.css) */
  --rd-teal: #1E9C8E;
  --rd-radius: 12px;
  --rd-shadow: none;
}

body { font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }
/* Títulos grandes: serif de contraste suave (Fraunces). Rótulos y títulos pequeños: Instrument Sans. */
h1, h2, h3, .rd-heading { font-family: 'Google Sans', sans-serif; font-weight: 500; letter-spacing: -0.015em;  }
h4, h5, h6 { font-family: 'Google Sans', sans-serif; font-weight: 600; letter-spacing: -0.01em; }
h4.rd-heading, h5.rd-heading, h6.rd-heading { font-family: 'Google Sans', sans-serif; font-weight: 600; }
.av-title, .av-stat-value, .av-caja-total, .av-login-inner h2, .av-login-brand h1 { font-family: 'Google Sans', sans-serif; font-weight: 500;  }
.av-panel-title, .av-sa-nombre, .av-cita-hora { font-family: 'Google Sans', sans-serif; font-weight: 600; }

/* Barra superior y navegación: se conservan los azules de antes (sin cambios) */
.rd-content { padding: 2rem 2.25rem; max-width: 1440px; width: 100%; margin: 0 auto; }

/* Rótulo de sección que imprime head.php sobre cada página */
.rd-content > div.text-uppercase.small.fw-semibold { color: var(--rd-ink-soft) !important; letter-spacing: .12em !important; font-size: .72rem !important; margin-bottom: .6rem !important; }

/* --- Superficies --- */
.rd-card { border: 1px solid var(--rd-line); box-shadow: none; border-radius: var(--rd-radius); }
.rd-stat-card { border-left: 1px solid var(--rd-line); }
.btn-outline-secondary { --bs-btn-color: var(--rd-ink); --bs-btn-border-color: var(--rd-line); --bs-btn-hover-bg: var(--rd-cream); --bs-btn-hover-color: var(--rd-ink); --bs-btn-hover-border-color: #cfd8e1; --bs-btn-active-bg: var(--rd-cream); --bs-btn-active-color: var(--rd-ink); border-radius: 9px; }
.btn-outline-primary { --bs-btn-color: var(--rd-header-blue); --bs-btn-border-color: #bcd1e3; --bs-btn-hover-bg: var(--rd-header-blue); --bs-btn-hover-border-color: var(--rd-header-blue); --bs-btn-active-bg: var(--rd-header-blue); border-radius: 9px; }
.form-control, .form-select { border-color: var(--rd-line); border-radius: 9px; }
.form-control:focus, .form-select:focus { border-color: var(--rd-header-blue); box-shadow: 0 0 0 3px rgba(59,102,214,.12); }
.table > :not(caption) > * > * { border-bottom-color: var(--rd-line); }

/* =====================================================================
   PANEL PRINCIPAL
   ===================================================================== */
.av-page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.av-eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rd-ink-soft); font-weight: 600; margin-bottom: .35rem; }
.av-title { font-family: 'Google Sans', sans-serif; font-size: 2.15rem; line-height: 1.1; font-weight: 500; color: var(--rd-ink); margin: 0; letter-spacing: -0.02em; }
.av-sub { color: var(--rd-ink-soft); margin: .4rem 0 0; font-size: .95rem; }
.av-actions { display: flex; gap: .5rem; }

/* Cifras: una sola banda con divisores, sin cajas ni íconos de colores */
.av-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); background: #fff; border: 1px solid var(--rd-line); border-radius: var(--rd-radius); margin-bottom: 1.5rem; overflow: hidden; }
.av-stat { padding: 1.25rem 1.5rem; border-left: 1px solid var(--rd-line); position: relative; }
.av-stat:first-child { border-left: none; }
.av-stat-label { font-size: .78rem; color: var(--rd-ink-soft); display: flex; align-items: center; gap: .4rem; font-weight: 500; }
.av-stat-label i { font-size: .95rem; opacity: .8; }
.av-stat-value { font-family: 'Google Sans', sans-serif; font-size: 2.1rem; font-weight: 500; line-height: 1.15; margin-top: .35rem; letter-spacing: -0.02em; color: var(--rd-ink); }
.av-stat-value.money { font-size: 1.75rem; }
.av-stat-note { font-size: .76rem; color: var(--rd-ink-soft); margin-top: .15rem; min-height: 1.1em; }
.av-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #C98A1B; margin-right: .3rem; vertical-align: middle; }
.av-dot.ok { background: var(--rd-teal); }
.av-dot.off { background: #B5C0CB; }

.av-panel { background: #fff; border: 1px solid var(--rd-line); border-radius: var(--rd-radius); padding: 1.35rem 1.5rem; height: 100%; }
.av-panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; gap: .5rem; }
.av-panel-title { font-family: 'Google Sans', sans-serif; font-size: 1.02rem; font-weight: 600; margin: 0; color: var(--rd-ink); letter-spacing: -0.015em; }
.av-link { font-size: .82rem; color: var(--rd-header-blue); text-decoration: none; font-weight: 500; }
.av-link:hover { text-decoration: underline; }
.av-empty { color: var(--rd-ink-soft); font-size: .9rem; margin: 0; padding: .5rem 0; }

/* Agenda de hoy: línea de tiempo */
.av-agenda { display: flex; flex-direction: column; }
.av-cita { display: grid; grid-template-columns: 56px 1fr auto; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--rd-line); align-items: start; }
.av-cita:first-child { border-top: none; padding-top: .25rem; }
.av-cita-hora { font-family: 'Google Sans', sans-serif; font-weight: 600; font-size: 1.05rem; line-height: 1.1; color: var(--rd-ink); }
.av-cita-hora small { display: block; font-family: 'Google Sans', sans-serif; font-weight: 400; font-size: .72rem; color: var(--rd-ink-soft); margin-top: .2rem; }
.av-cita-paciente { font-weight: 600; color: var(--rd-ink); text-decoration: none; display: block; }
.av-cita-paciente:hover { color: var(--rd-header-blue); }
.av-cita-meta { font-size: .82rem; color: var(--rd-ink-soft); margin-top: .1rem; }
.av-estado { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 500; padding: .22rem .6rem; border-radius: 999px; background: var(--rd-cream); color: var(--rd-ink); border: 1px solid var(--rd-line); white-space: nowrap; }
.av-estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #8FB4D3); }
.av-reprog { color: #C98A1B; font-size: 1.05rem; margin-left: .4rem; }

.av-vacio { text-align: center; padding: 2.5rem 1rem; }
.av-vacio i { font-size: 1.8rem; color: #A9BBCB; }
.av-vacio p { color: var(--rd-ink-soft); margin: .5rem 0 1rem; }

/* Caja + controles */
.av-caja-total { font-family: 'Google Sans', sans-serif; font-size: 1.8rem; font-weight: 500; letter-spacing: -0.02em; }
.av-control { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .65rem 0; border-top: 1px solid var(--rd-line); text-decoration: none; color: inherit; }
.av-control:first-of-type { border-top: none; }
.av-control:hover .av-control-n { color: var(--rd-header-blue); }
.av-control-n { font-size: .88rem; font-weight: 600; color: var(--rd-ink); }
.av-chip { font-size: .72rem; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--rd-line); color: var(--rd-ink-soft); white-space: nowrap; }
.av-chip.late { background: #FDF0EF; border-color: #F3C9C5; color: #A63A32; }

/* Gráficos */
.av-bars { display: flex; align-items: flex-end; gap: .6rem; height: 140px; }
.av-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.av-bar-fill { width: 100%; max-width: 44px; background: var(--rd-header-blue); border-radius: 5px 5px 0 0; min-height: 3px; opacity: .92; }
.av-bar-fill.zero { background: var(--rd-line); }
.av-bar-lbl { font-size: .68rem; color: var(--rd-ink-soft); margin-top: .4rem; }
.av-rank { margin-bottom: .85rem; }
.av-rank-row { display: flex; justify-content: space-between; font-size: .86rem; margin-bottom: .35rem; }
.av-rank-row span:last-child { color: var(--rd-ink-soft); font-variant-numeric: tabular-nums; }
.av-rank-bar { height: 4px; background: var(--rd-blush-100); border-radius: 999px; }
.av-rank-bar div { height: 100%; background: var(--rd-header-blue); border-radius: 999px; }

/* =====================================================================
   SUPERADMIN
   ===================================================================== */
.av-sa-tabla { width: 100%; }
.av-sa-tabla th { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--rd-ink-soft); font-weight: 600; border-bottom: 1px solid var(--rd-line); padding: .6rem; white-space: nowrap; }
.av-sa-tabla td { padding: 1rem .6rem; vertical-align: top; border-bottom: 1px solid var(--rd-line); font-size: .9rem; }
.av-sa-tabla tr:last-child td { border-bottom: none; }
.av-sa-tabla tr.sucursal td { background: #FBFCFD; }
.av-sa-nombre { font-family: 'Google Sans', sans-serif; font-weight: 600; font-size: 1.02rem; color: var(--rd-ink); letter-spacing: -0.015em; }
.av-sa-meta { font-size: .78rem; color: var(--rd-ink-soft); }
.av-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 500; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--rd-line); background: #fff; color: var(--rd-ink); }
.av-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #B5C0CB); }
.av-badge.activa { --c: var(--rd-teal); }
.av-badge.suspendida { --c: #C4473E; }
.av-badge.de_prueba { --c: #C98A1B; }
.av-logo-mini { width: 40px; height: 40px; border: 1px dashed #C5D2DE; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--rd-ink-soft); overflow: hidden; background: #fff; cursor: pointer; }
.av-logo-mini img { max-width: 100%; max-height: 100%; object-fit: contain; }
.av-menu-btn { border: 1px solid var(--rd-line); background: #fff; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--rd-ink-soft); }
.av-menu-btn:hover { background: var(--rd-cream); color: var(--rd-ink); }
.av-dd { border: 1px solid var(--rd-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,40,60,.12); padding: .35rem; min-width: 220px; }
.av-dd .dropdown-item, .av-dd button.dropdown-item { border-radius: 8px; font-size: .86rem; padding: .5rem .7rem; display: flex; align-items: center; gap: .55rem; color: var(--rd-ink); }
.av-dd .dropdown-item:hover { background: var(--rd-cream); }
.av-dd .dropdown-item.peligro { color: #B13A32; }
.av-dd .dropdown-item.peligro:hover { background: #FDF0EF; }
.av-dd hr { margin: .3rem 0; border-color: var(--rd-line); opacity: 1; }
.av-form-sa label.form-label { font-size: .8rem; font-weight: 600; color: var(--rd-ink); }

/* =====================================================================
   LOGIN
   ===================================================================== */
.av-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.av-login-brand { position: relative; overflow: hidden; background: #3B66D6; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 3rem 3.5rem; isolation: isolate; }
.av-login-brand::before { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(155deg, #3B66D6 0%, #2E51B0 100%); }
.av-login-tooth { position: absolute; left: 50%; top: 50%; width: min(76%, 450px); transform: translate(-50%, -58%); z-index: -1; }
.av-login-tag { margin-bottom: 1rem; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 600; }
.av-login-brand h1 { font-family: 'Google Sans', sans-serif; font-size: clamp(2.1rem, 3.4vw, 3.1rem); line-height: 1.08; font-weight: 500; letter-spacing: -0.02em; color: #fff; max-width: 13ch; margin: 0 0 1.1rem; }
.av-login-brand p { color: rgba(255,255,255,.72); max-width: 36ch; font-size: 1rem; line-height: 1.55; margin: 0; }
.av-login-list { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; gap: 1.75rem; flex-wrap: wrap; font-size: .84rem; color: rgba(255,255,255,.8); }
.av-login-list li { display: flex; align-items: center; gap: .5rem; }
.av-login-list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff; opacity:.8; }
.av-login-form { display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem 3.5rem 1.5rem; min-height: 100vh; }
.av-login-inner { width: 100%; max-width: 380px; margin: auto; padding: 2rem 0; }
.av-login-inner h2 { font-family: 'Google Sans', sans-serif; font-size: 2.1rem; letter-spacing: -0.02em; margin: 1.6rem 0 .4rem; font-weight: 500; line-height: 1.12; color: var(--rd-ink); }
.av-login-inner .sub { color: var(--rd-ink-soft); margin-bottom: 1.8rem; font-size: .95rem; }
.av-login-inner .form-label { font-size: .8rem; font-weight: 600; color: var(--rd-ink); margin-bottom: .35rem; }
.av-login-inner .form-control { padding: .7rem .9rem; border-radius: 10px; background: #fff; }
.av-login-inner .btn-rd-primary { padding: .78rem 1rem; border-radius: 10px; font-weight: 600; }
.av-login-foot { font-size: .78rem; color: var(--rd-ink-soft); }
@media (max-width: 991.98px) {
  .av-login { grid-template-columns: 1fr; }
  .av-login-brand { padding: 1.5rem 1.5rem 1.75rem; min-height: 0; gap: 1rem; justify-content: flex-start; }
  .av-login-tag { margin-bottom: 0; line-height: 1.4; }
  .av-login-brand h1 { font-size: 1.65rem; line-height: 1.15; max-width: none; margin: 0; }
  .av-login-brand p, .av-login-list, .av-login-tooth { display: none; }
  .av-login-form { padding: 1.5rem; min-height: 0; }
}
@media (max-width: 767.98px) {
  .rd-content { padding: 1.1rem; }
  .av-title { font-size: 1.55rem; }
  .av-stat { padding: 1rem 1.1rem; }
  .av-stats { grid-template-columns: repeat(2, 1fr); }
  .av-stat:nth-child(3) { border-left: none; }
  .av-stat:nth-child(n+3) { border-top: 1px solid var(--rd-line); }
}

/* =====================================================================
   Otros paneles (Mis clínicas, Reportes, CRM, Salud) + botón azul de la app
   ===================================================================== */
.btn-av-azul { background: var(--rd-header-blue); border-color: var(--rd-header-blue); color: #fff; font-weight: 500; border-radius: 9px; padding: .65rem 1.4rem; }
.btn-av-azul.btn-sm { padding: .3rem .8rem; }
.btn-av-azul:hover, .btn-av-azul:focus { background: var(--rd-header-blue-dark); border-color: var(--rd-header-blue-dark); color: #fff; }
.btn-av-azul:disabled { opacity: .55; }
.av-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; padding: 1rem 0 1.25rem; margin: .5rem 0; border-top: 1px solid var(--rd-line); }
.av-mini-v { font-family: 'Google Sans', sans-serif; font-size: 1.45rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; color: var(--rd-ink); }
.av-mini-l { font-size: .76rem; color: var(--rd-ink-soft); margin-top: .1rem; }
.av-fila { border-top: 1px solid var(--rd-line); }
.av-fila:first-of-type { border-top: none; }
a.av-stat { color: inherit; transition: background .12s; }
a.av-stat:hover { background: var(--rd-cream); color: inherit; }
.av-stats + .av-stats { margin-top: -.25rem; }
.av-panel.h-auto { height: auto; }

/* CRM: grupos y banner con el mismo lenguaje */
.crm-grupo { padding: 0 !important; }
.crm-grupo-h { background: #fff; padding: 1rem 1.25rem; font-size: .72rem; letter-spacing: .1em; }
.crm-item { padding: .85rem 1.25rem; }
.crm-item-ic { border-radius: 9px; }
.crm-banner { background: #F2F6FF; border: 1px solid #D5E0F7; border-radius: var(--rd-radius); }
.crm-banner > i { color: var(--rd-header-blue); }
.crm-banner .crm-banner-n { color: var(--rd-ink); font-size: 1.15rem; font-weight: 600; }
.crm-pill { background: var(--rd-header-blue); }

/* =====================================================================
   Header en celular: logo de AVIDENTIX + logo de la clínica, bien ajustados
   ===================================================================== */
.rd-nav-clinica-movil { display: none; }
@media (max-width: 991.98px) {
  .rd-header { padding: 0 .75rem; gap: .5rem; }
  .rd-header .rd-brand-name { flex: 0 0 auto; }
  .rd-logo-header-avidentix { height: 30px; max-height: 30px; width: auto; min-width: 100px; display: block; }
  .rd-header-derecha { gap: .5rem; min-width: 0; }
  .rd-header-derecha .rd-header-clinica { display: inline-flex !important; align-items: center; gap: .4rem; padding: .25rem .5rem; max-width: 150px; font-size: .78rem; }
  .rd-header-clinica-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rd-header-derecha .rd-header-clinica:has(.rd-header-clinica-logo) { background: #fff; color: var(--rd-ink); padding: .2rem .45rem; }
  .rd-header-derecha .rd-header-clinica:has(.rd-header-clinica-logo) .rd-header-clinica-nombre { display: none; }
  .rd-header-clinica-logo { height: 26px; max-width: 64px; }
  .rd-nav-clinica-movil { display: block; margin-left: auto; padding: 0 .9rem 0 .5rem; font-size: .85rem; font-weight: 600; color: var(--rd-ink);
    max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 575.98px) {
  .rd-header-derecha .rd-header-clinica:not(:has(.rd-header-clinica-logo)) .rd-header-clinica-nombre { display: none; }
  .rd-header-derecha .rd-header-clinica::after { display: none; }
}

/* =====================================================================
   Formulario modal minimalista (Nuevo paciente y similares)
   ===================================================================== */
.av-modal-form .modal-body { padding: 1.4rem 1.6rem; background: #fff; }
.av-modal-form .modal-footer { padding: .9rem 1.6rem; }
.av-modal-form .form-label { font-size: .74rem; font-weight: 600; letter-spacing: .03em; color: var(--rd-ink-soft); margin-bottom: .3rem; }
.av-modal-form .form-control, .av-modal-form .form-select { border-radius: 10px; border-color: var(--rd-line); padding: .55rem .8rem; font-size: .9rem; background-color: #fff; }
.av-modal-form .form-control:focus, .av-modal-form .form-select:focus { border-color: var(--rd-header-blue); box-shadow: 0 0 0 3px rgba(59,102,214,.13); }
.av-modal-form .form-text { font-size: .74rem; }
.av-sec { display: flex; align-items: center; gap: .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rd-header-blue); margin: 0 0 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--rd-line); }
.av-sec i { font-size: 1rem; }
.av-sec small { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--rd-ink-soft); }
.av-modal-form .form-check-label { color: var(--rd-ink); }
.av-modal-form .modal-footer .btn-rd-primary { background: var(--rd-header-blue); border-color: var(--rd-header-blue); }


/* ===== Pasada minimalista: menos sombra, menos degradado, más aire ===== */
.rd-card, .av-panel, .av-stats, .modal-content, .rd-grid-wrap { box-shadow: none !important; }
.rd-card, .av-panel, .av-stats { border-radius: 12px; }
.modal-content { border: 1px solid var(--rd-line); border-radius: 14px; }
.rd-modal-cita .modal-header { background: var(--rd-header-blue); padding: .95rem 1.35rem; }
.rd-modal-cita .modal-header .modal-title { font-weight: 600; font-size: 1.02rem; }
.rd-modal-cita .modal-footer { background: transparent; }
.av-title { font-size: 1.75rem; font-weight: 500; }
.av-sub { font-size: .9rem; }
.av-stat-value { font-size: 1.6rem; }
.btn, .btn-av-azul, .btn-rd-primary { box-shadow: none !important; }
.btn-rd-primary, .btn-av-azul { border-radius: 9px; font-weight: 500; }
.rd-cat-tab.activa { box-shadow: none; }
.rd-ficha-tabs-nivel2 .nav-link.active { box-shadow: none; border: 1px solid var(--rd-line); }
.dropdown-menu { box-shadow: 0 8px 24px rgba(20,40,60,.10); border-color: var(--rd-line); }
.av-dd { box-shadow: 0 8px 24px rgba(20,40,60,.10); }
.table > :not(caption) > * > * { padding-top: .7rem; padding-bottom: .7rem; }
.rd-content { padding-top: 1.75rem; }

/* ===== Login: logo más grande y adaptable ===== */
.av-login-inner { max-width: 420px; }
.av-login-inner .rd-logo-img { max-height: 112px; max-width: min(100%, 340px); width: auto; height: auto; }
.av-login-inner h2 { margin-top: 2rem; }
@media (max-width: 991.98px) {
  .av-login-form { justify-content: flex-start; }
  .av-login-inner { margin: 0 auto; padding: 1.25rem 0 .5rem; max-width: 440px; }
  .av-login-inner .rd-logo-wrap { justify-content: center; }
  .av-login-inner .rd-logo-img { max-height: 104px; max-width: min(78vw, 300px); }
  .av-login-inner h2 { text-align: center; margin-top: 1.4rem; font-size: 1.8rem; }
  .av-login-inner .sub { text-align: center; margin-bottom: 1.4rem; }
}
@media (max-width: 575.98px) {
  .av-login-brand { padding: 1.1rem 1.25rem 1.25rem; }
  .av-login-brand h1 { font-size: 1.4rem; }
  .av-login-form { padding: 1rem 1.25rem 1.25rem; }
  .av-login-inner .rd-logo-img { max-height: 96px; max-width: min(74vw, 270px); }
  .av-login-inner h2 { font-size: 1.6rem; }
}
