/* ── Shared Lightbox Overlay ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
.lightbox-overlay--visible {
  display: flex;
}
.lightbox-overlay__img {
  max-width: 95%;
  max-height: 95vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* ── Workboard Photo Lightbox ── */
.wb-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.wb-lightbox-overlay--visible {
  display: flex;
}
.wb-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 2;
  padding: 8px;
}
.wb-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
}
.wb-lightbox__nav--prev { left: 16px; }
.wb-lightbox__nav--next { right: 16px; }
.wb-lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}
.wb-lightbox__counter {
  color: #fff;
  font-size: var(--text-small);
  font-weight: 700;
  margin-top: 12px;
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

/* ── Shared Toast Notification ── */
.toast-notification {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 10001;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: var(--text-subsection);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 920px) {
  .toast-notification { bottom: 144px; }
}

/* ── Shared Debug/Data Modal ── */
.debug-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}
.debug-modal {
  background: var(--bg-primary, #fff);
  border-radius: 12px;
  width: 90vw;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.debug-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.debug-modal__title {
  margin: 0;
  font-size: 1rem;
}
.debug-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary, #666);
  padding: 0 4px;
}
.debug-modal__body {
  padding: 20px;
  overflow: auto;
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-body);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Inline Edit Input ── */
.inline-edit-input {
  width: 100%;
  padding: 4px 8px;
  font-size: var(--text-small);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input, #fff);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

/* ── PWA Install Modal ── */
.pwa-share-icon {
  font-size: 1.3em;
}
.pwa-instructions-modal__dismiss {
  margin-top: 1rem;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: #6366f1;
  color: #fff;
  font-size: var(--text-subsection);
  font-weight: 600;
  cursor: pointer;
}
.pwa-instructions-modal__dismiss:hover {
  background: #4f46e5;
}

/* ═══════════════════════════════════════════════
   JS-rendered UI utility classes
   Replaces common inline styles in view JS files
   ═══════════════════════════════════════════════ */

/* ── Layout ── */
.u-flex { display: flex; }
.u-flex-col { display: flex; flex-direction: column; }
.u-flex-center { display: flex; align-items: center; }
.u-flex-between { display: flex; justify-content: space-between; align-items: center; }
.u-flex-fill { flex: 1; }
.u-flex-shrink-0 { flex-shrink: 0; }
.u-gap-4 { gap: 4px; }
.u-gap-6 { gap: 6px; }
.u-gap-8 { gap: 8px; }
.u-gap-10 { gap: 10px; }
.u-gap-12 { gap: 12px; }
.u-flex-wrap { flex-wrap: wrap; }
.u-text-right { text-align: right; }
.u-text-center { text-align: center; }

/* ── Spacing ── */
.u-mb-4 { margin-bottom: 4px; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-12 { margin-bottom: 12px; }
.u-mb-14 { margin-bottom: 14px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-14 { margin-top: 14px; }

/* ── Images ── */
.u-img-cover { width: 100%; height: 100%; object-fit: cover; }

/* ── Typography ── */
.u-label-xs {
  font-size: 8px; letter-spacing: 1.5px; color: #94a3b8;
  margin-top: 1px; text-transform: uppercase; font-weight: 600;
}
.u-label-sm {
  font-size: 9px; font-weight: 700; color: #a8a29e;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 2px;
}
.u-text-primary-md { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.u-text-muted-xs { font-size: 11px; color: #94a3b8; }
.u-text-sm { font-size: 12px; }
.u-heading-lg { margin-top: 14px; font-size: 18px; font-weight: 700; color: var(--text-secondary); }
.u-heading-md { font-size: 14px; font-weight: 700; }

/* ── Opacity ── */
.u-opacity-50 { opacity: .5; }
.u-opacity-70 { opacity: .7; }

/* ── Forms ── */
.u-form-input {
  flex: 1; padding: 7px 10px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-base); color: var(--text-primary);
  outline: none; font-family: 'Manrope', sans-serif;
}

/* ── Buttons ── */
.u-btn-primary {
  padding: 6px 12px; font-size: 11px; font-weight: 600;
  border: none; border-radius: 6px; background: #3b82f6;
  color: #fff; cursor: pointer; white-space: nowrap;
}
.u-btn-success {
  padding: 6px 12px; font-size: 11px; font-weight: 600;
  border: none; border-radius: 6px; background: #16a34a;
  color: #fff; cursor: pointer; white-space: nowrap;
}
.u-btn-secondary {
  flex: 1; padding: 12px; background: #e7e5e4; color: #57534e;
  border: none; border-radius: 6px; font-size: 13px;
  font-weight: 700; cursor: pointer;
}
.u-btn-xs { padding: 6px 12px; font-size: 11px; }
.u-border-none { border: 0; }

/* ── Empty states ── */
.u-empty-state {
  padding: 12px; font-size: 13px; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 8px; text-align: center;
}
.u-centered-block { text-align: center; padding: 60px 20px; }

/* ── Scroll area ── */
.u-scroll-area { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ── Workboard grid ── */
.u-grid-7col { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
