@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/vendor/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/vendor/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/vendor/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/vendor/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/vendor/fonts/inter-latin-800-normal.woff2') format('woff2'); }

:root {
  /* Paleta DermaGestión: teal profundo + terracota cálido — moderna, clínica pero cálida,
     distinta a propósito de la paleta navy/azul del sistema hermano de odontología. */
  --navy: #33544f;
  --navy-deep: #203633;
  --accent: #d9784f;
  --accent-2: #f0b79c;
  --bg: #f7f4f0;
  --radius: 16px;
  --shadow-soft: 0 4px 16px rgba(32,54,51,0.08);
  --shadow-hover: 0 10px 28px rgba(32,54,51,0.16);
}
* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body { background: var(--bg); animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }
.app-navbar { background: var(--navy); box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.app-navbar .nav-link { transition: color .15s ease; border-radius: 6px; }
.app-navbar .nav-link:hover { color: #fff !important; }
.brand-link { transition: opacity .15s; }
.brand-link:hover { opacity: .85; }
.card { border: none; box-shadow: var(--shadow-soft); border-radius: var(--radius); transition: transform .18s ease, box-shadow .18s ease; }
.stat-card { border-left: 4px solid var(--accent); }
a.stat-card, .stat-card.hover-lift { cursor: pointer; }
.hover-lift:hover, a.card:hover, .stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.badge-payway { background: #7b2ff7; }
.badge-openpay { background: #072146; }
.badge-entidad-generica { background: #4a5568; }
.table thead { background: var(--navy); color: #fff; }
.btn { border-radius: 8px; transition: transform .12s ease, box-shadow .12s ease, background .15s ease; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--navy); border-color: var(--navy); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(217,120,79,.35); }
.btn:active { transform: translateY(0); }
.login-wrap {
  min-height: 100vh; display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(circle at 18% 24%, rgba(255,255,255,.10) 0, rgba(255,255,255,.10) 2px, transparent 2px),
    radial-gradient(circle at 62% 68%, rgba(255,255,255,.08) 0, rgba(255,255,255,.08) 2px, transparent 2px),
    linear-gradient(135deg, var(--navy-deep), var(--accent) 70%, var(--accent-2));
  background-size: 46px 46px, 64px 64px, 200% 200%;
  animation: gradientShift 12s ease infinite;
  position: relative; overflow: hidden;
}
@keyframes gradientShift { 0% { background-position: 0 0, 0 0, 0% 50%; } 50% { background-position: 0 0, 0 0, 100% 50%; } 100% { background-position: 0 0, 0 0, 0% 50%; } }
.login-card { max-width: 420px; width: 100%; animation: fadeIn .5s ease; position: relative; z-index: 1; background: rgba(255,255,255,.97); backdrop-filter: blur(6px); }
.login-decor { position:absolute; opacity:.12; color:#fff; }
.login-decor-1 { top:-60px; left:-60px; width:260px; height:260px; transform:rotate(-12deg); }
.login-decor-2 { bottom:-70px; right:-50px; width:220px; height:220px; transform:rotate(18deg); }
.note-illustrative { background:#fff2cc; border:1px solid #bf8f00; color:#7f6000; border-radius:8px; padding:10px 14px; font-size:.875rem; }
.opcion-cuota { border:1px solid #e3e8ef; border-radius:10px; padding:16px; transition: all .15s; }
.opcion-cuota:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(217,120,79,.18); }
.opcion-cuota.selected { border-color: var(--accent); background:#f7ece4; }
.opcion-cuota.sin-interes { border-color:#2e7d32; background:#f1f8f1; }
.login-logo { max-width: 220px; max-height: 110px; object-fit: contain; }
.nav-logo { height: 36px; max-width: 160px; object-fit: contain; background:#fff; border-radius:6px; padding:3px 6px; margin-right:8px; }
.logo-thumb { height: 34px; width: 34px; object-fit: contain; background:#fff; border:1px solid #e3e8ef; border-radius:6px; padding:2px; }
.brand-link { display:flex; align-items:center; }
.dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:4px; }
#calendar .fc-toolbar-title { font-size: 1.25rem; font-weight: 700; color: var(--navy); }
#calendar .fc-button-primary { background: var(--accent); border-color: var(--accent); }
#calendar .fc-button-primary:hover { background: var(--navy); border-color: var(--navy); }
#calendar .fc-button-primary:disabled { background: #9db8d1; border-color: #9db8d1; }
#calendar .fc-daygrid-day.fc-day-today, #calendar .fc-timegrid-col.fc-day-today { background: #f7ece4; }
#calendar .fc-event { cursor: pointer; border: none; }
/* --- Mapa de piel: equivalente dermatológico del odontograma --- */
.piel-stat { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; gap:0; background:#fff; border-radius:12px; padding:.4rem .9rem; box-shadow: var(--shadow-soft); font-size:.72rem; color:#7a8699; font-weight:600; min-width:84px; }
.piel-stat-num { font-size:1.15rem; font-weight:800; color: var(--navy); }
.piel-stat-alerta .piel-stat-num { color:#c0392b; }
.piel-stat-biopsia .piel-stat-num { color:#b5690a; }
.piel-mapa-card { background: linear-gradient(160deg, #fff 55%, #fbf1ea 100%); }
.nav-pills-piel .nav-link { border-radius:20px; font-weight:600; font-size:.85rem; color: var(--navy); padding:.4rem 1.1rem; transition: all .15s ease; }
.nav-pills-piel .nav-link.active { background: var(--accent); color:#fff; }
.piel-mapa-layout { display:grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items:start; }
@media (max-width: 720px) { .piel-mapa-layout { grid-template-columns: 1fr; } }
.piel-silueta-wrap { display:flex; justify-content:center; }
.silueta-cuerpo { width:100%; max-width:200px; height:auto; }
.piel-zonas-grid { display:flex; flex-wrap:wrap; gap:.5rem; align-content:flex-start; }
.piel-zona-chip {
  display:inline-flex; align-items:center; padding:.35rem .8rem; border-radius:20px; font-size:.8rem; font-weight:600;
  background:#f1ece6; color:#7a8699; text-decoration:none; border:1px solid transparent; transition: all .15s ease;
}
.piel-zona-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); color: var(--navy); }
.piel-zona-chip.con-lesiones { background:#fbeee5; color: var(--navy); border-color: rgba(217,120,79,.3); }
.piel-zona-chip.con-alerta { background:#fbe4e0; color:#b5342a; border-color:#e2988c; }
.piel-zona-chip .badge { background: var(--accent); }
.piel-zona-chip.con-alerta .badge { background:#c0392b; }

.lesion-card { border:1px solid #ece5dd; border-radius:12px; padding:.9rem 1rem; margin-bottom:.75rem; transition: box-shadow .15s ease; }
.lesion-card:hover { box-shadow: var(--shadow-soft); }
.lesion-card.lesion-resuelta { opacity:.68; }
.lesion-tipo-dot { display:inline-block; width:11px; height:11px; border-radius:50%; margin-right:4px; }
.lesion-fotos { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; }
.lesion-foto-tile { position:relative; display:block; width:76px; height:76px; border-radius:10px; overflow:hidden; box-shadow: var(--shadow-soft); }
.lesion-foto-tile img { width:100%; height:100%; object-fit:cover; }
.lesion-foto-fecha { position:absolute; bottom:0; left:0; right:0; background:rgba(32,54,51,.75); color:#fff; font-size:.6rem; text-align:center; padding:1px 0; }
.lesion-foto-add { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; }
.lesion-foto-add input[type=file] { font-size:.72rem; max-width:150px; }
.lesion-foto-add input[type=date] { font-size:.72rem; padding:.2rem .3rem; }
#modalHistorialPieza ul { max-height:100px; overflow-y:auto; }
.evolucion-timeline { max-height:420px; overflow-y:auto; padding-left:14px; border-left:2px solid #e3e8ef; }
.evolucion-item { position:relative; padding-bottom:14px; }
.evolucion-item:not(:last-child) { border-bottom:1px dashed #e3e8ef; margin-bottom:10px; }
.evolucion-item::before { content:""; position:absolute; left:-18px; top:4px; width:8px; height:8px; border-radius:50%; background:var(--accent); }

/* --- Hero de inicio --- */
.hero-banner {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.08) 0, rgba(255,255,255,.08) 2px, transparent 2px),
    linear-gradient(120deg, var(--navy-deep), var(--navy) 55%, var(--accent));
  background-size: 40px 40px, 100% 100%;
  color: #fff; padding: 2rem 2rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-hover);
}
.hero-banner .hero-greeting { font-size: 1.6rem; font-weight: 800; margin-bottom: .25rem; }
.hero-banner .hero-sub { color: rgba(255,255,255,.8); font-size: .95rem; }
.hero-decor { position:absolute; top:-30px; right:-20px; width: 220px; height: 220px; opacity: .14; pointer-events:none; }
.hero-decor-2 { position:absolute; bottom:-40px; right: 160px; width: 140px; height: 140px; opacity: .1; pointer-events:none; }
.hero-logo-frame {
  background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display:flex; align-items:center; justify-content:center; width: 108px; height: 108px;
  transition: transform .2s ease;
}
.hero-logo-frame:hover { transform: scale(1.04) rotate(-1deg); }
.hero-logo-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hero-mascot { width: 90px; height: 90px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); animation: floatY 3.2s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* --- Acciones rápidas --- */
.quick-action {
  display:flex; flex-direction:column; align-items:flex-start; gap:.5rem;
  background:#fff; border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration:none; color: var(--navy);
  box-shadow: var(--shadow-soft); border: 1px solid transparent; height: 100%;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.quick-action:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: rgba(217,120,79,.28); color: var(--navy); }
.quick-action .qa-icon {
  width: 42px; height: 42px; border-radius: 12px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; flex-shrink:0;
}
.quick-action .qa-title { font-weight: 700; font-size: .92rem; }
.quick-action .qa-sub { font-size: .78rem; color:#7a8699; }

/* --- Utilidades de animación de entrada, escalonada por índice --- */
.fade-up { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }
.delay-1 { animation-delay: .05s; } .delay-2 { animation-delay: .1s; } .delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; } .delay-5 { animation-delay: .25s; } .delay-6 { animation-delay: .3s; }

.avatar-circle {
  width: 40px; height: 40px; border-radius: 50%; object-fit: contain; background:#fff;
  border: 2px solid #e3e8ef; padding: 3px; flex-shrink: 0;
}
.avatar-fallback {
  width: 40px; height: 40px; border-radius: 50%; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; font-weight:700; flex-shrink:0;
}
.empty-state { text-align:center; padding: 2rem 1rem; color:#8592a6; }
.empty-state svg { width: 72px; height: 72px; opacity: .5; margin-bottom: .5rem; }

/* --- Volver atrás --- */
.volver-atras {
  display:inline-flex; align-items:center; gap:4px; font-size:.82rem; font-weight:600;
  color: var(--accent); text-decoration:none; margin-bottom:.75rem;
  transition: transform .15s ease, color .15s ease;
}
.volver-atras:hover { color: var(--navy); transform: translateX(-2px); }

/* --- Badge de rol / cuenta de empleado --- */
.badge-empleado { background: #6c757d; }
.franja-empleado { background:#eef1f5; border-left:4px solid #6c757d; border-radius:8px; padding:.5rem .9rem; font-size:.8rem; color:#495057; margin-bottom:1rem; }

/* --- Finanzas: tarjetas de resumen --- */
.finanzas-card { border-radius: var(--radius); padding:1.1rem; background:#fff; box-shadow: var(--shadow-soft); }
.finanzas-card .fin-label { font-size:.78rem; color:#7a8699; text-transform:uppercase; letter-spacing:.03em; font-weight:600; }
.finanzas-card .fin-monto { font-size:1.7rem; font-weight:800; color: var(--navy); }
.banner-push { position: sticky; top: 0; z-index: 1050; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--navy); color: #fff; padding: .6rem 1rem; font-size: .85rem; }
.banner-push-botones { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.medio-pill { display:inline-flex; align-items:center; gap:6px; padding:.3rem .7rem; border-radius:20px; font-size:.78rem; font-weight:600; }
.medio-pill.medio-tarjeta { background:#f7ece4; color: var(--accent); }
.medio-pill.medio-efectivo { background:#eafaf3; color:#1a8f6b; }
.medio-pill.medio-transferencia { background:#fff3e0; color:#b5690a; }
.medio-pill.medio-otro { background:#f1f1f4; color:#666; }

/* --- Automatización (WhatsApp / calendario): tarjetas de estado --- */
.estado-chip { display:inline-flex; align-items:center; gap:6px; padding:.25rem .65rem; border-radius:20px; font-size:.75rem; font-weight:700; }
.estado-chip.preparado { background:#fff3cd; color:#7f6000; }
.estado-chip.activo { background:#d1e7dd; color:#0f5132; }

/* --- Archivos adjuntos: grilla de miniaturas --- */
.archivos-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap:.75rem; }
.archivo-tile { background:#f8f9fc; border-radius:10px; padding:.5rem; text-align:center; }
.archivo-thumb-link { display:block; }
.archivo-thumb-img { width:100%; height:88px; object-fit:cover; border-radius:8px; background:#e9edf3; }
.archivo-thumb-icon { width:100%; height:88px; display:flex; align-items:center; justify-content:center; font-size:2.2rem; background:#e9edf3; border-radius:8px; }
.archivo-tile-nombre { font-size:.7rem; color:#495057; margin:.35rem 0 .2rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* --- Lista de espera --- */
.espera-item { border-left:3px solid var(--accent-2); }

/* --- Indicadores de gestión: barra de progreso simple --- */
.kpi-bar-track { background:#e9edf3; border-radius:20px; height:8px; overflow:hidden; }
.kpi-bar-fill { height:100%; border-radius:20px; background: var(--accent); }
.kpi-bar-fill.warn { background:#e0a800; }
.kpi-bar-fill.danger { background:#b02a37; }
