body {
  background-color: #f9f9f9;
  color: #212529;
}
.sidebar {
  width: 220px;
  background-color: #0d1b2a;
  color: #fff;
  height: 100vh;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.sidebar h2 {
  font-size: 1.3rem;
  color: #61dafb;
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar .nav {
  flex-grow: 1;
}

.sidebar .nav-link {
  color: #d1d5db;
  font-weight: 500;
  padding: 0.6rem 1rem;
  margin: 0.2rem 0;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

.sidebar .text-danger {
  color: #ef4444 !important;
  font-weight: 500;
}

.sidebar .user-info {
  font-size: 0.85rem;
  color: #94a3b8;
}

.sidebar .user-info strong {
  color: #f3f4f6;
}

.sidebar .badge.bg-secondary {
  background-color: #64748b;
}

.wrapper {
  display: flex;
}

.sidebar h2 {
  font-size: 20px;
  margin-bottom: 30px;
}
.sidebar ul {
  list-style: none;
  padding-left: 0;
}
.sidebar ul li {
  margin: 15px 0;
}
.sidebar ul li a {
  color: white;
  text-decoration: none;
  font-size: 16px;
}
.sidebar ul li a:hover {
  text-decoration: underline;
}
.main-content {
  margin-left: 220px; /* same as sidebar width */
  padding: 2rem;
  width: calc(100% - 220px); /* prevents overlap */
  min-height: 100vh;
  background-color: #f9f9f9;
}

.card {
  flex: 1;
  background: #2196f3;
  color: white;
  border-radius: 5px;
  overflow: hidden;
}
.card-body {
  padding: 20px;
}
.card-body h3 {
  font-size: 28px;
  margin: 0;
}
.card-footer {
  background: #b26bd1;
  text-align: center;
  padding: 8px;
  font-size: 14px;
}

.action-button {
  display: block;
  background: #2196f3;
  color: white;
  text-align: left;
  padding: 12px;
  margin: 10px 0;
  text-decoration: none;
  font-weight: bold;
  border-left: 8px solid #1e88e5;
  transition: background 0.3s;
}
.action-button:hover {
  background: #1976d2;
}
.appointments-box {
  background: white;
  padding: 20px;
  border-radius: 5px;
}
.appointments-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.appointments-table th,
.appointments-table td {
  border: 1px solid #ddd;
  padding: 8px;
}
.appointments-table th {
  background-color: #f2f2f2;
}
.avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}
.avatar-circle {
  width: 56px;
  height: 56px;
  background-color: #0d6efd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.card {
  background-color: #f4f9ff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}
.border-bottom {
  border-bottom: 1px solid #ddd !important;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.rounded-circle {
  border-radius: 50% !important;
  object-fit: cover;
}
.card-body p,
.card-body small {
  color: #000 !important;
}
.add-patient-container {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
}
.add-patient-header {
  background-color: #1da1f2;
  color: white;
  padding: 20px;
  font-size: 20px;
  font-weight: bold;
  border-radius: 4px 4px 0 0;
}
.section-title {
  color: #a64bf4;
  font-weight: bold;
  margin-top: 24px;
  margin-bottom: 8px;
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.field-row .form-group {
  flex: 1;
  min-width: 250px;
}
.form-group label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
  display: block;
}
input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 14px;
  box-sizing: border-box;
}
textarea {
  resize: vertical;
}
.form-check {
  margin-top: 10px;
}
.form-check-input {
  margin-right: 8px;
}
.btn-save {
  background-color: #a64bf4;
  color: white;
  padding: 10px 40px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  margin-top: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.btn-save:hover {
  background-color: #8c3dcc;
}
.upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}
.upload-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: #ccc;
  margin-bottom: 10px;
}
.upload-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.upload-buttons button {
  background-color: #d46fe8;
  border: none;
  color: white;
  padding: 5px 10px;
  font-size: 14px;
  border-radius: 4px;
}
.upload-note {
  font-size: 12px;
  color: red;
}
.header-blue {
  background-color: #0d83f7;
  color: white;
  border-radius: 4px;
}
.btn-purple {
  background-color: #a259ff;
  color: white;
  border: none;
}
.btn-purple:hover {
  background-color: #8e44ff;
}
.text-purple {
  color: #a259ff;
}
#calendar {
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
  height: 600px;
  background-color: white;
  border: 1px solid #ddd;
}
/* === DASHBOARD IMPROVEMENTS === */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.card.blue {
  background: linear-gradient(135deg, #2196f3, #0d47a1);
  color: white;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease;
}
.card.blue:hover {
  transform: translateY(-2px);
}
.card-footer {
  background-color: rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 10px;
  font-size: 14px;
  color: #e0e0e0;
}
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}
.action-button {
  display: inline-block;
  background: #2196f3;
  color: white;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: bold;
  border-left: 6px solid #1e88e5;
  border-radius: 4px;
  transition: background 0.3s ease;
}
.action-button:hover {
  background: #1976d2;
}
.appointments-box {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ddd;
}
.appointments-table th {
  background-color: #f1f1f1;
  font-weight: 600;
}

.card-tagata-blue {
  background-color: #2f6690;
}

.card-indigo {
  background-color: #4f46e5;
}

.card-cyan {
  background-color: #06b6d4;
}

.card-amber {
  background-color: #f59e0b;
  color: #1f2937;
}

.card-emerald {
  background-color: #10b981;
}

.card-footer-light {
  background-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
}

.card:hover {
  transform: translateY(-2px);
  transition: all 0.2s ease-in-out;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card::after {
  content: ""; /* or use calendar, bell, etc. */
  font-size: 3rem;
  position: absolute;
  bottom: 10px;
  right: 10px;
  opacity: 0.1;
}
.svg-container svg {
  width: 100%;
  height: auto;
  max-width: 786px; /* Adjust this to your preferred size */
  display: block;
  margin: auto;
}

svg [data-tooth] {
  pointer-events: all;
  cursor: pointer;
  stroke: black;
  transition: fill 0.2s ease;
}

@media (max-width: 768px) {
  #condition-popup {
    bottom: 10px !important;
    right: 10px !important;
    width: 90% !important;
  }
}

.legend-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 12px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.legend-item:hover {
  background: #f8f9fa;
  border-radius: 4px;
}
.legend-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid #999;
  border-radius: 3px;
  flex: 0 0 16px;
}
.legend-text {
  font-size: 0.9rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}
.legend-item:hover {
  background: #f8f9fa;
  border-radius: 4px;
}
.legend-swatch {
  width: 20px;
  height: 20px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}
.legend-text {
  font-size: 14px;
}
#toothNotes {
  background-color: #fff;
  border: 1px solid #e3e3e3;
}

.badge.bg-primary {
  background-color: #0d6efd !important;
}
.badge.bg-success {
  background-color: #198754 !important;
}
.badge.bg-secondary {
  background-color: #6c757d !important;
}

/* ===== Patient Overview Cards ===== */
.card-elev {
  border: 1px solid #e9ecef;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(13, 110, 253, 0.06);
  overflow: hidden;
}
.card-elev .card-header {
  background: linear-gradient(
    135deg,
    rgba(13, 110, 253, 0.08),
    rgba(13, 110, 253, 0.02)
  );
  border-bottom: 1px solid rgba(13, 110, 253, 0.15);
  font-weight: 600;
}

.left-card .list-group-item {
  padding: 0.85rem 0;
  border-color: #eef2f6;
}
.left-card .list-group-item strong {
  display: inline-block;
  min-width: 110px;
  color: #334155;
}

/* KPI rows */
.kpi {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.kpi .label {
  font-size: 0.9rem;
  color: #6c757d;
}
.kpi .value {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Progress */
.progress.thin {
  height: 6px;
  background: #eef2f6;
  border-radius: 999px;
}
.progress.thin .progress-bar {
  border-radius: 999px;
}

/* Documents */
.doc-drop {
  border: 2px dashed #ced4da;
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
  transition: all 0.15s ease;
}
.doc-drop:hover {
  border-color: #0d6efd;
  background: #f2f7ff;
}
.list-compact .list-group-item {
  padding: 0.6rem 0.75rem;
}

/* Badges */
.badge-soft {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  border: 1px solid rgba(13, 110, 253, 0.2);
}

/* Small utilities */
.text-muted-2 {
  color: #7a8899 !important;
}

/* ==== Patient Profile Header ==== */
.profile-header {
  padding: 16px 18px;
  background: linear-gradient(
    135deg,
    rgba(13, 110, 253, 0.08),
    rgba(13, 110, 253, 0.02)
  );
  border-bottom: 1px solid rgba(13, 110, 253, 0.15);
}
.avatar-xl {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  background: #e9f1ff;
  color: #0d6efd;
  border: 1px solid #dbe7ff;
}
.branch-pill {
  border: 1px solid rgba(13, 110, 253, 0.2);
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.detail-row strong {
  color: #334155;
  min-width: 120px;
  display: inline-block;
}
.detail-row {
  padding: 0.7rem 0;
  border-bottom: 1px solid #eef2f6;
}
.detail-row:last-child {
  border-bottom: 0;
}

.quick-actions .btn {
  padding: 0.25rem 0.5rem;
}

@media (min-width: 992px) {
  .sticky-panel {
    position: sticky;
    top: 84px;
  }
}
.money {
  font-variant-numeric: tabular-nums;
}

.page-header .branch-pill {
  display: none !important;
}

/* === Dashboard KPI cards === */
.kpi-card {
  border: 0;
  border-radius: 16px;
  padding: 16px;
  height: 100%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.kpi-link {
  display: block;
  text-decoration: none;
  color: inherit; /* keep card text colors */
}
.kpi-link:hover,
.kpi-link:focus {
  color: inherit; /* no blue link color on hover */
}

.kpi-card:hover,
.kpi-card:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0.98;
}

/* nice even-width digits for money */
.money {
  font-variant-numeric: tabular-nums;
}

/* optional: thin progress bars you use elsewhere too */
.progress.thin {
  height: 6px;
}

/* accessibility: disable motion if the user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .kpi-card {
    transition: none;
  }
}

/* KPI tiles */
.kpi-card {
  position: relative; /* needed for .stretched-link */
  border: 0;
  border-radius: 16px;
  padding: 16px;
  height: 100%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0.98;
}

.kpi-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.kpi-link:hover,
.kpi-link:focus {
  color: inherit;
}

/* even-width digits for counters and money */
.money {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .kpi-card {
    transition: none;
  }
}

/* ===== brand palette ===== */
:root {
  --c-surface: #f6f8fb; /* page background */
  --c-primary: #2563eb; /* total patients (blue) */
  --c-teal: #0ea5a5; /* appointments (teal) */
  --c-amber: #f59e0b; /* finance (amber) */
  --c-green: #16a34a; /* birthdays / success (green) */
  --c-on-dark: #ffffff; /* text on dark tiles */
  --c-on-light: #111827; /* text on light tiles */
}

body {
  background: var(--c-surface);
}

/* ===== only style the summary KPI cards row (your 4 tiles) ===== */
/* works with your current markup: .row.g-3.mb-4 > .col-md-3 > .card.rounded-4 */
.row.g-3.mb-4 > [class^="col-"] > .card.rounded-4 {
  border: 0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.row.g-3.mb-4 > [class^="col-"] > .card.rounded-4:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.row.g-3.mb-4 .card i {
  opacity: 0.9;
  color: inherit;
}

/* backgrounds + text colors mapped to your existing Bootstrap bg-* classes */
.row.g-3.mb-4 .card.bg-primary {
  background: var(--c-primary) !important;
  color: var(--c-on-dark) !important;
}
.row.g-3.mb-4 .card.bg-info {
  background: var(--c-teal) !important;
  color: var(--c-on-dark) !important;
}
.row.g-3.mb-4 .card.bg-warning {
  background: var(--c-amber) !important;
  color: var(--c-on-light) !important;
}
.row.g-3.mb-4 .card.bg-success {
  background: var(--c-green) !important;
  color: var(--c-on-dark) !important;
}

/* fix link/text utilities inside the tiles so they read correctly */
.row.g-3.mb-4 .card.bg-info a,
.row.g-3.mb-4 .card.bg-primary a,
.row.g-3.mb-4 .card.bg-success a {
  color: var(--c-on-dark) !important;
}
.row.g-3.mb-4 .card.bg-warning a {
  color: var(--c-on-light) !important;
}

/* progress bars (e.g., finance paid bar) */
.progress .progress-bar {
  background-color: var(--c-green);
}

/* optional: lighten tile icons on hover a bit */
/* .row.g-3.mb-4 .card:hover i{ filter: brightness(1.05); } */

/* Keep actions visible at the bottom of the tab content */
#treatment .treatment-actions-sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--bs-body-bg); /* matches Bootstrap theme */
}

.btn-teal {
  --bs-btn-bg: #0d9488;
  --bs-btn-border-color: #0d9488;
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #0b7d74;
  --bs-btn-hover-border-color: #0b7d74;
  --bs-btn-active-bg: #0a6c63;
  --bs-btn-active-border-color: #0a6c63;
}

.finance-dash .kpi-card {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(10, 30, 70, 0.05);
}
.finance-dash .kpi-label {
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.7;
  margin-bottom: 0.15rem;
}
.finance-dash .kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.finance-dash .kpi-icon {
  font-size: 1.6rem;
  opacity: 0.25;
}
.finance-dash .kpi-billed {
  background: linear-gradient(180deg, #eef5ff 0%, #fff 70%);
}
.finance-dash .kpi-collected {
  background: linear-gradient(180deg, #e9fff2 0%, #fff 70%);
}
.finance-dash .kpi-outstanding {
  background: linear-gradient(180deg, #fff0f0 0%, #fff 70%);
}

.finance-dash .chart-body {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.finance-dash .empty-state {
  text-align: center;
  color: #6c757d;
}
.finance-dash .empty-state i {
  font-size: 1.6rem;
  display: block;
}

/* theme vars */
:root {
  --violet: #7c4dff;
}

/* sidebar basics */
.sidebar .nav-link {
  color: #cfd8dc;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar .dropdown-menu {
  font-size: 0.9rem;
}
.sidebar .btn.btn-dark {
  --bs-btn-bg: #0f1b24;
  --bs-btn-border-color: #0f1b24;
}

/* violet group toggles */
.sidebar .group-toggle {
  color: var(--violet) !important;
  font-weight: 600;
}
.sidebar .group-toggle .bi {
  color: var(--violet) !important;
}
.sidebar .group-toggle .chev {
  transition: transform 0.2s;
}
.sidebar .group-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

/* (optional) slightly tighter spacing between groups */
.sidebar .nav-link.group-toggle {
  margin-top: 0.25rem;
}
