/* ==========================================================================
   Lexora Design System Core v2.0 - Ultra-Premium Corporate Framework
   ========================================================================= */

:root {
  /* Lexora Ultra-Premium Legal Tech Palette */
  --lexora-primary: #6366f1;         /* Accent Indigo */
  --lexora-primary-soft: rgba(99,102,241,0.1);
  --lexora-ink: #e2e8f0;             /* Light text for dark theme */
  --lexora-muted: #8b949e;           /* Muted text */
  --lexora-border: rgba(255,255,255,0.08); /* Dark border */
  --lexora-surface: #ffffff;
  --lexora-page: #f8fafc;            /* Smooth Matte Background */

  /* Luxury Legal Accents */
  --lexora-gold: #d4af37;            /* Premium Gold Accent */
  --lexora-gold-soft: rgba(212,175,55,0.12);

  /* Operational Status Colors */
  --lexora-success: #10b981;
  --lexora-info: #0ea5e9;
  --lexora-warning: #f59e0b;
  --lexora-danger: #ef4444;
}

body {
  background: var(--lexora-page);
  color: var(--lexora-ink);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* RTL Global Support Typography */
[dir="rtl"], [dir="rtl"] * {
  font-family: 'Cairo', system-ui, sans-serif !important;
}

/* ---- Global Card & Surface Polish ---- */
.card {
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  background: var(--lexora-surface);
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.02), 0 10px 15px -3px rgba(15, 23, 42, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header {
  border-bottom: 1px solid var(--lexora-border);
  padding: 1.5rem;
  background: transparent;
  margin-bottom: 10px;
}

.card-header h5 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--lexora-ink);
  letter-spacing: -0.02em;
  margin: 0;
}

.card-body {
  padding: 1.5rem;
}

/* ---- Advanced Tables Architecture ---- */
.table {
  --bs-table-hover-bg: #2b3137;
  margin-bottom: 0;
}

.table thead th {
  color: var(--lexora-muted);
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--lexora-border);
  background: rgba(255,255,255,0.03);
  padding: 1rem 1.5rem;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  box-shadow: inset 3px 0 0 var(--lexora-primary); /* LTR Safe Indicator */
}

[dir="rtl"] .table tbody tr:hover {
  box-shadow: inset -3px 0 0 var(--lexora-primary); /* RTL Safe Indicator */
}

.table tbody td {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 0.925rem;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---- Interactive Actions ---- */
.btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--lx-accent);
  border-color: var(--lx-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--lexora-primary);
  border-color: var(--lexora-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--lx-border-2) !important;
    color: #ffffff;
    background: #6366f1;
}

.btn-outline-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--lexora-ink);
}

.badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

/* ---- Premium Workspace Hero ---- */
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.2rem 2.5rem;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--lexora-gold);
}

[dir="rtl"] .dashboard-hero::before {
  left: auto;
  right: 0;
}

.dashboard-hero h3 {
  color: var(--lexora-ink);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  margin: 0;
}

.dashboard-kicker {
  color: var(--lexora-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* ---- KPI Scorecards Grid ---- */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.lexora-kpi-card {
  text-decoration: none;
  color: inherit;
}

.lexora-kpi-card:hover {
  color: inherit;
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -5px rgba(15, 23, 42, 0.08);
  border-color: var(--lexora-primary);
}

.lexora-kpi-card h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--lexora-ink);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Stat Icons Layout */
.stat-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 12px;
  font-size: 1.4rem;
}

.tone-primary .stat-icon { color: var(--lexora-primary); background: #eff6ff; }
.tone-success .stat-icon { color: var(--lexora-success); background: #ecfdf5; }
.tone-info .stat-icon { color: var(--lexora-info); background: #f0f9ff; }
.tone-warning .stat-icon { color: var(--lexora-warning); background: #fffbeb; }
.tone-danger .stat-icon { color: var(--lexora-danger); background: #fef2f2; }

/* ---- Advanced Finance Grid ---- */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.finance-grid > div {
  display: grid;
  gap: 0.4rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

.finance-grid span {
  color: var(--lexora-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.finance-grid strong {
  color: var(--lexora-ink);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.finance-net {
  background: var(--lexora-gold-soft) !important;
  border-color: #fef08a !important;
}

.finance-net strong {
  color: #fbbf24;
}

/* ---- Micro-Charts (Bar Series) Engine ---- */
.mini-series {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.bar-series {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 0.85rem;
  min-height: 160px;
  padding: 1.25rem;
  border: 1px solid var(--lexora-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.bar-series > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
}

.bar-series > div::before {
  content: "";
  display: block;
  width: 100%;
  min-height: 8px;
  height: calc(var(--value) * 7% + 8px);
  max-height: 100px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--lexora-primary) 0%, #60a5fa 100%);
  animation: barGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: bottom;
  will-change: transform;
}

@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.bar-series span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lexora-ink);
}

.bar-series small {
  color: var(--lexora-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

/* ---- Clean Workspace Month Snapshot ---- */
.workspace-summary {
  display: grid;
  gap: 1.25rem;
}

.workspace-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.workspace-summary > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.workspace-summary span {
  color: var(--lexora-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.workspace-summary strong {
  color: var(--lexora-ink);
  font-size: 1.15rem;
  font-weight: 700;
}

/* ---- Modern Timelines & Lists ---- */
.health-list, .rank-list, .timeline-list {
  display: grid;
  gap: 0.75rem;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}

.rank-row, .timeline-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: inherit;
  text-decoration: none;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rank-row:hover, .timeline-row:hover {
  color: var(--lexora-ink);
  border-color: var(--lexora-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.05);
  transform: translateY(-1px);
}

.rank-row > span {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--lexora-primary);
  background: #eff6ff;
  font-weight: 800;
  font-size: 0.95rem;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lexora-primary);
  box-shadow: 0 0 0 4px #eff6ff;
}

.timeline-dot.warning {
  background: var(--lexora-warning);
  box-shadow: 0 0 0 4px #fef3c7;
}

/* ---- Responsive Fluidity Optimization ---- */
@media (max-width: 1200px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* Stacks earlier (tablet, not just phone) now that the hero can hold three
   sections (welcome text, portfolio views, actions) - three flex items in
   a row ran out of width and started overlapping around 768-992px. */
@media (max-width: 992px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .dashboard-hero-actions {
    width: 100%;
  }

  .dashboard-hero-actions .btn {
    width: 100%;
    margin-bottom: 10px;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .dashboard-kpi-grid,
  .finance-grid,
  .mini-series {
    grid-template-columns: 1fr;
  }
}

/* ---- Layout Menu Responsive Fix ---- */

/* Base styles for all screen sizes - override core.css */

/* ===================================================================
   LEXORA LAYOUT OVERRIDE v3 — Fixed sidebar
   =================================================================== */

/* 1. Kill vendor padding on layout-page from layout-menu-fixed */
.layout-menu-fixed .layout-page,
.layout-menu-fixed:not(.layout-menu-collapsed) .layout-page,
.layout-page {
  padding-inline-start: 0 !important;
  padding-inline-end:   0 !important;
  padding-top:          0 !important;
  padding-bottom:       0 !important;
}

/* 2. layout-wrapper: full viewport */
.layout-wrapper {
  display: block !important;
  width: 100% !important;
  min-height: 100vh !important;
}

/* 3. layout-container: full width, no extra margin here */
.layout-container {
  display: block !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 4. layout-page: THIS is what shifts right to clear the fixed sidebar */
.layout-page {
  margin-right:   0 !important;
  min-height:     100vh !important;
  display:        flex !important;
  flex-direction: column !important;
  padding:        0 !important;
  width:          auto !important;  /* do NOT set width:100% — margin handles offset */
}

[dir="rtl"] .layout-page {
  margin-left:  0 !important;
  margin-right: var(--lx-sidebar-w, 256px);
}

/* Mobile: no offset */
@media (max-width: 991.98px) {
  .layout-page {
    margin-left:  0 !important;
    margin-right: 0 !important;
  }
}

/* 5. content-wrapper: fills remaining space */
.content-wrapper {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
}

/* 6. Kill navbar-detached margin & width constraints */
.layout-navbar,
.layout-navbar.navbar-detached,
.navbar-detached {
  margin:         0 !important;
  margin-block:   0 !important;
  inline-size:    100% !important;
  max-inline-size: 100% !important;
  width:          100% !important;
  border-radius:  0 !important;
  box-shadow:     none !important;
  padding-inline: 0 !important;
}

/* 7. layout-content-navbar inline-size:0 override */
.layout-content-navbar .layout-page {
  inline-size:     auto !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
}

/* 8. container-p-y: keep vertical padding on page content */
.container-p-y {
  padding-top:    1.5rem !important;
  padding-bottom: 1.5rem !important;
}

/* 9. overlay: hide when not active */
.layout-overlay:not(.show) {
  display:    none !important;
  opacity:    0 !important;
  visibility: hidden !important;
}

/* =========================================================
   Metric Cards (Performance Row)
   ========================================================= */
.lx-metric-card .card-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.lx-metric-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.lx-metric-primary { color: #6366f1; background: rgba(99,102,241,0.12); }
.lx-metric-success { color: #10b981; background: rgba(16,185,129,0.12); }
.lx-metric-warning { color: #f59e0b; background: rgba(245,158,11,0.12); }
.lx-metric-info    { color: #06b6d4; background: rgba(6,182,212,0.12); }

.lx-metric-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.lx-metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lx-metric-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #e2e8f0;
  line-height: 1.1;
}

.lx-metric-sub {
  font-size: 0.75rem;
  color: #8b949e;
}

.lx-metric-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  margin-top: 0.35rem;
}

.lx-metric-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.lx-fill-success { background: #10b981; }
.lx-fill-primary { background: #6366f1; }

/* =========================================================
   Setup checklist: the rocket button + its panel (a bottom sheet on phones)
   It sits on the inline-start side so it never sits on the chat bubbles (inline-end).
   ========================================================= */
.lx-setup-fab {
  position: fixed; bottom: 1.6rem; inset-inline-start: calc(var(--lx-sidebar-w, 260px) + 1.6rem); z-index: 1050;
  width: 60px; height: 60px; padding: 0; border-radius: 50%; border: 1px solid rgba(129, 140, 248, .35);
  background: radial-gradient(circle at 30% 25%, #26304f, #141b2f); color: #a5b4fc; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .65);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s;
}
.lx-setup-fab:hover, .lx-setup-fab.lx-fab-active { transform: translateY(-2px) scale(1.05); box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .7), 0 0 0 6px rgba(99, 102, 241, .16); }
.lx-setup-fab:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 3px; }
.lx-setup-fab-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lx-setup-fab > .bx { position: relative; font-size: 1.55rem; animation: lxRocket 3s ease-in-out infinite; }
@keyframes lxRocket { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.lx-setup-fab-badge { position: absolute; top: -4px; inset-inline-end: -6px; min-width: 30px; padding: 2px 6px; border-radius: 99px; background: #6366f1; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.3; border: 2px solid #0f1526; }
@media (prefers-reduced-motion: reduce) { .lx-setup-fab > .bx { animation: none; } }

.lx-setup-backdrop { position: fixed; inset: 0; z-index: 1048; background: rgba(5, 10, 25, .5); display: none; }
.lx-setup-panel {
  position: fixed; bottom: 6.4rem; inset-inline-start: calc(var(--lx-sidebar-w, 260px) + 1.6rem); z-index: 1049;
  width: 380px; max-height: min(640px, calc(100vh - 8rem)); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1a2238, #121828); color: #e8edf7; border: 1px solid rgba(129, 140, 248, .22); border-radius: 20px;
  box-shadow: 0 30px 70px -18px rgba(0, 0, 0, .8); overflow: hidden;
  transform: translateY(14px) scale(.97); opacity: 0; pointer-events: none; transition: transform .22s cubic-bezier(.4, 0, .2, 1), opacity .22s;
}
.lx-setup-panel[hidden] { display: none; }
.lx-setup-panel.lx-setup-panel-open { transform: none; opacity: 1; pointer-events: auto; }
.lx-setup-grab { display: none; }
.lx-setup-head { display: flex; align-items: center; gap: .8rem; padding: 1.05rem 1.1rem .85rem; }
.lx-setup-head-ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .7); }
.lx-setup-head-txt { flex: 1; min-width: 0; }
.lx-setup-head h6 { margin: 0 0 .15rem; font-size: 1.02rem; font-weight: 800; color: #fff; }
.lx-setup-head p { margin: 0; font-size: .8rem; color: #94a3c0; }
.lx-setup-head p b { color: #c7d2fe; }
.lx-setup-close { width: 34px; height: 34px; flex: none; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #cbd5e1; font-size: 1.3rem; display: grid; place-items: center; cursor: pointer; }
.lx-setup-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.lx-setup-progress { height: 4px; margin: 0 1.1rem .4rem; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; flex: none; }
.lx-setup-progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #22c55e); transition: width .6s ease; }
.lx-setup-list { flex: 1; min-height: 0; overflow-y: auto; padding: .35rem .55rem .5rem; -webkit-overflow-scrolling: touch; }
.lx-setup-item { display: flex; align-items: center; gap: .8rem; padding: .7rem .6rem; border-radius: 14px; text-decoration: none; color: #e8edf7; transition: background .15s; }
.lx-setup-item + .lx-setup-item { margin-top: 2px; }
.lx-setup-item:hover, .lx-setup-item:focus-visible { background: rgba(255, 255, 255, .05); color: #fff; outline: none; }
.lx-setup-item-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; background: rgba(99, 102, 241, .14); color: #a5b4fc; }
.lx-setup-item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lx-setup-item-txt b { font-size: .9rem; font-weight: 700; }
.lx-setup-item-txt small { font-size: .76rem; color: #8b96b3; line-height: 1.45; }
.lx-setup-chev { flex: none; font-size: 1.2rem; color: #64708f; }
[dir="ltr"] .lx-setup-chev { transform: scaleX(-1); }
.lx-setup-item.is-done .lx-setup-item-ic { background: rgba(34, 197, 94, .14); color: #4ade80; }
.lx-setup-item.is-done .lx-setup-item-txt b { color: #94a3c0; text-decoration: line-through; text-decoration-color: rgba(148, 163, 184, .5); }
.lx-setup-item.is-next { background: rgba(99, 102, 241, .1); border: 1px solid rgba(129, 140, 248, .3); }
.lx-setup-item.is-next .lx-setup-item-ic { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.lx-setup-go { flex: none; padding: .35rem .85rem; border-radius: 99px; background: #6366f1; color: #fff; font-size: .78rem; font-weight: 800; }
.lx-setup-foot { flex: none; padding: .7rem 1.1rem .95rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.lx-setup-tour { width: 100%; display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .65rem; border-radius: 12px; border: 1px solid rgba(129, 140, 248, .3); background: rgba(99, 102, 241, .1); color: #c7d2fe; font: inherit; font-weight: 700; font-size: .86rem; cursor: pointer; }
.lx-setup-tour:hover { background: rgba(99, 102, 241, .2); color: #fff; }
.lx-setup-tour .bx { font-size: 1.15rem; }

@media (max-width: 991.98px) {
  .lx-setup-fab, .lx-setup-panel { inset-inline-start: 1.25rem; }
}
/* phones: a smaller button; the panel is a bottom sheet over a dimmed page, closed until tapped */
@media (max-width: 767.98px) {
  .lx-setup-fab { width: 52px; height: 52px; bottom: calc(1rem + env(safe-area-inset-bottom)); inset-inline-start: 1rem; }
  .lx-setup-fab > .bx { font-size: 1.35rem; }
  .lx-setup-backdrop:not([hidden]) { display: block; z-index: 1051; }
  .lx-setup-panel { z-index: 1052; }
  .lx-setup-panel { inset-inline-start: 0; inset-inline-end: 0; bottom: 0; width: 100%; max-height: 86dvh; border-radius: 22px 22px 0 0; border-bottom: 0;
    transform: translateY(100%); opacity: 1; padding-bottom: env(safe-area-inset-bottom); }
  .lx-setup-panel.lx-setup-panel-open { transform: none; }
  .lx-setup-grab { display: block; width: 42px; height: 5px; margin: 8px auto 0; border-radius: 99px; background: rgba(255, 255, 255, .22); flex: none; }
  body.lx-setup-on { overflow: hidden; }
  body.lx-setup-on .lx-chat-heads { display: none !important; }
}

/* ==========================================================================
   Onboarding Tour (onboarding-tour.js): a spotlight on the section + a card (bottom sheet on phones)
   ========================================================================== */
.lxt { position: fixed; inset: 0; z-index: 7100; }
.lxt-catch { position: absolute; inset: 0; background: transparent; }
.lxt.is-center .lxt-catch { background: rgba(5, 10, 25, .66); backdrop-filter: blur(2px); }
.lxt-spot { position: fixed; border-radius: 14px; pointer-events: none; transition: all .28s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 0 0 9999px rgba(5, 10, 25, .66), 0 0 0 3px rgba(129, 140, 248, .95), 0 0 28px 6px rgba(99, 102, 241, .55); }
.lxt-card { position: fixed; width: 360px; max-width: calc(100vw - 24px); padding: 1.15rem 1.2rem 1rem; border-radius: 20px;
  background: linear-gradient(180deg, #1b2440, #141b2f); color: #e8edf7; border: 1px solid rgba(129, 140, 248, .3);
  box-shadow: 0 30px 70px -18px rgba(0, 0, 0, .8); transition: top .28s, left .28s; animation: lxtIn .25s ease-out; }
.lxt.is-center .lxt-card { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); width: 440px; text-align: center; padding: 1.6rem 1.5rem 1.2rem; }
@keyframes lxtIn { from { opacity: 0; } to { opacity: 1; } }
.lxt-top { display: flex; align-items: center; gap: .6rem; margin-bottom: .65rem; }
.lxt.is-center .lxt-top { justify-content: center; flex-direction: column; }
.lxt-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .7); }
.lxt.is-center .lxt-ic { width: 64px; height: 64px; border-radius: 20px; font-size: 2rem; }
.lxt-count { flex: 1; font-size: .75rem; font-weight: 800; color: #a5b4fc; letter-spacing: .04em; }
.lxt-x { width: 32px; height: 32px; flex: none; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .07); color: #cbd5e1; font-size: 1.3rem; display: grid; place-items: center; cursor: pointer; }
.lxt.is-center .lxt-x { position: absolute; top: 12px; inset-inline-end: 12px; }
.lxt-x:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.lxt-title { margin: 0 0 .4rem; font-size: 1.08rem; font-weight: 800; color: #fff; }
.lxt.is-center .lxt-title { font-size: 1.35rem; }
.lxt-text { margin: 0; font-size: .9rem; line-height: 1.75; color: #c2cbe0; }
.lxt-dots { display: flex; flex-wrap: wrap; gap: 5px; margin: .9rem 0 .2rem; }
.lxt.is-center .lxt-dots { justify-content: center; }
.lxt-dots i { width: 6px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .18); transition: all .2s; }
.lxt-dots i.done { background: rgba(129, 140, 248, .6); }
.lxt-dots i.on { width: 18px; background: #818cf8; }
.lxt-go { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .9rem; }
.lxt-go button { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem .6rem; border-radius: 12px; border: 1px solid rgba(129, 140, 248, .35); background: rgba(99, 102, 241, .14); color: #e0e7ff; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.lxt-go button:hover { background: rgba(99, 102, 241, .28); }
.lxt-actions { display: flex; align-items: center; gap: .45rem; margin-top: .9rem; }
.lxt-grow { flex: 1; }
.lxt-skip, .lxt-back { border: 0; background: transparent; color: #94a3c0; font: inherit; font-weight: 700; font-size: .86rem; padding: .55rem .6rem; border-radius: 10px; cursor: pointer; }
.lxt-back { background: rgba(255, 255, 255, .07); color: #dbe3f5; }
.lxt-skip:hover { color: #fff; }
.lxt-next { border: 0; border-radius: 11px; padding: .6rem 1.25rem; background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; box-shadow: 0 8px 22px -8px rgba(99, 102, 241, .8); }
.lxt-next:hover { filter: brightness(1.08); }
.lxt-next:focus-visible, .lxt-back:focus-visible, .lxt-skip:focus-visible, .lxt-x:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
@media (max-width: 991.98px) {
  .lxt:not(.is-center) .lxt-card { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; border-radius: 22px 22px 0 0; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .lxt.card-top:not(.is-center) .lxt-card { top: 0 !important; bottom: auto; border-radius: 0 0 22px 22px; padding-top: calc(1rem + env(safe-area-inset-top)); }
  .lxt.is-center .lxt-card { width: calc(100vw - 32px); padding: 1.4rem 1.1rem 1rem; }
  .lxt-text { font-size: .88rem; }
}

@media (prefers-color-scheme: dark) {
  .lx-tour-card {
    background: #1e293b;
  }
  .lx-tour-title {
    color: #f1f5f9;
  }
  .lx-tour-text {
    color: #cbd5e1;
  }
}

/* ==========================================================================
   Location dependent dropdowns (Country -> Governorate -> City)
   ========================================================================== */

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 2.1rem 0.55rem 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
}

[dir="rtl"] .custom-select-trigger {
  padding: 0.55rem 0.85rem 0.55rem 2.1rem;
}

.custom-select-trigger:hover {
  border-color: #a5b4fc;
}

.custom-select-trigger.open {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.custom-select-trigger.disabled {
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
}

.custom-select-trigger::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #9ca3af;
  transition: transform 0.2s ease;
}

[dir="rtl"] .custom-select-trigger::after {
  right: auto;
  left: 14px;
}

.custom-select-trigger.open::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14);
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}

.custom-select-options.open {
  display: block;
}

.custom-select-search {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: #ffffff;
}

.custom-select-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}

.custom-select-search input:focus {
  border-color: #6366f1;
}

.custom-select-option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.875rem;
  color: #1e293b;
}

.custom-select-option:hover {
  background: #f2f2fc;
}

.custom-select-option.selected {
  background: #6366f1;
  color: #ffffff;
}

.custom-select-option.no-results {
  padding: 10px;
  color: #94a3b8;
  font-size: 0.825rem;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .custom-select-trigger,
  .custom-select-options,
  .custom-select-search {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
  }
  .custom-select-trigger.disabled {
    background: #0f172a;
    color: #64748b;
  }
  .custom-select-option {
    color: #e2e8f0;
  }
  .custom-select-option:hover {
    background: #334155;
  }
}

/* ===== Persistent "add a payout method" banner (base.html) ===== */
.dashboard-payout-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.5rem;
  background: #fffbea;
  border-bottom: 1px solid #fbbf24;
  text-align: center;
}

.dashboard-payout-banner-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

.dashboard-payout-banner-body strong,
.dashboard-payout-banner-body span {
  color: #92400e;
}

.dashboard-payout-banner-cta {
  flex-shrink: 0;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  background: #d97706;
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.dashboard-payout-banner-cta:hover {
  background: #b45309;
  color: white;
}

.dashboard-verify-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-bottom: 1px solid rgba(99, 102, 241, .35);
  position: sticky;
  top: 0;
  z-index: 99;
}
.dashboard-verify-banner-body {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #c7d2fe;
}
.dashboard-verify-banner-body i {
  font-size: 1.2rem;
  color: #f59e0b;
}
.dashboard-verify-banner-cta {
  flex-shrink: 0;
  padding: 0.35rem 1.2rem;
  border-radius: 999px;
  background: #6366f1;
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s;
}
.dashboard-verify-banner-cta:hover {
  background: #4f46e5;
  color: white;
}
.dashboard-verify-banner--pending {
  background: linear-gradient(135deg, #422006, #78350f);
  border-bottom-color: rgba(251, 191, 36, .35);
}
.dashboard-verify-banner--pending .dashboard-verify-banner-body { color: #fde68a; }
.dashboard-verify-banner--pending .dashboard-verify-banner-body i { color: #fbbf24; }
.dashboard-verify-banner--pending .dashboard-verify-banner-cta { background: #d97706; }
.dashboard-verify-banner--pending .dashboard-verify-banner-cta:hover { background: #b45309; }
.dashboard-verify-banner--rejected {
  background: linear-gradient(135deg, #450a0a, #7f1d1d);
  border-bottom-color: rgba(248, 113, 113, .35);
}
.dashboard-verify-banner--rejected .dashboard-verify-banner-body { color: #fecaca; }
.dashboard-verify-banner--rejected .dashboard-verify-banner-body i { color: #f87171; }
.dashboard-verify-banner--rejected .dashboard-verify-banner-cta { background: #dc2626; }
.dashboard-verify-banner--rejected .dashboard-verify-banner-cta:hover { background: #b91c1c; }
@media (max-width: 575.98px) {
  .dashboard-verify-banner { padding: 0.6rem 1rem; gap: 0.6rem; }
  .dashboard-verify-banner-body { font-size: 0.8rem; }
}
