/* Real Estate CRM - Global Styles  |  2026 Colour Palette */
* { box-sizing: border-box; }

:root {
  /* ── 2026 Primary: Deep Violet-Indigo accent ── */
  --primary: #6366f1;          /* indigo-500  */
  --primary-dark: #4f46e5;     /* indigo-600  */
  --primary-light: #eef2ff;    /* indigo-50   */
  --secondary: #8b5cf6;        /* violet-500  */

  /* ── Semantic colours ── */
  --success: #10b981;          /* emerald-500  */
  --success-light: #ecfdf5;
  --warning: #f59e0b;          /* amber-500   */
  --warning-light: #fffbeb;
  --danger: #f43f5e;           /* rose-500    */
  --danger-light: #fff1f2;
  --purple: #8b5cf6;           /* violet-500  */
  --purple-light: #f5f3ff;

  /* ── Neutral scale (cool slate) ── */
  --sidebar-width: 264px;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* ── Elevation & shape ── */
  --card-shadow: 0 1px 3px rgba(15,23,42,0.05), 0 4px 16px rgba(99,102,241,0.06);
  --card-shadow-hover: 0 8px 32px rgba(99,102,241,0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  /* ── Page background: near-white with subtle warm tint ── */
  --bg-page: #f0f0f8;

  /* ── Portal brand colours ── */
  --pf-orange: #ea580c;        /* orange-600 */
  --pf-orange-bg: #fff7ed;
  --bayut-indigo: #6366f1;     /* matches new primary */
  --bayut-indigo-bg: #eef2ff;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.55;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f0e1a 0%, #13111f 50%, #0f0e1a 100%);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 40;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(99,102,241,0.12);
  box-shadow: 3px 0 20px rgba(0,0,0,0.28);
}
.sidebar .py-3 {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
}
.sidebar .py-3::-webkit-scrollbar { width: 3px; }
.sidebar .py-3::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.13); border-radius: 4px; }
.sidebar .py-3::-webkit-scrollbar-track { background: transparent; }

.main-content { margin-left: var(--sidebar-width); min-height: 100vh; }

/* Mobile sidebar backdrop overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 998;
  backdrop-filter: blur(1px);
}
.sidebar-backdrop.open {
  display: block;
}

/* Sidebar close button (mobile only) */
.sidebar-close-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: calc(var(--sidebar-width) - 44px);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #e2e8f0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1001;
  transition: background 0.15s;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.22); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; z-index: 999; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close-btn { display: flex !important; }
  .main-content { margin-left: 0; }
}

/* ── Nav items ── */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: #94a3b8;
  text-decoration: none; font-size: 13.5px;
  border-radius: 10px; margin: 1px 10px;
  transition: all 0.16s ease;
  cursor: pointer;
  font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #cbd5e1; }
.nav-item.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  font-weight: 600;
  box-shadow: 0 3px 14px rgba(99,102,241,0.50);
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; opacity: 0.85; }
.nav-item.active i { opacity: 1; }

/* ── Cards ── */
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
  border: 1px solid #e8edf5;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}
.stat-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Table ── */
.crm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.crm-table thead th {
  background: #f4f8fb;
  padding: 11px 16px;
  text-align: left;
  font-weight: 700;
  color: #4a5e78;
  border-bottom: 1.5px solid #dde5f0;
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.crm-table tbody tr { border-bottom: 1px solid #f0f4f9; transition: background 0.1s; }
.crm-table tbody tr:hover { background: #f5f3ff; }
.crm-table tbody td { padding: 11px 16px; color: var(--gray-700); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.badge-new        { background: #e0e7ff; color: #3730a3; }
.badge-contacted  { background: #fef9c3; color: #854d0e; }
.badge-qualified  { background: #dcfce7; color: #166534; }
.badge-negotiating{ background: #f3e8ff; color: #6b21a8; }
.badge-won        { background: #d1fae5; color: #065f46; }
.badge-lost       { background: #ffe4e6; color: #9f1239; }
.badge-on_hold    { background: #f1f5f9; color: #475569; }
.badge-active     { background: #d1fae5; color: #065f46; }
.badge-draft      { background: #f1f5f9; color: #475569; }
.badge-inactive   { background: #ffe4e6; color: #9f1239; }
.badge-published  { background: #d1fae5; color: #065f46; }
.badge-not_published { background: #f1f5f9; color: #64748b; }
.badge-pf         { background: #fff7ed; color: #9a3412; }
.badge-bayut      { background: #eef2ff; color: #4338ca; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid #d4dce8;
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--gray-800);
  background: #fafbfc;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-select {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid #d4dce8;
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--gray-800);
  background: #fafbfc; cursor: pointer; outline: none;
}
.form-select:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-textarea {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid #d4dce8;
  border-radius: var(--radius-sm);
  font-size: 13.5px; resize: vertical; min-height: 100px; outline: none;
  background: #fafbfc;
}
.form-textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.16s ease; text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 16px rgba(99,102,241,0.40); }
.btn-secondary {
  background: white; color: var(--gray-700);
  border: 1.5px solid #d4dce8;
}
.btn-secondary:hover { background: #f4f7fb; border-color: #b8c8da; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.35); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e11d48; box-shadow: 0 4px 12px rgba(244,63,94,0.35); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; box-shadow: 0 4px 12px rgba(245,158,11,0.35); }
.btn-sm  { padding: 6px 13px; font-size: 12.5px; border-radius: 7px; }
.btn-xs  { padding: 4px 9px;  font-size: 11.5px; border-radius: 6px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,15,32,0.52);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: white; border-radius: var(--radius-lg);
  width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 28px 70px rgba(15,23,42,0.26);
}
.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body  { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4cfe0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.26s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 30px; height: 30px;
  animation: spin 0.7s linear infinite;
}

/* ── Pipeline ── */
.pipeline-col {
  min-width: 240px; background: #f0f5fb;
  border-radius: 12px; padding: 14px;
  border: 1px solid #e4ecf5;
}
.pipeline-card {
  background: white; border-radius: 10px; padding: 13px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer; transition: box-shadow 0.18s;
  border-left: 3px solid var(--primary);
}
.pipeline-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); }

/* ── Toast ── */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 13px 18px; border-radius: 13px; color: white;
  font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 380px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  animation: fadeIn 0.26s ease;
}
.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-error   { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.toast-info    { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ── Tab navigation ── */
.tab-nav { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 22px; }
.tab-btn {
  padding: 11px 18px; font-size: 13.5px; font-weight: 600;
  color: var(--gray-500); cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -2px;
  transition: all 0.16s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── 2026: Sidebar nav accent line ── */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: rgba(255,255,255,0.7);
  border-radius: 0 3px 3px 0;
}

/* ── Portal badges ── */
.portal-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em;
}
.portal-pf    { background: #fff3e0; color: #9a3412; }
.portal-bayut { background: #ede9fe; color: #4c1d95; }

/* ── Page header ── */
.page-header {
  padding: 20px 24px;
  background: white;
  border-bottom: 1px solid #e8edf5;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--gray-900); }
.page-subtitle { font-size: 13px; color: var(--gray-400); margin-top: 2px; }

/* ── Loading state ── */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; border-radius: var(--radius);
}

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}

/* ── Search box ── */
.search-box { position: relative; }
.search-box input { padding-left: 36px; }
.search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 13px; }

/* ── Top navbar ── */
.topnav {
  background: white;
  border-bottom: 1px solid #e8edf5;
  padding: 12px 24px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 1px 6px rgba(15,23,42,0.06);
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state i { font-size: 44px; color: #c4cfe0; margin-bottom: 14px; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { color: var(--gray-400); font-size: 13.5px; }

/* ── Priority dots ── */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green  { background: #10b981; }
.dot-yellow { background: #f59e0b; }
.dot-red    { background: #ef4444; }
.dot-blue   { background: #3b82f6; }

/* ── Charts ── */
.chart-container { position: relative; height: 240px; }

/* ── Responsive grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }

/* ── Lead detail sidebar ── */
.detail-panel {
  width: 390px; background: white;
  border-left: 1px solid #e8edf5;
  overflow-y: auto;
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 50;
  transform: translateX(100%); transition: transform 0.26s ease;
  box-shadow: -4px 0 28px rgba(15,23,42,0.12);
}
.detail-panel.open { transform: translateX(0); }

/* ── Status dot ── */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Utilities ── */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ── Progress bar ── */
.progress-bar-track {
  height: 6px; background: #e2eaf4;
  border-radius: 99px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── Manager Report Table ── */
.mgr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mgr-table thead th {
  background: #f2f6fb;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  color: #3d5272;
  border-bottom: 2px solid #d4dce8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.mgr-table thead th:first-child,
.mgr-table thead th:nth-child(2) { text-align: left; }
.mgr-table tbody tr { border-bottom: 1px solid #edf2f8; transition: background 0.1s; }
.mgr-table tbody tr:hover { background: #eef5ff; }
.mgr-table tbody td { padding: 10px 12px; vertical-align: middle; }
.mgr-table tfoot td {
  padding: 10px 12px;
  background: #e8f0fd;
  border-top: 2px solid #b3c8ef;
  font-weight: 800;
}

/* ── KPI chip ── */
.kpi-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.kpi-pf { background: #fff7ed; color: #9a3412; }
.kpi-by { background: #eef2ff; color: #3730a3; }
.kpi-green { background: #dcfce7; color: #166534; }
.kpi-blue  { background: #e0e7ff; color: #3730a3; }

/* ── Agent card (report) ── */
.agent-row-risk { background: #fff8f8 !important; }
.agent-row-risk:hover { background: #ffeef0 !important; }

/* ── Cancel button on mobile ── */
@media (max-width: 768px) {
  .btn-cancel-mobile {
    display: inline-flex; width: 100%;
    justify-content: center; margin-top: 8px;
  }
}

h1 { font-family: 'Inter', Arial, Helvetica, sans-serif; }

/* ── PWA install banner animation ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(24px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Dashboard stat cards accent lines ── */
.stat-card-blue   { border-top: 3px solid #6366f1; }
.stat-card-green  { border-top: 3px solid #10b981; }
.stat-card-amber  { border-top: 3px solid #f59e0b; }
.stat-card-purple { border-top: 3px solid #8b5cf6; }
.stat-card-rose   { border-top: 3px solid #f43f5e; }
.stat-card-teal   { border-top: 3px solid #14b8a6; }

/* ── Filter bar ── */
.filter-bar {
  background: white;
  border-radius: var(--radius);
  border: 1px solid #e2eaf4;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  box-shadow: 0 1px 4px rgba(15,23,42,0.04);
}

/* ── Agent task report ── */
.agent-pct-bar {
  height: 5px; background: #e2eaf4;
  border-radius: 99px; overflow: hidden;
  margin-top: 4px;
}
.agent-pct-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.5s ease;
}

/* ── Section cards ── */
.section-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid #e2eaf4;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.section-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVE STYLES  (max-width: 768px)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Main layout ── */
  .main-content {
    margin-left: 0 !important;
    padding: 6px !important;
    min-height: 100vh;
  }
  #pageContent {
    padding: 6px 0 80px !important; /* bottom padding prevents content hidden under browser nav */
  }

  /* ── Top nav / header bar ── */
  .topnav {
    padding: 0 8px 0 6px !important;
    height: 50px !important;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .topnav .page-title,
  .topnav h1,
  #breadcrumb {
    font-size: 13px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }

  /* ── Page header (title + action buttons row) ── */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 0 10px !important;
    margin-bottom: 12px !important;
  }
  .page-header h1,
  .page-header h2,
  .page-header .page-title {
    font-size: 18px !important;
    line-height: 1.3;
  }
  .page-header .header-actions,
  .page-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-header .header-actions .btn,
  .page-header > div:last-child .btn {
    flex: 1 1 auto;
    min-width: 110px;
    font-size: 12px !important;
    padding: 7px 10px !important;
    justify-content: center;
  }

  /* ── Stat / KPI cards grid ── */
  .stats-grid,
  .grid.grid-cols-4,
  .grid.grid-cols-3,
  .grid.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .stat-card {
    padding: 14px 12px !important;
  }
  .stat-card .stat-value,
  .stat-card h3 {
    font-size: 22px !important;
  }
  .stat-card .stat-label,
  .stat-card p {
    font-size: 11px !important;
  }
  .stat-card .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }

  /* ── Tables — horizontal scroll wrapper ── */
  .table-container,
  .overflow-x-auto {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
  }
  table {
    min-width: 600px;
  }
  /* Tighten table cells on small screens */
  table th,
  table td {
    padding: 8px 10px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }

  /* ── Filter bar ── */
  .filter-bar {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  .filter-bar .form-select,
  .filter-bar .form-input,
  .filter-bar input,
  .filter-bar select {
    width: 100% !important;
    font-size: 13px !important;
  }
  .filter-bar .btn {
    width: 100% !important;
    justify-content: center;
  }

  /* ── Cards / section cards ── */
  .card,
  .section-card {
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }
  .section-card-header {
    padding: 12px 14px !important;
    gap: 8px !important;
  }
  .section-card-header h2,
  .section-card-header h3 {
    font-size: 14px !important;
  }

  /* ── Forms ── */
  .form-grid,
  .grid-cols-2.form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-input,
  .form-select,
  .form-textarea,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
    padding: 10px 12px !important;
  }
  label {
    font-size: 13px !important;
  }

  /* ── Modals ── */
  .modal-overlay {
    padding: 10px !important;
    align-items: flex-end !important; /* slide up from bottom on mobile */
  }
  .modal,
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    border-radius: 16px 16px 0 0 !important;
    overflow-y: auto !important;
    padding: 16px !important;
    margin: 0 !important;
  }
  .modal-header {
    margin-bottom: 14px !important;
  }
  .modal-header h2,
  .modal-header h3 {
    font-size: 16px !important;
  }
  .modal-footer,
  .modal .btn-row,
  .modal > div:last-child {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .modal .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 11px 16px !important;
  }

  /* ── Buttons ── */
  .btn {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
  .btn-sm {
    font-size: 11px !important;
    padding: 5px 10px !important;
  }
  .btn-lg {
    padding: 12px 18px !important;
    font-size: 15px !important;
  }

  /* ── Lead cards (if using card layout instead of table) ── */
  .lead-card {
    padding: 14px !important;
    margin-bottom: 10px !important;
  }
  .lead-card .lead-name {
    font-size: 14px !important;
  }

  /* ── Dashboard specific ── */
  .dashboard-welcome {
    font-size: 16px !important;
    padding: 12px 14px !important;
  }

  /* ── PF API panel tabs ── */
  #pfApiTabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  #pfApiTabs button {
    font-size: 11px !important;
    padding: 6px 10px !important;
    white-space: nowrap;
  }

  /* ── Notifications page ── */
  .push-page-card {
    padding: 16px !important;
  }
  .push-page-card h2 {
    font-size: 16px !important;
  }

  /* ── Chart containers ── */
  .chart-container {
    height: 200px !important;
  }

  /* ── PropSearch launcher buttons ── */
  #pageContent a[href*="propsearch"] {
    padding: 6px 12px !important;
    font-size: 11px !important;
  }

  /* ── Breadcrumb hide on very small ── */
  .breadcrumb {
    font-size: 11px !important;
  }
  .breadcrumb .separator + span:not(:last-child) {
    display: none; /* hide middle crumbs on tiny screens */
  }

  /* ── Tabs (generic) ── */
  .tabs-bar,
  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    padding-bottom: 2px;
  }
  .tab-item,
  .tabs-bar button,
  .tab-bar button {
    white-space: nowrap;
    font-size: 12px !important;
    padding: 7px 12px !important;
  }

  /* ── Hide optional columns label text ── */
  .hide-mobile {
    display: none !important;
  }

  /* ── Full-width helper ── */
  .mobile-full {
    width: 100% !important;
  }
}

/* ── Extra-small phones (< 380px) ── */
@media (max-width: 380px) {
  .stats-grid,
  .grid.grid-cols-4,
  .grid.grid-cols-3,
  .grid.grid-cols-2 {
    grid-template-columns: 1fr 1fr !important;
  }
  .stat-card .stat-value {
    font-size: 18px !important;
  }
  .main-content {
    padding: 6px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   INTERACTIVE / ANIMATION LAYER  — added July 2026
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Skeleton / shimmer loader ──────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    #edf0f7 0%, #f6f8fc 40%, #edf0f7 80%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-text  { height: 13px; border-radius: 4px; }
.skeleton-title { height: 20px; border-radius: 5px; }
.skeleton-circle{ border-radius: 50% !important; }
.skeleton-btn   { height: 34px; border-radius: 9px; }

/* Skeleton card (matches stat-card shape) */
.skeleton-stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
  border: 1px solid #e8edf5;
  display: flex; align-items: center; gap: 14px;
}

/* Skeleton lead-row */
.skeleton-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #f0f4f9;
}

/* Skeleton property card */
.skeleton-prop-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #f0f0f0;
  overflow: hidden;
}

/* ── 2. Page-enter animation ─────────────────────────────────── */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter {
  animation: pageEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 3. Stagger children (first 12 direct children) ──────────── */
.stagger-children > *:nth-child(1)  { animation-delay: 0ms;   }
.stagger-children > *:nth-child(2)  { animation-delay: 40ms;  }
.stagger-children > *:nth-child(3)  { animation-delay: 80ms;  }
.stagger-children > *:nth-child(4)  { animation-delay: 120ms; }
.stagger-children > *:nth-child(5)  { animation-delay: 160ms; }
.stagger-children > *:nth-child(6)  { animation-delay: 200ms; }
.stagger-children > *:nth-child(7)  { animation-delay: 240ms; }
.stagger-children > *:nth-child(8)  { animation-delay: 280ms; }
.stagger-children > *:nth-child(9)  { animation-delay: 320ms; }
.stagger-children > *:nth-child(10) { animation-delay: 360ms; }
.stagger-children > *:nth-child(11) { animation-delay: 400ms; }
.stagger-children > *:nth-child(12) { animation-delay: 440ms; }

/* ── 4. Card hover lift ──────────────────────────────────────── */
.card-lift {
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.22s cubic-bezier(0.22,1,0.36,1);
  will-change: transform;
}
.card-lift:hover {
  transform: translateY(-4px) scale(1.008);
  box-shadow: 0 12px 36px rgba(15,23,42,0.13);
}
.card-lift:active {
  transform: translateY(-1px) scale(1.002);
}

/* Apply lift to stat-cards automatically */
.stat-card {
  cursor: default;
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.22s cubic-bezier(0.22,1,0.36,1) !important;
}
.stat-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 30px rgba(15,23,42,0.12) !important;
}

/* ── 5. Button press (active-scale) ──────────────────────────── */
.btn {
  transition: all 0.16s ease, transform 0.1s ease !important;
}
.btn:active {
  transform: scale(0.96) !important;
}

/* ── 6. Button ripple ────────────────────────────────────────── */
.btn-ripple {
  position: relative; overflow: hidden;
}
.ripple-effect {
  position: absolute; border-radius: 50%;
  transform: scale(0); opacity: 0.28;
  background: rgba(255,255,255,0.7);
  animation: rippleAnim 0.5s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ── 7. Animated counter (number roll) ───────────────────────── */
.count-up {
  display: inline-block;
  transition: none;
}

/* ── 8. Smooth spinner (improved) ────────────────────────────── */
@keyframes spinSmooth {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.spinner {
  animation: spinSmooth 0.75s cubic-bezier(0.4,0,0.2,1) infinite !important;
}

/* ── 9. Nav item hover glow ─────────────────────────────────── */
.nav-item {
  transition: all 0.18s cubic-bezier(0.22,1,0.36,1) !important;
}
.nav-item:hover {
  background: rgba(255,255,255,0.09) !important;
  color: #e2e8f0 !important;
  transform: translateX(2px);
}
.nav-item.active {
  box-shadow: 0 3px 14px rgba(99,102,241,0.55) !important;
}

/* ── 10. Modal entrance ──────────────────────────────────────── */
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.modal {
  animation: modalSlideUp 0.28s cubic-bezier(0.22,1,0.36,1);
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-overlay {
  animation: overlayFadeIn 0.2s ease;
}

/* ── 11. Toast entrance/exit ─────────────────────────────────── */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast {
  animation: toastSlideIn 0.28s cubic-bezier(0.22,1,0.36,1) !important;
}

/* ── 12. Detail panel improved slide ────────────────────────── */
.detail-panel {
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1) !important;
}

/* ── 13. Pipeline card hover ────────────────────────────────── */
.pipeline-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.pipeline-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15,23,42,0.12) !important;
}

/* ── 14. Table row hover (enhanced) ─────────────────────────── */
.crm-table tbody tr {
  transition: background 0.12s ease !important;
}
.crm-table tbody tr:hover {
  background: #f5f3ff !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ── 15. Badge pulse for urgent items ────────────────────────── */
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}
#notifBadge:not(.hidden) {
  animation: badgePulse 2s ease infinite;
}

/* ── 16. Page-content smooth transition ──────────────────────── */
#pageContent {
  transition: opacity 0.18s ease;
}
#pageContent.navigating {
  opacity: 0;
}

/* ── 17. Input focus ring ────────────────────────────────────── */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  transform: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15), 0 1px 3px rgba(0,0,0,0.06) !important;
}

/* ── 18. Top-nav search glow (if present) ────────────────────── */
.topnav input:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.14);
}

/* ── 19. Empty-state entrance ────────────────────────────────── */
.empty-state {
  animation: pageEnter 0.4s cubic-bezier(0.22,1,0.36,1);
}
.empty-state i {
  display: block;
  animation: emptyIconBounce 0.6s cubic-bezier(0.22,1,0.36,1) 0.15s both;
}
@keyframes emptyIconBounce {
  from { opacity: 0; transform: scale(0.5) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── 20. Sidebar credits number flash on update ──────────────── */
@keyframes creditFlash {
  0%   { color: inherit; }
  30%  { color: #34d399; }
  100% { color: inherit; }
}
.credit-updated {
  animation: creditFlash 1.2s ease;
}

/* ── 21. Action button loading state ────────────────────────── */
.btn-loading {
  pointer-events: none; opacity: 0.75;
  position: relative;
}
.btn-loading::after {
  content: '';
  position: absolute; right: 10px; top: 50%;
  width: 13px; height: 13px; margin-top: -6.5px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spinSmooth 0.65s linear infinite;
}

/* ── 22. Property card hover (inline-style cards) ────────────── */
.prop-card-wrap {
  transition: transform 0.22s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.22s cubic-bezier(0.22,1,0.36,1);
}
.prop-card-wrap:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(15,23,42,0.12) !important;
}

/* ── 23. Filter bar active filter highlight ──────────────────── */
@keyframes filterApplied {
  0%   { box-shadow: 0 0 0 0 rgba(37,99,235,0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
.filter-applied {
  animation: filterApplied 0.6s ease;
}

/* ── 24. Section card header hover ──────────────────────────── */
.section-card {
  transition: box-shadow 0.2s ease;
}

/* ── 25. Responsive: disable heavy transforms on low-end mobile ─ */
@media (max-width: 480px) {
  .card-lift:hover,
  .stat-card:hover {
    transform: none !important;
  }
  .nav-item:hover {
    transform: none !important;
  }
}

/* ── 26. Reduce motion for accessibility ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE UX POLISH — Touch targets, page headers, animations
   ═══════════════════════════════════════════════════════════════ */

/* ── 27. Inline-style page headers (Expenses / Salary / PettyCash) ── */
/* These pages use inline flex headers — ensure they wrap nicely on mobile */
@media (max-width: 768px) {
  /* Any flex header with margin-left:auto actions → wrap cleanly */
  div[style*="display:flex"][style*="align-items:center"][style*="flex-wrap:wrap"] {
    gap: 10px !important;
  }

  /* Expense and Salary page outer wrapper padding */
  div[style*="padding:24px"],
  div[style*="padding: 24px"],
  div[style*="padding:20px"],
  div[style*="padding: 20px"] {
    padding: 12px !important;
  }

  /* PettyCash header bar */
  div[style*="background:#fff;border-bottom:1px solid #e5e7eb;padding:16px 24px"] {
    padding: 12px 14px !important;
    gap: 10px !important;
  }
}

/* ── 28. Touch target minimum sizes ─────────────────────────── */
@media (max-width: 768px) {
  /* All buttons should be at least 44px tall for comfortable touch */
  button, .btn, [role="button"] {
    min-height: 40px;
  }
  /* Edit / action buttons inside cards / table rows */
  button[onclick], a[onclick] {
    min-height: 36px;
  }
  /* Inline icon-only buttons (like edit icons in tables) */
  button[style*="padding:4px"] {
    padding: 8px 14px !important;
    min-height: 36px !important;
  }

  /* Selects also need comfortable height */
  select, input[type="text"], input[type="number"],
  input[type="email"], input[type="tel"], input[type="password"] {
    min-height: 40px;
  }
}

/* ── 29. Salary / Expenses inline header: stack on mobile ───── */
@media (max-width: 600px) {
  /* The sal/exp header flex row → column */
  .sal-page-header, .exp-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .sal-page-header > div:last-child,
  .exp-page-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .sal-page-header > div:last-child > *,
  .exp-page-header > div:last-child > * {
    flex: 1 1 auto !important;
    min-width: 80px !important;
  }
}

/* ── 30. Petty cash summary cards: responsive grid ──────────── */
@media (max-width: 600px) {
  #pcSummaryCards {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
}

/* ── 31. Leads filter bar: full width inputs on mobile ─────── */
@media (max-width: 600px) {
  #leadsTableContainer {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* filter search box in leads */
  .search-box {
    min-width: 100% !important;
  }
}

/* ── 32. Mobile-friendly modal bottom-sheet: better bottom bar ─ */
@media (max-width: 600px) {
  .modal-overlay,
  div[style*="position:fixed"][style*="align-items:center"][style*="justify-content:center"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  /* Direct modal children (the white box) */
  div[style*="background:#fff;border-radius:16px;padding:28px"] {
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 16px !important;
    margin: 0 !important;
  }
}

/* ── 33. Salary edit modal grid: single column on tiny phones ── */
@media (max-width: 400px) {
  div[style*="grid-template-columns:1fr 1fr;gap:14px"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── 34. Page breadcrumb / topnav better spacing ────────────── */
@media (max-width: 600px) {
  .topnav {
    gap: 6px !important;
  }
  /* Notif bell + avatar — don't let them shrink to zero */
  #notifBtn, #topUserBtn {
    flex-shrink: 0 !important;
  }
}

/* ── 35. Smooth momentum scroll on all scrollable containers ── */
.overflow-x-auto,
.table-container,
.modal,
.modal-content,
#pageContent {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ── 36. Active state tap highlight (mobile) ─────────────────── */
@media (max-width: 768px) {
  button:active, .btn:active, a:active {
    opacity: 0.82 !important;
  }
  /* Remove default mobile tap highlight */
  * {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── 37. Improved nav-item touch zones (sidebar) ─────────────── */
@media (max-width: 768px) {
  .nav-item {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: flex !important;
    align-items: center !important;
  }
}

/* ── 38. Pull-to-refresh visual hint (loading spinner at top) ── */
@keyframes pullArrow {
  0%   { opacity: 0; transform: translateY(-8px); }
  60%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(4px); }
}
.pull-indicator {
  display: none;
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 20px;
  padding: 6px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 12px;
  color: #64748b;
  z-index: 9990;
  animation: pullArrow 1.2s ease infinite;
  align-items: center;
  gap: 6px;
}
@media (max-width: 768px) {
  .pull-indicator.visible {
    display: flex;
  }
}

/* ── 39. Better tab bar on mobile (scrollable, no wrap) ──────── */
@media (max-width: 600px) {
  /* Expenses/Salary page year/month select wrap */
  div[style*="margin-left:auto;display:flex;gap:8px"] {
    flex-wrap: wrap !important;
    margin-left: 0 !important;
    width: 100% !important;
    justify-content: flex-start !important;
  }
}

/* ── 40. Floating action button (FAB) for quick add on mobile ─── */
.fab-mobile {
  display: none;
}
@media (max-width: 600px) {
  .fab-mobile {
    display: flex !important;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.50);
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 800;
    transition: transform 0.18s cubic-bezier(0.22,1,0.36,1),
                box-shadow 0.18s ease;
  }
  .fab-mobile:active {
    transform: scale(0.92);
    box-shadow: 0 3px 12px rgba(99,102,241,0.35);
  }
}

/* ── 41. Inline card actions: better spacing on mobile ──────── */
@media (max-width: 600px) {
  /* Mobile expense/salary card edit button */
  button[onclick*="showEditExpMonth"],
  button[onclick*="showSalaryEdit"],
  button[onclick*="showAddLeadModal"],
  button[onclick*="showAddPCEntry"] {
    min-height: 40px !important;
    padding: 8px 16px !important;
  }
}

/* ── 42. Section card headers: horizontal scroll for many tabs ─ */
.section-card-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.section-card-tabs::-webkit-scrollbar {
  display: none;
}

/* ── 43. Enhanced mobile pagination ─────────────────────────── */
@media (max-width: 600px) {
  #leadsPagination {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
  }
  #leadsPagination .btn {
    min-width: 80px !important;
    justify-content: center !important;
  }
}

/* ── 44. Notification page UX improvements ──────────────────── */
@media (max-width: 600px) {
  .push-page-card {
    border-radius: 16px !important;
    margin: 0 0 12px !important;
  }
  /* Diagnostic output: monospace scrollable box */
  #diagOutput, #notifLog {
    font-size: 11px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── 45. Table container: add swipe hint on first load ──────── */
@media (max-width: 768px) {
  .table-swipe-hint::after {
    content: '← Swipe to see more →';
    display: block;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    padding: 6px 0 2px;
    font-style: italic;
  }
}

/* ── 46. Extra small mobile text helpers ────────────────────── */
.hide-mobile-xs { display: inline; }
.show-mobile-xs { display: none;   }
@media (max-width: 480px) {
  .hide-mobile-xs { display: none   !important; }
  .show-mobile-xs { display: inline !important; }
}

/* ── 47. Petty Cash padding on mobile ───────────────────────── */
@media (max-width: 600px) {
  #pcSummaryCards > div {
    min-width: 0 !important;
    flex: 1 1 calc(50% - 5px) !important;
  }
}

/* ── 48. Expense / Salary edit modal: bottom-sheet on mobile ── */
@media (max-width: 600px) {
  #expEditModal > div,
  #salEditModal > div {
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  #expEditModal,
  #salEditModal {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  /* Single column for sal edit grid on tiny screens */
  #salEditModal div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   2026 DESIGN REFRESH — Extra polish & schema panel styles
   ═══════════════════════════════════════════════════════════════ */

/* ── 2026-A. Pipeline column: violet tint ────────────────────── */
.pipeline-col {
  min-width: 240px;
  background: #f5f3ff;
  border-radius: 12px; padding: 14px;
  border: 1px solid #ede9fe;
}
.pipeline-card {
  border-left: 3px solid var(--primary);
}

/* ── 2026-B. Topnav 2026 refresh ─────────────────────────────── */
.topnav {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99,102,241,0.10);
  box-shadow: 0 1px 8px rgba(99,102,241,0.06);
}

/* ── 2026-C. Schema / custom columns panel ───────────────────── */
.schema-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #e0e7ff;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.schema-col-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.12s;
}
.schema-col-row:hover { background: #f5f3ff; }
.schema-col-row:last-child { border-bottom: none; }
.schema-col-row input[type="text"] {
  flex: 1; min-width: 0;
  padding: 6px 10px;
  border: 1.5px solid #e0e7ff;
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray-800);
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.schema-col-row input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.13);
}
.schema-col-row .col-type-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: #e0e7ff; color: #4338ca;
  white-space: nowrap;
}
.schema-toggle-vis {
  width: 30px; height: 18px;
  border-radius: 9px;
  background: #e2e8f0;
  border: none; cursor: pointer;
  position: relative; flex-shrink: 0;
  transition: background 0.2s;
}
.schema-toggle-vis.on  { background: var(--primary); }
.schema-toggle-vis::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.schema-toggle-vis.on::after { left: 14px; }

/* ── 2026-D. Success/danger inline chip ──────────────────────── */
.chip-success { background: #dcfce7; color: #166534; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.chip-danger  { background: #ffe4e6; color: #9f1239; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.chip-info    { background: #e0e7ff; color: #3730a3; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.chip-warn    { background: #fef9c3; color: #854d0e; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }

/* ── 2026-E. Section card header: accent left border on hover ── */
.section-card:hover {
  box-shadow: 0 4px 24px rgba(99,102,241,0.10);
}

/* ── 2026-F. Credit flash updated animation colour ──────────── */
@keyframes creditFlash {
  0%   { color: inherit; }
  30%  { color: #a5f3fc; }
  100% { color: inherit; }
}
.credit-updated {
  animation: creditFlash 1.2s ease;
}

/* ── 2026-G. Filter-applied ring colour ─────────────────────── */
@keyframes filterApplied {
  0%   { box-shadow: 0 0 0 0 rgba(99,102,241,0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(99,102,241,0); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}
.filter-applied {
  animation: filterApplied 0.6s ease;
}

/* ── 2026-H. Sidebar "you" badge colour ─────────────────────── */
.sidebar-you-badge {
  background: rgba(99,102,241,0.22);
  color: #a5b4fc;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
  margin-left: auto;
}
