/* Sticky Footer */
html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

.main-content {
  flex: 1;
}

/* Minimalist Dashboard */
.dashboard-title {
  font-size: 1.5rem;
  font-weight: 300;
  color: #374151;
  margin-bottom: 1.5rem;
}

.card-minimal {
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-minimal:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Patient Input */
.patient-input {
  border: 2px solid #e5e7eb;
  border-left: none;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.patient-input:focus {
  border-color: #4066d4;
  box-shadow: none;
  outline: none;
}

.input-group > .input-group-text:first-child {
  border: 2px solid #e5e7eb;
  border-right: none;
  border-radius: 8px 0 0 8px;
  transition: border-color 0.2s;
}

.input-group:focus-within > .input-group-text:first-child {
  border-color: #4066d4;
}

.input-group:focus-within .patient-input {
  border-color: #4066d4;
  box-shadow: 0 0 0 3px rgba(64, 102, 212, 0.1);
}

/* Patient Autocomplete Dropdown */
.patient-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 260px;
  overflow-y: auto;
}

.patient-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
  border-bottom: 1px solid #f3f4f6;
}

.patient-dropdown-item:last-child {
  border-bottom: none;
}

.patient-dropdown-item:hover {
  background: #f8fafc;
}

.patient-dropdown-item.create-new {
  color: #4066d4;
  font-size: 0.9rem;
  font-weight: 500;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: 0 0 10px 10px;
}

.patient-dropdown-item.create-new:hover {
  background: #eff6ff;
}

/* Patient Chip (selected state) */
.patient-chip {
  display: flex;
  align-items: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

/* New Patient Form */
.new-patient-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

/* Package Buttons */
.package-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.package-btn {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 16px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 120px;
}

.package-btn:hover {
  border-color: #4066d4;
  background: #f8fafc;
}

.package-btn.selected {
  border-color: #4066d4;
  background: #eff6ff;
}

/* Studies Table */
.studies-table-container {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.studies-table {
  margin-bottom: 0;
}

.studies-table th {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 500;
  color: #6b7280;
  font-size: 0.875rem;
  position: sticky;
  top: 0;
}

.studies-table td {
  padding: 8px 12px;
  vertical-align: middle;
}

.studies-table tr:hover {
  background: #f9fafb;
}

/* Summary Table */
.summary-table {
  font-size: 0.9rem;
}

.summary-table th {
  background: #f9fafb;
  font-weight: 500;
}

.total-row {
  background: #f3f4f6;
  font-weight: 600;
}

/* Submit Button */
.btn-create {
  background: #4066d4;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-create:hover:not(:disabled) {
  background: #3358c4;
  transform: translateY(-1px);
}

.btn-create:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Search Input */
.search-input {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.search-input:focus {
  border-color: #4066d4;
  outline: none;
}

/* Pending Studies Section */
.pending-section {
  margin-bottom: 1.5rem;
}

.pending-card {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  background: #fef3c7;
  transition: all 0.2s;
  cursor: pointer;
}

.pending-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pending-card.paid {
  background: #d1fae5;
}

/* Footer Styles */
.footer {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
  .studies-table-container {
    max-height: 200px;
  }

  .summary-container {
    margin-top: 1rem;
  }
}

/* ── iOS Drum Date Picker ─────────────────────────────── */
.date-drum-trigger {
  cursor: pointer;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  height: calc(1.3125rem + 0.5rem + 2px);
  display: flex;
  align-items: center;
  color: #212529;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}
.date-drum-trigger:hover { border-color: #adb5bd; }
.date-drum-trigger:focus {
  border-color: #4066d4;
  box-shadow: 0 0 0 3px rgba(64, 102, 212, 0.15);
  outline: none;
}

.date-drum-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1050;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
  width: 270px;
  overflow: hidden;
  animation: drumIn 0.17s ease-out;
}
@keyframes drumIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.date-drum-container {
  position: relative;
  display: flex;
  height: 180px;
  background: #fff;
}

.date-drum-col {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.3) 18%,
    black 36%,
    black 64%,
    rgba(0,0,0,0.3) 82%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.3) 18%,
    black 36%,
    black 64%,
    rgba(0,0,0,0.3) 82%,
    transparent 100%
  );
}
.date-drum-col::-webkit-scrollbar { display: none; }

.drum-item {
  height: 36px;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #374151;
  user-select: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s;
}
.drum-item:hover { color: #4066d4; }

.drum-spacer { min-height: 72px; }

.date-drum-overlay {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  transform: translateY(-50%);
  height: 36px;
  border-top: 1.5px solid #d1d5db;
  border-bottom: 1.5px solid #d1d5db;
  pointer-events: none;
  border-radius: 6px;
  background: rgba(64, 102, 212, 0.04);
}

.date-drum-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #f3f4f6;
  background: #f9fafb;
}