/* ============================================================
   ADMIN.CSS — Admin Panel page
   ============================================================ */

/* Extra colour tokens used only on admin */
:root {
  --green: #2D7A3A;
  --green-bg: #F0F7F0;
  --red: #C0392B;
  --red-bg: #FEF2F2;
  --yellow: #B7791F;
  --yellow-bg: #FFFBEB;
}

/* Login screen (dark) */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh; height: 100dvh; min-height: 100dvh;
  background: var(--ink);
}

.login-box {
  background: var(--cream);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--clay);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--warm-grey);
  margin-bottom: 32px;
}

.login-box input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--sand);
  border-radius: 12px;
  font-size: 15px;
  margin-bottom: 12px;
  font-family: var(--sans);
  outline: none;
}

.login-box input:focus {
  border-color: var(--clay);
}

.login-btn {
  width: 100%;
  background: var(--clay);
  color: white;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}

.login-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

/* Main layout */
.main {
  display: none;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--ink);
  min-height: 100vh; height: 100dvh; min-height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  padding: 24px 16px;
}

.sidebar-logo {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--clay-light);
  margin-bottom: 4px;
}

.sidebar-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 32px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 4px;
  transition: all 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(196, 98, 45, 0.2);
  color: white;
}

.sidebar-nav a .badge {
  background: var(--clay);
  color: white;
  border-radius: 100px;
  padding: 1px 7px;
  font-size: 11px;
  margin-left: auto;
}

.sidebar-bottom {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
}

.logout-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--sans);
}

/* Content area */
.content {
  margin-left: 220px;
  padding: 32px;
}

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

.page-title {
  font-size: 24px;
  font-weight: 700;
}

.page-sub {
  font-size: 14px;
  color: var(--warm-grey);
  margin-top: 4px;
}

.refresh-btn {
  background: white;
  border: 1.5px solid var(--sand);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 6px;
}

.refresh-btn:hover {
  border-color: var(--clay);
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  border: 1.5px solid var(--sand);
}

.stat-num {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--warm-grey);
}

.stat-card.pending .stat-num { color: var(--yellow); }
.stat-card.approved .stat-num { color: var(--green); }
.stat-card.rejected .stat-num { color: var(--red); }

/* Filters */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--sand);
  background: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid var(--sand);
  border-radius: 100px;
  padding: 7px 16px;
  margin-left: auto;
}

.search-box input {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: var(--sans);
  width: 160px;
}

/* Application cards */
.app-card {
  background: white;
  border-radius: 16px;
  border: 1.5px solid var(--sand);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.app-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
}

.app-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clay);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.app-name {
  font-size: 16px;
  font-weight: 600;
}

.app-meta {
  font-size: 13px;
  color: var(--warm-grey);
  margin-top: 2px;
}

.app-status {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending { background: var(--yellow-bg); color: var(--yellow); }
.status-approved { background: var(--green-bg); color: var(--green); }
.status-rejected { background: var(--red-bg); color: var(--red); }

.app-time {
  font-size: 12px;
  color: var(--warm-grey);
  margin-left: 12px;
  white-space: nowrap;
}

.app-chevron {
  font-size: 18px;
  color: var(--warm-grey);
  margin-left: 8px;
  transition: transform 0.2s;
}

.app-card.expanded .app-chevron {
  transform: rotate(180deg);
}

/* Expandable details */
.app-details {
  display: none;
  border-top: 1px solid var(--sand);
  padding: 24px;
}

.app-card.expanded .app-details {
  display: block;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item .label {
  font-size: 11px;
  color: var(--warm-grey);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.detail-item .value {
  font-size: 14px;
  font-weight: 500;
}

/* Documents section */
.docs-section {
  margin-bottom: 24px;
}

.docs-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-grey);
  margin-bottom: 12px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--cream);
  border-radius: 10px;
  margin-bottom: 8px;
}

.doc-icon {
  font-size: 22px;
}

.doc-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.doc-action {
  background: var(--ink);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}

.doc-link {
  color: var(--clay);
  font-size: 13px;
  word-break: break-all;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--sand);
}

.action-btn {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans);
  border: none;
  transition: all 0.15s;
}

.approve-btn { background: var(--green); color: white; }
.approve-btn:hover { background: #236830; }

.reject-btn { background: white; color: var(--red); border: 2px solid var(--red); }
.reject-btn:hover { background: var(--red-bg); }

.msg-btn { background: white; color: var(--ink); border: 2px solid var(--sand); }
.msg-btn:hover { border-color: var(--clay); }

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

/* Notes area */
.notes-area {
  margin-top: 16px;
}

.notes-area textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--sand);
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--sans);
  resize: none;
  outline: none;
}

.notes-area textarea:focus {
  border-color: var(--clay);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--warm-grey);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-text {
  font-size: 15px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--warm-grey);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--sand);
  border-top-color: var(--clay);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Image modal */
.img-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.img-modal.open {
  display: flex;
}

.img-modal img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
}

.img-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Listing moderation cards */
.listing-admin-card {
  background: white;
  border: 1px solid var(--sand);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.listing-admin-card.pending { border-left: 4px solid #3B82F6; }
.listing-admin-card.active { border-left: 4px solid #22C55E; }
.listing-admin-card.paused { border-left: 4px solid #F59E0B; }

.listing-admin-info {
  flex: 1;
  min-width: 0;
}

.listing-admin-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.listing-admin-meta {
  font-size: 13px;
  color: var(--warm-grey);
  margin-bottom: 8px;
}

.listing-admin-detail {
  font-size: 12px;
  color: var(--warm-grey);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.listing-admin-detail span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.listing-admin-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.badge-status {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pending { background: #DBEAFE; color: #1E40AF; }
.badge-active { background: #DCFCE7; color: #166534; }
.badge-paused { background: #FEF3C7; color: #92400E; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .content {
    margin-left: 0;
    padding: 20px 16px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .action-bar {
    flex-direction: column;
  }

  .listing-admin-card {
    flex-direction: column;
  }

  .listing-admin-actions {
    flex-wrap: wrap;
  }

  .admin-mobile-nav {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--ink);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .admin-mobile-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-family: var(--sans);
    white-space: nowrap;
    position: relative;
    transition: all 0.15s;
  }
  .admin-mobile-tab:hover,
  .admin-mobile-tab.active {
    color: white;
    background: rgba(255,255,255,0.1);
  }
  .admin-mobile-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    background: #C4622D;
    color: white;
    padding: 1px 5px;
    border-radius: 100px;
    line-height: 1.3;
  }
}

/* ============================================================
   WHITE GLOVE — Form styles
   ============================================================ */

#whiteglove-panel {
  max-width: 720px;
}

#whiteglove-panel .filter-btn {
  font-size: 14px;
  padding: 10px 20px;
}

.wg-section {
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.wg-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sand);
}

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

.wg-field { display: flex; flex-direction: column; }
.wg-field.full { grid-column: 1 / -1; }

.wg-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.wg-input {
  padding: 10px 12px;
  border: 1px solid #C9BFB3;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.2s;
}

.wg-input:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.1);
}

textarea.wg-input {
  min-height: 100px;
}

.wg-hint {
  font-size: 11px;
  color: #8C8278;
  margin-top: 3px;
}

.wg-amenity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.wg-amenity {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  padding: 6px 12px;
  background: #FDFBF8;
  border: 1px solid var(--sand);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.wg-amenity:has(input:checked) {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.wg-amenity input { accent-color: var(--clay); }

.wg-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.wg-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.wg-btn:active { transform: scale(0.98); }

.wg-btn-primary {
  background: var(--clay);
  color: #fff;
}

.wg-btn-primary:hover { background: var(--clay-light); }
.wg-btn-primary:disabled { opacity: 0.6; cursor: wait; }

.wg-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wg-photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--sand);
}

.wg-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.wg-photo-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 768px) {
  .wg-form-grid { grid-template-columns: 1fr; }
  .wg-amenity-row { gap: 6px; }
  .wg-photo-thumb { width: 64px; height: 64px; }
}

/* Hide mobile nav on desktop */
.admin-mobile-nav {
  display: none;
}
