#sidebar + div {
  margin-top: 0;
  padding: 16px;
  background: #fafafa;
  overflow-y: auto;
  z-index: 1;
}
/* ===== APPOINTMENT CONTAINER ENHANCEMENTS ===== */

/* Base appointment container - allows unlimited appointments */
.appointment-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  flex: 1;
  overflow: visible;
  min-height: 0;
}

/* Date cells must flex to accommodate unlimited appointments */
.date {
  display: flex;
  flex-direction: column;
  min-height: 80px;
  max-height: none; /* Remove any height limits */
  overflow: visible;
  position: relative;
}

/* Date container (number) styling */
.date-container {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 5;
}

/* Ensure add button doesn't interfere with appointments */
.add-event-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background: #e2e8f0;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
}

.date:hover .add-event-btn {
  opacity: 1;
}

.add-event-btn:hover {
  background: #cbd5e1;
  color: #475569;
  transform: scale(1.1);
}

/* ===== APPOINTMENT STYLING ENHANCEMENTS ===== */

/* Base appointment styling */
.appointment {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  border: none;
  line-height: 1.1;
  min-height: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  word-wrap: break-word;
  text-overflow: ellipsis;
  flex-shrink: 0; /* Prevent appointments from shrinking too much */
}

.appointment:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

/* Desktop appointment content styling */
.appt-name-time {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 2px;
  
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt-title {
  font-size: 8px;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.0;
 
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt-name-only {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile appointment content styling */
.appt-name-mobile {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt-time-mobile {
  flex: 0 0 auto;
  font-size: 8px;
  font-weight: 500;
  opacity: 0.9;
  margin-left: 4px;
}

/* Today highlighting - FIXED */
.today {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
  border: 2px solid #3b82f6 !important;
  color: #1e40af !important;
}

.today .date-container {
  color: #1e40af !important;
  font-weight: 800 !important;
}

/* Ensure calendar grid cells can expand */
#calendarmonth {
  grid-auto-rows: minmax(100px, auto); /* Allow rows to expand */
}

/* Today highlighting */
.today {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 2px solid #3b82f6;
  color: #1e40af;
}

.today .date-container {
  color: #1e40af;
  font-weight: 800;
}

/* Other month dates */
.other-month {
  opacity: 0.4;
  background: #f8fafc;
}

.other-month .date-container {
  color: #94a3b8;
}

/* Desktop appointment styling */
@media (min-width: 1025px) {
  .appointment {
    padding: 6px 8px;
    font-size: 12px;
    min-height: 24px;
    border-radius: 8px;
  }
  
  .appt-name-time {
    font-size: 12px;
    margin-bottom: 2px;
  }
  
  .appt-title {
    font-size: 9px;
  }
  
  .appt-name-only {
    font-size: 12px;
  }
  
  /* Ensure appointments container can hold many appointments */
  .appointment-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    max-height: calc(100% - 30px);
    overflow: visible;
  }
  
  .date {
    min-height: 100px;
    padding: 8px;
  }
  
  .appointment-container {
    gap: 3px;
    margin-top: 6px;
  }
  
  .date-container {
    font-size: 16px;
    margin-bottom: 6px;
  }
  
  .add-event-btn {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }
  
  /* Scale appointments more gracefully on desktop */
  .appointment {
    min-height: 24px;
    padding: 6px 8px;
    font-size: 12px;
  }
  
  /* Allow calendar rows to expand on desktop */
  #calendarmonth {
    grid-auto-rows: minmax(120px, auto);
  }
}

/* Tablet appointment styling */
@media (min-width: 769px) and (max-width: 1024px) {
  .appointment {
    padding: 5px 6px;
    font-size: 11px;
    min-height: 20px;
  }
  
  .appt-name-time {
    font-size: 11px;
  }
  
  .appt-name-only {
    font-size: 11px;
  }
  
  .appt-title {
    font-size: 8px;
  }
}

/* Mobile appointment styling */
@media (max-width: 768px) {
  .appointment {
    padding: 4px 5px;
    font-size: 10px;
    min-height: 18px;
    border-radius: 4px;
    /* Mobile: Horizontal layout for name and time */
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  
  .appt-name-mobile {
    font-size: 10px;
  }
  
  .appt-time-mobile {
    font-size: 8px;
  }
  
  .appt-name-only {
    font-size: 10px;
  }
  
  .appt-title {
    display: none; /* Hide titles on mobile */
  }
}

/* ===== COMPACT MODERN APPOINTMENT MODAL STYLES ===== */

/* Modal Overlay */
.modalappointmentclass {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  backdrop-filter: blur(8px);
  padding: 15px;
  box-sizing: border-box;
}

.modalappointmentclass.open {
  display: flex;
}

/* Modal Container - More Compact */
.modalappointment-inner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 20px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modal Header - Reduced Height */
.appointment-adder-form h2 {
  background: linear-gradient(135deg, #1e293b, #475569);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  padding: 24px 24px 12px 24px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.5px;
}

/* Modal Content Area - Reduced Padding */
.modal-content-area {
  padding: 0 24px 24px 24px;
  max-height: calc(85vh - 100px);
  overflow-y: auto;
}

/* Custom Scrollbar */
.modal-content-area::-webkit-scrollbar {
  width: 6px;
}

.modal-content-area::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.modal-content-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.modal-content-area::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Form Styling */
.appointment-adder-form {
  display: flex;
  flex-direction: column;
}

/* Form Rows - More Compact Spacing */
.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.form-row:last-of-type {
  margin-bottom: 0;
}

/* Labels - Smaller */
.form-row label {
  font-weight: 600;
  font-size: 11px;
  color: #374151;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Input Fields - Even Smaller Height */
.form-row input,
.form-row select,
.dropdown-btn {
  padding: 10px 14px;
  font-size: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  color: #374151;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus,
.dropdown-btn:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 
    0 0 0 3px rgba(59, 130, 246, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.form-row input:hover,
.form-row select:hover,
.dropdown-btn:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

/* Dropdown Buttons */
.dropdown-btn {
  background: white;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.dropdown-btn::after {
  content: '▼';
  font-size: 10px;
  color: #6b7280;
  transition: transform 0.3s ease;
}

.dropdown-btn.open::after {
  transform: rotate(180deg);
}

/* Dropdown Content - More Compact */
.date-picker-dropdown,
.time-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 10001;
  display: none;
  padding: 10px;
  animation: dropdownSlideIn 0.2s ease;
}

.date-picker-dropdown.open,
.time-picker-dropdown.open {
  display: block;
}

#date-dropdown-content,
#time-dropdown-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

#date-dropdown-content select,
#time-dropdown-content select {
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 11px;
}

/* Client Dropdown - More Compact */
.client-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  max-height: 140px;
  overflow-y: auto;
  z-index: 10001;
  display: none;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.client-dropdown .option {
  padding: 10px 14px;
  cursor: pointer;
  color: #374151;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}

.client-dropdown .option:last-child {
  border-bottom: none;
}

.client-dropdown .option:hover {
  background: #f8fafc;
  color: #1e293b;
}

/* Color Picker - Even Smaller */
input[type="color"] {
  width: 100%;
  height: 38px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 10px !important;
  cursor: pointer;
  padding: 3px !important;
  background: white;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

/* Action Buttons - More Compact */
.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.actions-row button {
  flex: 1;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Save Button */
#submitAppointment {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

#submitAppointment:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

#submitAppointment:active {
  transform: translateY(-1px);
}

/* Cancel Button */
.cancel-btn {
  background: #f3f4f6;
  color: #6b7280;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.cancel-btn:hover {
  background: #e5e7eb;
  color: #374151;
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

/* Delete Button - More Compact */
.delete-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  margin-left: 0 !important;
  margin-top: 10px !important;
  width: 100%;
  padding: 9px 18px;
  font-size: 12px;
}

.delete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(107, 114, 128, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  z-index: 10002;
}

.modal-close:hover {
  background: rgba(107, 114, 128, 0.2);
  color: #374151;
  transform: scale(1.1);
}

/* Modal Header for Editing - FIXED FOR FULL NAME VISIBILITY */
.modal-header {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  margin: -24px -24px 14px -24px;
  padding: 40px 24px 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  /* ENSURE FULL TEXT VISIBILITY */
  word-wrap: break-word;
  overflow: visible;
  line-height: 1.4;
  min-height: 24px;
}

.modal-header:hover {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.modal-header::before {
  content: '👤';
  font-size: 14px;
  flex-shrink: 0;
}

/* Animations */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-80px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design - Updated for Compact Size */
@media (max-width: 640px) {
  .modalappointment-inner {
    margin: 0;
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }
  
  .appointment-adder-form h2 {
    font-size: 18px;
    padding: 18px 18px 10px 18px;
  }
  
  .modal-content-area {
    padding: 0 18px 18px 18px;
  }
  
  .actions-row {
    flex-direction: column;
    gap: 6px;
  }
  
  .delete-btn {
    order: -1;
    margin-top: 6px !important;
  }

  .modal-header {
    margin: -1px -18px 12px -18px;
    padding: 14px 18px 14px 18px;
    font-size: 13px;
  }
}

/* Form positioning for relative dropdowns */
.form-row {
  position: relative;
}

/* Loading state for buttons */
.actions-row button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.actions-row button:disabled::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 6px;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* Fix: keep filter dropdown above navbar */
#sidebar + div {
  margin-top: 0;
  padding: 16px;
  background: #fafafa;
  overflow-y: auto;
  z-index: 1;
}

/* ───── HIDE APPOINTMENT TIME ON VERY SMALL SCREENS ───── */
@media (max-width: 667px) {
  .appt-time-mobile {
    display: none !important;
  }
}
/* ─── Remove inner 'today' styling on the date number ─── */
.date-container.today {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: inherit !important;
  font-weight: normal !important;
}

