/* Admin login + dashboard overlays */

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.admin-login-card {
  width: 400px;
  max-width: 90%;
  background: #fafaf8;
  border-radius: 28px;
  padding: 48px;
  position: relative;
  opacity: 0;
  transform: scale(0.94) translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.admin-overlay.open .admin-login-card {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.admin-login-card.shake {
  animation: admin-shake 0.45s ease;
}

@keyframes admin-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

.admin-login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  color: #c9a96e;
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.admin-login-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #6b6b6b;
  text-align: center;
  margin: 0 0 28px;
}

.admin-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.admin-input {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  background: white;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 14px;
  box-sizing: border-box;
}

.admin-input:focus {
  border-color: #c9a96e;
}

.admin-input.error {
  border-color: #e05252;
}

.admin-error-msg {
  color: #e05252;
  font-size: 13px;
  margin: -6px 0 14px;
  font-family: 'DM Sans', sans-serif;
}

.admin-btn-gold {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 100px;
  background: #c9a96e;
  color: #0a0a0a;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-btn-gold:hover {
  background: #e8d5b0;
}

.admin-btn-outline {
  border: 1.5px solid rgba(201, 169, 110, 0.6);
  color: #c9a96e;
  background: transparent;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 100px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

/* Hidden navbar admin trigger */
.admin-trigger-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.admin-trigger-btn.visible {
  opacity: 1;
  pointer-events: all;
}

/* Dashboard */
.admin-dashboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #f5f4f0;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
}

.admin-dashboard-overlay.open {
  transform: translateX(0);
}

.admin-dashboard-overlay.closing {
  transform: translateX(100%);
}

.admin-dash-topbar {
  min-height: 64px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.admin-dash-brand {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: #1a1a1a;
}

.admin-dash-brand span {
  color: #6b6b6b;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  margin-left: 12px;
}

.admin-dash-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
}

.db-online {
  background: #e8f5e9;
  color: #2e7d32;
}

.db-offline {
  background: #ffebee;
  color: #c62828;
}

.admin-lang-pills {
  display: flex;
  gap: 4px;
  background: #f5f4f0;
  padding: 4px;
  border-radius: 100px;
}

.admin-lang-pills button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #6b6b6b;
}

.admin-lang-pills button.active {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.admin-dash-hamburger {
  display: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
}

.admin-dash-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.admin-dash-sidebar {
  width: 240px;
  background: #0a0a0a;
  padding: 24px 16px;
  flex-shrink: 0;
  overflow-y: auto;
}

.admin-dash-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 4px;
  border-left: 3px solid transparent;
}

.admin-dash-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.admin-dash-nav-item.active {
  color: #fff;
  border-left-color: #c9a96e;
  background: rgba(201, 169, 110, 0.12);
}

.admin-dash-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: #f5f4f0;
}

.admin-tab-content {
  animation: admin-tab-in 0.25s ease;
}

@keyframes admin-tab-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.admin-stat-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #c9a96e;
}

.admin-stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #6b6b6b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.admin-stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: #1a1a1a;
  margin: 0;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-section-header h2 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: #1a1a1a;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

.admin-table th,
.admin-table td {
  padding: 14px 18px;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

.admin-table th {
  background: #fff;
  color: #6b6b6b;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.admin-table tr:nth-child(even) td {
  background: #fafaf8;
}

.admin-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.admin-badge.confirmed {
  background: #e8f5e9;
  color: #2e7d32;
}

.admin-badge.pending {
  background: #fff8e1;
  color: #f57f17;
}

.admin-badge.cancelled {
  background: #ffebee;
  color: #c62828;
}

.admin-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.admin-toggle {
  width: 44px;
  height: 24px;
  border-radius: 100px;
  background: #ddd;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.admin-toggle.on {
  background: #c9a96e;
}

.admin-toggle.on::after {
  transform: translateX(20px);
}

.admin-gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-gallery-tile {
  height: 140px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.admin-gallery-tile .admin-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.25s;
  color: #fff;
  font-size: 13px;
}

.admin-gallery-tile:hover .admin-gallery-overlay {
  opacity: 1;
}

.admin-settings-form {
  max-width: 520px;
  background: #fff;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
}

.admin-settings-form label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #6b6b6b;
  margin-bottom: 6px;
}

.admin-hours-row {
  display: grid;
  grid-template-columns: 100px 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

.admin-hours-input {
  margin-bottom: 0;
  padding: 10px 12px;
}

@media (max-width: 768px) {
  .admin-login-card {
    width: 90%;
    padding: 32px;
  }

  .admin-dash-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .admin-dash-sidebar {
    position: absolute;
    left: 0;
    top: 64px;
    bottom: 0;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .admin-dash-sidebar.open {
    transform: translateX(0);
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-gallery-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-drawer {
    width: 100vw;
  }

  .admin-drawer-actions {
    flex-direction: column;
  }

  .admin-drawer-save {
    width: 100%;
  }
}

/* Appointment drawer */
.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.admin-drawer-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.admin-drawer {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 480px;
  max-width: 100vw;
  background: #fafaf8;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  z-index: 10002;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-drawer.open {
  transform: translateX(0);
}

.admin-drawer.closing {
  transform: translateX(100%);
  transition: transform 0.35s ease-in;
}

.admin-drawer-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.admin-drawer-back {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  color: #1a1a1a;
}

.admin-drawer-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin: 0;
  color: #1a1a1a;
}

.admin-drawer-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #6b6b6b;
  margin: 4px 0 0;
}

.admin-drawer-form {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-drawer-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.admin-optional {
  font-weight: 400;
  color: #6b6b6b;
}

.admin-drawer-input {
  margin-bottom: 4px;
}

.admin-drawer-input.valid {
  border-color: #4caf50;
}

.admin-drawer-textarea {
  resize: vertical;
  min-height: 88px;
}

.admin-field-error {
  color: #e05252;
  font-size: 12px;
  margin: 0 0 12px;
  font-family: 'DM Sans', sans-serif;
}

.admin-drawer-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-drawer-cancel {
  flex-shrink: 0;
}

.admin-drawer-save {
  flex: 1;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table-empty {
  text-align: center;
  color: #6b6b6b;
  padding: 32px !important;
}

.admin-table-actions {
  white-space: nowrap;
}

.admin-icon-btn {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  margin-right: 4px;
  font-size: 14px;
}

.admin-icon-btn:hover {
  background: #f5f4f0;
}

.admin-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-availability-editor {
  width: 100%;
}

.admin-availability-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.admin-availability-slots .cal-slot {
  width: 100%;
  border: none;
  text-align: left;
}

.admin-availability-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #6b6b6b;
  margin: 12px 0 0;
}

.admin-success-msg {
  color: #15803d;
  font-size: 13px;
  margin-top: 12px;
}

.admin-price-edit {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-price-input {
  width: 80px;
  margin-bottom: 0;
  padding: 8px 10px;
}

.admin-client-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-client-detail {
  background: #fafaf8;
  border-radius: 20px;
  padding: 32px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

/* Save button spinner */
.admin-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: admin-spin 0.7s linear infinite;
  vertical-align: -2px;
}

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

/* MongoDB storage widget */
.storage-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  margin-top: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.storage-header h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.storage-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.storage-bar {
  flex: 1;
  height: 10px;
  background: #f0f0f0;
  border-radius: 100px;
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.3s ease;
}

#storage-pct {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  min-width: 40px;
  text-align: right;
}

.storage-details {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #6b6b6b;
  margin-bottom: 16px;
}

.storage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  gap: 12px;
  flex-wrap: wrap;
}

#storage-last-cleanup {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #9ca3af;
}

.cleanup-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid rgba(201, 169, 110, 0.5);
  color: #c9a96e;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.cleanup-btn:hover {
  background: #c9a96e;
  color: white;
  border-color: #c9a96e;
}

.cleanup-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.storage-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}

.badge-ok {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-warn {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fde047;
}

.badge-high {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.badge-critical {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fca5a5;
}

.admin-client-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #6b6b6b;
  margin: 0 0 8px;
}
