/* ============================================================
   SO-HAVILAH ESTATE — main.css  (complete rewrite)
   ============================================================ */
:root {
  --primary:      #1a3c5e;
  --primary-dark: #12293f;
  --gold:         #c9a84c;
  --gold-dark:    #b8963e;
  --sidebar-w:    240px;
  --topbar-h:     56px;
}

/* ── Reset / Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: #f0f2f7; color: #333; margin: 0; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary       { background: var(--primary);  border-color: var(--primary); }
.btn-primary:hover,
.btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-gold          { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover    { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }
.btn-xs            { padding: .15rem .4rem; font-size: .73rem; }

/* ── Cards ───────────────────────────────────────────────── */
.card        { border: none; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.card-header { background: #fff; border-bottom: 1px solid #edf1f7; font-weight: 600;
               padding: .85rem 1.25rem; border-radius: 10px 10px 0 0 !important; }

/* ── Tables ──────────────────────────────────────────────── */
.table thead th { background: #f0f4f9; font-size: .78rem; font-weight: 700;
                  text-transform: uppercase; letter-spacing: .04em;
                  border-bottom: 2px solid #dee2e6; }
.table tbody td { vertical-align: middle; font-size: .87rem; }
.table-hover tbody tr:hover { background: #f7f9fd; }

/* ── Forms ───────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: .84rem; margin-bottom: .3rem; }
.form-label.required::after { content: " *"; color: #dc3545; }

/* ── Public navbar ───────────────────────────────────────── */
.navbar-primary { background: var(--primary) !important; }
.navbar-primary .navbar-brand img { height: 42px; }
.navbar-primary .nav-link { color: rgba(255,255,255,.85) !important; }
.navbar-primary .nav-link:hover { color: #fff !important; }

/* ── Public page ─────────────────────────────────────────── */
main.py-4 { min-height: calc(100vh - 120px); }

/* ── Public footer ───────────────────────────────────────── */
.site-footer { background: #111e2d; color: #9099a8; padding: 2.5rem 0; margin-top: 3rem; }
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ============================================================
   SHARED SIDEBAR STYLES
   (used by both .admin-sidebar and .customer-sidebar)
   ============================================================ */
.admin-sidebar,
.customer-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--primary);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: width .25s ease, transform .25s ease;
}

/* Logo area */
.sidebar-logo {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo img { height: 36px; flex-shrink: 0; }
.sidebar-brand-text {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
}

/* Profile area (customer sidebar) */
.sidebar-profile {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

/* Nav list */
.sidebar-menu {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 1;
}
.sidebar-menu li { list-style: none !important; }
.sidebar-menu .nav-section {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  padding: 14px 18px 4px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-menu li a,
.sidebar-menu li > a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: rgba(255,255,255,.75) !important;
  text-decoration: none !important;
  font-size: .875rem;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.sidebar-menu li a:hover,
.sidebar-menu li.active > a {
  background: rgba(255,255,255,.13) !important;
  color: #fff !important;
}
.sidebar-menu li a i { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-menu li a span { overflow: hidden; }

/* text-danger-soft link in sidebar */
.text-danger-soft { color: rgba(255,100,100,.8) !important; }
.text-danger-soft:hover { color: #ff6464 !important; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
#adminWrapper {
  display: flex;
  min-height: 100vh;
}
.admin-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  transition: margin-left .25s ease;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1.4rem;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-main { padding: 1.5rem; flex: 1; }

/* Collapsed admin sidebar */
.admin-sidebar.collapsed { width: 58px; }
.admin-sidebar.collapsed .sidebar-brand-text,
.admin-sidebar.collapsed .sidebar-menu .nav-section,
.admin-sidebar.collapsed .sidebar-menu li a span { display: none; }
.admin-sidebar.collapsed .sidebar-logo { justify-content: center; }
.admin-sidebar.collapsed .sidebar-menu li a { justify-content: center; padding: 12px; }
#adminWrapper.sidebar-collapsed .admin-content { margin-left: 58px; }

/* ============================================================
   CUSTOMER LAYOUT
   ============================================================ */
#customerWrapper {
  display: flex;
  min-height: 100vh;
}
.customer-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.customer-topbar {
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1.4rem;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.customer-main { padding: 1.5rem; flex: 1; }

/* ── Stat / metric cards ─────────────────────────────────── */
.stat-card { border-radius: 12px; padding: 1.2rem 1.4rem; }
.stat-card.blue  { background: linear-gradient(135deg,#1a3c5e,#2a6099); color:#fff; }
.stat-card.gold  { background: linear-gradient(135deg,#b8963e,#c9a84c); color:#fff; }
.stat-card.green { background: linear-gradient(135deg,#1a6b3a,#28a745); color:#fff; }
.stat-card.red   { background: linear-gradient(135deg,#8b1a1a,#dc3545); color:#fff; }
.stat-card.teal  { background: linear-gradient(135deg,#1a5f6b,#17a2b8); color:#fff; }

/* ── Password strength bar ───────────────────────────────── */
#passwordStrength { transition: width .3s, background-color .3s; }

/* ── Misc ────────────────────────────────────────────────── */
.badge { font-weight: 600; }
.page-wrap { padding: 1.5rem; }

/* ── Lightbox (click any .lightbox-img to enlarge) ──────── */
.lightbox-img { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.9);
  display: none; align-items: center; justify-content: center;
  z-index: 2000; padding: 2rem;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img.lightbox-img-full {
  max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
  cursor: default;
}
.lightbox-overlay button {
  position: absolute; background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 1.4rem; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.lightbox-overlay button:hover { background: rgba(255,255,255,.3); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }
@media (max-width: 576px) {
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; font-size: 1.1rem; }
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .admin-sidebar,
  .customer-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.mobile-open,
  .customer-sidebar.mobile-open {
    transform: translateX(0);
  }
  .admin-content,
  .customer-content {
    margin-left: 0 !important;
  }
  .admin-main, .customer-main { padding: 1rem; }
}
@media (max-width: 576px) {
  .admin-topbar, .customer-topbar { padding: 0 .75rem; }
  .card-body { padding: 1rem; }
}

/* ── Dropdown above sidebar ──────────────────────────────── */
.dropdown-menu { z-index: 9999 !important; }
.admin-topbar .dropdown-menu { margin-top: 8px !important; }
