:root {
  --primary:   #0d6e6e;
  --secondary: #12a3a3;
  --light-bg:  #e8f8f8;
  --sidebar-w: 240px;
}

body { background: #f4f6f9; font-family: 'Segoe UI', sans-serif; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--primary);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .25s;
}
.sidebar-brand {
  padding: 1.4rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.sidebar-brand h5 { color: #fff; font-weight: 700; margin: 0; font-size: 1rem; }
.sidebar-brand small { color: rgba(255,255,255,.6); font-size: .75rem; }

.sidebar .nav-link {
  color: rgba(255,255,255,.8);
  padding: .65rem 1.2rem;
  border-radius: 6px;
  margin: 2px 8px;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  transition: background .2s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.main-content {
  margin-left: var(--sidebar-w);
  padding: 1.8rem;
  min-height: 100vh;
}

.topbar {
  background: #fff;
  border-radius: 10px;
  padding: .8rem 1.2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  border-left: 4px solid var(--secondary);
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label  { color: #6c757d; font-size: .85rem; }

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.card-header {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}

.table-hover tbody tr:hover { background: var(--light-bg); cursor: pointer; }
.table th { color: var(--primary); font-weight: 600; font-size: .85rem; }

.btn-primary   { background: var(--secondary); border-color: var(--secondary); }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }

.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

#toast-container {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 9999;
}

/* ── Odontograma ────────────────────────────── */
.odontogram-wrapper {
  background: #fff;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.odontogram-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}
.tooth-btn {
  width: 38px;
  height: 48px;
  border: 2px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #555;
  transition: all .15s;
  position: relative;
  padding: 2px;
}
.tooth-btn:hover { transform: scale(1.1); z-index: 10; }
.tooth-btn .tooth-num { font-size: 9px; color: #888; line-height: 1; }
.tooth-btn .tooth-icon { font-size: 16px; line-height: 1; }

/* Estados */
.tooth-sano          { border-color: #27ae60; background: #eafaf1; }
.tooth-caries        { border-color: #e74c3c; background: #fdedec; }
.tooth-obturado      { border-color: #3498db; background: #ebf5fb; }
.tooth-extraccion    { border-color: #e67e22; background: #fef9e7; }
.tooth-extraido      { border-color: #95a5a6; background: #f2f3f4; }
.tooth-corona        { border-color: #9b59b6; background: #f5eef8; }
.tooth-endodoncia    { border-color: #e91e63; background: #fce4ec; }
.tooth-implante      { border-color: #00bcd4; background: #e0f7fa; }
.tooth-fractura      { border-color: #ff5722; background: #fbe9e7; }
.tooth-en_erupcion   { border-color: #8bc34a; background: #f1f8e9; }
.tooth-ausente_cong  { border-color: #bdc3c7; background: #ecf0f1; }

.odontogram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #555;
}
.legend-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 2px solid currentColor;
  flex-shrink: 0;
}
.odontogram-divider {
  border-top: 2px dashed #ccc;
  margin: 4px 0;
}
