/* ══════════════════════════════════════════════════════════════
   Centro Odontológico – Main CSS
   ══════════════════════════════════════════════════════════════ */

:root {
  --primary:   #0d6efd;
  --sidebar-w: 240px;
  --sidebar-bg: #1a1d23;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: #f4f6fb;
  color: #1a1a2e;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  transition: width .25s ease;
}

#main-content { min-height: calc(100vh - 56px); }

#app-wrapper { min-height: calc(100vh - 56px); }

.sidebar .nav-link {
  border-radius: 8px;
  padding: .55rem .85rem;
  font-size: .88rem;
  transition: background .15s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255,255,255,.12);
}

/* ── Carrusel ─────────────────────────────────────────────── */
.hero-swiper { height: 520px; position: relative; }

.hero-swiper .swiper-slide { overflow: hidden; }

.carousel-img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  filter: brightness(.75);
}

.carousel-caption-overlay {
  position: absolute;
  bottom: 80px;
  left: 0; right: 0;
  z-index: 10;
}

.hero-default {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  min-height: 420px;
  display: flex;
  align-items: center;
}

/* ── Tarjetas de servicios ────────────────────────────────── */
.service-card {
  border-radius: 16px !important;
  transition: transform .2s, box-shadow .2s;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,.12) !important;
}

.ad-card { border-radius: 12px !important; overflow: hidden; }
.ad-img { height: 180px; object-fit: cover; }

/* ── Autenticación ────────────────────────────────────────── */
.auth-page { background: linear-gradient(135deg, #e8f1ff 0%, #f4f6fb 100%) !important; }
.auth-card { border-radius: 16px; max-width: 440px; width: 100%; }

/* ── Dashboard cards ──────────────────────────────────────── */
.stat-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

.hover-card { transition: transform .15s, box-shadow .15s; }
.hover-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1) !important;
}

/* ── Botón pequeño ────────────────────────────────────────── */
.btn-xs {
  padding: .2rem .55rem;
  font-size: .78rem;
  border-radius: 6px;
}

/* ── Avatares ─────────────────────────────────────────────── */
.avatar-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}
.avatar-circle-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.5rem;
}

/* ── Alertas Flash ────────────────────────────────────────── */
.alert { border-radius: 10px; border: none; }

/* ── Tablas ───────────────────────────────────────────────── */
.table > :not(caption) > * > * { padding: .65rem .85rem; }
.table thead th { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* ── Cards ────────────────────────────────────────────────── */
.card { border-radius: 12px !important; }
.card-header { border-bottom: 1px solid rgba(0,0,0,.06); }

/* ── Odontograma ──────────────────────────────────────────── */
.odontogram-grid { overflow-x: auto; }

.tooth-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
}

.row-label {
  min-width: 120px;
  font-size: .75rem;
}

.teeth-group { display: flex; gap: 6px; flex-wrap: wrap; }

.tooth-cell {
  cursor: pointer;
  text-align: center;
  transition: transform .15s;
}
.tooth-cell:hover { transform: scale(1.1); }

.tooth-number {
  font-size: .7rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 3px;
}

.tooth-svg {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #dee2e6;
  font-size: .6rem;
  font-weight: 700;
}

.tooth-sano            { background: #d1f7d6; border-color: #198754; color: #0f5132; }
.tooth-caries          { background: #fce4e4; border-color: #dc3545; color: #842029; }
.tooth-obturado        { background: #d0e8ff; border-color: #0d6efd; color: #084298; }
.tooth-extraido        { background: #e2e3e5; border-color: #6c757d; color: #3d3f41; }
.tooth-corona          { background: #fff3cd; border-color: #ffc107; color: #664d03; }
.tooth-implante        { background: #cff4fc; border-color: #0dcaf0; color: #055160; }
.tooth-endodoncia      { background: #e2d9f3; border-color: #6f42c1; color: #3d0a91; }
.tooth-pendiente       { background: #fff3cd; border-color: #fd7e14; color: #7c3400; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { width: 100%; position: relative; height: auto; min-height: unset; }
  #app-wrapper { flex-direction: column; }
  .hero-swiper, .carousel-img { height: 280px; }
}

/* ── Progress bars ────────────────────────────────────────── */
.progress { border-radius: 100px; }
.progress-bar { border-radius: 100px; }
