/* ═══════════════════════════════════════════════════════════════
   ESTATE MANAGEMENT — DESIGN SYSTEM v6
   Mode:  Light
   Font:  Mulish
   Theme: White surfaces · single indigo accent · no glows · sidebar nav
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Mulish:wght@300;400;500;600;700;800;900&display=swap');


/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --font: 'Mulish', system-ui, sans-serif;

  --bg:           #f5f6f8;
  --surface:      #ffffff;
  --surface-2:    #f9fafb;
  --surface-3:    #f1f3f6;
  --hover-bg:     #eef0f5;

  --border-light: #e8eaee;
  --border-mid:   #d0d4dc;

  --brand:        #3d4ed8;
  --brand-dark:   #2f3db5;
  --brand-light:  #eef0fb;
  --brand-mid:    #c7cbf5;
  --brand-ring:   rgba(61,78,216,0.15);

  --t1: #111827; --t2: #374151; --t3: #6b7280; --t4: #9ca3af; --ta: #3d4ed8;

  --success: #059669; --success-bg: #ecfdf5; --success-bd: #a7f3d0;
  --warn:    #d97706; --warn-bg:    #fffbeb; --warn-bd:    #fcd34d;
  --error:   #dc2626; --error-bg:   #fef2f2; --error-bd:   #fca5a5;
  --info:    #2563eb; --info-bg:    #eff6ff; --info-bd:    #bfdbfe;

  --sb-w:      220px;
  --sb-bg:     #1a1236;
  --sb-border: rgba(255,255,255,0.08);
  --sb-text:   rgba(255,255,255,0.58);
  --sb-text-h: #ffffff;
  --sb-active: rgba(255,255,255,0.10);
  --sb-accent: #818cf8;
  /* Sidebar background image + overlay */
  --sb-img:    url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=600&q=70');
  --sb-overlay: rgba(20,12,58,0.84);

  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px; --r-2xl: 24px;

  --sh-xs:    0 1px 2px rgba(0,0,0,0.05);
  --sh-sm:    0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md:    0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --sh-lg:    0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --sh-modal: 0 16px 48px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
}


/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--t2); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ta); }
button { font-family: var(--font); }

/* Body modifier for auth pages and Elementor wrapper pages */
.dash-page-bg { background: var(--bg); }


/* ═══════════════════════════════════════════════════════════
   DASHBOARD SHELL
   dash-root > dash-sidebar + dash-main
   dash-main > dash-topbar + page-inner
═══════════════════════════════════════════════════════════ */
.dash-root { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.dash-sidebar {
  width: var(--sb-w);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
  /* Background image layer */
  background-color: var(--sb-bg);
  background-image: var(--sb-img);
  background-size: cover;
  background-position: center;
  isolation: isolate;
}
/* Dark overlay sits between image and content */
.dash-sidebar::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--sb-overlay);
}
/* All direct children sit above the overlay */
.dash-sidebar > * { position: relative; z-index: 1; }
.sb-head { padding: 20px 18px 16px; border-bottom: 1px solid var(--sb-border); flex-shrink: 0; }
.sb-head img { height: 30px; width: auto; display: block; }

.sb-nav { flex: 1; overflow-y: auto; padding: 8px 10px; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }

.sb-section-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.10em;
  text-transform: uppercase; color: rgba(255,255,255,0.25);
  padding: 14px 8px 5px;
}

.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 700;
  color: var(--sb-text); text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px; white-space: nowrap; position: relative;
  background: none; border: none; cursor: pointer; width: 100%; text-align: left;
}
.sb-link svg        { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s; }
.sb-link:hover      { background: rgba(255,255,255,0.12); color: var(--sb-text-h); }
.sb-link:hover svg  { opacity: 1; }
.sb-link.active     { background: rgba(255,255,255,0.14); color: var(--sb-text-h); }
.sb-link.active svg { opacity: 1; }
.sb-link.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--sb-accent); border-radius: 0 2px 2px 0;
}

/* Sidebar image variants — add class to .dash-sidebar */
.dash-sidebar.sb-img-security {
  --sb-img: url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?auto=format&fit=crop&w=600&q=70');
}
.dash-sidebar.sb-img-office {
  --sb-img: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&w=600&q=70');
}
.dash-sidebar.sb-img-residential {
  --sb-img: url('https://images.unsplash.com/photo-1580587771525-78b9dba3b914?auto=format&fit=crop&w=600&q=70');
}
.sb-foot { flex-shrink: 0; border-top: 1px solid var(--sb-border); padding: 12px 14px; }

.sb-duty {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--success);
  padding: 4px 0; margin-bottom: 10px;
}
.sb-duty::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); animation: livePulse 2s infinite; flex-shrink: 0;
}

.sb-user { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sb-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-light); border: 1.5px solid var(--brand-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: var(--brand);
  flex-shrink: 0; overflow: hidden;
}
.sb-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-text  { min-width: 0; }
.sb-user-name  { font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role  { font-size: 10px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

.sb-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 6px; padding: 10px 12px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-md); font-family: var(--font); font-size: 13px; font-weight: 800;
  color: rgba(255,255,255,0.92); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  text-align: center;
}
.sb-logout svg { width: 16px; height: 16px; flex-shrink: 0; }
.sb-logout:hover {
  background: rgba(220,38,38,0.28); border-color: rgba(252,165,165,0.45);
  color: #fff;
}
.sb-logout:active { transform: scale(0.98); }
.sb-logout:disabled {
  opacity: 0.65; cursor: wait; transform: none;
}

/* ── Main area ── */
.dash-main { flex: 1; margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ── Topbar ── */
.dash-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border-light);
  padding: 0 28px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: var(--sh-xs); flex-shrink: 0;
}
.dash-topbar-left  { display: flex; align-items: center; gap: 12px; }
.dash-topbar-title { font-size: 14px; font-weight: 800; color: var(--t1); letter-spacing: -0.01em; }
.dash-topbar-right { display: flex; align-items: center; gap: 10px; }

/* Hamburger — mobile only */
.sb-toggle {
  display: none; background: none; border: none;
  padding: 6px; cursor: pointer; color: var(--t2);
  border-radius: var(--r-sm); align-items: center;
}
.sb-toggle:hover { background: var(--surface-3); }
.sb-toggle svg   { width: 20px; height: 20px; display: block; }

.sb-backdrop      { display: none; position: fixed; inset: 0; z-index: 199; background: rgba(17,24,39,0.50); backdrop-filter: blur(2px); }
.sb-backdrop.open { display: block; }

/* ── Content wrapper ── */
.page-inner { max-width: 1200px; margin: 0 auto; padding: 28px 28px 60px; flex: 1; }

/* ── Mobile ── */
@media (max-width: 900px) {
  .dash-sidebar { transform: translateX(calc(-1 * var(--sb-w))); }
  .dash-sidebar.open { transform: translateX(0); box-shadow: var(--sh-modal); }
  .dash-main { margin-left: 0; }
  .sb-toggle { display: flex; }
  .page-inner { padding: 20px 16px 48px; }
  .dash-topbar { padding: 0 16px; }
}


/* ═══════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════ */
.auth-split-page { overflow: hidden; height: 100%; }
html:has(body.auth-split-page) { height: 100%; }
@media (max-width: 768px) { body.auth-split-page { overflow: auto; height: auto; } html:has(body.auth-split-page) { height: auto; } }

.auth-split { display: flex; height: 100vh; min-height: 100vh; }
.auth-split-left { flex: 0 0 42%; position: relative; overflow: hidden; background: var(--brand); }
.auth-split-left-bg { position: absolute; inset: 0; opacity: 0.12; background: url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1200&q=80') no-repeat center/cover; }
.auth-split-left-bg.bg-residential { background-image: url('https://images.unsplash.com/photo-1580587771525-78b9dba3b914?auto=format&fit=crop&w=1200&q=80'); }
.auth-split-left-bg.bg-security    { background-image: url('https://images.unsplash.com/photo-1558618666-fcd25c85cd64?auto=format&fit=crop&w=1200&q=80'); }
.auth-split-left-bg.bg-office      { background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&w=1200&q=80'); }
.auth-split-left-content { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; padding: 36px 40px; }
.auth-split-brand { display: flex; align-items: center; gap: 12px; }
.auth-split-tagline { padding-bottom: 48px; }
.auth-split-tagline h2 { font-size: clamp(22px,3vw,34px); font-weight: 900; letter-spacing: -0.03em; color: #fff; line-height: 1.2; margin-bottom: 12px; }
.auth-split-tagline p  { font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.65; max-width: 280px; }
.auth-split-tagline ul { list-style: none; padding: 0; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.auth-split-tagline ul li { font-size: 13px; color: rgba(255,255,255,0.80); display: flex; align-items: center; gap: 10px; }
.auth-split-tagline ul li::before { content: '✓'; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff; font-size: 10px; font-weight: 900; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.auth-split-right { flex: 1; background: var(--surface); overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 40px 28px 60px; scrollbar-width: none; }
.auth-split-right::-webkit-scrollbar { display: none; }
.auth-split-right-inner        { width: 100%; max-width: 420px; padding-top: 16px; }
.auth-split-right-inner.wide   { max-width: 680px; }
.auth-split-right-inner.medium { max-width: 560px; }
@media (max-width: 768px) {
  .auth-split { flex-direction: column; height: auto; min-height: 100vh; }
  .auth-split-left { flex: none; height: 180px; }
  .auth-split-left-content { flex-direction: row; align-items: center; padding: 20px 24px; }
  .auth-split-tagline { display: none; }
  .auth-split-right { padding: 28px 20px 48px; }
  .auth-split-right-inner, .auth-split-right-inner.wide, .auth-split-right-inner.medium { max-width: 100%; }
}

.card-title  { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--t1); line-height: 1.2; margin-bottom: 5px; }
.card-sub    { font-size: 13px; color: var(--t3); line-height: 1.55; }
.card-footer { font-size: 13px; color: var(--t3); text-align: center; margin-top: 20px; }
.card-footer a { color: var(--brand); font-weight: 700; }
.card-footer a:hover { color: var(--brand-dark); }
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--t3); margin-bottom: 28px; text-decoration: none; transition: color 0.15s; }
.back-btn svg   { width: 14px; height: 14px; }
.back-btn:hover { color: var(--brand); }


/* ═══════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; }
.form-label { font-size: 12px; font-weight: 800; color: var(--t2); margin-bottom: 7px; letter-spacing: 0.01em; }
.req        { color: var(--error); margin-left: 2px; }

.field {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border-mid); border-radius: var(--r-md);
  font-family: var(--font); font-size: 13px; color: var(--t1);
  background: var(--surface); outline: none; appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field::placeholder { color: var(--t4); }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.field:disabled, .field[readonly] { background: var(--surface-2); color: var(--t3); cursor: default; }
select.field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
  padding-right: 34px; cursor: pointer;
}
select.field option  { background: var(--surface); color: var(--t1); }
select.field:disabled { cursor: not-allowed; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; } }

.field-row   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.field-row a { font-size: 11px; font-weight: 700; color: var(--brand); }
.field-row a:hover { color: var(--brand-dark); }

.pw-wrap       { position: relative; }
.pw-wrap .field { padding-right: 40px; }
.pw-eye        { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 4px; cursor: pointer; color: var(--t4); display: flex; align-items: center; }
.pw-eye:hover  { color: var(--t2); }
.pw-eye svg    { width: 15px; height: 15px; display: block; }

.check-row     { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--t2); }
.check-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.check-row label { cursor: pointer; }
.check-row a   { color: var(--brand); font-weight: 700; }

.form-section-header { font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--t4); margin: 24px 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--border-light); }

.strength-track { height: 3px; background: var(--border-light); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.strength-fill  { height: 100%; border-radius: 2px; width: 0%; transition: width 0.3s, background 0.3s; }
.strength-lbl   { font-size: 11px; color: var(--t4); margin-top: 3px; display: block; }
.field-loading  { display: none; align-items: center; gap: 7px; font-size: 11px; color: var(--t3); margin-top: 5px; }
.field-loading.on { display: flex; }


/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 11px 20px; margin-top: 18px;
  background: var(--brand); color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 800;
  border: none; border-radius: var(--r-md); cursor: pointer;
  transition: background 0.15s; letter-spacing: 0.01em;
}
.btn-primary:hover    { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary.btn-success       { background: var(--success); }
.btn-primary.btn-success:hover { background: #047857; }

.btn-spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.65s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-inline  { padding: 4px 10px; border: none; border-radius: var(--r-sm); font-family: var(--font); font-size: 11px; font-weight: 800; cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.btn-inline.view     { background: var(--brand-light); color: var(--brand); }
.btn-inline.approve  { background: var(--success-bg);  color: var(--success); }
.btn-inline.reject   { background: var(--error-bg);    color: var(--error); }
.btn-inline.warn     { background: var(--warn-bg);     color: var(--warn); }
.btn-inline.inactive { background: var(--surface-3);   color: var(--t3); }
.btn-inline:hover    { filter: brightness(0.95); }
.btn-inline:disabled { opacity: 0.45; cursor: not-allowed; }

.spin-sm { display: inline-block; width: 10px; height: 10px; border: 1.5px solid rgba(0,0,0,0.15); border-top-color: var(--t3); border-radius: 50%; animation: spin 0.65s linear infinite; }


/* ═══════════════════════════════════════════════════════════
   STATUS PILLS
═══════════════════════════════════════════════════════════ */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: capitalize; white-space: nowrap; line-height: 1.5; }
.pill.approved, .pill.active, .pill.completed, .pill.paid, .pill.accessed { background: var(--success-bg); color: var(--success); }
.pill.pending, .pill.expected { background: var(--warn-bg); color: var(--warn); }
.pill.rejected, .pill.failed, .pill.cancelled, .pill.inactive { background: var(--error-bg); color: var(--error); }
.pill.checked-in  { background: var(--info-bg);   color: var(--info); }
.pill.checked-out { background: var(--surface-3); color: var(--t3); }


/* ═══════════════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 9px 16px; background: none; border: none;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  color: var(--t3); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover  { color: var(--t1); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel      { display: none; }
.tab-panel.active { display: block; }


/* ═══════════════════════════════════════════════════════════
   FEEDBACK — .msg handles all inline alerts
   Show/hide by toggling class: .msg.success / .msg.error / .msg.info
   Dashboard notices use .msg.ok and .msg.err via #estate-notice
═══════════════════════════════════════════════════════════ */
.msg { padding: 0; font-size: 13px; font-weight: 700; border-radius: var(--r-md); line-height: 1.5; display: none; }
.msg:not(:empty)  { display: block; padding: 10px 14px; }
.msg.success, .msg.ok  { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bd); }
.msg.error,   .msg.err { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-bd); }
.msg.info              { background: var(--info-bg);     color: var(--info);    border: 1px solid var(--info-bd); }
.msg.show { display: block; padding: 10px 14px; margin-bottom: 16px; }

.notice { border-radius: var(--r-md); font-size: 13px; font-weight: 700; margin-bottom: 16px; display: none; }
.notice.show     { display: block; padding: 10px 14px; }
.notice.show.ok  { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bd); }
.notice.show.err { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-bd); }


/* ═══════════════════════════════════════════════════════════
   SURFACE CARDS
═══════════════════════════════════════════════════════════ */
.section-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-xs); margin-bottom: 20px; }
.section-card-title { font-size: 13px; font-weight: 800; color: var(--t1); letter-spacing: -0.01em; padding-bottom: 13px; margin-bottom: 16px; border-bottom: 1px solid var(--border-light); }


/* ═══════════════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════════════ */
.stat-card { background: var(--surface); border: 1px solid var(--border-light); border-left: 3px solid var(--border-mid); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-xs); }
.stat-card.blue-accent  { border-left-color: var(--brand); }
.stat-card.green-accent { border-left-color: var(--success); }
.stat-card.amber-accent { border-left-color: var(--warn); }
.stat-card.red-accent   { border-left-color: var(--error); }
.stat-card-label { font-size: 11px; font-weight: 800; color: var(--t4); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 8px; }
.stat-card-value { font-size: 28px; font-weight: 900; color: var(--t1); letter-spacing: -0.03em; line-height: 1.1; }
.stat-card-sub   { font-size: 11px; color: var(--t4); margin-top: 4px; }


/* ═══════════════════════════════════════════════════════════
   GRIDS
═══════════════════════════════════════════════════════════ */
.grid-stats-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.grid-stats-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.grid-nav     { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
@media (max-width: 1024px) { .grid-stats-4 { grid-template-columns: repeat(2,1fr); } .grid-nav { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 768px)  { .grid-nav { grid-template-columns: repeat(2,1fr); } .grid-stats-3 { grid-template-columns: 1fr; } .grid-stats-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px)  { .grid-nav { grid-template-columns: 1fr; } .grid-stats-4 { grid-template-columns: 1fr; } }


/* ═══════════════════════════════════════════════════════════
   NAV TILES
═══════════════════════════════════════════════════════════ */
.nav-tile { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 15px 16px; text-decoration: none; color: var(--t1); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; box-shadow: var(--sh-xs); }
.nav-tile:hover { border-color: var(--border-mid); box-shadow: var(--sh-sm); color: var(--t1); background: var(--surface-2); }
.nav-tile-icon  { width: 38px; height: 38px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-tile-icon svg { width: 18px; height: 18px; }
.nav-tile-text  { min-width: 0; }
.nav-tile-text strong { display: block; font-size: 13px; font-weight: 800; color: var(--t1); }
.nav-tile-text span   { font-size: 11px; color: var(--t4); }


/* ═══════════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════════ */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.page-header-text h1 { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; color: var(--t1); }
.page-header-text p  { font-size: 13px; color: var(--t3); margin-top: 2px; }
.page-header-text    { min-width: 0; }
.page-header-actions { display: flex; align-items: center; gap: 10px; }


/* ═══════════════════════════════════════════════════════════
   TOOLBAR
═══════════════════════════════════════════════════════════ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search-wrap { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-md); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.search-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.search-wrap svg   { margin-left: 12px; color: var(--t4); flex-shrink: 0; width: 14px; height: 14px; }
.search-wrap input { flex: 1; border: none; background: none; outline: none; padding: 9px 12px; font-family: var(--font); font-size: 13px; color: var(--t1); }
.search-wrap input::placeholder { color: var(--t4); }
.filter-btn        { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border-light); background: var(--surface); color: var(--t3); font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.filter-btn.active { background: var(--brand-light); color: var(--brand); border-color: var(--brand-mid); }
.filter-btn:hover  { border-color: var(--border-mid); color: var(--t1); }


/* ═══════════════════════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════════════════════ */
.table-wrap  { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--sh-xs); margin-bottom: 20px; }
.data-table  { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th { padding: 11px 14px; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--t4); text-align: left; border-bottom: 1px solid var(--border-light); background: var(--surface-2); white-space: nowrap; }
.data-table td { padding: 12px 14px; font-size: 13px; color: var(--t2); border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td      { background: var(--surface-2); }
.data-table td.actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.table-loading { text-align: center; padding: 32px; color: var(--t4); font-size: 13px; }


/* ═══════════════════════════════════════════════════════════
   ACTIVITY LIST
═══════════════════════════════════════════════════════════ */
.activity-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.activity-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: 13px; color: var(--t2); border-bottom: 1px solid var(--border-light); }
.activity-list li:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-mid); flex-shrink: 0; margin-top: 5px; }


/* ═══════════════════════════════════════════════════════════
   OVERLAY MODAL
═══════════════════════════════════════════════════════════ */
.overlay { position: fixed; inset: 0; background: rgba(17,24,39,0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 9000; display: none; align-items: center; justify-content: center; padding: 20px; }
.overlay.show { display: flex; }
.overlay-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-xl); width: 100%; max-width: 460px; box-shadow: var(--sh-modal); padding: 28px 26px 24px; animation: cardIn 0.25s cubic-bezier(0.22,1,0.36,1) both; position: relative; }
.overlay-card.wide { max-width: 580px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.overlay-title { font-size: 17px; font-weight: 800; color: var(--t1); margin-bottom: 5px; letter-spacing: -0.01em; }
.overlay-sub   { font-size: 13px; color: var(--t3); margin-bottom: 20px; }
.overlay-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--t4); cursor: pointer; font-size: 18px; padding: 4px 6px; border-radius: 6px; line-height: 1; transition: color 0.15s, background 0.15s; }
.overlay-close:hover { color: var(--t1); background: var(--surface-3); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-item { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--r-sm); padding: 10px 12px; }
.detail-item .key { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t4); margin-bottom: 3px; }
.detail-item .val { font-size: 13px; font-weight: 600; color: var(--t1); }
@media (max-width: 520px) { .detail-grid { grid-template-columns: 1fr; } }


/* ═══════════════════════════════════════════════════════════
   SUCCESS POPUP
═══════════════════════════════════════════════════════════ */
.popup-overlay { position: fixed; inset: 0; background: rgba(17,24,39,0.50); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; }
.popup-overlay.active { opacity: 1; visibility: visible; }
.popup-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-xl); padding: 40px 36px 32px; max-width: 460px; width: 100%; text-align: center; box-shadow: var(--sh-modal); transform: scale(0.95) translateY(10px); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1); }
.popup-overlay.active .popup-card { transform: scale(1) translateY(0); }
.popup-icon  { width: 64px; height: 64px; margin: 0 auto 18px; background: var(--success-bg); border: 1.5px solid var(--success-bd); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.popup-icon svg { width: 28px; height: 28px; color: var(--success); }
.popup-title { font-size: 20px; font-weight: 900; color: var(--t1); letter-spacing: -0.02em; margin-bottom: 8px; }
.popup-sub   { font-size: 13px; color: var(--t3); line-height: 1.65; margin-bottom: 20px; }
.popup-info  { background: var(--brand-light); border: 1px solid var(--brand-mid); border-radius: var(--r-md); padding: 14px 16px; text-align: left; margin-bottom: 20px; font-size: 12px; color: var(--t2); line-height: 1.6; }
.popup-info strong { display: block; color: var(--brand); margin-bottom: 2px; font-size: 12px; }


/* ═══════════════════════════════════════════════════════════
   RECEIPT LIGHTBOX
═══════════════════════════════════════════════════════════ */
.receipt-modal { display: none; position: fixed; inset: 0; background: rgba(17,24,39,0.7); z-index: 99999; align-items: center; justify-content: center; padding: 24px; }
.receipt-modal.show { display: flex; }
.receipt-modal img  { max-width: 90vw; max-height: 85vh; border-radius: 12px; box-shadow: var(--sh-modal); }
.receipt-modal-close { position: fixed; top: 20px; right: 24px; background: var(--surface); border: 1px solid var(--border-mid); color: var(--t2); border-radius: var(--r-sm); padding: 7px 14px; cursor: pointer; font-family: var(--font); font-size: 13px; font-weight: 700; transition: background 0.15s; }
.receipt-modal-close:hover { background: var(--hover-bg); }


/* ═══════════════════════════════════════════════════════════
   CHARTS + FULLCALENDAR
═══════════════════════════════════════════════════════════ */
.charts-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card   { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-xs); }
.chart-card-title { font-size: 13px; font-weight: 800; color: var(--t1); margin-bottom: 16px; }
.chart-card canvas { width: 100% !important; max-height: 240px !important; }
@media (max-width: 768px) { .charts-grid { grid-template-columns: 1fr; } }

.fc { background: transparent !important; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border-light) !important; }
.fc-toolbar-title  { color: var(--t1) !important; font-family: var(--font) !important; font-size: 15px !important; font-weight: 800 !important; }
.fc-button         { background: var(--surface) !important; border-color: var(--border-mid) !important; color: var(--t3) !important; font-family: var(--font) !important; font-size: 12px !important; }
.fc-button:hover   { background: var(--hover-bg) !important; color: var(--t1) !important; }
.fc-button-active  { background: var(--brand-light) !important; color: var(--brand) !important; border-color: var(--brand-mid) !important; }
.fc-daygrid-day-number    { color: var(--t3); font-size: 12px; font-family: var(--font); }
.fc-col-header-cell-cushion { color: var(--t4); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.fc-event   { font-size: 11px !important; border-radius: 4px !important; }
.fc-day-today { background: var(--brand-light) !important; }


/* ═══════════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════════ */
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--success); }
.live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: livePulse 2s infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.empty-state { padding: 48px 24px; text-align: center; color: var(--t4); font-size: 13px; }
.empty-state-icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--t4); opacity: 0.5; }

.code-badge    { font-family: 'Courier New', monospace; font-weight: 700; background: var(--surface-2); padding: 3px 8px; border-radius: var(--r-xs); font-size: 12px; color: var(--t1); border: 1px solid var(--border-mid); letter-spacing: 0.08em; }
.code-input-lg { font-family: 'Courier New', monospace; font-size: 22px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; text-align: center; }

.kv-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .kv-label { color: var(--t4); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; }
.kv-row .kv-val   { color: var(--t1); font-weight: 600; text-align: right; }

.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--border-mid); border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.toggle-switch input:checked + .toggle-track { background: var(--brand); }
.toggle-track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: var(--sh-xs); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); }

.dependent-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-light); }
.dependent-item:last-child { border-bottom: none; }
.dependent-name { font-size: 13px; font-weight: 700; color: var(--t1); }
.dependent-meta { font-size: 12px; color: var(--t4); margin-top: 1px; text-transform: capitalize; }

.drop-zone { border: 2px dashed var(--border-mid); border-radius: var(--r-lg); padding: 28px 20px; text-align: center; cursor: pointer; background: var(--surface-2); transition: border-color 0.2s, background 0.2s; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--brand); background: var(--brand-light); }
.drop-zone input[type="file"] { display: none; }
.drop-zone-text     { color: var(--t3); font-size: 13px; margin-bottom: 4px; }
.drop-zone-hint     { color: var(--t4); font-size: 11px; }
.drop-zone-icon     { color: var(--t4); margin: 0 auto 10px; display: block; }
.drop-zone-filename { color: var(--brand); font-weight: 700; font-size: 12px; margin-top: 6px; }
.receipt-preview    { max-width: 160px; max-height: 160px; border-radius: var(--r-sm); margin-top: 10px; display: none; }

.brand-logo      { height: 30px; width: auto; display: block; }
.brand-logo.dark { filter: invert(1) brightness(0.15); }

/* Agent check-in standalone */
.checkin-page { min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.checkin-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-2xl); width: 100%; max-width: 460px; box-shadow: var(--sh-lg); overflow: hidden; }
.checkin-card-header { background: var(--brand); padding: 28px 28px 24px; text-align: center; }
.checkin-card-header img { height: 32px; width: auto; filter: brightness(0) invert(1); margin-bottom: 10px; }
.checkin-card-header h3  { font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 3px; }
.checkin-card-header p   { font-size: 12px; color: rgba(255,255,255,0.70); margin: 0; }
.checkin-card-body { padding: 28px; }
.checkin-success { text-align: center; padding: 16px 0; }
.checkin-success-icon { width: 56px; height: 56px; background: var(--success-bg); border: 1.5px solid var(--success-bd); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.checkin-success-icon svg { width: 24px; height: 24px; color: var(--success); }

/* Elementor resets */
.elementor-column-gap-default > .elementor-column > .elementor-element-populated { padding: 0; }
.elementor-widget-wrap { padding: 0; }
.e-con { padding: 0; }
.elementor-widget-html * { font-family: var(--font); }


/* ═══════════════════════════════════════════════════════════
   OTP / EMAIL VERIFY
   Used on the verify-otp page (auth-split layout)
═══════════════════════════════════════════════════════════ */

/* Email chip — shows the address the code was sent to */
.email-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-light); border: 1px solid var(--brand-mid);
  border-radius: var(--r-md); padding: 6px 12px;
  font-size: 13px; font-weight: 800; color: var(--brand);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 10px;
}
.email-chip svg { width: 13px; height: 13px; flex-shrink: 0; }

/* OTP input group */
.otp-group {
  display: flex; gap: 10px; justify-content: center;
  margin: 28px 0 24px;
}
.otp-input {
  width: 52px; height: 56px;
  border: 1.5px solid var(--border-mid); border-radius: var(--r-lg);
  font-family: var(--font); font-size: 22px; font-weight: 900;
  text-align: center; color: var(--t1);
  background: var(--surface); outline: none; appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  caret-color: var(--brand);
}
.otp-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  transform: translateY(-2px);
}
.otp-input.filled {
  border-color: var(--brand-mid);
  background: var(--brand-light);
  color: var(--brand);
}
.otp-input.error-state {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
  animation: otpShake 0.4s cubic-bezier(0.36,0.07,0.19,0.97);
}
@keyframes otpShake {
  10%,90%  { transform: translateX(-2px); }
  20%,80%  { transform: translateX(3px);  }
  30%,50%,70% { transform: translateX(-4px); }
  40%,60%  { transform: translateX(4px);  }
}

/* Resend row */
.otp-resend-row {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 20px;
  font-size: 13px; color: var(--t4); font-weight: 700;
}
.otp-resend-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 800;
  color: var(--brand); padding: 0; transition: color 0.15s;
}
.otp-resend-btn:hover    { color: var(--brand-dark); }
.otp-resend-btn:disabled { color: var(--t4); cursor: not-allowed; }
.otp-resend-timer {
  font-variant-numeric: tabular-nums;
  color: var(--brand); font-weight: 800;
}

/* Mobile OTP */
@media (max-width: 480px) {
  .otp-group { gap: 7px; }
  .otp-input { width: 44px; height: 50px; font-size: 20px; }
}