/* Admin panel shell — shared layout for /adminsenior and /adminwedding.
   Per-site color comes from each theme's --admin-accent (orange for
   senior, blue for wedding) — no new per-site CSS needed here. */

.is-hidden { display: none !important; }

.admin-gate,
.admin-denied {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.admin-gate-card {
  max-width: 26rem;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-md);
  border-top: 4px solid var(--admin-accent);
}

.admin-gate-card .icon-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--admin-accent);
  margin: 0 auto;
}

.admin-gate-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 1rem 0 0.75rem;
  color: var(--text);
}

.admin-gate-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.admin-gate-card .btn {
  width: 100%;
  margin-bottom: 0.75rem;
}

.btn-admin-primary {
  background: var(--admin-accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-md);
}

.btn-admin-primary:hover {
  transform: translateY(-2px);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--admin-accent);
}

.admin-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-user-email {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  min-height: calc(100svh - 70px);
}

.admin-sidebar {
  border-left: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-nav-btn {
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.admin-nav-btn:hover {
  background: rgba(var(--admin-accent-rgb), 0.12);
}

.admin-nav-btn.is-active {
  background: var(--admin-accent);
  color: var(--on-accent);
  font-weight: 600;
}

.admin-main {
  padding: 2rem 2.5rem;
}

.admin-panel h2 {
  font-family: var(--font-display);
  margin-top: 0;
  color: var(--text);
}

.admin-stub-note {
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  max-width: 40rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 46rem;
}

.admin-card h3 {
  font-family: var(--font-display);
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--text);
}

.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-form-row input[type="text"],
.admin-form-row input[type="date"],
.admin-form-row input[type="number"],
.admin-form-row select {
  flex: 1 1 180px;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  color-scheme: var(--admin-color-scheme, light);
}

.admin-form-row .btn {
  padding: 0.7rem 1.3rem;
}

.admin-field-group {
  margin-bottom: 1.1rem;
}

.admin-field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.admin-field-group input[type="text"],
.admin-field-group input[type="email"],
.admin-field-group input[type="number"],
.admin-field-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  color-scheme: var(--admin-color-scheme, light);
}

.admin-field-group input::placeholder,
.admin-form-row input::placeholder,
.pricing-row textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.admin-field-group--narrow {
  flex: 0 1 130px;
}

.pkg-banner-preview-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.pkg-banner-preview {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.watermark-color-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-size: 0.85rem;
}

.watermark-color-control input[type="color"] {
  width: 3rem;
  height: 2.6rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-picker-btn {
  cursor: pointer;
  white-space: nowrap;
}

.file-picker-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.admin-form-row.watermark-options {
  margin-top: 0.75rem;
}

.upload-progress-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-row {
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.upload-row.is-success {
  border-color: rgba(80, 180, 100, 0.4);
}

.upload-row.is-error {
  border-color: rgba(220, 90, 90, 0.5);
  color: #d15b5b;
}

.upload-row .upload-retry-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.gallery-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.gallery-photo-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.gallery-photo-thumb a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.gallery-photo-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.gallery-photo-thumb.is-watermarked {
  border-color: var(--admin-accent);
  border-width: 2px;
}

.gallery-photo-check-wrap {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  padding: 3px;
  line-height: 0;
}

.gallery-photo-check {
  display: block;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.gallery-photo-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-photo-delete-btn:hover {
  background: #d15b5b;
}

/* ---------- Album-centric Gallery panel ---------- */

.gallery-albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-album-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  padding: 1.1rem 1.2rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.15s;
}

.gallery-album-card:hover {
  border-color: var(--admin-accent);
  transform: translateY(-2px);
}

.gallery-album-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}

.gallery-album-card-meta,
.gallery-album-card-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gallery-hd-note {
  grid-column: 1 / -1;
}

.album-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.2rem 0 1.6rem;
}

.album-detail-title {
  font-family: var(--font-display);
  margin: 0 0 0.3rem;
}

.album-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.album-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.6rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: 0.15s;
}

.album-dropzone.is-dragover {
  border-color: var(--admin-accent);
  background: rgba(139, 92, 246, 0.06);
  color: var(--text);
}

.album-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.album-photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.album-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-photo-card.is-purchased img {
  opacity: 0.45;
}

.album-photo-select {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  padding: 3px;
  line-height: 0;
}

.album-photo-select input {
  display: block;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.album-photo-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.25rem 0;
  border-radius: 6px;
}

.album-trash-actions {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.7);
}

.album-trash-actions .btn {
  flex: 1;
  padding: 0.3rem 0.4rem;
  font-size: 0.7rem;
  min-height: 0;
}

.admin-card-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.album-photo-customize-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.album-photo-customize-btn:hover {
  background: var(--admin-accent);
}

.photo-settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1.2rem;
  overflow-y: auto;
  z-index: 400;
}

.photo-settings-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem;
}

.photo-settings-modal h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
}

.photo-settings-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.photo-settings-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1.1rem;
}

.portfolio-thumb {
  cursor: grab;
}

.portfolio-thumb.is-dragging {
  opacity: 0.4;
  outline: 2px dashed var(--admin-accent);
}

.portfolio-preview-toggle-btn {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.portfolio-preview-toggle-btn:hover {
  color: #fff;
}

.portfolio-preview-toggle-btn.is-active {
  background: var(--admin-accent);
  color: var(--on-accent);
}

.portfolio-order-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 2;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.portfolio-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(var(--admin-accent-rgb), 0.06);
}

.portfolio-select-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.portfolio-bulk-toolbar .admin-checkbox-row {
  margin: 0;
}

.portfolio-bulk-toolbar .portfolio-bulk-delete-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.portfolio-bulk-toolbar .portfolio-bulk-delete-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.portfolio-bulk-toolbar .admin-stub-note {
  flex-basis: 100%;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.8rem;
  margin: 0;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-card-header h3 {
  margin: 0;
}

.gallery-filter-options {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.gallery-filter-options .admin-field-group:last-child {
  margin-bottom: 0;
}

.filter-control-label {
  display: flex;
  flex: 1 1 180px;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.admin-form-row .filter-control-label select {
  flex: none;
  height: 2.75rem;
  min-height: 2.75rem;
}

.gallery-filter-options .watermark-color-control {
  align-self: flex-end;
  min-height: 2.75rem;
}

.watermark-library-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.82);
}

.watermark-library-dialog {
  width: min(900px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.watermark-library-close {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 2rem;
}

.watermark-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.watermark-library-item {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.watermark-library-item img,
.watermark-library-missing {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 8px;
  background-color: #d8d8d8;
  background-image: linear-gradient(45deg, #fff 25%, transparent 25%), linear-gradient(-45deg, #fff 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #fff 75%), linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.watermark-library-item figcaption {
  margin-top: 0.6rem;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pricing-row {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.4rem 1.4rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.pricing-row .admin-form-row {
  margin-bottom: 0.6rem;
}

.pricing-row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -0.15rem 0 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.pricing-row-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.pricing-row-title.is-placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

.pricing-row-price {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-accent);
  white-space: nowrap;
}

.booking-payment-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin: 0.7rem 0 1rem;
}

.booking-payment-status span:first-child {
  font-weight: 700;
  color: var(--text);
}

.booking-payment-status[data-status="paid_in_full"] span:first-child { color: #2f9e5b; }
.booking-payment-status[data-status="pending_retainer"] span:first-child { color: #c0392b; }
.booking-payment-status[data-status="retainer_paid"] span:first-child { color: var(--admin-accent); }

.booking-detail-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
  font-size: 0.88rem;
}

.booking-detail-grid dt {
  color: var(--text-muted);
  font-weight: 600;
}

.booking-detail-grid dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.booking-list-heading {
  margin: 2rem 0 1rem;
}

.booking-inquiries-list,
.bookings-list {
  display: grid;
  gap: 1rem;
}

.booking-inquiry-badge {
  color: var(--admin-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.booking-inquiry-row a {
  color: var(--admin-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.member-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.member-role-badge[data-role="admin"] {
  color: var(--admin-accent);
  border-color: var(--admin-accent);
}

.pricing-fields-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.pricing-fields-row .admin-field-group {
  margin-bottom: 0;
}

.pricing-section-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.1rem 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pricing-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.pricing-field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0.3rem;
}

.pricing-row textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  resize: vertical;
  margin-bottom: 0.6rem;
}

.pricing-row-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pkg-addons-list {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.pkg-addon-row {
  display: grid;
  grid-template-columns: 1fr 130px auto;
  gap: 0.6rem;
  align-items: center;
}

.pkg-addon-row input[type="text"],
.pkg-addon-row input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  color-scheme: var(--admin-color-scheme, light);
}

.pkg-addon-remove {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  font-size: 1.1rem;
  line-height: 1;
}

.pkg-add-addon-btn {
  margin-bottom: 0.6rem;
}

@media (max-width: 760px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-main {
    padding: 1.5rem;
  }
  .admin-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
