/* ============================================================
   GUEST GUIDE – Admin Panel Styles
   ============================================================ */

/* ── Admin Layout ────────────────────────────────────────────── */
.admin-body {
  background: var(--bg);
  min-height: 100dvh;
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #0c4a6e 0%, #0891b2 100%);
}
.login-card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: 12px; }
.login-card h1 { font-size: 1.625rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.login-card > p { font-size: 0.9375rem; color: var(--ink-3); margin-bottom: 28px; }
.login-hint {
  font-size: 0.8rem;
  color: var(--ink-3);
  background: var(--ink-5);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  text-align: left;
  font-family: 'Courier New', monospace;
}

/* ── Admin App Shell ─────────────────────────────────────────── */
.admin-app {
  display: flex;
  min-height: 100dvh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: #1e293b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}
.sidebar.open { transform: translateX(0); }

@media (min-width: 1024px) {
  .sidebar { position: sticky; transform: translateX(0); }
  .admin-main { margin-left: 260px; }
  #sidebarClose { display: none; }
  .hamburger { display: none; }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.0625rem; font-weight: 800; color: #f8fafc; letter-spacing: -.01em; }
.sidebar-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  padding: 4px;
  line-height: 1;
  transition: color var(--t);
}
.sidebar-close:hover { color: #f8fafc; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-section + .nav-section { margin-top: 16px; }
.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #475569;
  padding: 4px 8px;
  margin-bottom: 2px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all var(--t);
  cursor: pointer;
}
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.sidebar-link.active { background: var(--sky); color: #fff; font-weight: 600; }
.sidebar-link .badge-count {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  color: #fff;
  padding: 1px 7px;
  border-radius: var(--r-f);
  font-size: 0.7rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--sky);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.user-name  { font-size: 0.875rem; font-weight: 600; color: #e2e8f0; }
.user-email { font-size: 0.75rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .btn-ghost { color: #64748b; padding: 6px 8px; font-size: 0.8rem; }
.sidebar-footer .btn-ghost:hover { color: #e2e8f0; background: rgba(255,255,255,.06); }

/* ── Admin Main ─────────────────────────────────────────────── */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid var(--ink-4);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.hamburger {
  background: none;
  border: none;
  font-size: 1.375rem;
  color: var(--ink-2);
  padding: 8px;
  margin: -8px;
  line-height: 1;
  transition: color var(--t);
}
.hamburger:hover { color: var(--ink); }
.admin-page-title { font-size: 1.0625rem; font-weight: 700; color: var(--ink); flex: 1; }

.admin-content { flex: 1; padding: 24px 20px; max-width: 1200px; }

/* ── Sidebar overlay (mobile) ─────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Admin Views ─────────────────────────────────────────────── */
.view { animation: fadeInUp 0.25s ease both; }

/* ── Dashboard ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--ink-4);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--sh-sm);
}
.stat-label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-change { font-size: 0.8125rem; color: var(--green); font-weight: 600; }

.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.property-dash-card {
  background: #fff;
  border: 1px solid var(--ink-4);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.property-dash-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.property-dash-cover { height: 140px; background-size: cover; background-position: center; position: relative; }
.property-dash-cover-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.5)); }
.property-dash-badge {
  position: absolute; bottom: 10px; left: 12px;
  background: rgba(255,255,255,.9);
  border-radius: var(--r-f);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex; align-items: center; gap: 4px;
}
.property-dash-badge.active { color: var(--green); }
.property-dash-badge.inactive { color: var(--red); }
.property-dash-body { padding: 16px; }
.property-dash-name { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.property-dash-meta { font-size: 0.8125rem; color: var(--ink-3); margin-bottom: 14px; }
.property-dash-stats { display: flex; gap: 16px; margin-bottom: 14px; }
.property-dash-stat { display: flex; flex-direction: column; gap: 2px; }
.pds-value { font-size: 1.125rem; font-weight: 800; color: var(--ink); }
.pds-label { font-size: 0.7rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; }
.property-dash-actions { display: flex; gap: 8px; }

/* ── Data Tables ─────────────────────────────────────────────── */
.table-card {
  background: #fff;
  border: 1px solid var(--ink-4);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink-4);
  gap: 12px;
}
.table-title { font-size: 1rem; font-weight: 700; color: var(--ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  background: var(--ink-5);
  border-bottom: 1px solid var(--ink-4);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-6);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--ink-5); }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid var(--ink-4);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
}
.form-card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ink-4);
}
.form-card-title { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.form-card-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.form-hint  { font-size: 0.8125rem; color: var(--ink-3); margin-top: -2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--ink-4);
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Section Toggle ──────────────────────────────────────────── */
.section-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--ink-5);
  border: 1px solid var(--ink-4);
  border-radius: var(--r-sm);
}
.toggle-item-info { display: flex; align-items: center; gap: 10px; }
.toggle-item-icon { font-size: 1.25rem; }
.toggle-item-label { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: var(--r-f);
  cursor: pointer;
  transition: background var(--t);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--sky); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Item List (sortable items) ──────────────────────────────── */
.item-list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  background: #fff;
  border: 1.5px solid var(--ink-4);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--t), box-shadow var(--t);
}
.list-item:hover { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14,165,233,.08); }
.list-item.dragging { opacity: 0.5; border-style: dashed; }
.drag-handle {
  color: #cbd5e1;
  cursor: grab;
  font-size: 1.25rem;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-name { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.list-item-meta { font-size: 0.8125rem; color: var(--ink-3); margin-top: 2px; }
.list-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.list-item.inactive { opacity: 0.55; }
.list-item.inactive .list-item-name { text-decoration: line-through; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--ink-4);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.modal-close {
  background: var(--ink-5);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.modal-close:hover { background: var(--ink-4); color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--ink-4);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

@media (min-width: 560px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: var(--r-lg); }
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  z-index: 300;
  white-space: nowrap;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Analytics ───────────────────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--ink-4);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--sh-sm);
}
.chart-title { font-size: 0.9375rem; font-weight: 700; color: var(--ink); margin-bottom: 16px; }

/* Bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 100px; padding-top: 4px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%;
  background: var(--sky-l);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: background var(--t);
  position: relative;
}
.bar:hover { background: var(--sky); }
.bar-label { font-size: 0.55rem; color: var(--ink-3); text-align: center; }

/* Ranked list */
.ranked-list { display: flex; flex-direction: column; gap: 10px; }
.ranked-item { display: flex; flex-direction: column; gap: 4px; }
.ranked-item-header { display: flex; justify-content: space-between; align-items: center; }
.ranked-name { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.ranked-count { font-size: 0.875rem; font-weight: 700; color: var(--sky); }
.ranked-bar-bg { height: 6px; background: var(--ink-4); border-radius: var(--r-f); overflow: hidden; }
.ranked-bar-fill { height: 100%; background: var(--sky); border-radius: var(--r-f); transition: width .6s ease; }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb-link { color: var(--sky); font-weight: 600; cursor: pointer; }
.breadcrumb-link:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--ink-4); }

/* ── Property tabs nav ────────────────────────────────────────── */
.prop-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 2px solid var(--ink-4);
  margin-bottom: 24px;
  padding-bottom: 2px;
}
.prop-tabs::-webkit-scrollbar { display: none; }
.prop-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--t);
}
.prop-tab:hover { color: var(--ink); }
.prop-tab.active { color: var(--sky-d); border-bottom-color: var(--sky); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-3);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1.0625rem; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.empty-state-desc { font-size: 0.9rem; }

/* ── Property preview link ────────────────────────────────────── */
.preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--sky);
  padding: 6px 12px;
  background: rgba(14,165,233,.08);
  border-radius: var(--r-sm);
  border: 1px solid var(--sky-l);
  transition: all var(--t);
}
.preview-link:hover { background: var(--sky-l); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .admin-main { margin-left: 0; }
  .admin-content { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
  .modal-overlay { align-items: center; padding: 24px; }
}
