/* ========================================
   GRIMY GRILLS CRM / Client Relationship Manager
   ======================================== */

/* Prevent body scroll on CRM page */
.crm-page {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.crm-page .header {
  flex-shrink: 0;
}

/* ========================================
   LAYOUT
   ======================================== */

.crm-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ========================================
   WORKSPACE (centered list → split w/ detail)
   ======================================== */

.crm-workspace {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  padding: 24px 24px 32px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
}

.crm-workspace--split {
  display: grid;
  grid-template-columns: minmax(280px, 400px) 1fr;
  gap: 24px;
  align-items: stretch;
  width: 100%;
}

.crm-list-panel {
  width: 100%;
  flex-shrink: 0;
}

.crm-workspace--split .crm-list-panel {
  min-width: 0;
}

.crm-detail-panel {
  width: 100%;
  flex-shrink: 0;
}

.crm-workspace--split .crm-detail-panel {
  max-width: none;
  min-width: 0;
  overflow-y: auto;
  min-height: 0;
}

/* Salesforce-style list view card */
.list-view-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(43, 41, 38, 0.06), 0 4px 12px rgba(43, 41, 38, 0.04);
  overflow: hidden;
}

.list-view-header {
  padding: 20px 22px 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafafa 0%, var(--white) 100%);
}

.list-view-breadcrumb {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--charcoal-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.list-bc-sep {
  margin: 0 6px;
  opacity: 0.5;
}

.list-view-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

.list-view-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--charcoal);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
}

.client-count {
  background: var(--cream-dark);
  color: var(--charcoal-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  font-family: 'Outfit', sans-serif;
  vertical-align: middle;
}

.list-view-toolbar {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.list-view-search {
  position: relative;
  max-width: 320px;
}

.list-view-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--charcoal-light);
  pointer-events: none;
}

.list-view-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  color: var(--charcoal);
  background: var(--cream);
  transition: border-color var(--transition);
  box-sizing: border-box;
}

.list-view-search input:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(196, 80, 27, 0.08);
  background: var(--white);
}

/* List table (Salesforce-like columns) */
.list-table {
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.list-table-header {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) minmax(100px, 2fr) minmax(72px, 100px);
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--charcoal-light);
  background: #f4f2ef;
  border-bottom: 1px solid var(--border);
}

.list-table-body {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  overflow-y: auto;
  max-height: min(52vh, 520px);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.crm-workspace--split .list-table-body {
  max-height: min(calc(100dvh - 220px), 640px);
}

.list-table-body::-webkit-scrollbar {
  width: 6px;
}

.list-table-body::-webkit-scrollbar-track {
  background: transparent;
}

.list-table-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.client-list {
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* List loading */
.list-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 18px;
  color: var(--charcoal-light);
  font-size: 0.875rem;
  grid-column: 1 / -1;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Client list row */
.client-item {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) minmax(100px, 2fr) minmax(72px, 100px);
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.client-item:last-child {
  border-bottom: none;
}

.client-item:hover {
  background: #faf8f6;
}

.client-item.active {
  background: var(--copper-light);
  box-shadow: inset 3px 0 0 var(--copper);
}

.client-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--cream-dark);
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.client-item.active .client-avatar {
  background: rgba(196, 80, 27, 0.15);
  color: var(--copper);
}

.client-item-namecell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.client-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-item.active .client-item-name {
  color: var(--copper-dark);
}

.client-item-contact {
  font-size: 0.8rem;
  color: var(--charcoal-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.client-item-last {
  font-size: 0.72rem;
  color: var(--charcoal-light);
  text-align: right;
}

.no-results {
  grid-column: 1 / -1;
  padding: 36px 18px;
  text-align: center;
  color: var(--charcoal-light);
  font-size: 0.875rem;
}

/* ========================================
   MAIN PANEL
   ======================================== */

.crm-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cream);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.crm-main::-webkit-scrollbar { width: 5px; }
.crm-main::-webkit-scrollbar-track { background: transparent; }
.crm-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ========================================
   CLIENT DETAIL
   ======================================== */

.client-detail {
  padding: 28px 28px 60px;
  max-width: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(43, 41, 38, 0.06);
  box-sizing: border-box;
}

.client-detail.hidden { display: none; }

/* Detail header */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.detail-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.detail-back-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--charcoal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.detail-back-btn:hover {
  background: var(--cream-dark);
  border-color: var(--copper);
  color: var(--copper);
}

.detail-back-btn:focus-visible {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(196, 80, 27, 0.12);
}

.client-avatar-lg {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  background: var(--copper-light);
  color: var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.client-header-info h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  color: var(--charcoal-light);
}

.meta-item svg {
  color: var(--copper);
  flex-shrink: 0;
}

.meta-item a {
  color: var(--copper);
  font-weight: 500;
}

.meta-item a:hover {
  text-decoration: underline;
}

.meta-item-vip {
  background: rgba(196, 80, 27, 0.12);
  color: var(--copper);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.detail-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

#toggleVipBtn.btn-vip-active {
  background: rgba(196, 80, 27, 0.16);
  border-color: rgba(196, 80, 27, 0.4);
  color: var(--copper);
}

/* Detail sections */
.detail-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-section-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--charcoal);
}

.detail-notes-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--transition);
}

.detail-notes-input:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(196, 80, 27, 0.08);
  background: var(--white);
}

.detail-notes-input::placeholder {
  color: var(--charcoal-light);
  opacity: 0.55;
}

/* ========================================
   PHOTOS GRID
   ======================================== */

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.photos-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--charcoal-light);
  opacity: 0.5;
  font-size: 0.875rem;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--cream-dark);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.photo-thumb:hover img {
  transform: scale(1.04);
}

.photo-thumb .photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(43, 41, 38, 0.75);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  line-height: 1;
}

.photo-thumb:hover .photo-delete {
  opacity: 1;
}

/* Upload progress bar */
.upload-progress {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-progress.hidden { display: none; }

.upload-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.upload-fill {
  height: 100%;
  background: var(--copper);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

#photoUpload {
  display: none;
}

.upload-label {
  cursor: pointer;
}

/* ========================================
   SERVICE HISTORY
   ======================================== */

.service-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--charcoal-light);
  opacity: 0.5;
  font-size: 0.875rem;
}

.service-record {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  transition: background var(--transition);
}

.service-record:hover {
  background: var(--cream-dark);
}

.service-record-date {
  text-align: center;
  min-width: 56px;
  flex-shrink: 0;
}

.service-record-date .day {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--charcoal);
  line-height: 1;
}

.service-record-date .month {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--copper);
}

.service-record-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  flex-shrink: 0;
}

.service-record-body {
  flex: 1;
  min-width: 0;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.service-tag {
  background: var(--copper-light);
  color: var(--copper-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.service-record-notes {
  font-size: 0.875rem;
  color: var(--charcoal-light);
  line-height: 1.6;
}

.service-record-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.service-price {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sage);
}

.service-record-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal-light);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--cream-dark);
  color: var(--charcoal);
}

.btn-icon.danger:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
}

/* ========================================
   BOOKINGS LIST
   ======================================== */

.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-record {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--cream);
  transition: background var(--transition);
}

.booking-record:hover {
  background: var(--cream-dark);
}

.booking-record.cancelled {
  opacity: 0.55;
}

.booking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.booking-time {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--charcoal);
}

.booking-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.booking-status-pending {
  background: #FEF3C7;
  color: #92400E;
}

.booking-status-confirmed {
  background: #D1FAE5;
  color: #065F46;
}

.booking-status-cancelled {
  background: var(--cream-dark);
  color: var(--charcoal-light);
}

.booking-upcoming {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--copper-light);
  color: var(--copper-dark);
}

/* ========================================
   BUTTONS (extra sizes)
   ======================================== */

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
  gap: 5px;
}

.btn-danger {
  background: #DC2626;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #B91C1C;
  transform: translateY(-1px);
}

/* ========================================
   MODALS
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 41, 38, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(43, 41, 38, 0.2);
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm {
  max-width: 400px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--cream);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--charcoal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.modal-close:hover {
  background: var(--cream-dark);
  color: var(--charcoal);
}

.modal form {
  padding: 20px 28px;
}

.modal .form-group {
  margin-bottom: 16px;
}

.modal .form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--charcoal);
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--charcoal);
  background: var(--cream);
  transition: border-color var(--transition);
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(196, 80, 27, 0.08);
  background: var(--white);
}

.modal .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.crm-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  cursor: pointer;
}

.crm-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 20px;
}

.confirm-body {
  padding: 16px 28px;
}

.confirm-body p {
  color: var(--charcoal-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Service checkboxes */
.service-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.service-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.service-checkbox-item:hover {
  border-color: var(--copper);
  background: var(--copper-light);
}

.service-checkbox-item.checked {
  border-color: var(--copper);
  background: var(--copper-light);
}

.service-checkbox-item input[type="checkbox"] {
  display: none;
}

.service-checkbox-dot {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.service-checkbox-item.checked .service-checkbox-dot {
  background: var(--copper);
  border-color: var(--copper);
  color: white;
}

.service-checkbox-dot::after {
  content: '';
  display: none;
}

.service-checkbox-item.checked .service-checkbox-dot::after {
  display: block;
  width: 5px;
  height: 8px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.service-checkbox-label {
  flex: 1;
  min-width: 0;
}

.service-checkbox-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--charcoal);
  display: block;
}

.service-checkbox-price {
  font-size: 0.75rem;
  color: var(--charcoal-light);
  display: block;
}

.service-checkbox-item.checked .service-checkbox-price {
  color: var(--copper-dark);
}

/* ========================================
   LIGHTBOX
   ======================================== */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.92);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lightbox.hidden { display: none; }

.lightbox-content {
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  line-height: 1;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  line-height: 1;
  padding-bottom: 2px;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ========================================
   TOAST
   ======================================== */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--charcoal);
  color: white;
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  display: flex !important;
}

.toast.success { background: var(--sage); }
.toast.error { background: #DC2626; }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
  .client-detail {
    padding: 24px 20px 48px;
  }

  .crm-workspace--split {
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 16px;
  }
}

@media (max-width: 680px) {
  .crm-page {
    overflow: auto;
    height: auto;
  }

  .crm-layout {
    overflow: visible;
    height: auto;
  }

  .crm-main {
    overflow: visible;
  }

  .crm-workspace,
  .crm-workspace--split {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: none;
    overflow: visible;
  }

  .crm-list-panel,
  .crm-detail-panel {
    max-width: none;
  }

  .list-table-body {
    max-height: 45vh;
  }

  .detail-header {
    flex-direction: column;
    gap: 16px;
  }

  .detail-header-actions {
    width: 100%;
  }

  .service-checkboxes {
    grid-template-columns: 1fr;
  }

  .modal .form-row {
    grid-template-columns: 1fr;
  }

  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}
