/* ============================================================
   RAJGARHIA ADMIN — SHARED THEME
   Heritage palette: deep crimson + antique gold on warm ivory
   ============================================================ */

:root {
  --crimson:     #7a1515;
  --crimson-dk:  #5a0f0f;
  --crimson-lt:  #9e2020;
  --gold:        #c9a24d;
  --gold-lt:     #e8c97a;
  --gold-dk:     #a07830;
  --ivory:       #fdf6e3;
  --ivory-dk:    #f5ead0;
  --ivory-card:  #fffaf0;
  --text:        #2c1a0e;
  --text-muted:  #7a6040;
  --border:      #ddc97a;
  --sidebar-w:   240px;
  --header-h:    60px;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,0.10);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Georgia', serif;
  background: var(--ivory);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════
   SIDEBAR
══════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--crimson-dk);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 2px solid var(--gold-dk);
  background: var(--crimson);
}
.sidebar-logo img {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}
.sidebar-title {
  color: var(--gold);
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
}
.sidebar-sub {
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 10px 0 20px; flex: 1; }

.nav-section {
  color: var(--gold-dk);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 14px 18px 4px;
  font-family: sans-serif;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item i { width: 16px; text-align: center; opacity: 0.8; }
.nav-item:hover {
  background: rgba(201,162,77,0.12);
  color: var(--gold-lt);
}
.nav-item.active {
  background: var(--gold);
  color: var(--crimson-dk);
  font-weight: bold;
}
.nav-item.active i { opacity: 1; }

.badge-count {
  margin-left: auto;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: sans-serif;
}

/* ══════════════════════════════════
   TOPBAR
══════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--header-h);
  background: var(--ivory-card);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 99;
  gap: 16px;
}
.topbar-title {
  color: var(--crimson);
  font-size: 18px;
  font-weight: bold;
  flex: 1;
}
.topbar-user {
  font-size: 12px;
  color: var(--text-muted);
  font-family: sans-serif;
}

/* ══════════════════════════════════
   MAIN CONTENT
══════════════════════════════════ */
.page-wrap {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  flex: 1;
  min-height: 100vh;
}
.page-body {
  padding: 24px;
  max-width: 1200px;
}

/* ── Breadcrumb ── */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.breadcrumb-bar h2 {
  font-size: 20px;
  color: var(--crimson);
}
.breadcrumb {
  list-style: none;
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: sans-serif;
}
.breadcrumb li + li::before { content: '›'; margin-right: 6px; }
.breadcrumb a { color: var(--crimson); text-decoration: none; }

/* ══════════════════════════════════
   CARDS
══════════════════════════════════ */
.hcard {
  background: var(--ivory-card);
  border: 3px double var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.hcard-header {
  background: var(--crimson);
  color: #fff;
  padding: 13px 20px;
  font-size: 16px;
  font-weight: bold;
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hcard-body { padding: 20px; }

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--ivory-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num {
  font-size: 36px;
  font-weight: bold;
  color: var(--crimson);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.6;
}

/* ══════════════════════════════════
   TABLES
══════════════════════════════════ */
.htable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.htable thead { background: var(--crimson); color: #fff; }
.htable th {
  padding: 10px 12px;
  text-align: left;
  font-weight: normal;
  border: 1px solid var(--crimson-lt);
}
.htable td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  vertical-align: middle;
}
.htable tbody tr:nth-child(even) { background: var(--ivory-dk); }
.htable tbody tr:hover { background: #fff3d6; }

/* ══════════════════════════════════
   FORMS
══════════════════════════════════ */
.form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.form-row label {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
  font-family: sans-serif;
}
.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-family: Georgia, serif;
  font-size: 14px;
  color: var(--text);
  transition: border 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,77,0.15);
}
.form-control[readonly] { background: var(--ivory-dk); }

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: Georgia, serif;
  transition: all 0.18s;
}
.btn-primary {
  background: var(--crimson);
  color: #fff;
  border: 2px solid var(--gold-dk);
}
.btn-primary:hover { background: var(--crimson-lt); color: #fff; }

.btn-gold {
  background: var(--gold);
  color: var(--crimson-dk);
  border: 2px solid var(--gold-dk);
  font-weight: bold;
}
.btn-gold:hover { background: var(--gold-dk); color: #fff; }

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
.btn-danger { background: #c0392b; color: #fff; border: none; }
.btn-danger:hover { background: #922b21; }
.btn-success { background: #27ae60; color: #fff; border: none; }
.btn-success:hover { background: #1e8449; }
.btn-default {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-default:hover { background: var(--ivory-dk); }

/* ══════════════════════════════════
   ALERTS
══════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  font-family: sans-serif;
}
.alert-success { background: #d5f5e3; border-left: 4px solid #27ae60; color: #1e8449; }
.alert-danger  { background: #fde8e8; border-left: 4px solid #c0392b; color: #922b21; }
.alert-warning { background: #fef9e7; border-left: 4px solid #f39c12; color: #b7770d; }
.alert-info    { background: #eaf4fb; border-left: 4px solid #2980b9; color: #1a6090; }

/* ══════════════════════════════════
   SEARCH BOX (Dashboard)
══════════════════════════════════ */
.search-wrap { position: relative; max-width: 500px; margin-bottom: 24px; }
.search-wrap input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: Georgia, serif;
}
.search-results {
  display: none;
  position: absolute;
  width: 100%;
  background: #fff;
  border: 2px solid var(--gold);
  border-top: none;
  z-index: 999;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}
.search-results div {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--ivory-dk);
}
.search-results div:hover { background: var(--ivory-dk); color: var(--crimson); }

/* ══════════════════════════════════
   IMAGE BOX
══════════════════════════════════ */
.img-upload-box {
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  background: var(--ivory-dk);
}
.img-upload-box img {
  width: 160px; height: 150px;
  object-fit: cover;
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 8px;
  display: block;
  margin-inline: auto;
}

/* ══════════════════════════════════
   DIFF TABLE (Edit Requests)
══════════════════════════════════ */
.diff-old { background: #fde8e8; color: #922b21; }
.diff-new { background: #d5f5e3; color: #1e8449; }

/* ══════════════════════════════════
   SECTION TITLE
══════════════════════════════════ */
.section-title {
  color: var(--crimson);
  font-size: 17px;
  font-weight: bold;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  margin: 28px 0 14px;
}

/* ══════════════════════════════════
   GALLERY GRID
══════════════════════════════════ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.gallery-thumb {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.gallery-thumb img {
  width: 100%; height: 120px;
  object-fit: cover; display: block;
}
.gallery-thumb-actions {
  padding: 6px;
  display: flex;
  gap: 4px;
  justify-content: center;
  background: var(--ivory-dk);
  font-size: 11px;
}

/* ══════════════════════════════════
   LOGIN PAGE
══════════════════════════════════ */
body.login-page {
  background: linear-gradient(135deg, var(--crimson-dk) 0%, #3d0a0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: var(--ivory-card);
  border: 5px double var(--gold);
  border-radius: 10px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-box h2 {
  color: var(--crimson);
  text-align: center;
  font-size: 22px;
  margin-bottom: 6px;
}
.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
  font-family: sans-serif;
}
.login-divider {
  height: 3px;
  width: 80px;
  background: var(--gold);
  margin: 10px auto 20px;
}

/* ══════════════════════════════════
   UTILITIES
══════════════════════════════════ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.gap-8  { gap: 8px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
.pull-right { float: right; }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .page-wrap { margin-left: 0; }
  .topbar { left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .form-row label { text-align: left; }
}
