/* ═══════════════════════════════════════════
   PITARA CRM — White Navbar / Black Body
═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Accent */
  --accent:      #2563eb;
  --accent-lt:   #eff6ff;
  --accent-dark: #1d4ed8;

  /* 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;

  /* Theme */
  --bg:        #0a0a0a;        /* body — near-black */
  --card:      #ffffff;        /* all cards — white */
  --border:    #e5e7eb;
  --text:      #1f2937;        /* text INSIDE cards */
  --text-bg:   #f1f5f9;        /* text ON the black body (titles, labels outside cards) */
  --muted:     #6b7280;
  --muted-bg:  #94a3b8;        /* muted text ON black body */
  --navy:      #ffffff;        /* navbar bg */

  /* Status */
  --green:  #16a34a;
  --red:    #dc2626;
  --amber:  #d97706;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow:    0 2px 8px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.10);
  --radius:    8px;
  --radius-lg: 12px;

  --fs-xs:   0.8rem;
  --fs-sm:   0.9rem;
  --fs-base: 1rem;
  --fs-md:   1.1rem;
  --fs-lg:   1.2rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  1.85rem;
}

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: var(--fs-base);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ════════════════════════
   NAVBAR
════════════════════════ */
.navbar {
  background: var(--navy);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.10);
  position: sticky;
  top: 0;
  z-index: 300;
}

.navbar-brand {
  color: var(--gray-800);
  font-size: var(--fs-lg);
  font-weight: 700;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.3px;
}
.navbar-brand .brand-icon {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.navbar-brand span { color: var(--accent); font-weight: 400; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 5px;
}
.nav-toggle:hover { background: var(--gray-100); color: var(--gray-800); }

.navbar-nav {
  display: flex;
  gap: 0.05rem;
  list-style: none;
  align-items: center;
}
.navbar-nav a {
  color: var(--gray-600);
  text-decoration: none !important;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.navbar-nav a i { font-size: 0.72rem; width: 13px; text-align: center; }
.navbar-nav a:hover { background: var(--gray-100); color: var(--gray-900); }
.navbar-nav a.active { background: var(--accent-lt); color: var(--accent); font-weight: 600; }
.nav-divider { width: 1px; height: 16px; background: var(--gray-200); margin: 0 0.25rem; }

/* ════════════════════════
   LAYOUT
════════════════════════ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  flex: 1;
  width: 100%;
}

/* ════════════════════════
   PAGE HEADER
════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.page-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-bg);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.page-title i { color: var(--muted-bg); font-size: 1rem; }
.page-title small {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--muted-bg);
  margin-left: 0.35rem;
}
.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ════════════════════════
   BUTTONS
════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.42rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  line-height: 1.4;
  white-space: nowrap;
  font-family: inherit;
}
.btn i { font-size: 0.72rem; }
.btn:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.btn:active { box-shadow: none; }

/* Primary — accent blue */
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Secondary — dark gray */
.btn-secondary { background: var(--gray-700); color: #fff; border-color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-800); border-color: var(--gray-800); }

/* Danger — only for delete */
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #b91c1c; }

/* Outline — works on both black body and white card */
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.35);
  color: var(--text-bg);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }

/* Ghost */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted-bg);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-bg); }

.btn-sm { padding: 0.26rem 0.65rem; font-size: var(--fs-xs); border-radius: 6px; }
.btn-icon-only { padding: 0.3rem 0.5rem; }

/* ════════════════════════
   CARDS
════════════════════════ */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.card-title i { color: var(--gray-400); font-size: 0.8rem; }

/* ════════════════════════
   STAT CARDS
════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
/* Single accent left border only */
.stat-card::before {
  display: none; /* removed colored top bars */
}
.stat-icon-wrap {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: var(--gray-100);
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
/* Only the primary stat gets accent icon */
.stat-card.accent .stat-icon-wrap { background: var(--accent-lt); color: var(--accent); }

.stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); line-height: 1.1; }
.stat-sub   { font-size: var(--fs-xs); color: var(--muted); }
.stat-link  { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.stat-link:hover { text-decoration: underline; }

/* ════════════════════════
   SECTION HEADER
════════════════════════ */
.section-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 1.5rem 0 0.75rem;
}
.section-header h2 {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted-bg);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 0.35rem;
}
.section-header h2 i { font-size: 0.7rem; color: var(--muted-bg); }
.section-line { flex: 1; height: 1px; background: rgba(255,255,255,0.10); }
.section-count {
  font-size: var(--fs-xs); font-weight: 600;
  padding: 0.12rem 0.5rem; border-radius: 99px;
  background: rgba(255,255,255,0.08); color: var(--muted-bg);
}

/* ════════════════════════
   AVATAR
════════════════════════ */
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700;
  flex-shrink: 0; text-transform: uppercase;
}
.avatar-lg { width: 42px; height: 42px; font-size: var(--fs-sm); }

/* All avatar types — same neutral style */
.avatar-architect, .avatar-dealer, .avatar-contractor, .avatar-customer {
  background: var(--gray-200); color: var(--gray-600);
}

.name-cell { display: flex; align-items: center; gap: 0.5rem; }
.name-cell a { font-weight: 600; color: var(--gray-800); text-decoration: none; font-size: var(--fs-base); }
.name-cell a:hover { color: var(--accent); text-decoration: underline; }
.name-cell-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 0.1rem; }

/* ════════════════════════
   BADGES — minimal, text only
════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.16rem 0.55rem;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.badge i { font-size: 0.6rem; }

/* All stage badges — gray base, only converted/lost get slight color */
.badge-lead        { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge-interested  { background: #eff6ff;          color: #1d4ed8;         border: 1px solid #bfdbfe; }
.badge-site-visit  { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-negotiation { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-converted   { background: #f0fdf4;          color: #15803d;         border: 1px solid #bbf7d0; }
.badge-lost        { background: #fef2f2;          color: #b91c1c;         border: 1px solid #fecaca; }

/* Pro type badges — all same neutral */
.badge-architect   { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-dealer      { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-contractor  { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }

/* Tag / req badges */
.badge-req   { background: var(--gray-50); color: var(--gray-600); border: 1px solid var(--gray-200); font-size: 0.65rem; }
.badge-count { background: var(--gray-200); color: var(--gray-600); }

/* ════════════════════════
   TABLES
════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--gray-100); }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 0.6rem 1rem; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }
.td-actions { text-align: right; white-space: nowrap; }

/* Mobile card rows */
.card-rows { display: none; }
.card-row {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  background: var(--card);
}
.card-row-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.45rem; }
.card-row-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem;
  font-size: var(--fs-xs); color: var(--muted);
  margin-bottom: 0.5rem;
}
.card-row-meta span { display: flex; align-items: center; gap: 0.25rem; }
.card-row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.mobile-num { font-size: var(--fs-sm); color: var(--text); }
.mobile-num a { color: inherit; text-decoration: none; }
.mobile-num a:hover { color: var(--accent); }

/* ════════════════════════
   PIPELINE BARS
════════════════════════ */
.pipeline-row { display:flex; align-items:center; gap:0.6rem; margin-bottom:0.45rem; }
.pipeline-label { width:85px; font-size:var(--fs-xs); font-weight:600; color:var(--muted); text-align:right; flex-shrink:0; }
.pipeline-track { flex:1; background:var(--gray-100); border-radius:99px; height:18px; overflow:hidden; }
.pipeline-fill  { height:100%; border-radius:99px; display:flex; align-items:center; padding-left:6px; min-width:20px; transition:width 0.5s ease; }
.pipeline-fill span { font-size:0.6rem; font-weight:800; color:#fff; }
.pipeline-pct   { width:30px; font-size:var(--fs-xs); font-weight:600; color:var(--text); text-align:right; flex-shrink:0; }

/* ════════════════════════
   FILTER BAR
════════════════════════ */
.filter-bar {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.filter-bar .form-group { display:flex; flex-direction:column; gap:0.2rem; min-width:130px; flex:1; }
.filter-bar label { font-size:var(--fs-xs); font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:0.4px; }
.filter-bar input, .filter-bar select {
  border: 1px solid var(--gray-300); border-radius:var(--radius);
  padding: 0.4rem 0.7rem; font-size:var(--fs-sm); outline:none;
  transition: border-color 0.12s, box-shadow 0.12s;
  background: #fff; color:var(--text); width:100%; font-family:inherit;
}
.filter-bar input:focus, .filter-bar select:focus { border-color:var(--accent); box-shadow:0 0 0 2px rgba(37,99,235,0.1); }
.filter-actions { display:flex; gap:0.45rem; align-items:flex-end; flex-shrink:0; }

/* ════════════════════════
   FORMS
════════════════════════ */
.form-card { max-width: 700px; }
.form-grid { display:grid; gap:0.9rem; }
.form-grid-2 { grid-template-columns:1fr 1fr; }
.form-grid-3 { grid-template-columns:1fr 1fr 1fr; }
.form-group { display:flex; flex-direction:column; gap:0.28rem; }
.form-group label { font-size:var(--fs-sm); font-weight:600; color:var(--gray-700); }
.req-star { color:var(--red); margin-left:1px; }
.form-section-label {
  font-size: var(--fs-xs); font-weight:700; color:var(--gray-500);
  text-transform:uppercase; letter-spacing:0.5px;
  padding: 0.6rem 0 0.1rem;
  border-top: 1px solid var(--gray-100);
  margin-top: 0.4rem;
}
.form-control {
  border: 1px solid var(--gray-300); border-radius:var(--radius);
  padding: 0.48rem 0.8rem; font-size:var(--fs-base); font-family:inherit;
  outline:none; background:#fff; color:var(--text); width:100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.form-control:focus { border-color:var(--accent); box-shadow:0 0 0 2px rgba(37,99,235,0.1); }
textarea.form-control { resize:vertical; min-height:88px; }
.form-actions { display:flex; gap:0.55rem; margin-top:0.5rem; align-items:center; flex-wrap:wrap; }

/* ════════════════════════
   SUBGROUP COMBOBOX
════════════════════════ */
.subgroup-widget {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.subgroup-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.subgroup-tab {
  flex: 1;
  padding: 0.38rem 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: center;
  font-family: inherit;
}
.subgroup-tab.active {
  background: #fff;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}
.subgroup-panel { padding: 0.6rem 0.75rem; }
.subgroup-panel.hidden { display: none; }
.subgroup-select-wrap { position: relative; }
.subgroup-select-wrap select { padding-right: 2rem; }
.subgroup-new-wrap { display: flex; gap: 0.4rem; align-items: center; }
.subgroup-new-wrap input { flex: 1; }

/* ════════════════════════
   CHECKBOX PILLS
════════════════════════ */
.checkbox-list { display:flex; flex-wrap:wrap; gap:0.35rem; padding:0.25rem 0; }
.checkbox-pill {
  display: flex; align-items:center; gap:0.3rem;
  font-size: var(--fs-xs); font-weight:600; color:var(--gray-600);
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 4px; padding: 0.25rem 0.65rem;
  cursor: pointer; transition: border-color 0.12s, background 0.12s; user-select:none;
}
.checkbox-pill:hover { border-color: var(--gray-400); background: var(--gray-100); }
.checkbox-pill input[type="checkbox"] { display:none; }
.checkbox-pill.checked { border-color: var(--accent); background: var(--accent-lt); color: var(--accent); }

/* ════════════════════════
   DETAIL PAGE
════════════════════════ */
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.detail-row  { margin-bottom:0.8rem; }
.detail-label {
  font-size: var(--fs-xs); font-weight:600; color:var(--muted);
  text-transform:uppercase; letter-spacing:0.5px; margin-bottom:0.15rem;
}
.detail-value { font-size: var(--fs-md); color:var(--text); }
.tag-list  { display:flex; flex-wrap:wrap; gap:0.3rem; }
.notes-box {
  background: var(--gray-50); border-radius:var(--radius);
  border: 1px solid var(--gray-200); padding: 0.7rem 0.9rem;
  font-size:var(--fs-sm); color:var(--gray-700); white-space:pre-wrap; line-height:1.6;
}

/* ════════════════════════
   QUICK ACTIONS
════════════════════════ */
.quick-actions { display:flex; flex-direction:column; gap:0.4rem; }
.quick-action-btn {
  display:flex; align-items:center; gap:0.55rem;
  padding: 0.55rem 0.85rem;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius); text-decoration:none !important;
  color: var(--gray-700); font-size:var(--fs-sm); font-weight:600;
  transition: all 0.12s;
}
.quick-action-btn i { width:14px; text-align:center; color:var(--gray-400); font-size:0.75rem; }
.quick-action-btn:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-lt); }
.quick-action-btn:hover i { color:var(--accent); }

/* ════════════════════════
   DASH / GROUP / REQ GRIDS
════════════════════════ */
.dash-grid          { display:grid; grid-template-columns:2fr 1fr; gap:1rem; align-items:start; }
.group-detail-grid  { display:grid; grid-template-columns:1fr 290px; gap:1rem; align-items:start; }
.req-grid           { display:grid; grid-template-columns:1fr 1fr; gap:1rem; align-items:start; max-width:820px; }

/* ════════════════════════
   FOOTER
════════════════════════ */
footer { background:#0f172a; color:#3d5a7a; text-align:center; padding:0.75rem; font-size:var(--fs-xs); margin-top:auto; }

/* ════════════════════════
   ERROR PAGE
════════════════════════ */
.error-wrap { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:55vh; gap:0.75rem; text-align:center; }
.error-code { font-size:4.5rem; font-weight:900; color:rgba(255,255,255,0.12); line-height:1; }
.error-msg  { font-size:var(--fs-lg); color:var(--muted-bg); }

/* ════════════════════════
   UTILITIES
════════════════════════ */
.text-muted { color:var(--muted); }
.text-sm    { font-size:var(--fs-sm); }
.text-xs    { font-size:var(--fs-xs); }
.mt-1  { margin-top:0.5rem; }
.mt-2  { margin-top:1rem; }
.mb-1  { margin-bottom:0.5rem; }
.mb-0  { margin-bottom:0; }
.d-flex       { display:flex; }
.gap-1        { gap:0.3rem; }
.gap-2        { gap:0.5rem; }
.gap-3        { gap:0.75rem; }
.align-center { align-items:center; }
.flex-wrap    { flex-wrap:wrap; }
.justify-end  { justify-content:flex-end; }
.w-100        { width:100%; }

/* ════════════════════════
   TABLET  ≤900px
════════════════════════ */
@media (max-width: 900px) {
  .stats-grid         { grid-template-columns: repeat(3, 1fr); }
  .dash-grid          { grid-template-columns: 1fr; }
  .group-detail-grid  { grid-template-columns: 1fr; }
  .req-grid           { grid-template-columns: 1fr; max-width:100%; }
  .detail-grid        { grid-template-columns: 1fr; }
  .form-grid-3        { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════
   MOBILE  ≤600px
════════════════════════ */
@media (max-width: 600px) {
  html { font-size: 15px; }

  .nav-toggle { display:flex; }
  .navbar-nav {
    display: none;
    position: fixed; top: 52px; left:0; right:0;
    background: #fff;
    flex-direction: column; padding: 0.6rem 0.5rem; gap:0.1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); z-index:299;
    border-top: 1px solid var(--gray-200);
  }
  .navbar-nav.open { display:flex; }
  .navbar-nav a { padding:0.55rem 1rem; font-size:var(--fs-sm); border-radius:6px; }
  .nav-divider { display:none; }

  .container { padding:1rem 0.85rem; }

  .stats-grid  { grid-template-columns:1fr 1fr; gap:0.6rem; }
  .stat-value  { font-size:1.5rem; }

  .table-wrap  { display:none; }
  .card-rows   { display:block; }

  .form-grid-2 { grid-template-columns:1fr; }
  .form-grid-3 { grid-template-columns:1fr; }
  .form-card   { max-width:100%; }

  .filter-bar .form-group { min-width:100%; }
  .filter-actions { width:100%; }
  .filter-actions .btn { flex:1; justify-content:center; }

  .card { padding:0.9rem; }
  .page-title { font-size:var(--fs-xl); }
  .section-header { margin: 1rem 0 0.55rem; }
}

/* ════════════════════════
   SMALL  ≤380px
════════════════════════ */
@media (max-width: 380px) {
  html { font-size:14px; }
  .stats-grid { grid-template-columns:1fr 1fr; }
}

/* ════════════════════════
   PROFESSIONAL WIDGET
   (select-or-create accordion)
════════════════════════ */
.prof-widget { transition: box-shadow 0.12s; }
.prof-widget:focus-within { box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

.prof-widget-header:hover { background: var(--gray-100) !important; }
.prof-widget-header:hover i.prof-chevron { color: var(--accent) !important; }

.prof-widget-body { border-top: 1px solid var(--gray-200); }

/* size="N" select styling */
select[size] {
  border-radius: var(--radius);
  padding: 0.3rem 0;
}
select[size] option {
  padding: 0.35rem 0.7rem;
  font-size: var(--fs-sm);
  cursor: pointer;
}
select[size] option:checked {
  background: var(--accent-lt);
  color: var(--accent);
  font-weight: 600;
}

/* ════════════════════════
   DYNAMIC BADGES
   (stage, subgroup, prof type)
════════════════════════ */

/* Stage badge — neutral with accent left bar */
.badge-stage {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-left: 3px solid var(--accent);
}

/* Sub group badge */
.badge-subgroup {
  background: var(--gray-50);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

/* Professional type badges — all same neutral, icon differentiates */
.badge-architect  { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-carpenter  { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-contractor { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.badge-proftype   { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }

/* Avatar for carpenter (was avatar-dealer) */
.avatar-carpenter { background: var(--gray-200); color: var(--gray-600); }

/* ════════════════════════════════════════
   ADD FORM — Sectioned Layout
════════════════════════════════════════ */

.add-form-layout {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Each numbered section */
.add-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.add-section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.add-section-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.add-section-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.2;
}

.add-section-sub {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 0.1rem;
}

.add-section-optional {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.add-section-body {
  padding: 1.25rem;
}

/* Submit row — sits on black body */
.add-form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0 1rem;
}

.btn-lg {
  padding: 0.6rem 1.4rem;
  font-size: var(--fs-base);
}

/* ── Input with icon ── */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--gray-400);
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 1;
}
.form-control.has-icon { padding-left: 2.1rem; }

/* ── Combo widget (tabs + panels) ── */
.combo-widget {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.combo-tabs {
  display: flex;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.combo-tab {
  flex: 1;
  padding: 0.4rem 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.combo-tab i { font-size: 0.65rem; }
.combo-tab:hover { color: var(--gray-700); background: var(--gray-100); }
.combo-tab.active { color: var(--accent); background: #fff; border-bottom-color: var(--accent); }

.combo-panel { padding: 0.75rem; }
.combo-panel.hidden { display: none; }

.combo-hint {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Professional Accordion ── */
.prof-accordion {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.pac-item { border-bottom: 1px solid var(--gray-200); }
.pac-item:last-child { border-bottom: none; }

.pac-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: var(--gray-50);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.pac-toggle:hover { background: var(--gray-100); }
.pac-open > .pac-toggle { background: var(--accent-lt); }

.pac-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pac-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--gray-200);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.pac-open > .pac-toggle .pac-icon { background: var(--accent-lt); color: var(--accent); }

.pac-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gray-700);
}
.pac-open > .pac-toggle .pac-label { color: var(--accent); }

.pac-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-xs);
  color: var(--green);
  font-weight: 600;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
}

.pac-chevron {
  font-size: 0.65rem;
  color: var(--gray-400);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.pac-body {
  background: #fff;
  border-top: 1px solid var(--gray-200);
  padding: 0.85rem 1rem;
}
.pac-body.hidden { display: none; }

.pac-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Size-based select in prof widget */
.prof-list-select {
  border-radius: var(--radius);
  padding: 0.25rem 0;
  height: auto;
  font-size: var(--fs-sm);
}
.prof-list-select option { padding: 0.4rem 0.75rem; }
.prof-list-select option:checked {
  background: var(--accent-lt);
  color: var(--accent);
  font-weight: 600;
}

/* ── Stage radio pills ── */
.stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 0 0.25rem;
}

.stage-pill {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.stage-pill input[type="radio"] { display: none; }
.stage-pill span {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 99px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-50);
  transition: all 0.12s;
}
.stage-pill:hover span { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }
.stage-pill.active span { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
  .add-section-body { padding: 1rem; }
  .add-section-head { padding: 0.75rem 1rem; }
  .pac-body { padding: 0.75rem; }
  .add-form-actions .btn-lg { flex: 1; justify-content: center; }
}

/* ════════════════════════
   FILTER CHIPS
════════════════════════ */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
}

.filter-chips-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted-bg);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  background: rgba(255,255,255,0.10);
  border: 1.5px solid rgba(255,255,255,0.20);
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-bg);
  white-space: nowrap;
}
.filter-chip i:first-child { color: #93c5fd; font-size: 0.65rem; }

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  text-decoration: none !important;
  margin-left: 0.1rem;
  font-size: 0.55rem;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.chip-remove:hover { background: var(--red); color: #fff; }

.filter-chip-clear {
  background: none;
  border-color: transparent;
  color: var(--red);
  text-decoration: none !important;
  font-weight: 700;
}
.filter-chip-clear:hover { background: #fef2f2; border-color: #fecaca; }
.filter-chip-clear i { color: var(--red) !important; }

/* nav user badge */
.nav-user { display: flex; align-items: center; }
.nav-user-mobile {
  color: var(--gray-500);
  font-size: var(--fs-xs);
  padding: 0.2rem 0.6rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-logout {
  color: var(--red) !important;
}
.nav-logout:hover { background: #fef2f2 !important; color: #b91c1c !important; }

/* ════════════════════════
   PAGINATION
════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.85rem 0 0.25rem;
}

.pagination-info {
  font-size: var(--fs-sm);
  color: var(--muted-bg);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-bg);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  text-decoration: none !important;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  cursor: pointer;
}
.pg-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}
.pg-btn.pg-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: default;
}
.pg-btn.pg-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.pg-gap {
  font-size: var(--fs-sm);
  color: var(--muted-bg);
  padding: 0 0.15rem;
  user-select: none;
}

@media (max-width: 600px) {
  .pagination { justify-content: center; }
  .pagination-info { width: 100%; text-align: center; }
  .pg-btn { min-width: 32px; height: 32px; font-size: var(--fs-xs); }
}

/* ════════════════════════
   FLASH MESSAGES
════════════════════════ */
.flash {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 1rem;
  animation: slideDown 0.2s ease;
  position: relative;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.flash-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.flash-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.flash-info {
  background: var(--accent-lt);
  border: 1px solid #bfdbfe;
  color: var(--accent-dark);
}
.flash i:first-child { font-size: 0.85rem; flex-shrink: 0; }
.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0.1rem 0.25rem;
  font-size: 0.8rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* ════════════════════════
   WHATSAPP BUTTON
════════════════════════ */
.btn-wa {
  background: #25d366;
  color: #fff;
  border-color: #25d366;
}
.btn-wa:hover { background: #1da851; border-color: #1da851; }

/* ════════════════════════
   PROFESSIONAL LINK CARDS
   (on customer show page)
════════════════════════ */
.prof-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.prof-link-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--gray-50);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.prof-link-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}

.prof-link-type {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.prof-link-type i { font-size: 0.75rem; }

.prof-link-name {
  font-weight: 700;
  font-size: var(--fs-base);
  margin-bottom: 0.3rem;
}
.prof-link-name a {
  color: var(--gray-800);
  text-decoration: none;
}
.prof-link-name a:hover { color: var(--accent); text-decoration: underline; }

.prof-link-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.prof-link-mobile {
  font-size: var(--fs-sm);
  color: var(--gray-700);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.prof-link-mobile i { font-size: 0.7rem; color: var(--muted); }
.prof-link-mobile:hover { color: var(--accent); }
.prof-link-wa {
  color: #25d366;
  font-size: var(--fs-base);
  text-decoration: none;
  margin-left: auto;
}
.prof-link-wa:hover { color: #1da851; }

@media (max-width: 600px) {
  .prof-links-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .prof-links-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════
   BRAND LOGO (navbar)
════════════════════════ */
.brand-logo {
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

/* ════════════════════════
   PAGE WATERMARK
   centered, large, faint
════════════════════════ */
.page-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 480px;
  background-image: url('/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  filter: grayscale(100%) invert(1);
}

/* keep content above watermark */
.container > *:not(.page-watermark) {
  position: relative;
  z-index: 1;
}

@media (max-width: 600px) {
  .brand-logo {  height: 38px; }
  .page-watermark { width: 100%; height: 280px; opacity: 0.04; }
}

/* ════════════════════════
   CAMPAIGN PAGE
════════════════════════ */
.wa-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  gap: 0.75rem;
}
.wa-qr-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--gray-800);
}
.wa-qr-img {
  width: 220px;
  height: 220px;
  border: 3px solid var(--gray-200);
  border-radius: var(--radius);
}
.wa-connected {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.wa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
}
.wa-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
  display: inline-block;
  flex-shrink: 0;
}
.wa-status-ready  { background:#f0fdf4; border-color:#bbf7d0; color:#15803d; }
.wa-status-qr     { background:#fff7ed; border-color:#fed7aa; color:#c2410c; }
.wa-status-offline{ background:var(--gray-100); color:var(--muted); }

/* Campaign status badges */
.camp-status-draft   { background:var(--gray-100); color:var(--gray-600); border:1px solid var(--gray-200); }
.camp-status-running { background:#dbeafe; color:#1d4ed8; border:1px solid #bfdbfe; }
.camp-status-paused  { background:#fef3c7; color:#92400e; border:1px solid #fde68a; }
.camp-status-done    { background:#dcfce7; color:#15803d; border:1px solid #bbf7d0; }

/* Progress bar */
.campaign-progress-track {
  width: 100%;
  height: 6px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
}
.campaign-progress-fill {
  height: 100%;
  background: #25d366;
  border-radius: 99px;
  transition: width 0.5s ease;
  min-width: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.fa-spin { animation: spin 1s linear infinite; }

/* ════════════════════════
   CAMPAIGN PAGE
════════════════════════ */

/* WA status badge in header */
.wa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.7rem;
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 700;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  color: var(--gray-600);
}
.wa-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
}
.wa-status-ready  { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.wa-status-qr     { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.wa-status-offline{ background: var(--gray-100); color: var(--muted); border-color: var(--gray-200); }

/* QR panel */
.wa-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}
.wa-qr-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.wa-qr-title i { color: #25d366; font-size: 1.1rem; }
.wa-qr-img {
  width: 220px;
  height: 220px;
  border-radius: var(--radius);
  border: 3px solid var(--gray-200);
  display: block;
}

/* Connected state */
.wa-connected {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

/* Campaign status badges */
.camp-status-draft   { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.camp-status-running { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.camp-status-paused  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.camp-status-done    { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }

/* Campaign progress bar */
.campaign-progress-track {
  height: 6px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
  min-width: 80px;
}
.campaign-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 4px;
}

/* Spin utility */
@keyframes spin { to { transform: rotate(360deg); } }
.fa-spin { animation: spin 1s linear infinite; }

/* ════════════════════════
   MEDIA DROP ZONE
════════════════════════ */
.media-drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--gray-50);
  user-select: none;
}
.media-drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-lt);
}

/* ════════════════════════
   FOLLOW-UP FILTER WIDGET
════════════════════════ */
.follow-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 100%;           /* full row */
  min-width: 100%;
}

.follow-filter-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted-bg);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.follow-filter-label i { font-size: 0.7rem; color: #93c5fd; }

/* Quick-pick row */
.follow-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.fq-btn {
  padding: 0.28rem 0.85rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  border: 1.5px solid transparent;
  border-radius: 99px;
  background: rgba(255,255,255,0.07);
  color: var(--text-bg);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}

/* Individual colors per button — using nth-child on the container */
.follow-quick-btns .fq-btn:nth-child(1)        { background:#1e293b; border-color:#334155; color:#94a3b8; }  /* All — slate */
.follow-quick-btns .fq-btn:nth-child(2)        { background:#14532d; border-color:#16a34a; color:#4ade80; }  /* Today — green */
.follow-quick-btns .fq-btn:nth-child(3)        { background:#1e3a5f; border-color:#2563eb; color:#93c5fd; }  /* Tomorrow — blue */
.follow-quick-btns .fq-btn:nth-child(4)        { background:#4c1d95; border-color:#7c3aed; color:#c4b5fd; }  /* This Week — violet */
.follow-quick-btns .fq-btn:nth-child(5)        { background:#7c2d12; border-color:#ea580c; color:#fdba74; }  /* This Month — orange */
.follow-quick-btns .fq-btn:nth-child(6)        { background:#164e63; border-color:#0891b2; color:#67e8f9; }  /* Single Date — cyan */
.follow-quick-btns .fq-btn:nth-child(7)        { background:#3b0764; border-color:#a855f7; color:#e879f9; }  /* Between — fuchsia */

/* Hover — lighten each */
.follow-quick-btns .fq-btn:nth-child(1):hover  { background:#334155; border-color:#64748b; color:#e2e8f0; }
.follow-quick-btns .fq-btn:nth-child(2):hover  { background:#166534; border-color:#22c55e; color:#86efac; }
.follow-quick-btns .fq-btn:nth-child(3):hover  { background:#1e40af; border-color:#3b82f6; color:#bfdbfe; }
.follow-quick-btns .fq-btn:nth-child(4):hover  { background:#5b21b6; border-color:#8b5cf6; color:#ddd6fe; }
.follow-quick-btns .fq-btn:nth-child(5):hover  { background:#9a3412; border-color:#f97316; color:#fed7aa; }
.follow-quick-btns .fq-btn:nth-child(6):hover  { background:#155e75; border-color:#22d3ee; color:#a5f3fc; }
.follow-quick-btns .fq-btn:nth-child(7):hover  { background:#581c87; border-color:#c026d3; color:#f0abfc; }

/* Active — full solid fill */
.follow-quick-btns .fq-btn:nth-child(1).active { background:#475569; border-color:#475569; color:#fff; }
.follow-quick-btns .fq-btn:nth-child(2).active { background:#16a34a; border-color:#16a34a; color:#fff; }
.follow-quick-btns .fq-btn:nth-child(3).active { background:#2563eb; border-color:#2563eb; color:#fff; }
.follow-quick-btns .fq-btn:nth-child(4).active { background:#7c3aed; border-color:#7c3aed; color:#fff; }
.follow-quick-btns .fq-btn:nth-child(5).active { background:#ea580c; border-color:#ea580c; color:#fff; }
.follow-quick-btns .fq-btn:nth-child(6).active { background:#0891b2; border-color:#0891b2; color:#fff; }
.follow-quick-btns .fq-btn:nth-child(7).active { background:#a855f7; border-color:#a855f7; color:#fff; }

/* Date picker row */
.follow-date-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.follow-date-inputs .form-control {
  max-width: 170px;
}
.follow-between-sep {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted-bg);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .follow-date-inputs .form-control { max-width: 100%; }
  .fq-btn { font-size: 0.7rem; padding: 0.22rem 0.6rem; }
}

/* ════════════════════════
   FOLLOW DATE CELL STATES
════════════════════════ */
.badge-stage.follow-today {
  border-color: var(--amber);
  background: #fffbeb;
  color: #92400e;
}
.badge-stage.follow-tomorrow {
  border-color: var(--accent);
  background: var(--accent-lt);
  color: var(--accent-dark);
}
.badge-stage.follow-overdue {
  border-color: var(--red);
  background: #fef2f2;
  color: var(--red);
}

/* ════════════════════════
   NEW ENTRY ROW
   (subgroup / inline create)
════════════════════════ */
.new-entry-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.new-entry-row .input-icon-wrap { flex: 1; }

.new-entry-confirm {
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.new-entry-confirm.confirmed {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  cursor: default;
  font-size: var(--fs-xs);
}

/* ════════════════════════
   AJAX SAVE ROW & FEEDBACK
════════════════════════ */
.ajax-save-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.ajax-save-row .input-icon-wrap { flex: 1; }
.ajax-save-btn { flex-shrink: 0; white-space: nowrap; }

.ajax-feedback {
  min-height: 1.4rem;
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
}
.ajax-feedback-success {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--green);
  font-weight: 600;
}
.ajax-feedback-error {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--red);
  font-weight: 600;
}

/* Success-muted button state after save */
.btn-success-muted {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: var(--green);
}

/* ════════════════════════
   CONTEXT OVERRIDES
   btn-outline / btn-ghost inside white cards
════════════════════════ */
.card .btn-outline,
.filter-bar .btn-outline,
.add-section .btn-outline {
  border-color: var(--gray-300);
  color: var(--gray-700);
  background: transparent;
}
.card .btn-outline:hover,
.filter-bar .btn-outline:hover,
.add-section .btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}

.card .btn-ghost,
.add-section .btn-ghost {
  color: var(--muted);
}
.card .btn-ghost:hover,
.add-section .btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text);
}

/* ════════════════════════
   CAMPAIGN MEDIA UPLOAD
════════════════════════ */
.media-drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--gray-50);
  user-select: none;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-drop-zone:hover,
.media-drop-zone.dz-hover {
  border-color: var(--accent);
  background: var(--accent-lt);
}

.dz-icon {
  font-size: 2rem;
  color: var(--gray-400);
  display: block;
  margin-bottom: 0.5rem;
}
.dz-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}
.dz-hint {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Preview inside drop zone */
.dz-preview-img,
.dz-preview-vid {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto 0.5rem;
  object-fit: contain;
}
.dz-preview-name {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 0.3rem;
}
.dz-clear-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.12s;
}
.dz-clear-btn:hover { background: #b91c1c; }

/* ── Campaign table thumbnails ── */
.camp-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  border: 1px solid var(--gray-200);
}
.camp-thumb-video {
  position: relative;
  width: 56px;
  height: 42px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: center;
}
.camp-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 0.7rem;
  border-radius: 5px;
}

/* Mobile small thumb */
.camp-thumb-sm {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.camp-thumb-video-sm {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--gray-200);
}

/* ════════════════════════
   AUTO-CAPITALIZE INPUTS
   Visual hint while typing — actual enforcement is in models
════════════════════════ */
input[type="text"],
input[type="tel"],
input[type="search"],
textarea {
  text-transform: capitalize;
}
/* Keep mobile numbers, emails, passwords as-is */
input[type="tel"]      { text-transform: none; }
input[type="email"]    { text-transform: none; }
input[type="password"] { text-transform: none; }
input[type="date"]     { text-transform: none; }
input[type="number"]   { text-transform: none; }
/* Search inputs — leave as-is */
input[name="search"]   { text-transform: none; }
