/* =====================================================================
   Real Estate Admin — premium theme on top of Bootstrap 5.3
   ===================================================================== */
:root {
  --re-primary: #4f46e5;
  --re-primary-2: #7c3aed;
  --re-primary-rgb: 79, 70, 229;
  --re-success: #10b981;
  --re-warning: #f59e0b;
  --re-danger: #ef4444;
  --re-info: #0ea5e9;
  --re-sidebar-w: 264px;
  --re-sidebar-w-collapsed: 80px;
  --re-topbar-h: 68px;
  --re-radius: 16px;
  --re-radius-sm: 12px;
  --re-bg: #f4f6fb;
  --re-surface: #ffffff;
  --re-surface-2: #f8fafc;
  --re-border: #e7eaf3;
  --re-text: #0f172a;
  --re-muted: #64748b;
  --re-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -8px rgba(15, 23, 42, .08);
  --re-shadow-lg: 0 20px 45px -15px rgba(15, 23, 42, .25);
  --re-sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
  --re-glass: rgba(255, 255, 255, .78);
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #4338ca;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: 14px;
}
[data-bs-theme="dark"] {
  --re-bg: #0b1020;
  --re-surface: #131a2e;
  --re-surface-2: #182038;
  --re-border: #24304d;
  --re-text: #e2e8f0;
  --re-muted: #94a3b8;
  --re-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -10px rgba(0, 0, 0, .5);
  --re-glass: rgba(19, 26, 46, .78);
  --bs-body-bg: #0b1020;
  --bs-body-color: #e2e8f0;
  --bs-border-color: #24304d;
  --bs-secondary-bg: #182038;
  --bs-tertiary-bg: #131a2e;
  --bs-link-color: #a5b4fc;
  --bs-link-color-rgb: 165, 180, 252;
}

html, body { min-height: 100%; }
body {
  background: var(--re-bg);
  color: var(--re-text);
  font-family: var(--bs-body-font-family);
  font-size: .925rem;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
::selection { background: rgba(var(--re-primary-rgb), .18); }
.material-symbols-rounded { font-size: 1.25em; vertical-align: -.2em; }

/* ---------- Scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .35); border-radius: 8px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  width: var(--re-sidebar-w);
  background: var(--re-sidebar-bg);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  transition: width .28s cubic-bezier(.4, 0, .2, 1), transform .28s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 4px 0 30px -10px rgba(15, 23, 42, .5);
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at -20% 0%, rgba(124, 58, 237, .35), transparent 60%),
              radial-gradient(400px 300px at 120% 100%, rgba(14, 165, 233, .18), transparent 60%);
}
.sidebar-brand {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: var(--re-topbar-h); padding: 0 20px; color: #fff; flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.2rem; color: #fff;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 8px 20px -6px rgba(168, 85, 247, .6);
}
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.brand-text strong { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.brand-text small { font-size: .7rem; color: #a5b4fc; text-transform: uppercase; letter-spacing: .12em; }
.sidebar-nav { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 12px 20px; }
.nav-group-label {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
  color: rgba(203, 213, 225, .45); padding: 16px 12px 6px; white-space: nowrap;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0; border-radius: 12px;
  color: #cbd5e1; font-weight: 500; white-space: nowrap;
  transition: background .2s, color .2s, transform .2s;
}
.nav-item i { font-size: 1.12rem; width: 24px; text-align: center; flex-shrink: 0; transition: transform .25s; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item:hover i { transform: scale(1.12); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, .9), rgba(168, 85, 247, .75));
  box-shadow: 0 10px 25px -10px rgba(129, 140, 248, .8);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: #c4b5fd;
}
.nav-badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px;
  background: #f43f5e; color: #fff; font-size: .7rem; font-weight: 700;
  display: inline-grid; place-items: center; animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, .5); } 50% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); } }
.sidebar-footer { position: relative; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.collapse-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .05); color: #cbd5e1; font-weight: 500; white-space: nowrap;
}
.collapse-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.collapse-btn i { width: 24px; transition: transform .3s; }

.app-main {
  margin-left: var(--re-sidebar-w); min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left .28s cubic-bezier(.4, 0, .2, 1);
}

/* Collapsed (desktop) */
@media (min-width: 992px) {
  .sidebar-collapsed .sidebar { width: var(--re-sidebar-w-collapsed); }
  .sidebar-collapsed .app-main { margin-left: var(--re-sidebar-w-collapsed); }
  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-group-label span { opacity: 0; width: 0; display: none; }
  .sidebar-collapsed .nav-group-label { padding: 10px 0 4px; height: 1px; margin: 10px 12px; background: rgba(255, 255, 255, .08); }
  .sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; }
  .sidebar-collapsed .nav-badge { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; font-size: .6rem; }
  .sidebar-collapsed .sidebar-brand { padding: 0; justify-content: center; }
  .sidebar-collapsed .collapse-btn { justify-content: center; }
  .sidebar-collapsed .collapse-btn i { transform: rotate(180deg); }
  .sidebar-collapsed .nav-item:hover::after {
    content: attr(data-title); position: fixed; left: calc(var(--re-sidebar-w-collapsed) + 6px);
    background: #1e1b4b; color: #fff; padding: 6px 12px; border-radius: 8px; font-size: .8rem;
    box-shadow: var(--re-shadow-lg); z-index: 2000; pointer-events: none;
  }
}

/* Mobile: off-canvas */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-105%); }
  .app-main { margin-left: 0; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1035;
    background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); animation: fadeIn .2s;
  }
  .sidebar-footer { display: none; }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--re-topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: var(--re-glass);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--re-border);
}
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--re-border);
  background: var(--re-surface); color: var(--re-text); display: inline-grid; place-items: center;
  font-size: 1.15rem; transition: all .2s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--re-primary); border-color: rgba(var(--re-primary-rgb), .4); transform: translateY(-1px); box-shadow: var(--re-shadow); }
.topbar-search {
  align-items: center; gap: 10px; flex: 1; max-width: 460px; height: 42px; padding: 0 14px;
  background: var(--re-surface); border: 1px solid var(--re-border); border-radius: 12px; transition: all .2s;
}
.topbar-search:focus-within { border-color: rgba(var(--re-primary-rgb), .5); box-shadow: 0 0 0 4px rgba(var(--re-primary-rgb), .1); }
.topbar-search i { color: var(--re-muted); }
.topbar-search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--re-text); min-width: 0; }
.topbar-search kbd { background: var(--re-surface-2); color: var(--re-muted); border: 1px solid var(--re-border); font-size: .7rem; }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: linear-gradient(135deg, #f43f5e, #ef4444); color: #fff; font-size: .68rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--re-surface); animation: pop .4s;
}
.bell-ring i { animation: ring 1s ease-in-out; display: inline-block; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(18deg); } 40% { transform: rotate(-16deg); } 60% { transform: rotate(10deg); } 80% { transform: rotate(-6deg); } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.notif-dropdown { width: 370px; max-width: calc(100vw - 24px); padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--re-border); }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--re-border); color: var(--re-text); transition: background .15s; cursor: pointer; }
.notif-item:hover { background: var(--re-surface-2); }
.notif-item.unread { background: rgba(var(--re-primary-rgb), .05); }
.notif-item.unread .notif-title::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--re-primary); margin-left: 6px; vertical-align: middle; }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: rgba(var(--re-primary-rgb), .1); color: var(--re-primary); }
.notif-title { font-weight: 600; font-size: .86rem; }
.notif-body { font-size: .8rem; color: var(--re-muted); }
.notif-time { font-size: .72rem; color: var(--re-muted); }
.admin-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 14px;
  border: 1px solid var(--re-border); background: var(--re-surface); color: var(--re-text);
}
.admin-chip strong { font-size: .84rem; }
.admin-chip small { font-size: .72rem; }
.dropdown-menu { border-radius: 14px; border-color: var(--re-border); padding: 6px; }
.dropdown-item { border-radius: 9px; padding: 8px 12px; }

/* ---------- Content ---------- */
.app-content { flex: 1; padding: 26px 28px 32px; }
.page-fade { animation: pageIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 575.98px) { .app-content { padding: 18px 14px 24px; } .topbar { padding: 0 14px; } }
.app-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  padding: 16px 28px; font-size: .8rem; color: var(--re-muted); border-top: 1px solid var(--re-border);
}

.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.page-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.page-subtitle { color: var(--re-muted); margin: 6px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb { font-size: .8rem; --bs-breadcrumb-divider-color: var(--re-muted); }
.breadcrumb a { color: var(--re-muted); }
.breadcrumb a:hover { color: var(--re-primary); }
.breadcrumb-item.active { color: var(--re-text); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  --bs-card-bg: var(--re-surface);
  --bs-card-border-color: var(--re-border);
  --bs-card-border-radius: var(--re-radius);
  --bs-card-inner-border-radius: calc(var(--re-radius) - 1px);
  --bs-card-cap-bg: transparent;
  box-shadow: var(--re-shadow);
}
.card-header { padding: 16px 20px; border-bottom-color: var(--re-border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-header h5, .card-header .card-title { margin: 0; font-size: 1rem; font-weight: 700; }
.card-body { padding: 20px; }
.card-hover { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--re-shadow-lg); }
.section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--re-muted); margin: 0 0 12px; }

/* KPI cards */
.kpi-card {
  position: relative; overflow: hidden; border-radius: var(--re-radius); padding: 20px; color: #fff; height: 100%;
  box-shadow: 0 14px 30px -14px rgba(var(--kpi-shadow, 79, 70, 229), .7);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.kpi-card:hover { transform: translateY(-5px); }
.kpi-card::before, .kpi-card::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12);
}
.kpi-card::before { width: 140px; height: 140px; right: -40px; top: -50px; }
.kpi-card::after { width: 90px; height: 90px; right: 40px; bottom: -50px; background: rgba(255, 255, 255, .08); }
.kpi-card .kpi-icon {
  position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .2); font-size: 1.35rem; margin-bottom: 14px; backdrop-filter: blur(4px);
}
.kpi-card .kpi-value { position: relative; z-index: 1; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi-card .kpi-label { position: relative; z-index: 1; font-size: .82rem; opacity: .88; font-weight: 500; margin-top: 4px; }
.kpi-card .kpi-foot { position: relative; z-index: 1; font-size: .74rem; opacity: .85; margin-top: 10px; }
.kpi-card a { color: inherit; }
.grad-indigo { background: linear-gradient(135deg, #4f46e5, #7c3aed); --kpi-shadow: 79, 70, 229; }
.grad-blue   { background: linear-gradient(135deg, #0284c7, #38bdf8); --kpi-shadow: 2, 132, 199; }
.grad-green  { background: linear-gradient(135deg, #059669, #34d399); --kpi-shadow: 5, 150, 105; }
.grad-amber  { background: linear-gradient(135deg, #d97706, #fbbf24); --kpi-shadow: 217, 119, 6; }
.grad-rose   { background: linear-gradient(135deg, #e11d48, #fb7185); --kpi-shadow: 225, 29, 72; }
.grad-violet { background: linear-gradient(135deg, #7c3aed, #c084fc); --kpi-shadow: 124, 58, 237; }
.grad-teal   { background: linear-gradient(135deg, #0d9488, #2dd4bf); --kpi-shadow: 13, 148, 136; }
.grad-slate  { background: linear-gradient(135deg, #334155, #64748b); --kpi-shadow: 51, 65, 85; }
.grad-pink   { background: linear-gradient(135deg, #db2777, #f472b6); --kpi-shadow: 219, 39, 119; }
.grad-orange { background: linear-gradient(135deg, #ea580c, #fb923c); --kpi-shadow: 234, 88, 12; }

/* Light stat card */
.stat-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--re-radius); background: var(--re-surface); border: 1px solid var(--re-border); box-shadow: var(--re-shadow); height: 100%; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.25rem; font-weight: 800; line-height: 1.15; }
.stat-card .stat-label { font-size: .78rem; color: var(--re-muted); font-weight: 500; }
.soft-primary { background: rgba(79, 70, 229, .12); color: #4f46e5; }
.soft-success { background: rgba(16, 185, 129, .14); color: #059669; }
.soft-warning { background: rgba(245, 158, 11, .16); color: #d97706; }
.soft-danger  { background: rgba(239, 68, 68, .14); color: #dc2626; }
.soft-info    { background: rgba(14, 165, 233, .14); color: #0284c7; }
.soft-secondary { background: rgba(100, 116, 139, .14); color: #64748b; }
[data-bs-theme="dark"] .soft-primary { color: #a5b4fc; }
[data-bs-theme="dark"] .soft-success { color: #6ee7b7; }
[data-bs-theme="dark"] .soft-warning { color: #fcd34d; }
[data-bs-theme="dark"] .soft-danger  { color: #fca5a5; }
[data-bs-theme="dark"] .soft-info    { color: #7dd3fc; }

/* ---------- Badges ---------- */
.badge-soft { font-weight: 600; font-size: .74rem; padding: .42em .75em; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.badge-soft .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge-soft-success   { background: rgba(16, 185, 129, .14); color: #047857; }
.badge-soft-warning   { background: rgba(245, 158, 11, .18); color: #b45309; }
.badge-soft-primary   { background: rgba(79, 70, 229, .13); color: #4338ca; }
.badge-soft-danger    { background: rgba(239, 68, 68, .14); color: #b91c1c; }
.badge-soft-info      { background: rgba(14, 165, 233, .15); color: #0369a1; }
.badge-soft-secondary { background: rgba(100, 116, 139, .15); color: #475569; }
[data-bs-theme="dark"] .badge-soft-success   { color: #6ee7b7; }
[data-bs-theme="dark"] .badge-soft-warning   { color: #fcd34d; }
[data-bs-theme="dark"] .badge-soft-primary   { color: #a5b4fc; }
[data-bs-theme="dark"] .badge-soft-danger    { color: #fca5a5; }
[data-bs-theme="dark"] .badge-soft-info      { color: #7dd3fc; }
[data-bs-theme="dark"] .badge-soft-secondary { color: #cbd5e1; }
.role-badge {
  --rc: #4f46e5; display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600;
  padding: .32em .7em; border-radius: 999px; color: var(--rc);
  background: color-mix(in srgb, var(--rc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 30%, transparent);
}
.role-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--rc); }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; }
.avatar-initials { display: inline-grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: .02em; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .person-name { font-weight: 600; color: var(--re-text); line-height: 1.2; }
.person .person-sub { font-size: .76rem; color: var(--re-muted); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 10px; position: relative; overflow: hidden; transition: all .2s; }
.btn-primary {
  --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5; --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
  --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3; --bs-btn-disabled-bg: #4f46e5; --bs-btn-disabled-border-color: #4f46e5;
  background-image: linear-gradient(135deg, #4f46e5, #7c3aed); border: 0; box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .7);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(79, 70, 229, .8); }
.btn-outline-primary { --bs-btn-color: #4f46e5; --bs-btn-border-color: rgba(79, 70, 229, .45); --bs-btn-hover-bg: #4f46e5; --bs-btn-hover-border-color: #4f46e5; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #a5b4fc; }
.btn-light { --bs-btn-bg: var(--re-surface-2); --bs-btn-border-color: var(--re-border); --bs-btn-color: var(--re-text); --bs-btn-hover-bg: var(--re-border); --bs-btn-hover-border-color: var(--re-border); }
.btn-soft-primary { background: rgba(79, 70, 229, .1); color: #4f46e5; border: 0; }
.btn-soft-primary:hover { background: #4f46e5; color: #fff; }
.btn-soft-success { background: rgba(16, 185, 129, .12); color: #059669; border: 0; }
.btn-soft-success:hover { background: #10b981; color: #fff; }
.btn-soft-danger { background: rgba(239, 68, 68, .12); color: #dc2626; border: 0; }
.btn-soft-danger:hover { background: #ef4444; color: #fff; }
.btn-soft-warning { background: rgba(245, 158, 11, .15); color: #b45309; border: 0; }
.btn-soft-warning:hover { background: #f59e0b; color: #fff; }
.btn-soft-info { background: rgba(14, 165, 233, .12); color: #0284c7; border: 0; }
.btn-soft-info:hover { background: #0ea5e9; color: #fff; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple .6s linear; background: rgba(255, 255, 255, .45); pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .82rem; margin-bottom: 6px; color: var(--re-text); }
.form-control, .form-select { border-radius: 10px; border-color: var(--re-border); padding: .55rem .85rem; background-color: var(--re-surface); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--re-primary-rgb), .55); box-shadow: 0 0 0 4px rgba(var(--re-primary-rgb), .12); }
.form-control-sm, .form-select-sm { padding: .35rem .7rem; }
.input-group-text { border-color: var(--re-border); background: var(--re-surface-2); border-radius: 10px; }
.form-check-input:checked { background-color: #4f46e5; border-color: #4f46e5; }
.form-switch .form-check-input { width: 2.6em; height: 1.35em; cursor: pointer; }
.form-text { font-size: .76rem; }
.required::after { content: " *"; color: var(--re-danger); }
.form-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px dashed var(--re-border); }
.form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.ts-wrapper .ts-control { border-radius: 10px !important; border-color: var(--re-border) !important; padding: .5rem .85rem !important; background: var(--re-surface) !important; }
.ts-dropdown { border-radius: 12px; border-color: var(--re-border); box-shadow: var(--re-shadow-lg); overflow: hidden; }
.ts-wrapper.multi .ts-control > div { border-radius: 8px !important; background: rgba(var(--re-primary-rgb), .12) !important; color: #4338ca !important; border: 0 !important; }
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control > div { color: #c7d2fe !important; }
[data-bs-theme="dark"] .ts-dropdown, [data-bs-theme="dark"] .ts-control input { background: var(--re-surface); color: var(--re-text); }

/* Upload drop zone */
.dropzone {
  border: 2px dashed var(--re-border); border-radius: var(--re-radius); padding: 28px; text-align: center;
  background: var(--re-surface-2); cursor: pointer; transition: all .2s; color: var(--re-muted);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--re-primary); background: rgba(var(--re-primary-rgb), .05); color: var(--re-primary); }
.dropzone i { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.img-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; border: 1px solid var(--re-border); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--re-surface-2); border: 1px solid var(--re-border); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .thumb-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.thumb:hover .thumb-actions { opacity: 1; }
.thumb .thumb-handle { position: absolute; top: 6px; left: 6px; cursor: grab; background: rgba(15, 23, 42, .6); color: #fff; border-radius: 8px; padding: 2px 6px; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; vertical-align: middle; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--re-border); }
.table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--re-muted);
  background: var(--re-surface-2); border-bottom: 1px solid var(--re-border); white-space: nowrap;
}
.table-hover > tbody > tr { transition: background .15s; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: rgba(var(--re-primary-rgb), .04); }
.table-card { border-radius: var(--re-radius); overflow: hidden; }
.table-card .table thead th:first-child { padding-left: 20px; }
.table-card .table td:first-child { padding-left: 20px; }
div.dt-container { padding: 0; }
div.dt-container .dt-layout-row { padding: 12px 18px; margin: 0 !important; }
div.dt-container .dt-layout-row.dt-layout-table { padding: 0; }
div.dt-container .dt-search input, div.dt-container .dt-length select { border-radius: 10px; border-color: var(--re-border); }
div.dt-container .dt-paging .page-link { border-radius: 9px !important; margin: 0 2px; border: 0; }
div.dt-container .dt-paging .page-item.active .page-link { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
div.dt-container .dt-info { font-size: .8rem; color: var(--re-muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ---------- Tabs / pills ---------- */
.nav-tabs-modern { gap: 6px; border: 0; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs-modern .nav-link {
  border: 1px solid var(--re-border); border-radius: 12px; color: var(--re-muted); font-weight: 600; background: var(--re-surface);
  white-space: nowrap; display: flex; align-items: center; gap: 8px; padding: .55rem 1rem;
}
.nav-tabs-modern .nav-link:hover { color: var(--re-primary); }
.nav-tabs-modern .nav-link.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .7); }
.nav-tabs-modern .nav-link .count { background: rgba(100, 116, 139, .15); border-radius: 999px; padding: 0 8px; font-size: .72rem; }
.nav-tabs-modern .nav-link.active .count { background: rgba(255, 255, 255, .25); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--re-muted); }
.empty-state .empty-icon {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; font-size: 2.2rem;
  color: var(--re-primary); background: linear-gradient(135deg, rgba(79, 70, 229, .12), rgba(168, 85, 247, .12));
  animation: floaty 4s ease-in-out infinite;
}
.empty-state h5 { color: var(--re-text); font-weight: 700; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Loader overlay ---------- */
.loader-overlay {
  position: fixed; inset: 0; z-index: 3000; display: none; place-items: center;
  background: rgba(15, 23, 42, .35); backdrop-filter: blur(3px);
}
.loader-overlay.show { display: grid; animation: fadeIn .2s; }
.loader-box { display: flex; align-items: center; gap: 14px; background: var(--re-surface); color: var(--re-text); padding: 16px 24px; border-radius: 16px; box-shadow: var(--re-shadow-lg); font-weight: 600; }
.loader-ring { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(var(--re-primary-rgb), .2); border-top-color: var(--re-primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--re-surface-2) 25%, var(--re-border) 37%, var(--re-surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Availability grid ---------- */
.unit-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; font-weight: 600; }
.unit-legend span { display: inline-flex; align-items: center; gap: 6px; }
.unit-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.unit-cell {
  position: relative; border-radius: 12px; padding: 10px 8px; text-align: center; cursor: pointer; color: #fff;
  transition: transform .2s, box-shadow .2s; user-select: none; border: 0; width: 100%;
}
.unit-cell:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 20px -8px rgba(15, 23, 42, .45); }
.unit-cell .u-no { font-weight: 800; font-size: .95rem; display: block; }
.unit-cell .u-meta { font-size: .68rem; opacity: .9; display: block; }
.unit-available, .lg-available { background: linear-gradient(135deg, #059669, #10b981); }
.unit-hold, .lg-hold { background: linear-gradient(135deg, #d97706, #f59e0b); }
.unit-booked, .lg-booked { background: linear-gradient(135deg, #2563eb, #4f46e5); }
.unit-sold, .lg-sold { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 28px; margin: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 2px; background: var(--re-border); }
.timeline li { position: relative; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-dot { position: absolute; left: -24px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--re-border); border: 3px solid var(--re-surface); box-shadow: 0 0 0 2px var(--re-border); }
.timeline li.done .tl-dot { background: var(--re-success); box-shadow: 0 0 0 2px rgba(16, 185, 129, .35); }
.timeline li.current .tl-dot { background: var(--re-primary); box-shadow: 0 0 0 4px rgba(var(--re-primary-rgb), .25); animation: pulse-dot 1.8s infinite; }
.timeline li.cancel .tl-dot { background: var(--re-danger); box-shadow: 0 0 0 2px rgba(239, 68, 68, .35); }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 3px rgba(var(--re-primary-rgb), .3); } 50% { box-shadow: 0 0 0 7px rgba(var(--re-primary-rgb), .05); } }
.timeline .tl-title { font-weight: 700; }
.timeline .tl-time { font-size: .76rem; color: var(--re-muted); }

/* ---------- Definition list ---------- */
.info-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; }
.info-list .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--re-muted); font-weight: 700; }
.info-list .v { font-weight: 600; word-break: break-word; }

/* ---------- Progress ---------- */
.progress { border-radius: 999px; background: var(--re-surface-2); }
.progress-bar { border-radius: 999px; background-image: linear-gradient(90deg, #4f46e5, #7c3aed); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.progress-bar.bg-success { background-image: linear-gradient(90deg, #059669, #34d399); }
.progress-bar.bg-danger { background-image: linear-gradient(90deg, #dc2626, #f87171); }
.progress-bar.bg-warning { background-image: linear-gradient(90deg, #d97706, #fbbf24); }

/* ---------- Project cards ---------- */
.project-card { overflow: hidden; height: 100%; }
.project-card .pc-cover { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, #312e81, #7c3aed); overflow: hidden; }
.project-card .pc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project-card:hover .pc-cover img { transform: scale(1.07); }
.project-card .pc-cover .pc-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.project-card .pc-cover .pc-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .6); font-size: 3rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: rgba(255, 255, 255, .92); color: #0f172a; }

/* ---------- Hero ---------- */
.hero-banner {
  position: relative; overflow: hidden; border-radius: 20px; color: #fff; padding: 26px 28px;
  background: linear-gradient(120deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%); box-shadow: 0 20px 40px -20px rgba(79, 70, 229, .8);
}
.hero-banner::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}
.hero-banner h2 { font-weight: 800; letter-spacing: -.02em; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 8px; border-radius: 14px;
  background: var(--re-surface); border: 1px solid var(--re-border); color: var(--re-text); font-weight: 600; font-size: .82rem; text-align: center;
  transition: all .25s; height: 100%;
}
.quick-action i { font-size: 1.4rem; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.quick-action:hover { transform: translateY(-4px); box-shadow: var(--re-shadow-lg); border-color: transparent; color: var(--re-primary); }

/* ---------- Maps ---------- */
.map-box { height: 380px; border-radius: var(--re-radius); overflow: hidden; border: 1px solid var(--re-border); z-index: 0; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-container { font-family: inherit; }

/* ---------- Org chart ---------- */
.org-wrap { overflow: auto; padding: 20px 10px 40px; cursor: grab; }
.org-tree, .org-tree ul { display: flex; justify-content: center; padding-top: 22px; position: relative; margin: 0; padding-left: 0; list-style: none; }
.org-tree { padding-top: 0; min-width: max-content; }
.org-tree li { position: relative; padding: 22px 8px 0; text-align: center; list-style: none; }
.org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--re-border); }
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid var(--re-border); }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 22px; }
.org-tree > li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid var(--re-border); border-radius: 0 10px 0 0; }
.org-tree li:first-child::after { border-radius: 10px 0 0 0; }
.org-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--re-border); }
.org-tree li.collapsed > ul { display: none; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--re-bg); }
@media (max-width: 991.98px) { .auth-page { grid-template-columns: 1fr; } .auth-brand { display: none !important; } }
.auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff;
  background: linear-gradient(135deg, #0f172a 0%, #312e81 45%, #7c3aed 100%);
}
.auth-brand .shape { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; animation: float 12s ease-in-out infinite; }
.auth-brand .s1 { width: 320px; height: 320px; background: radial-gradient(circle, #a855f7, transparent 70%); top: -80px; right: -60px; }
.auth-brand .s2 { width: 240px; height: 240px; background: radial-gradient(circle, #0ea5e9, transparent 70%); bottom: 10%; left: -60px; animation-delay: -4s; }
.auth-brand .s3 { width: 160px; height: 160px; background: radial-gradient(circle, #f472b6, transparent 70%); bottom: -40px; right: 25%; animation-delay: -8s; }
.auth-brand .sq { position: absolute; border: 2px solid rgba(255, 255, 255, .18); border-radius: 18px; animation: spinSlow 30s linear infinite; }
.auth-brand .q1 { width: 90px; height: 90px; top: 22%; left: 12%; }
.auth-brand .q2 { width: 50px; height: 50px; top: 58%; right: 16%; animation-direction: reverse; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(20px, -30px) scale(1.05); } 66% { transform: translate(-15px, 20px) scale(.97); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.auth-brand .brand-content { position: relative; z-index: 1; }
.auth-brand h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.auth-illustration { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 14px; height: 200px; margin: 30px 0; }
.auth-illustration .bld { background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .06)); border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px 10px 0 0; backdrop-filter: blur(4px); position: relative; animation: rise 1.2s cubic-bezier(.2, .8, .2, 1) both; }
.auth-illustration .bld::before { content: ""; position: absolute; inset: 12px; background-image: radial-gradient(rgba(255, 255, 255, .55) 2px, transparent 2.5px); background-size: 16px 18px; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; opacity: 0; } to { transform: scaleY(1); transform-origin: bottom; opacity: 1; } }
.auth-feature { display: flex; align-items: center; gap: 10px; font-size: .9rem; opacity: .9; margin-bottom: 8px; }
.auth-feature i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .15); }
.auth-form-side { display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden; }
.auth-form-side::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 58, 237, .16), transparent 70%); top: -120px; right: -120px; }
.auth-card {
  position: relative; width: 100%; max-width: 420px; padding: 36px; border-radius: 24px;
  background: var(--re-glass); backdrop-filter: blur(18px); border: 1px solid var(--re-border); box-shadow: var(--re-shadow-lg);
  animation: pageIn .6s cubic-bezier(.2, .8, .2, 1);
}
.auth-card .form-control { padding: .75rem 1rem .75rem 2.8rem; }
.auth-card .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--re-muted); z-index: 5; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--re-muted); z-index: 5; }

/* ---------- Misc ---------- */
.text-muted { color: var(--re-muted) !important; }
.fw-800 { font-weight: 800; }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }
.credential-card { border-radius: 16px; padding: 18px; background: linear-gradient(135deg, rgba(79, 70, 229, .08), rgba(168, 85, 247, .08)); border: 1px dashed rgba(79, 70, 229, .4); }
.credential-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--re-surface); border: 1px solid var(--re-border); margin-bottom: 8px; }
.credential-row code { font-size: 1rem; font-weight: 700; color: var(--re-text); }
.swal2-popup { border-radius: 20px !important; font-family: inherit !important; }
.swal2-toast { border-radius: 14px !important; box-shadow: var(--re-shadow-lg) !important; }
[data-bs-theme="dark"] .swal2-popup { background: var(--re-surface) !important; color: var(--re-text) !important; }
[data-bs-theme="dark"] .swal2-title, [data-bs-theme="dark"] .swal2-html-container { color: var(--re-text) !important; }
.fc { --fc-border-color: var(--re-border); --fc-today-bg-color: rgba(var(--re-primary-rgb), .07); --fc-button-bg-color: #4f46e5; --fc-button-border-color: #4f46e5; --fc-button-active-bg-color: #3730a3; --fc-button-hover-bg-color: #4338ca; --fc-page-bg-color: var(--re-surface); }
.fc .fc-button { border-radius: 10px; font-weight: 600; text-transform: capitalize; }
.fc .fc-event { border-radius: 6px; padding: 2px 4px; cursor: pointer; }
.fc .fc-toolbar-title { font-size: 1.15rem; font-weight: 700; }
.modal-content { border-radius: 20px; border: 0; box-shadow: var(--re-shadow-lg); background: var(--re-surface); }
.modal-header { border-bottom-color: var(--re-border); padding: 18px 22px; }
.modal-footer { border-top-color: var(--re-border); }
.modal-title { font-weight: 700; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 6px 0; display: flex; gap: 8px; }
.list-clean li i { color: var(--re-success); }
.swiper { border-radius: var(--re-radius); }
.swiper-slide img { width: 100%; height: 420px; object-fit: cover; }
@media (max-width: 767.98px) { .swiper-slide img { height: 240px; } }
.split-total { font-weight: 800; font-size: 1.1rem; }
@media print {
  .sidebar, .topbar, .app-footer, .page-actions, .no-print, .breadcrumb { display: none !important; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; }
  .card { box-shadow: none !important; }
  body { background: #fff !important; }
}

/* ---------- Appearance menu (Light / Dark / System) ---------- */
#themeMenu { min-width: 180px; }
#themeMenu .dropdown-item.active,
#themeMenu .dropdown-item:active { background: rgba(var(--re-primary-rgb, 79, 70, 229), .12); color: var(--re-primary, #4f46e5); }

/* Map search box (RE.mapSearch) */
.re-map-search { width: min(360px, calc(100vw - 90px)); }
.re-map-search .form-control { border-color: var(--re-border, #e5e7eb); }
.re-map-results { max-height: 240px; overflow-y: auto; margin-top: 4px; }
.re-map-results .list-group-item { white-space: normal; text-align: left; }
