/* ============================================================
   🏢 REAL ESTATE & FINISHING ERP - ULTRA-LUXURY STYLESHEET
   نظام إدارة العقارات والسمسرة العقارية والتشطيبات والعملاء
   ============================================================ */

:root {
  --font-family: 'Tajawal', sans-serif;
  --bg-gradient: linear-gradient(135deg, #070a12 0%, #0d1527 50%, #0a1120 100%);
  --sidebar-bg: rgba(13, 21, 39, 0.75);
  --card-bg: rgba(22, 33, 56, 0.55);
  --card-hover: rgba(28, 43, 73, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(11, 19, 36, 0.6);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Luxury Gold & Emerald Brand Accents */
  --accent-gold: #f59e0b;
  --accent-amber: #d97706;
  --accent-emerald: #10b981;
  --accent-cyan: #0ea5e9;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --blue-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-gold: 0 0 25px rgba(245, 158, 11, 0.25);
  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.25);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  direction: rtl;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(13, 21, 39, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

.hidden {
  display: none !important;
}

/* 🔒 PASSCODE GATE */
.passcode-gate {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #13223f 0%, #070a12 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.passcode-card {
  background: rgba(22, 33, 56, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  backdrop-filter: blur(20px);
  padding: 45px 35px;
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), var(--glow-gold);
  animation: floatUp 0.6s ease-out;
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.lock-icon {
  width: 76px;
  height: 76px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 34px;
  color: white;
  box-shadow: var(--glow-gold);
}

.passcode-card h2 {
  font-weight: 800;
  margin-bottom: 8px;
  font-size: 22px;
  color: #fff;
}

.passcode-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 25px;
}

.passcode-input-container {
  display: flex;
  gap: 12px;
  justify-content: center;
}

#passcode-input {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  color: white;
  font-size: 24px;
  text-align: center;
  letter-spacing: 12px;
  width: 140px;
  padding: 10px 0;
  outline: none;
  transition: var(--transition-smooth);
}

#passcode-input:focus {
  border-color: var(--accent-gold);
  box-shadow: var(--glow-gold);
}

.error-msg {
  display: none;
  color: var(--danger);
  margin-top: 15px;
  font-size: 14px;
  font-weight: 600;
}

/* 🏢 MAIN APP CONTAINER */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* 🎛️ SIDEBAR */
.sidebar {
  background: var(--sidebar-bg);
  backdrop-filter: blur(25px);
  border-left: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  padding: 25px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 20px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: var(--glow-gold);
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
}

.logo-text span {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 600;
}

.mobile-menu-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 26px;
  cursor: pointer;
  margin-right: auto;
}

.sidebar-menu {
  flex-grow: 1;
}

.sidebar-menu ul {
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.menu-item i {
  font-size: 20px;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.menu-item.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--glow-gold);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 📄 MAIN CONTENT */
.main-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

/* 🌐 TOP BAR */
.top-bar {
  background: rgba(13, 21, 39, 0.6);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 15px;
}

.top-bar-start {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.4rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.page-title h2 {
  font-size: 20px;
  font-weight: 800;
  color: white;
}

.digital-clock-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: 30px;
  backdrop-filter: blur(10px);
  margin-right: auto;
}

.digital-clock-widget i {
  color: var(--accent-gold);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.user-role {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
}

/* 📊 TAB CONTENT */
.tab-content {
  padding: 28px;
  flex-grow: 1;
}

.tab-page {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 💳 STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  padding: 22px;
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  background: var(--card-hover);
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-3px);
  box-shadow: var(--glow-gold);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  flex-shrink: 0;
}

.stat-icon.gold { background: var(--accent-gradient); box-shadow: var(--glow-gold); }
.stat-icon.emerald { background: var(--emerald-gradient); box-shadow: var(--glow-emerald); }
.stat-icon.blue { background: var(--blue-gradient); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.stat-info h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.stat-info .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: white;
}

.stat-info .stat-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 📊 CHARTS & SECTIONS */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  padding: 24px;
  border-radius: var(--border-radius-lg);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card-header h3 i {
  color: var(--accent-gold);
}

/* 🎛️ ACTION BAR & CONTROLS */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  padding: 10px 18px;
  border-radius: var(--border-radius-md);
  flex-grow: 1;
  max-width: 400px;
}

.search-box i {
  color: var(--text-secondary);
  font-size: 18px;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  width: 100%;
}

.filters-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--accent-gold);
}

/* 🔘 BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--glow-gold);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-emerald {
  background: var(--emerald-gradient);
  color: white;
  box-shadow: var(--glow-emerald);
}

.btn-emerald:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* 🏢 PROPERTIES GRID & CARDS */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.property-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.property-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--glow-gold);
}

.property-card-top {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.prop-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  text-transform: uppercase;
}

.prop-badge.available { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.prop-badge.sold { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.prop-badge.rented { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.prop-badge.negotiating { background: rgba(245, 158, 11, 0.2); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.4); }

.prop-code {
  font-family: monospace;
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 13px;
}

.property-card-body {
  padding: 20px;
  flex-grow: 1;
}

.property-card-body h4 {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.prop-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 14px;
}

.prop-specs {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.spec-item i {
  color: var(--accent-gold);
}

.prop-financials {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
}

.prop-price {
  font-size: 19px;
  font-weight: 800;
  color: var(--accent-emerald);
}

.prop-commission {
  font-size: 12px;
  color: var(--text-muted);
}

.property-card-footer {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* 👥 CRM PIPELINE & LEADS */
.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stage-column {
  background: rgba(18, 28, 48, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.stage-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.crm-lead-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  transition: var(--transition-smooth);
}

.crm-lead-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
}

.lead-name {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  margin-bottom: 4px;
}

.lead-pref {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.lead-budget {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-emerald);
}

/* 🎨 FINISHING PROJECTS */
.finishing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

.finishing-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--border-radius-lg);
  padding: 22px;
  transition: var(--transition-smooth);
}

.finishing-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: var(--glow-emerald);
  transform: translateY(-3px);
}

.progress-container {
  margin: 16px 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--emerald-gradient);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* 📋 TABLES */
.table-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--border-radius-lg);
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
}

.custom-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 18px;
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  white-space: nowrap;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* 🖼️ MODAL WINDOW */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: #0f192c;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), var(--glow-gold);
  animation: floatUp 0.3s ease-out;
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: 25px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--accent-gold);
}

.modal-footer {
  padding: 18px 25px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 📱 RESPONSIVE MEDIA QUERIES */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    right: -320px;
    top: 0;
    width: 280px;
    height: 100vh;
    transition: right 0.3s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  }

  .sidebar.mobile-open {
    right: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-menu-close-btn {
    display: block;
  }

  .digital-clock-widget {
    display: none;
  }
}

/* --- CRM Engaz-style upgrades --- */
.stage-total {
  font-size: 11px;
  color: var(--text-muted);
  margin: -2px 0 8px;
  padding: 0 4px;
  font-weight: 600;
}
.lead-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.source-badge {
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.source-badge i { font-size: 13px; }
.crm-lead-card.followup-due { border-right: 3px solid #ef4444; }
.lead-followup {
  font-size: 11px;
  margin-top: 6px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lead-followup.due { color: #ef4444; font-weight: 700; }
.last-contact { color: var(--text-muted); font-weight: 400; }
.lead-actions { display: flex; gap: 6px; margin-top: 8px; }
.action-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease;
}
.action-icon:hover { transform: translateY(-1px); }
.action-icon.wa { color: #25d366; border-color: rgba(37,211,102,0.4); }
.action-icon.call { color: #3b82f6; border-color: rgba(59,130,246,0.4); }
.action-icon.log { color: #10b981; border-color: rgba(16,185,129,0.4); }
.view-toggle {
  display: flex;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
}
.view-toggle button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.view-toggle button.active { background: var(--accent-gradient); color: #fff; }
.btn.active-filter { background: #ef4444 !important; color: #fff !important; border-color: #ef4444 !important; }
.table-wrapper { overflow-x: auto; }
.crm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crm-table th {
  text-align: right;
  padding: 10px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 600;
  white-space: nowrap;
}
.crm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}
.crm-table tr.row-due { background: rgba(239,68,68,0.07); }
.crm-table .muted { color: var(--text-muted); font-size: 11px; }
.stage-chip { background: rgba(255,255,255,0.08); padding: 3px 10px; border-radius: 20px; font-size: 11px; white-space: nowrap; }
.due-text { color: #ef4444; font-weight: 700; }
.table-actions { display: flex; gap: 10px; }
.table-actions a, .table-actions button {
  background: none; border: none; cursor: pointer;
  font-size: 17px; color: var(--text-secondary); text-decoration: none;
}
.table-actions a:hover, .table-actions button:hover { color: #fff; }

/* --- Boyot Al Mashreq platinum rebrand --- */
:root {
  --accent-gold: #dbe2ec;
  --accent-amber: #a8b3c4;
  --accent-gradient: linear-gradient(135deg, #eef2f8 0%, #9fadc2 100%);
  --glow-gold: 0 0 25px rgba(216, 224, 236, 0.16);
}
.btn-primary { color: #0d1527; font-weight: 700; }
.view-toggle button.active { color: #0d1527; font-weight: 700; }
.stat-icon.gold i { color: #0d1527; }
.menu-item.active, .menu-item:hover { color: #fff; }

/* Brand logo placements */
.gate-logo {
  width: 150px;
  height: auto;
  margin: 0 auto 18px;
  display: block;
  filter: drop-shadow(0 0 22px rgba(216, 224, 236, 0.28));
}
.sidebar-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(216, 224, 236, 0.25));
}
.passcode-card h2 {
  background: linear-gradient(135deg, #f4f7fb 0%, #aab6c9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* WhatsApp share button */
.btn-wa {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-wa:hover { filter: brightness(1.1); color: #fff; }
.menu-item.active { color: #0d1527; font-weight: 700; }
.menu-item.active i { color: #0d1527; }

/* --- Reports tab --- */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}
.report-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  backdrop-filter: blur(10px);
  height: 340px;
  display: flex;
  flex-direction: column;
}
.report-card h3 {
  font-size: 15px;
  margin-bottom: 14px;
  color: var(--text-secondary);
}
.report-card canvas {
  flex: 1;
  min-height: 0;
}

/* --- Projects tab --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  padding: 4px 28px 28px;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
}
.project-card:hover { transform: translateY(-3px); border-color: rgba(216,224,236,0.4); }
.project-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.project-status { font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 999px; border: 1px solid; }
.project-card h3 { font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.project-en { color: var(--text-muted); font-size: 12px; direction: ltr; text-align: right; margin-bottom: 10px; }
.project-meta { color: var(--text-secondary); font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.project-plan { color: var(--text-secondary); font-size: 13px; background: rgba(216,224,236,0.06); border: 1px dashed rgba(216,224,236,0.25); border-radius: 10px; padding: 8px 12px; margin: 12px 0; display: flex; align-items: center; gap: 6px; }
.project-foot { display: flex; justify-content: space-between; align-items: flex-end; }
.project-price { font-size: 17px; font-weight: 800; background: linear-gradient(90deg,#f4f7fb,#9fadc2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.project-eoi { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ☀️ Light theme */
body.light-theme {
  --bg-gradient: linear-gradient(135deg, #eef2f7 0%, #f8fafc 50%, #eef4fb 100%);
  --sidebar-bg: rgba(255, 255, 255, 0.92);
  --card-bg: rgba(255, 255, 255, 0.9);
  --card-hover: rgba(241, 245, 249, 0.95);
  --card-border: rgba(15, 23, 42, 0.08);
  --input-bg: rgba(241, 245, 249, 0.9);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}
body.light-theme .top-bar {
  background: rgba(255, 255, 255, 0.75);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
body.light-theme #digital-clock { color: #0f172a !important; }
body.light-theme #digital-date { color: #475569 !important; }
body.light-theme .digital-clock-widget { background: rgba(15,23,42,0.05); border-color: rgba(15,23,42,0.08); }
body.light-theme .digital-clock-widget i { color: #64748b; }
body.light-theme #notif-panel { background: #ffffff !important; border-color: rgba(15,23,42,0.12) !important; }
body.light-theme #notif-list > div { border-bottom-color: rgba(15,23,42,0.07) !important; }
body.light-theme .mobile-menu-btn { background: rgba(15,23,42,0.06); color: #0f172a; }
body.light-theme .menu-item { color: #475569; }
body.light-theme .menu-item:hover { color: #0f172a; }
body.light-theme .menu-item.active { color: #fff; }
body.light-theme .sidebar-logo h2, body.light-theme .sidebar-logo p { color: #0f172a; }
body.light-theme .user-role { color: #475569; }
body.light-theme .status-indicator { background: rgba(16,185,129,0.1); }
body.light-theme input, body.light-theme select, body.light-theme textarea { color: #0f172a; }
body.light-theme .filter-select { background: rgba(255,255,255,0.9); border-color: rgba(15,23,42,0.12); color: #0f172a; }
body.light-theme .search-box input { color: #0f172a; }
body.light-theme .property-card { box-shadow: 0 4px 20px rgba(15,23,42,0.06); }
body.light-theme .modal-content { background: #ffffff; }
body.light-theme .quick-command-bar { background: rgba(14,165,233,0.07); border-color: rgba(14,165,233,0.35); }
body.light-theme h1, body.light-theme h2, body.light-theme h3, body.light-theme h4,
body.light-theme .chart-card-header h3,
body.light-theme .logo-text h1,
body.light-theme .property-card h4,
body.light-theme .stat-value,
body.light-theme .stat-card h3,
body.light-theme .prop-price,
body.light-theme table th,
body.light-theme .prop-code,
body.light-theme .page-title h2 { color: #0f172a; }
body.light-theme .demo-banner, body.light-theme .alert, body.light-theme [class*="banner"] { color: #7c2d12; }
body.light-theme .btn { color: #fff; }
body.light-theme .btn-secondary { color: #0f172a; }
body.light-theme #demo-mode-alert { color: #92400e !important; }
body.light-theme #demo-mode-alert button { color: #92400e !important; }
