/* ============================================================
   TAQWA GROUP CRM v3.0 — Premium Light Design System
   Reference: CRM 2.jpg / CRM 5.jpg — Clean, White, Professional
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+Bengali:wght@400;500;600;700;800;900&family=Anek+Bangla:wght@400;500;600;700;800&family=Hind+Siliguri:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13.5px; scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Bengali', 'Anek Bangla', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F4F6F9;
  color: #1A1D1F;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.006em;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
ul { list-style: none; }
img { max-width: 100%; }

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand Greens */
  --green-50:  #ECFDF5;
  --green-100: #D1FAE5;
  --green-200: #A7F3D0;
  --green-500: #1B7B3D;
  --green-600: #15803D;
  --green-700: #166534;
  --green-800: #14532D;

  /* Neutrals */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Accent Colors */
  --blue-50:  #EFF6FF; --blue-500: #3B82F6; --blue-600: #2563EB;
  --orange-50:#FFF7ED; --orange-500:#F59E0B; --orange-600:#D97706;
  --red-50:   #FEF2F2; --red-500:  #EF4444; --red-600:  #DC2626;
  --purple-50:#F5F3FF; --purple-500:#8B5CF6; --purple-600:#7C3AED;
  --teal-50:  #F0FDFA; --teal-500: #14B8A6; --teal-600: #0D9488;
  --gold-500: #C9A84C; --gold-50:  #FFFBEB;

  /* Surfaces & Glassmorphism */
  --bg-page:    #F4F6F9;
  --bg-card:    #FFFFFF;
  --bg-sidebar: #FAFBFC;
  --bg-input:   #F9FAFB;
  --bg-hover:   #F3F4F6;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #6B7280;
  --text-muted:     #6B7280;
  --text-heading:   #1A1D1F;

  /* Border */
  --border:      #E5E7EB;
  --border-light:#F3F4F6;

  /* Shadows — Soft Glassmorphism */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm:  0 2px 6px rgba(0,0,0,0.03);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.06);
  --shadow-xl:  0 12px 32px rgba(0,0,0,0.08);
  --shadow-card:0 4px 20px rgba(0,0,0,0.04);
  --shadow-hover: 0 8px 26px rgba(0,0,0,0.07);

  /* Layout */
  --sidebar-w:    260px;
  --header-h:     70px;
  --bottom-nav-h: 68px;
  --radius-xs:    4px;
  --radius-sm:    6px;
  --radius-md:    8px;
  --radius-lg:    10px;
  --radius-xl:    14px;
  --radius-full:  9999px;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.15s var(--ease);
}

/* ── App Layout ────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

.sidebar-brand {
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
}
.sidebar-brand .brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: 0 4px 12px rgba(27,123,61,0.25);
  flex-shrink: 0;
}
.sidebar-brand .brand-text h3 {
  font-size: 15px; font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sidebar-brand .brand-text span {
  font-size: 11px; color: var(--text-muted);
  font-weight: 500;
}

.sidebar-user {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.sidebar-user .user-ava {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.sidebar-user .user-info .name { font-size: 13px; font-weight: 700; color: var(--text-heading); }
.sidebar-user .user-info .role { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 16px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 700;
  border-radius: var(--radius-xs);
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; opacity: 0.75; }
.nav-badge {
  margin-left: auto;
  background: var(--red-500);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0; /* CRITICAL: Allows flex item to shrink below content width */
  width: calc(100% - var(--sidebar-w));
  max-width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ── Top Header ────────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.header-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding-right: 12px;
}
.header-left h1 {
  font-size: 19px; font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-left p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-icon-btn {
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}
.header-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--gray-300); }
.notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--red-500);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1440px;
  width: 100%;
  min-width: 0; /* CRITICAL: Prevents horizontal overflow */
  box-sizing: border-box;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: var(--transition);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  min-width: 0;
  flex-wrap: wrap;
  gap: 10px;
  box-sizing: border-box;
}
.card-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}
.card-body {
  padding: 20px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  box-sizing: border-box;
  min-width: 0;
}

/* ── Stat Cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: none;
  transition: var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-300);
}
.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-icon-wrap {
  width: 12px; height: 40px;
  display: flex; align-items: flex-end;
  gap: 2px;
}
.stat-icon-wrap .mini-bar {
  width: 3px;
  background: var(--gray-800);
  border-radius: 1px;
  opacity: 0.6;
}
.stat-value {
  font-size: 28px; font-weight: 800;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
  font-family: 'Inter', sans-serif;
}
.stat-value .stat-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 4px;
}
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px; font-weight: 600;
  margin-top: 8px;
  padding: 2px 0;
}
.stat-change.up { color: var(--green-600); }
.stat-change.down { color: var(--red-500); }
.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  letter-spacing: -0.01em;
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; font-size: 14px; border-radius: var(--radius-xs); }
.w-full { width: 100%; }

.btn-primary {
  background: var(--gray-900);
  color: #fff;
}
.btn-primary:hover { background: var(--gray-800); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-green {
  background: var(--green-600);
  color: #fff;
}
.btn-green:hover { background: var(--green-700); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(21,128,61,0.3); }

.btn-secondary {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--gray-300); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--red-50);
  color: var(--red-600);
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover { background: #FEE2E2; }

.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #20b558; }

.btn-call { background: var(--green-50); color: var(--green-700); border-color: var(--green-200); }
.btn-call:hover { background: var(--green-100); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge-green  { background: var(--green-50);  color: var(--green-700); }
.badge-gold   { background: var(--gold-50);   color: #92400E; }
.badge-blue   { background: var(--blue-50);   color: var(--blue-600); }
.badge-orange { background: var(--orange-50); color: var(--orange-600); }
.badge-red    { background: var(--red-50);    color: var(--red-600); }
.badge-purple { background: var(--purple-50); color: var(--purple-600); }
.badge-gray   { background: var(--gray-100);  color: var(--gray-600); }
.badge-teal   { background: var(--teal-50);   color: var(--teal-600); }
.badge-success{ background: #DCFCE7; color: #166534; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus {
  border-color: var(--green-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27,123,61,0.08);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ── Search Box ────────────────────────────────────────────── */
.search-box { position: relative; }
.search-box input { padding-left: 40px; }
.search-box .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 16px;
}

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter-bar .search-box { flex: 1; min-width: 220px; }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active {
  color: var(--text-heading);
  border-bottom-color: var(--green-600);
}
.tab-btn:hover:not(.active) { color: var(--text-primary); }

.tab-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-pill {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: #fff;
  transition: var(--transition);
}
.tab-pill.active { background: var(--gray-900); color: #fff; border-color: var(--gray-900); }
.tab-pill:hover:not(.active) { border-color: var(--gray-400); color: var(--text-primary); background: var(--gray-50); }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrapper, .table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  box-sizing: border-box;
}
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--gray-50); }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center; justify-content: center;
  z-index: 300; padding: 16px;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.2s var(--ease);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-heading); }
.modal-close {
  width: 32px; height: 32px;
  background: var(--gray-100); border-radius: var(--radius-xs);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--red-500); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Customer List ─────────────────────────────────────────── */
.customer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  cursor: pointer; transition: var(--transition);
  border-bottom: 1px solid var(--border-light);
}
.customer-item:last-child { border-bottom: none; }
.customer-item:hover { background: var(--gray-50); }
.customer-ava {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
  flex-shrink: 0;
}
.customer-info { flex: 1; min-width: 0; }
.customer-name { font-size: 14px; font-weight: 700; color: var(--text-heading); margin-bottom: 2px; }
.customer-phone { font-size: 13px; color: var(--text-muted); }
.customer-right { text-align: right; flex-shrink: 0; }

/* ── Follow-up Card ────────────────────────────────────────── */
.followup-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.followup-card:hover { box-shadow: var(--shadow-sm); }
.followup-card.overdue { border-left: 3px solid var(--red-500); }
.followup-card.today   { border-left: 3px solid var(--orange-500); }
.followup-card.upcoming{ border-left: 3px solid var(--blue-500); }

/* ── Timeline ──────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before {
  content: ''; position: absolute;
  left: 16px; top: 36px; bottom: 0; width: 2px; background: var(--border);
}
.timeline-dot {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-50); border: 2px solid var(--green-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; z-index: 1;
}
.timeline-content { flex: 1; padding-top: 6px; }
.timeline-date { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.timeline-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; }

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
  height: 8px; background: var(--gray-100);
  border-radius: var(--radius-full); overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--green-500); border-radius: var(--radius-full);
  transition: width 0.5s var(--ease);
}
.progress-fill.gold { background: var(--gold-500); }
.progress-fill.red  { background: var(--red-500); }

/* ── Avatar ────────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff; flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.avatar-xl { width: 80px; height: 80px; font-size: 32px; }

/* ── FAB ───────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 54px; height: 54px;
  background: var(--gray-900); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  box-shadow: var(--shadow-lg); z-index: 80; transition: var(--transition);
}
.fab:hover { transform: scale(1.06); box-shadow: var(--shadow-xl); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px 0; }
.page-btn {
  width: 34px; height: 34px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  background: #fff; border: 1px solid var(--border); transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--gray-900); color: #fff; border-color: var(--gray-900); }

/* ── Toast ─────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.toast {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 18px; display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  box-shadow: var(--shadow-lg); animation: slideInRight 0.3s var(--ease);
  min-width: 280px; max-width: 380px;
}
.toast.success { border-left: 4px solid var(--green-500); }
.toast.error   { border-left: 4px solid var(--red-500); }
.toast.info    { border-left: 4px solid var(--blue-500); }
.toast.warning { border-left: 4px solid var(--orange-500); }

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F2B1A 0%, #061209 50%, #0A1A0F 100%);
  padding: 24px; position: relative; overflow: hidden;
}
.login-bg-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 30%, rgba(27,123,61,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 70%, rgba(201,168,76,0.08) 0%, transparent 55%);
  pointer-events: none;
}
.login-card {
  background: rgba(255,255,255,0.05); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-xl);
  padding: 44px 36px; width: 100%; max-width: 420px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.4); position: relative; z-index: 1;
}
.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(27,123,61,0.35);
}
.login-title { text-align: center; margin-bottom: 32px; }
.login-title h1 { font-size: 24px; font-weight: 800; color: #20BA5A; margin-bottom: 6px; letter-spacing: -0.02em; }
.login-title p { font-size: 14px; color: #8E9993; }

/* ── Section Title ─────────────────────────────────────────── */
.section-title {
  font-size: 14px; font-weight: 700; color: var(--text-heading);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text-muted); }

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); font-size: 13px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-green  { color: var(--green-600); }
.text-red    { color: var(--red-500); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.chart-row { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.fade-in { animation: fadeIn 0.25s var(--ease); }
.slide-up { animation: slideUp 0.3s var(--ease); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Responsive ────────────────────────────────────────────── */

/* Tier 1: Laptops & Medium/Small Desktop Monitors (901px to 1366px) */
@media (min-width: 901px) and (max-width: 1366px) {
  :root {
    --sidebar-w: 220px;
    --header-h: 62px;
  }
  .sidebar-brand { padding: 0 14px; gap: 8px; }
  .sidebar-brand .brand-icon { width: 34px; height: 34px; font-size: 16px; }
  .sidebar-brand .brand-text h3 { font-size: 13.5px; }
  .sidebar-brand .brand-text span { font-size: 10px; }
  
  .sidebar-user { padding: 10px 14px; gap: 8px; }
  .sidebar-user .user-ava { width: 32px; height: 32px; font-size: 12px; }
  .sidebar-user .user-info .name { font-size: 12px; }
  .sidebar-user .user-info .role { font-size: 10px; }
  
  .sidebar-nav { padding: 8px 6px; }
  .nav-item { padding: 7px 10px; font-size: 12.5px; gap: 8px; }
  .nav-item .nav-icon { font-size: 15px; width: 18px; }
  .nav-label { padding: 10px 10px 4px; font-size: 10px; }
  
  .top-header { padding: 0 18px; }
  .page-content { padding: 18px 20px; }
  
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .card-body { padding: 16px; }
}

/* Tier 2: Compact Desktop / Low-res Monitors (901px to 1150px) */
@media (min-width: 901px) and (max-width: 1150px) {
  :root {
    --sidebar-w: 200px;
  }
  .top-header { padding: 0 14px; }
  .header-left h1 { font-size: 16px; }
  .header-left p { font-size: 11px; }
  .page-content { padding: 14px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .nav-item span:not(.nav-icon):not(.nav-badge) { font-size: 12px; }
  #globalSyncBtn { font-size: 11.5px; padding: 5px 8px; }
}

/* Tier 3: Tablets & Mobile (<= 900px) */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s var(--ease); z-index: 200; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-bottom: var(--bottom-nav-h);
  }
  .fab { bottom: calc(var(--bottom-nav-h) + 16px); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .page-content { padding: 14px 14px !important; }
  .top-header { padding: 0 14px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .login-card { padding: 28px 20px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ── Bottom Nav (Mobile) ───────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  z-index: 1000;
  padding: 4px 6px calc(env(safe-area-inset-bottom, 0px) + 4px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}
@media (max-width: 900px) {
  .bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 12px;
  color: #64748B;
  font-size: 10.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  flex: 1;
}
.bottom-nav-item .nav-icon {
  font-size: 19px;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}
.bottom-nav-item.active {
  color: #16A34A !important;
  font-weight: 700;
}
.bottom-nav-item.active .nav-icon {
  transform: scale(1.12);
  color: #16A34A;
}
.bottom-nav-item:active {
  transform: scale(0.94);
}

/* ── Mobile Header ─────────────────────────────────────────── */
.mobile-header {
  display: none; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
@media (max-width: 900px) { .top-header { display: none; } .mobile-header { display: flex; } }
.hamburger {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-secondary);
  background: var(--gray-100); border-radius: var(--radius-sm);
}
.mobile-brand { display: flex; align-items: center; gap: 8px; }
.mobile-brand span { font-size: 15px; font-weight: 800; color: var(--text-heading); }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; }
@media (max-width: 900px) { .sidebar-overlay.show { display: block; } }

/* ── Missing Utilities ─────────────────────────────────────── */
.mb-4  { margin-bottom: 4px; }
.text-primary { color: var(--text-primary); }
.bg-gray-50 { background: var(--gray-50); }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }

/* Badge aliases for backward compat */
.badge-booked { background: #DCFCE7; color: #166534; }
.badge-thinking { background: #FFFBEB; color: #92400E; }
.badge-notcalled { background: var(--gray-100); color: var(--gray-600); }
.badge.available { background: #DCFCE7; color: #166534; }
.badge.limited { background: var(--orange-50); color: var(--orange-600); }
.badge.sold-out { background: var(--red-50); color: var(--red-600); }

/* Component aliases */
.task-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; transition: var(--transition); }
.task-card:hover { box-shadow: var(--shadow-sm); }
.page-title { font-size: 20px; font-weight: 800; color: var(--text-heading); letter-spacing: -0.02em; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.modal-content { background: #fff; border-radius: var(--radius-xl); max-width: 560px; width: 100%; box-shadow: var(--shadow-xl); }
.close-btn { width: 32px; height: 32px; background: var(--gray-100); border-radius: var(--radius-xs); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 16px; border: none; cursor: pointer; transition: var(--transition); }
.close-btn:hover { background: var(--gray-200); color: var(--red-500); }
.form-actions { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }
.notif-btn { width: 40px; height: 40px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text-secondary); transition: var(--transition); position: relative; }
.stat-icon { font-size: 24px; }

/* ── Dark theme vars for legacy pages ──────────────────────── */
:root {
  --navy-900: #1F2937; --navy-800: #374151; --navy-700: #4B5563;
  --gold: #C9A84C; --gold-dark: #92400E;
  --white: #FFFFFF;
  --glass-border: rgba(0,0,0,0.06);
  --hot: #EF4444; --warm: #F59E0B; --cold: #3B82F6;
}

/* ── Mobile Touch & Anti-Zoom Optimization ─────────────────── */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

.table-wrapper, .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes slideUpBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  /* FIX: was previously scoped to max-width:768px only. .bottom-nav has
     z-index:1000 and shows up to 900px wide, so between 769px-900px every
     modal-overlay (edit/delete/receipt popups) was rendering UNDERNEATH the
     bottom nav bar (z-index:300) and appeared to "disappear" or hide behind
     it. Widening this query to match .bottom-nav's own breakpoint fixes it. */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
    z-index: 2500 !important;
  }
  .modal-overlay.open .modal {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 88vh !important;
    transform: translateY(0) !important;
    animation: slideUpBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-bottom: none !important;
    box-shadow: 0 -12px 40px rgba(0,0,0,0.25) !important;
    z-index: 2501 !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal::before {
    content: '';
    display: block;
    width: 44px;
    height: 5px;
    background: #CBD5E1;
    border-radius: 4px;
    margin: 10px auto 6px auto;
  }
}

@media (max-width: 768px) {
  html, body {
    font-size: 14px;
  }
  .app-layout {
    width: 100vw;
    overflow-x: hidden;
  }
  .main-content {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .page-content {
    padding: 12px !important;
  }
  .card {
    padding: 14px !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
  }
  .card-body {
    padding: 12px !important;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 14px !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 18px rgba(0,0,0,0.04) !important;
  }
  .stat-value {
    font-size: 22px !important;
  }
  .tab-pills {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile Bottom Sheet Modal */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
    z-index: 2500 !important;
  }
  .modal-overlay.open .modal {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 88vh !important;
    transform: translateY(0) !important;
    animation: slideUpBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-bottom: none !important;
    box-shadow: 0 -12px 40px rgba(0,0,0,0.25) !important;
    z-index: 2501 !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal::before {
    content: '';
    display: block;
    width: 44px;
    height: 5px;
    background: #CBD5E1;
    border-radius: 4px;
    margin: 10px auto 6px auto;
  }
}

/* ── More Action Sheet Card ────────────────────────────────── */
.more-action-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.more-action-card:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}
.more-action-card.danger {
  background: #FFF5F5;
  border-color: #FECACA;
}
.more-action-card.danger:hover {
  background: #FEE2E2;
}
.more-action-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.more-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.more-action-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.25;
}
.more-action-sub {
  font-size: 11.5px;
  color: #64748B;
  margin-top: 2px;
}
.more-action-arrow {
  font-size: 18px;
  font-weight: 700;
  color: #94A3B8;
}

/* ── FINAL POLISH GUIDELINES ─────────────────────────────────── */

body, table, input, button, select {
  font-family: 'Plus Jakarta Sans', 'Hind Siliguri', sans-serif !important;
}

/* টেবিল রো এবং প্যাডিং পলিশ */
.table tbody tr td, table td {
  padding: 13px 16px !important;
  vertical-align: middle !important;
  font-size: 13.5px !important;
}

tbody tr {
  transition: all 0.15s ease;
}
tbody tr:hover {
  background: rgba(241, 245, 249, 0.7) !important;
}

/* কার্ড শ্যাডো ও ট্রানজিশন পলিশ */
.card, .widget-box, .stat-card, .plot-card, .followup-card {
  border-radius: 14px !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover, .plot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.07) !important;
}

/* অ্যাকশন বাটনগুলোর অতিরিক্ত বর্ডার ও বক্স রিমুভ */
table td button, table td a, .followup-card .btn {
  box-shadow: none !important;
  border-radius: 8px !important;
}

/* ── Mobile Touch Cards & App Experience ── */
.mobile-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 640px) and (max-width: 1024px) {
  .mobile-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
.lead-mobile-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.lead-mobile-card:hover {
  box-shadow: 0 8px 26px rgba(0,0,0,0.07);
}
.touch-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  min-height: 42px;
}
.touch-btn-call {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.touch-btn-wa {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}
.touch-btn-crm {
  background: linear-gradient(135deg,#1B7B3D,#20BA5A);
  color: #fff;
}
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Money Receipt & Certificate Print Styles ── */
@media print {
  @page {
    size: landscape;
    margin: 8mm;
  }
  body * {
    visibility: hidden;
  }
  #printableReceiptArea, #printableReceiptArea *,
  #printableCertArea, #printableCertArea * {
    visibility: visible;
  }
  #printableReceiptArea, #printableCertArea {
    position: fixed;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
  }
  .no-print {
    display: none !important;
  }
}

/* ── Customer Details Screen (Mobile & Desktop App UI) ── */
.cd-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 12px 24px;
}
@media (min-width: 901px) {
  .cd-container {
    max-width: 920px;
    padding: 16px 24px 32px;
  }
}

.cd-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.cd-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.cd-icon-btn:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}
.cd-top-title {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.01em;
}

.cd-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 20px 0;
  padding: 4px 6px;
}
.cd-avatar-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818CF8 0%, #6366F1 50%, #4F46E5 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
  flex-shrink: 0;
}
.cd-profile-meta {
  flex: 1;
  min-width: 0;
}
.cd-profile-name {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 3px 0;
  line-height: 1.25;
}
.cd-profile-phone {
  font-size: 14.5px;
  color: #64748B;
  font-weight: 500;
  margin: 0 0 7px 0;
}
.cd-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.cd-status-pill.interested { background: #DCFCE7; color: #15803D; }
.cd-status-pill.hot { background: #FEE2E2; color: #B91C1C; }
.cd-status-pill.warm { background: #FFEDD5; color: #C2410C; }
.cd-status-pill.thinking { background: #FEF3C7; color: #B45309; }
.cd-status-pill.visit-done { background: #CCFBF1; color: #0F766E; }
.cd-status-pill.booked { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.cd-status-pill.called { background: #EFF6FF; color: #1D4ED8; }
.cd-status-pill.new { background: #F1F5F9; color: #475569; }
.cd-status-pill.not-interested { background: #FEE2E2; color: #991B1B; }

/* 4 Quick Action Tiles */
.cd-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.cd-action-tile {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #E2E8F0;
}
.cd-action-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border-color: #CBD5E1;
}
.cd-action-tile:active {
  transform: scale(0.96);
}
.cd-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  transition: transform 0.2s ease;
}
.cd-tile-icon.call { background: #F0FDF4; color: #16A34A; }
.cd-tile-icon.wa { background: #DCFCE7; color: #16A34A; }
.cd-tile-icon.sms { background: #EFF6FF; color: #2563EB; }
.cd-tile-icon.more { background: #F8FAFC; color: #64748B; border: 1px solid #E2E8F0; }
.cd-tile-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

/* Key-Value Details Card */
.cd-kv-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-bottom: 20px;
}
.cd-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 14px;
  gap: 16px;
}
.cd-kv-row:last-child {
  border-bottom: none;
}
.cd-kv-label {
  color: #64748B;
  font-weight: 500;
  font-size: 13.5px;
  flex-shrink: 0;
}
.cd-kv-value {
  font-weight: 700;
  color: #0F172A;
  text-align: right;
  word-break: break-word;
}

/* Follow-up History Card */
.cd-history-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
}
.cd-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cd-history-title {
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
}
.cd-history-seeall {
  font-size: 13px;
  font-weight: 700;
  color: #16A34A;
  cursor: pointer;
  text-decoration: none;
}
.cd-history-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
}
.cd-history-item:last-child {
  border-bottom: none;
}
.cd-history-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.cd-history-info {
  flex: 1;
  min-width: 0;
}
.cd-history-meta {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
}
.cd-history-eo {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 4px;
}
.cd-history-notes {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.45;
}

/* More Actions Modern Action Sheet Cards */
.more-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px 0;
}
.more-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
.more-action-card:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.more-action-card:active {
  transform: scale(0.98);
}
.more-action-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.more-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.more-action-icon.receipt { background: #ECFDF5; color: #059669; }
.more-action-icon.edit { background: #EFF6FF; color: #2563EB; }
.more-action-icon.note { background: #FEF3C7; color: #D97706; }
.more-action-icon.visit { background: #F0FDF4; color: #16A34A; }
.more-action-icon.delete { background: #FEE2E2; color: #DC2626; }

.more-action-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 2px;
}
.more-action-sub {
  font-size: 11.5px;
  color: #64748B;
}
.more-action-arrow {
  color: #94A3B8;
  font-size: 16px;
  font-weight: 700;
}
.more-action-card.delete-card {
  border-color: #FECACA;
  background: #FFFBFB;
}
.more-action-card.delete-card:hover {
  background: #FEF2F2;
  border-color: #F87171;
}
.more-action-card.delete-card .more-action-title {
  color: #DC2626;
}

/* ============================================================
   TAQWA GROUP CRM — Mobile & Responsive Utilities
   ============================================================ */
@media (max-width: 900px) {
  .main-content {
    margin-left: 0 !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 75px) !important;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    /* FIX: this duplicate rule used to say z-index: 99, silently overriding
       the z-index: 199 set earlier in this file (later rule wins when both
       media conditions match). That let page content/images sit above the
       sidebar overlay on mobile. Keep it consistent with the earlier rule. */
    z-index: 199;
  }

  .sidebar-overlay.show {
    display: block;
  }
}





/* Keyboard, touch and reading support across CRM pages. */
:where(button,a,input,select,textarea,[tabindex]):focus-visible {
  outline: 3px solid #16896b;
  outline-offset: 3px;
}
@media (pointer:coarse) {
  .btn,.btn-icon-sm,.sidebar a { min-height:44px; }
  input,select,textarea { font-size:16px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; }
}
