/* ═══════════════════════════════════════════
   PITARA CRM — Full Responsive Stylesheet
   Font Awesome 6 icons, mobile-first
═══════════════════════════════════════════ */

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

:root {
  --navy:      #0f1e35;
  --navy-mid:  #1a2e4a;
  --navy-soft: #243754;
  --blue:      #1a6fc4;
  --blue-lt:   #eff6ff;
  --green:     #16a34a;
  --red:       #dc2626;
  --amber:     #d97706;
  --purple:    #7c3aed;
  --teal:      #0f766e;
  --indigo:    #3730a3;
  --slate:     #64748b;
  --border:    #e2e8f0;
  --bg:        #f0f4f8;
  --card:      #ffffff;
  --text:      #1e293b;
  --muted:     #64748b;
  --radius:    10px;
  --shadow:    0 1px 8px rgba(0,0,0,0.09);

  /* font scale — base 14px on mobile */
  --fs-xs:   0.7rem;
  --fs-sm:   0.78rem;
  --fs-base: 0.875rem;
  --fs-md:   0.95rem;
  --fs-lg:   1.1rem;
  --fs-xl:   1.35rem;
  --fs-2xl:  1.65rem;
}

html { font-size: 14px; }

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(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.navbar-brand {
  color: #fff;
  font-size: var(--fs-lg);
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.navbar-brand .brand-icon {
  background: var(--blue);
  color: #fff;
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.navbar-brand span { color: #60aff5; }

/* Hamburger toggle — mobile only */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #c8d8e8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.nav-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }

.navbar-nav {
  display: flex;
  gap: 0.1rem;
  list-style: none;
  align-items: center;
}
.navbar-nav a {
  color: #a0b8d0;
  text-decoration: none;
  padding: 0.38rem 0.8rem;
  border-radius: 7px;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.navbar-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.navbar-nav a.active { background: rgba(255,255,255,0.14); color: #fff; font-weight: 700; }
.navbar-nav a i { font-size: 0.8rem; width: 14px; text-align: center; }
.nav-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.12); margin: 0 0.3rem; }

/* ════════════════════════════════════════
   LAYOUT
════════════════════════════════════════ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  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: 800;
  color: var(--navy-mid);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-title small {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.4rem;
}
.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); box-shadow: none; filter: brightness(0.95); }
.btn i { font-size: 0.75rem; }
.btn-primary   { background: var(--blue);   color: #fff; }
.btn-success   { background: var(--green);  color: #fff; }
.btn-danger    { background: var(--red);    color: #fff; }
.btn-secondary { background: var(--slate);  color: #fff; }
.btn-amber     { background: var(--amber);  color: #fff; }
.btn-teal      { background: var(--teal);   color: #fff; }
.btn-sm        { padding: 0.28rem 0.7rem; font-size: var(--fs-xs); border-radius: 6px; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--blue);
  color: var(--blue);
}
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-icon-only { padding: 0.32rem 0.55rem; }

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0,0,0,0.04);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--navy-mid);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.card-title i { color: var(--blue); font-size: 0.85rem; }

/* ════════════════════════════════════════
   STAT CARDS
════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
}
.stat-card.blue::before   { background: var(--blue); }
.stat-card.green::before  { background: var(--green); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.amber::before  { background: var(--amber); }
.stat-card.teal::before   { background: var(--teal); }
.stat-card.red::before    { background: var(--red); }
.stat-card.indigo::before { background: var(--indigo); }

.stat-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}
.stat-card.blue   .stat-icon-wrap { background: #dbeafe; color: var(--blue); }
.stat-card.green  .stat-icon-wrap { background: #dcfce7; color: var(--green); }
.stat-card.purple .stat-icon-wrap { background: #ede9fe; color: var(--purple); }
.stat-card.amber  .stat-icon-wrap { background: #fef3c7; color: var(--amber); }
.stat-card.teal   .stat-icon-wrap { background: #ccfbf1; color: var(--teal); }
.stat-card.red    .stat-icon-wrap { background: #fee2e2; color: var(--red); }
.stat-card.indigo .stat-icon-wrap { background: #e0e7ff; color: var(--indigo); }

.stat-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.9rem; font-weight: 900; color: var(--navy-mid); line-height: 1.1; }
.stat-sub   { font-size: var(--fs-xs); color: var(--muted); }
.stat-link  { font-size: var(--fs-xs); font-weight: 700; color: var(--blue); text-decoration: none; }
.stat-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   SECTION HEADER (group-by divider)
════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1.5rem 0 0.75rem;
}
.section-header h2 {
  font-size: var(--fs-base);
  font-weight: 800;
  color: var(--navy-mid);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.section-header h2 i { font-size: 0.82rem; }
.section-line { flex: 1; height: 1.5px; background: var(--border); border-radius: 2px; }
.section-count {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: #f1f5f9;
  color: var(--muted);
}

/* ════════════════════════════════════════
   AVATAR INITIALS
════════════════════════════════════════ */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-lg { width: 44px; height: 44px; font-size: var(--fs-sm); }
.avatar-architect  { background: #ccfbf1; color: #0f766e; }
.avatar-dealer     { background: #e0e7ff; color: #3730a3; }
.avatar-contractor { background: #fef3c7; color: #92400e; }
.avatar-customer   { background: #dbeafe; color: #1d4ed8; }

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

/* ════════════════════════════════════════
   TABLES — with mobile card fallback
════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -0.1rem; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
thead th {
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.1s; }
tbody tr:hover { background: #f8fafd; }
tbody td { padding: 0.6rem 0.9rem; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }
.td-actions { text-align: right; white-space: nowrap; }

/* Mobile card rows — hidden on desktop, shown on mobile */
.card-rows { display: none; }
.card-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.6rem;
  background: var(--card);
}
.card-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.card-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  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-meta i { font-size: 0.65rem; }
.card-row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.mobile-num { font-size: var(--fs-sm); color: var(--text); letter-spacing: 0.3px; }
.mobile-num a { color: inherit; text-decoration: none; }
.mobile-num a:hover { color: var(--blue); }

/* ════════════════════════════════════════
   BADGES
════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge i { font-size: 0.6rem; }
/* Stage */
.badge-lead         { background: #f1f5f9; color: #475569; }
.badge-interested   { background: #dbeafe; color: #1d4ed8; }
.badge-site-visit   { background: #ffedd5; color: #c2410c; }
.badge-negotiation  { background: #ede9fe; color: #6d28d9; }
.badge-converted    { background: #dcfce7; color: #15803d; }
.badge-lost         { background: #fee2e2; color: #b91c1c; }
/* Pro type */
.badge-architect    { background: #ccfbf1; color: #0f766e; }
.badge-dealer       { background: #e0e7ff; color: #3730a3; }
.badge-contractor   { background: #fef3c7; color: #92400e; }
/* Misc */
.badge-req   { background: #f8fafc; color: #334155; border: 1px solid #cbd5e1; font-size: 0.67rem; }
.badge-count { background: #e2e8f0; color: #334155; }

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

/* ════════════════════════════════════════
   FILTER BAR
════════════════════════════════════════ */
.filter-bar {
  background: var(--card);
  border-radius: 10px;
  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 rgba(0,0,0,0.04);
}
.filter-bar .form-group { display: flex; flex-direction: column; gap: 0.2rem; min-width: 140px; flex: 1; }
.filter-bar label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.filter-bar input, .filter-bar select {
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 0.4rem 0.7rem;
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,111,196,0.1);
}
.filter-actions { display: flex; gap: 0.5rem; align-items: flex-end; flex-shrink: 0; }

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.form-card { max-width: 660px; }
.form-grid { display: grid; gap: 1rem; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: var(--fs-sm); font-weight: 700; color: #374151; }
.req-star { color: var(--red); margin-left: 2px; }
.form-control {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.52rem 0.8rem;
  font-size: var(--fs-base);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: var(--text);
  width: 100%;
}
.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,111,196,0.12);
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; align-items: center; flex-wrap: wrap; }

/* Checkbox pills */
.checkbox-list { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.3rem 0; }
.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 0.28rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.checkbox-pill:hover { border-color: var(--blue); background: var(--blue-lt); }
.checkbox-pill input[type="checkbox"] { display: none; }
.checkbox-pill.checked { border-color: var(--blue); background: var(--blue-lt); color: var(--blue); }

/* ════════════════════════════════════════
   DETAIL PAGE
════════════════════════════════════════ */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-row { margin-bottom: 0.85rem; }
.detail-label { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.2rem; }
.detail-value { font-size: var(--fs-md); color: var(--text); }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.notes-box {
  background: #f8fafc;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  padding: 0.75rem 0.9rem;
  font-size: var(--fs-sm);
  color: #374151;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ════════════════════════════════════════
   QUICK ACTIONS
════════════════════════════════════════ */
.quick-actions { display: flex; flex-direction: column; gap: 0.45rem; }
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  text-decoration: none !important;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: all 0.15s;
}
.quick-action-btn i { width: 16px; text-align: center; color: var(--blue); font-size: 0.8rem; }
.quick-action-btn:hover { border-color: var(--blue); background: var(--blue-lt); color: var(--blue); transform: translateX(3px); }

/* ════════════════════════════════════════
   INLINE FORM (Requirements page)
════════════════════════════════════════ */
.inline-form { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.inline-form input { flex: 1; }

/* ════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
  font-size: var(--fs-sm);
  line-height: 2;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; color: #cbd5e1; }

/* ════════════════════════════════════════
   DASHBOARD GRID
════════════════════════════════════════ */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* ════════════════════════════════════════
   GROUP DETAIL GRID
════════════════════════════════════════ */
.group-detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  align-items: start;
}

/* ════════════════════════════════════════
   REQUIREMENTS GRID
════════════════════════════════════════ */
.req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  max-width: 860px;
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
footer {
  background: var(--navy);
  color: #4a6a8a;
  text-align: center;
  padding: 0.8rem;
  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: 60vh;
  gap: 0.75rem;
  text-align: center;
}
.error-code { font-size: 5rem; font-weight: 900; color: #e2e8f0; line-height: 1; }
.error-msg  { font-size: var(--fs-lg); color: var(--muted); }

/* ════════════════════════════════════════
   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-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.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; }
  thead th:nth-child(4), tbody td:nth-child(4) { display: none; } /* hide Notes col */
}

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

  /* Nav becomes hamburger */
  .nav-toggle { display: flex; }
  .navbar-nav {
    display: none;
    position: fixed;
    top: 54px;
    left: 0; right: 0;
    background: var(--navy-mid);
    flex-direction: column;
    padding: 0.75rem 0.5rem;
    gap: 0.15rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 299;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a { padding: 0.6rem 1rem; border-radius: 8px; font-size: var(--fs-sm); }
  .nav-divider { display: none; }

  .container { padding: 1rem 0.75rem; }

  .page-title { font-size: var(--fs-xl); }
  .page-header { margin-bottom: 1rem; }

  /* Stats — 2 cols */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .stat-value { font-size: 1.5rem; }

  /* Tables hidden, card rows shown */
  .table-wrap { display: none; }
  .card-rows  { display: block; }

  .form-grid-2 { 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; }

  .btn { padding: 0.42rem 0.85rem; font-size: var(--fs-xs); }
  .btn-sm { padding: 0.25rem 0.6rem; }

  .card { padding: 0.85rem; border-radius: 10px; }
  .card-header { margin-bottom: 0.75rem; padding-bottom: 0.65rem; }

  .section-header { margin: 1.1rem 0 0.6rem; }

  .pipeline-label { width: 70px; font-size: 0.6rem; }
}

/* ════════════════════════════════════════
   SMALL MOBILE (≤380px)
════════════════════════════════════════ */
@media (max-width: 380px) {
  html { font-size: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.35rem; }
  .navbar-brand { font-size: 1rem; }
}
