/* =====================================================================
 *  Ancestral Abode — Admin Management Portal CSS
 *  Theme: Heritage Obsidian, Gold & Regal Cream
 * ===================================================================== */

:root {
  --admin-bg: #0f0d0b;
  --admin-surface: #181411;
  --admin-surface-2: #221d18;
  --admin-surface-3: #2d2620;
  --admin-border: rgba(200, 157, 86, 0.22);
  --admin-border-subtle: rgba(255, 255, 255, 0.08);

  --c-gold: #c89d56;
  --c-gold-bright: #dfb36c;
  --c-gold-glow: rgba(200, 157, 86, 0.25);
  --c-emerald: #25D366;
  --c-emerald-dark: #1f7a46;
  --c-danger: #e05353;
  --c-amber: #e6a23c;
  --c-blue: #4a90e2;

  --text-main: #f5f1eb;
  --text-muted: #a69888;
  --text-dim: #73675a;

  --ff-display: 'Cinzel', Georgia, serif;
  --ff-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--text-main);
  font-family: var(--ff-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography & Headings ── */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.04em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.6em 1.2em;
  font-family: var(--ff-sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-sm {
  padding: 0.35em 0.8em;
  font-size: 0.78rem;
}
.btn-gold {
  background: linear-gradient(135deg, #c89d56 0%, #aa7c35 100%);
  color: #120f0c;
  box-shadow: 0 4px 14px rgba(200, 157, 86, 0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #dfb36c 0%, #b8863b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(200, 157, 86, 0.45);
}
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--admin-border);
}
.btn-outline:hover {
  background: var(--admin-surface-2);
  border-color: var(--c-gold);
}
.btn-outline-danger {
  background: transparent;
  color: var(--c-danger);
  border-color: rgba(224, 83, 83, 0.4);
}
.btn-outline-danger:hover {
  background: rgba(224, 83, 83, 0.15);
  border-color: var(--c-danger);
}
.btn-success {
  background: #238636;
  color: #fff;
}
.btn-success:hover {
  background: #2ea043;
}
.btn-block {
  width: 100%;
}

/* ── Inputs & Selects ── */
.form-group {
  margin-bottom: 1.1rem;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-sm);
  color: var(--text-main);
  font-family: var(--ff-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px var(--c-gold-glow);
}
.form-input-sm, .form-select-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}
.form-textarea {
  resize: vertical;
}

/* ── Login Screen ── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #201a14 0%, #0f0d0b 80%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-lg);
  padding: 38px 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px var(--c-gold-glow);
}
.login-header {
  text-align: center;
  margin-bottom: 26px;
}
.login-crest {
  display: inline-block;
  margin-bottom: 12px;
}
.login-title {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.password-wrap {
  position: relative;
}
.pwd-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
}
.login-alert {
  background: rgba(224, 83, 83, 0.15);
  border: 1px solid var(--c-danger);
  color: #ff9d9d;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.login-helper {
  margin-top: 20px;
  font-size: 0.76rem;
  color: var(--text-dim);
  text-align: center;
}

/* ── Dashboard Layout ── */
.portal-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-brand-title {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: block;
}
.nav-brand-tag {
  font-size: 0.72rem;
  color: var(--c-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: all 0.2s;
}
.nav-link-btn:hover {
  color: var(--c-gold);
  background: var(--admin-surface-2);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border-subtle);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.user-dot {
  width: 8px;
  height: 8px;
  background: var(--c-emerald);
  border-radius: 50%;
}

.portal-main {
  flex: 1;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: bold;
}
.stat-icon-gold { background: rgba(200, 157, 86, 0.15); color: var(--c-gold); }
.stat-icon-blue { background: rgba(74, 144, 226, 0.15); color: var(--c-blue); }
.stat-icon-amber { background: rgba(230, 162, 60, 0.15); color: var(--c-amber); }
.stat-icon-green { background: rgba(37, 211, 102, 0.15); color: var(--c-emerald); }
.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.stat-val {
  font-family: var(--ff-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ── Portal Tabs ── */
.portal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--admin-border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--ff-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn:hover {
  color: var(--text-main);
}
.tab-btn.is-active {
  color: var(--c-gold);
  border-bottom-color: var(--c-gold);
}

/* ── Pane Headers ── */
.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pane-title {
  font-size: 1.25rem;
  margin-bottom: 4px;
}
.pane-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 650px;
}
.filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.search-wrap {
  width: 240px;
}

/* ── Rooms & Price Editor ── */
.rooms-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}
.room-price-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}
.room-price-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid var(--admin-border-subtle);
}
.room-price-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.room-price-title {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.room-price-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  gap: 14px;
}
.price-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--admin-border-subtle);
}
.price-input-wrap {
  position: relative;
  flex: 1;
}
.price-input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-gold);
  font-weight: bold;
}
.price-input-wrap .form-input {
  padding-left: 28px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-gold);
}

/* ── Data Tables ── */
.table-container {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-md);
  overflow-x: auto;
}
.portal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}
.portal-table th {
  background: var(--admin-surface-2);
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--admin-border);
}
.portal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border-subtle);
  vertical-align: middle;
}
.portal-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 36px 16px !important;
}

/* Status Badges */
.badge-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-pending { background: rgba(230, 162, 60, 0.15); color: var(--c-amber); border: 1px solid rgba(230, 162, 60, 0.35); }
.badge-confirmed { background: rgba(37, 211, 102, 0.15); color: var(--c-emerald); border: 1px solid rgba(37, 211, 102, 0.35); }
.badge-cancelled { background: rgba(224, 83, 83, 0.15); color: var(--c-danger); border: 1px solid rgba(224, 83, 83, 0.35); }
.badge-new { background: rgba(74, 144, 226, 0.15); color: var(--c-blue); border: 1px solid rgba(74, 144, 226, 0.35); }
.badge-responded { background: rgba(37, 211, 102, 0.15); color: var(--c-emerald); border: 1px solid rgba(37, 211, 102, 0.35); }

/* Table Actions */
.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

[hidden], .admin-modal-backdrop[hidden] {
  display: none !important;
}

/* ── Modals ── */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.admin-modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.7);
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border-subtle);
  background: var(--admin-surface-2);
}
.admin-modal-title {
  font-size: 1.1rem;
}
.admin-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.admin-modal-body {
  padding: 20px;
}
.admin-modal-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.admin-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: var(--admin-surface-2);
  border-top: 1px solid var(--admin-border-subtle);
}
.modal-booking-summary {
  background: var(--admin-surface-3);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--r-sm);
  padding: 12px;
  font-size: 0.82rem;
  margin-bottom: 16px;
}

/* ── Toasts ── */
.admin-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-toast {
  background: var(--admin-surface-2);
  color: var(--text-main);
  border: 1px solid var(--admin-border);
  padding: 12px 18px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: slideIn 0.25s ease-out;
}
.admin-toast-success { border-color: var(--c-emerald); color: #85e89d; }
.admin-toast-error { border-color: var(--c-danger); color: #ff9d9d; }

@keyframes slideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .portal-nav { padding: 12px 16px; }
  .portal-main { padding: 16px; }
  .nav-brand-title { font-size: 1rem; }
  .user-pill { display: none; }
}
