/* Custom Overrides */
:root {
  --sidebar-width: 260px;
}

#sidebar-wrapper {
  min-height: 100vh;
  width: var(--sidebar-width);
  margin-left: 0;
  transition: all .25s ease-out;
  flex-shrink: 0;
}

#wrapper.toggled #sidebar-wrapper {
  margin-left: calc(0 * var(--sidebar-width));
  width: 0;
  padding: 0 !important;
  overflow: hidden;
}

.card {
  border: none;
  border-radius: 12px;
}

/* Calendar Grid */
.clinic-col {
  min-width: 280px;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin-right: 1rem;
  border: 1px solid #e9ecef;
}

.time-slot {
  padding: 0.5rem;
  border-bottom: 1px solid #f8f9fa;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.time-slot:hover {
  background: #f0f9ff;
}

.slot-booked {
  background: #e3f2fd;
  border-left: 4px solid #0dcaf0;
  padding-left: 10px;
  font-size: 0.85rem;
}

.slot-empty {
  font-size: 0.8rem;
  color: #adb5bd;
  border: 1px dashed #dee2e6;
  transition: all 0.2s;
}

.slot-empty:hover {
  background: #f8f9fa;
  border-color: #0d6efd;
  color: #0d6efd;
  cursor: pointer;
}

.slots-container {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Custom Scrollbar for Slots */
.slots-container::-webkit-scrollbar {
  width: 4px;
}

.slots-container::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 4px;
}

/* Animations */
.module-section {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.clinic-inactive {
  background-color: #f8f9fa;
  filter: grayscale(0.5);
  pointer-events: none;
  opacity: 0.6;
}

.slot-booked+.slot-booked {
  margin-top: -10px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-xs {
  padding: 1px 5px;
  font-size: 0.75rem;
}

/* --- Patient Row Card Design --- */
.patient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.patient-row:hover {
  background: #f8fafc;
}

.patient-row-expanded {
  background: #f0f7ff;
  border-left: 3px solid #0d6efd;
}

.patient-row .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.patient-row .info {
  flex: 1;
  min-width: 0;
}

.patient-row .info .name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.patient-row .info .detail {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 1px;
}

.patient-actions {
  display: flex;
  gap: 4px;
  padding: 8px 16px 12px 68px;
  background: #f0f7ff;
  border-bottom: 1px solid #dbeafe;
  flex-wrap: wrap;
}

.patient-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 8px;
  min-width: 52px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  background: none;
  text-decoration: none;
}

.patient-action-btn:hover {
  background: rgba(13, 110, 253, 0.08);
}

.patient-action-btn i {
  font-size: 1rem;
  color: #0d6efd;
}

.patient-action-btn span {
  font-size: 0.65rem;
  font-weight: 600;
  color: #475569;
}

.patient-list-container {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

/* --- Calendar Appointment Cards --- */
.appt-card {
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.15s;
}

.appt-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.appt-card-linked {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.appt-card-linked .appt-card-header {
  background: #f0fdf4;
}

.appt-card-linked .appt-card-header:hover {
  background: #dcfce7;
}

.appt-card-linked .appt-card-body {
  background: #ecfdf5;
}

.appt-card-unlinked {
  border-color: #fed7aa;
  background: #fffbeb;
}

.appt-card-unlinked .appt-card-header {
  background: #fffbeb;
}

.appt-card-unlinked .appt-card-header:hover {
  background: #fef3c7;
}

.appt-card-unlinked .appt-card-body {
  background: #fefce8;
}

.appt-card-saving {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.appt-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  background: white;
  transition: background 0.15s;
}

.appt-card-header:hover {
  background: #f8fafc;
}

.appt-card-header .appt-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0d6efd;
  white-space: nowrap;
}

.appt-card-header .appt-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appt-card-header .appt-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 100px;
  font-weight: 500;
  white-space: nowrap;
}

.appt-badge-linked {
  background: #dcfce7;
  color: #16a34a;
}

.appt-badge-unlinked {
  background: #fef3c7;
  color: #d97706;
}

.appt-badge-saving {
  background: #f1f5f9;
  color: #94a3b8;
}

.appt-card-body {
  padding: 8px 10px 10px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.appt-card-body .appt-detail {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 8px;
}

.appt-card-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.appt-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: white;
  transition: background 0.15s;
  text-decoration: none;
  border: 1px solid #e2e8f0;
}

.appt-action-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.appt-action-btn i {
  font-size: 0.85rem;
  color: #0d6efd;
}

.appt-action-btn.danger i {
  color: #ef4444;
}

.appt-action-btn.success i {
  color: #16a34a;
}

.appt-action-btn.warning i {
  color: #d97706;
}

.appt-action-btn span {
  font-size: 0.55rem;
  font-weight: 600;
  color: #475569;
}