/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Inter', system-ui, sans-serif; background: #0f0e0d; color: #e0d9cf; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

:root {
  --gold: #18aebf;
  --teal: #18aebf;
  --gold-light: #22c5d8;
  --gold-dim: rgba(24, 174, 191, 0.12);
  --bg: #0f0e0d;
  --bg-card: #181614;
  --bg-card2: #201e1a;
  --bg-input: #1c1a17;
  --border: rgba(201, 168, 76, 0.18);
  --border-light: rgba(255,255,255,0.06);
  --text: #e0d9cf;
  --text-muted: #8a8070;
  --text-dim: #585048;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --danger: #c0392b;
}

/* ── Helpers ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Login ───────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1a1510 0%, #0a0908 100%);
  padding: 16px;
}
.login-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: clamp(28px, 6vw, 48px) clamp(20px, 5vw, 40px);
  width: 100%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.login-brand { text-align: center; margin-bottom: 36px; }
.logo-name { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: var(--gold); }
.login-sub { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 10px 22px; cursor: pointer;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  border-radius: 5px; border: 1.5px solid transparent; transition: all 0.2s;
  font-family: inherit;
}
.btn-primary { background: var(--gold); color: #111; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-light); }
.btn-outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover { background: var(--gold-dim); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg-card2); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #e74c3c; }
.btn-sm { padding: 6px 14px; font-size: 0.74rem; }
.btn-full { width: 100%; text-align: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Form Elements ───────────────────────────────────────── */
.admin-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 5px; padding: 10px 14px;
  color: var(--text); font-family: inherit; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s; width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--gold); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group.full { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-status { font-size: 0.85rem; min-height: 1.2em; }
.form-status.success { color: #27ae60; }
.form-status.error { color: #e74c3c; }
.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }
.checkbox-group label { font-size: 0.85rem; color: var(--text-muted); text-transform: none; letter-spacing: 0; cursor: pointer; }

/* ── Admin Layout ────────────────────────────────────────── */
.admin-app { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w); background: var(--bg-card); border-right: 1px solid var(--border-light);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transition: transform 0.3s;
}
.sidebar-header {
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--border-light);
}
.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  font-size: 0.82rem; color: var(--text-muted); cursor: pointer;
  transition: all 0.15s; border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--text); background: var(--bg-card2); }
.sidebar-link.active { color: var(--gold); background: var(--gold-dim); border-left-color: var(--gold); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.badge {
  background: var(--gold); color: #111; font-size: 0.65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; margin-left: auto;
}
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-dim);
}

/* Main */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: var(--bg-card); border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 40;
}
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }
.page-heading { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #fff; flex: 1; }
.admin-content { padding: 32px 28px; flex: 1; }

/* ── Dashboard ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 24px; transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border); }
.stat-card-num { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-top: 6px; }
.quick-actions h3 { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.quick-actions-grid { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Section Header ──────────────────────────────────────── */
.section-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.section-bar h2 { font-size: 1rem; font-weight: 600; color: #fff; }

/* ── Tables ──────────────────────────────────────────────── */
.admin-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border-light); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-card2); }
th { padding: 12px 16px; text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid var(--border-light); font-size: 0.85rem; color: var(--text-muted); vertical-align: middle; }
tr:hover td { background: var(--bg-card2); }
.td-title { color: var(--text); font-weight: 500; }
.td-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.pill-green { background: rgba(39,174,96,0.15); color: #27ae60; }
.pill-gray { background: var(--bg-card2); color: var(--text-dim); }

/* ── Card (form container) ───────────────────────────────── */
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 28px;
}
.admin-card + .admin-card { margin-top: 24px; }
.admin-card h3 { font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light); }

/* ── Image Upload ────────────────────────────────────────── */
.img-upload-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.img-preview {
  width: 120px; height: 120px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-card2); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 0.75rem;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-upload-ctrl { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.img-upload-ctrl input[type=file] { font-size: 0.82rem; color: var(--text-muted); }
.img-url-input { font-size: 0.82rem; }

/* ── Toast ───────────────────────────────────────────────── */
.admin-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 1000;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 22px; font-size: 0.85rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  transform: translateY(20px); opacity: 0;
  transition: all 0.3s; pointer-events: none;
}
.admin-toast.show { transform: translateY(0); opacity: 1; }
.admin-toast.success { border-color: rgba(39,174,96,0.4); color: #27ae60; }
.admin-toast.error { border-color: rgba(192,57,43,0.4); color: #e74c3c; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 32px; max-width: 540px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}
.modal-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: #fff; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Message card ────────────────────────────────────────── */
.msg-card {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 20px 24px; margin-bottom: 12px;
}
.msg-card.unread { border-left: 3px solid var(--gold); }
.msg-meta { display: flex; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.msg-name { font-weight: 600; color: #fff; font-size: 0.9rem; }
.msg-email { font-size: 0.8rem; color: var(--text-muted); }
.msg-date { font-size: 0.72rem; color: var(--text-dim); margin-left: auto; }
.msg-subject { font-size: 0.82rem; color: var(--gold); margin-bottom: 8px; }
.msg-body { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; }
.msg-actions { margin-top: 12px; display: flex; gap: 8px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .admin-content { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --topbar-h: 48px; }
  .admin-topbar { padding: 0 14px; }
  .admin-content { padding: 16px 12px; }
  .admin-card { padding: 18px 16px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 28px; }
  .stat-card { padding: 18px; }
  .modal-box { padding: 22px 18px; }
  .admin-toast { right: 12px; left: 12px; bottom: 16px; }
  td, th { padding: 10px; }
}
