/* ═══════════════════════════════════════════════════
   RUC CRM — MAIN STYLESHEET
   Color System:
     --navy:   #0B2545  (primary background)
     --steel:  #134074  (sub-elements, nav bg)
     --accent: #00B4D8  (CTAs, active states)
     --panel:  #EBF2FF  (content panels)
════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --navy:        #0B2545;
  --navy-dark:   #071A33;
  --steel:       #134074;
  --steel-light: #1A5294;
  --accent:      #00B4D8;
  --accent-dark: #0096B5;
  --accent-glow: rgba(0, 180, 216, 0.15);
  --panel:       #EBF2FF;
  --panel-dark:  #D6E8FF;
  --white:       #FFFFFF;
  --text-primary:#0B2545;
  --text-muted:  #6B84A3;
  --text-light:  #A8BDD4;
  --border:      #D0DFF0;
  --sidebar-w:   256px;
  --topbar-h:    64px;
  --breadcrumb-h:36px;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 2px 12px rgba(11,37,69,0.10);
  --shadow-lg:   0 8px 32px rgba(11,37,69,0.16);
  --transition:  0.2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--panel);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

a { text-decoration: none; cursor: pointer; }
button { cursor: pointer; border: none; background: none; }
input, select, textarea { outline: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }


/* ══════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: 60px;
  height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: 72px;
}
.logo-mark {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.logo-text { display: flex; flex-direction: column; overflow: hidden; }
.logo-title { font-size: 0.95rem; font-weight: 700; color: var(--white); white-space: nowrap; }
.logo-sub { font-size: 0.7rem; color: var(--text-light); white-space: nowrap; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 16px;
}
.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-light);
  padding: 14px 20px 4px;
  white-space: nowrap;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: #9BB5D4;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.nav-item i { font-size: 1rem; min-width: 18px; }
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
  border-left-color: rgba(0,180,216,0.4);
}
.nav-item.active {
  background: rgba(0,180,216,0.12);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar-sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--steel);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-info-sm { display: flex; flex-direction: column; overflow: hidden; }
.user-name-sm { font-size: 0.78rem; font-weight: 600; color: var(--white); white-space: nowrap; }
.user-role-sm { font-size: 0.65rem; color: var(--text-light); white-space: nowrap; }

/* Sidebar collapsed */
.sidebar.collapsed { width: 60px; min-width: 60px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info-sm { display: none; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  border-left: none;
  border-radius: 0;
  position: relative;
}
.sidebar.collapsed .nav-item.active { background: rgba(0,180,216,0.15); }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 20px 10px; }
.sidebar.collapsed .sidebar-user { justify-content: center; }

/* Tooltip on collapsed nav icons */
.sidebar.collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--steel);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 300;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }


/* ══════════════════════════════════════════════════
   ROW ACTION MENU (three-dot)
══════════════════════════════════════════════════ */
.btn-row-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 1rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
}
.btn-row-menu:hover,
.btn-row-menu.active {
  background: var(--panel-dark);
  border-color: var(--border);
  color: var(--navy);
}
.row-menu-items { display: none; }

#globalRowMenu {
  position: fixed;
  z-index: 9999;
  min-width: 168px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(11,37,69,0.16);
  padding: 5px 0;
  display: none;
}
#globalRowMenu.open { display: block; }
#globalRowMenu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  transition: background var(--transition);
}
#globalRowMenu button:hover { background: var(--panel); }
#globalRowMenu button.menu-danger { color: #dc3545; }
#globalRowMenu button.menu-danger:hover { background: #fff5f5; }
#globalRowMenu button.menu-success { color: #198754; }
#globalRowMenu button.menu-success:hover { background: #f0faf4; }
#globalRowMenu .menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ══════════════════════════════════════════════════
   MAIN WRAPPER
══════════════════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: margin-left var(--transition);
  overflow: hidden;
}
.main-wrapper.expanded { margin-left: 60px; }


/* ══════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 14px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 6px; }

.sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.3rem;
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--panel); color: var(--navy); }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  flex: 1;
  max-width: 380px;
}
.topbar-search i { color: var(--text-muted); font-size: 0.85rem; }
.topbar-search input {
  background: none;
  border: none;
  font-size: 0.82rem;
  color: var(--text-primary);
  width: 100%;
}
.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  position: relative;
  transition: all var(--transition);
}
.topbar-btn:hover { background: var(--panel); color: var(--navy); }
.badge-dot {
  width: 7px;
  height: 7px;
  background: #E63946;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 6px;
  border: 1.5px solid var(--white);
}
.topbar-divider { width: 1px; height: 28px; background: var(--border); margin: 0 6px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--panel); }
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-meta { display: flex; flex-direction: column; }
.user-name { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 0.65rem; color: var(--text-muted); }


/* ══════════════════════════════════════════════════
   BREADCRUMB BAR
══════════════════════════════════════════════════ */
.breadcrumb-bar {
  height: var(--breadcrumb-h);
  background: var(--steel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 0.72rem;
  color: var(--text-light);
  letter-spacing: 0.3px;
}
.breadcrumb-date { color: var(--accent); font-weight: 500; }


/* ══════════════════════════════════════════════════
   CONTENT AREA & PANELS
══════════════════════════════════════════════════ */
.content-area {
  flex: 1;
  overflow-y: auto;
  background: var(--panel);
  padding: 24px;
}
.panel { display: none; }
.panel.active { display: block; }


/* ── Panel Header ── */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.panel-title { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.panel-subtitle { font-size: 0.78rem; color: var(--text-muted); }
.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Buttons */
.btn-accent {
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
  border: none;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
}
.btn-navy:hover { background: var(--steel); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.btn-outline:hover { background: var(--accent); color: var(--white); }

.btn-ghost-sm {
  background: none;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.btn-ghost-sm:hover { background: var(--accent-glow); }
.btn-ghost-sm:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-danger-sm {
  background: rgba(230,57,70,0.1);
  color: #E63946;
  border: 1px solid rgba(230,57,70,0.2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-danger-sm:hover { background: #E63946; color: var(--white); }

.btn-edit-sm {
  background: rgba(0,180,216,0.1);
  color: var(--accent);
  border: 1px solid rgba(0,180,216,0.2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-edit-sm:hover { background: var(--accent); color: var(--white); }

/* Form controls in panels */
.form-select, .form-control {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-primary);
  background: var(--white);
  transition: border var(--transition);
}
.form-select:focus, .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-label { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }


/* ══════════════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.kpi-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.kpi-icon.teal   { background: rgba(0,180,216,0.12);  color: #00B4D8; }
.kpi-icon.blue   { background: rgba(19,64,116,0.10);  color: #134074; }
.kpi-icon.amber  { background: rgba(244,162,97,0.15); color: #F4A261; }
.kpi-icon.green  { background: rgba(45,198,83,0.12);  color: #2DC653; }
.kpi-icon.red    { background: rgba(230,57,70,0.10);  color: #E63946; }
.kpi-icon.purple { background: rgba(123,47,190,0.10); color: #7B2FBE; }

.kpi-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  display: block;
}

.kpi-main-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.kpi-main-val {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.5px;
}

.kpi-sub-label {
  font-size: 0.63rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.kpi-delta {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: center;
}
.kpi-delta.up   { background: rgba(25,135,84,0.12);  color: #198754; }
.kpi-delta.down { background: rgba(220,53,69,0.12);  color: #dc3545; }
.kpi-delta.flat { background: rgba(108,117,125,0.10); color: var(--text-muted); }

.kpi-footer {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: auto;
}

.kpi-footer-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kpi-footer-item.kpi-footer-right { align-items: flex-end; }

.kpi-footer-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.kpi-footer-lbl {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.kpi-footer-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 16px;
}

/* legacy — kept for any non-dashboard cards */
.kpi-value { font-size: 1.4rem; font-weight: 600; color: var(--navy); line-height: 1.2; }
.kpi-trend { font-size: 0.65rem; font-weight: 600; margin-top: 2px; }
.kpi-trend.up   { color: #198754; }
.kpi-trend.down { color: #dc3545; }
.kpi-trend.flat { color: var(--text-muted); font-weight: 500; }


/* ══════════════════════════════════════════════════
   CHARTS
══════════════════════════════════════════════════ */
.charts-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  margin-bottom: 20px;
}
.charts-row > * { min-width: 0; }
@media (max-width: 1100px) { .charts-row { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.chart-title { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.chart-legend { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-muted); }
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.teal { background: var(--accent); }
.legend-dot.blue { background: var(--steel); }

.chart-wrapper { position: relative; height: 270px; overflow: hidden; }
.chart-card canvas { max-width: 100%; }
.donut-legend-val { font-weight: 700; color: var(--navy); }


/* ══════════════════════════════════════════════════
   BOTTOM ROW & DATA CARDS
══════════════════════════════════════════════════ */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  margin-bottom: 16px;
}
.bottom-row > * { min-width: 0; }
@media (max-width: 1100px) { .bottom-row { grid-template-columns: 1fr; } }

.data-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.data-card.full-width { width: 100%; }
.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.data-card-title { font-size: 0.82rem; font-weight: 700; color: var(--navy); }


/* ── Pipeline ── */
.pipeline-list { display: flex; flex-direction: column; gap: 12px; }
.pipeline-item { display: flex; align-items: center; gap: 10px; }
.pipeline-label { font-size: 0.72rem; color: var(--text-muted); width: 120px; min-width: 120px; }
.pipeline-bar-wrap { flex: 1; height: 6px; background: var(--panel); border-radius: 10px; overflow: hidden; }
.pipeline-bar { height: 100%; border-radius: 10px; transition: width 0.6s ease; }
.pipeline-count { font-size: 0.75rem; font-weight: 700; color: var(--navy); width: 28px; text-align: right; }


/* ══════════════════════════════════════════════════
   CRM TABLE
══════════════════════════════════════════════════ */
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.crm-table thead th {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.crm-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.crm-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.crm-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.crm-table tbody tr:hover { background: rgba(0,180,216,0.04); }
.crm-table tbody tr:last-child { border-bottom: none; }
.crm-table tbody td {
  padding: 9px 12px;
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}
.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 28px !important;
  font-size: 0.78rem;
}
.empty-row i { font-size: 1.1rem; margin-right: 6px; opacity: 0.5; }

/* Table action buttons */
.td-actions { display: flex; gap: 6px; align-items: center; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Status Badges ── */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.67rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-status.active      { background: rgba(45,198,83,0.12);  color: #2DC653; }
.badge-status.pending     { background: rgba(244,162,97,0.15); color: #E07A2F; }
.badge-status.approved    { background: rgba(0,180,216,0.12);  color: #0096B5; }
.badge-status.rejected    { background: rgba(230,57,70,0.10);  color: #E63946; }
.badge-status.enrolled    { background: rgba(123,47,190,0.12); color: #7B2FBE; }
.badge-status.differed    { background: rgba(19,64,116,0.10);  color: #134074; }
.badge-status.conditional { background: rgba(244,162,97,0.15); color: #E07A2F; }
.badge-status.unconditional { background: rgba(0,180,216,0.12); color: #0096B5; }
.badge-status.refund      { background: rgba(230,57,70,0.10);  color: #E63946; }


/* ══════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-btns { display: flex; gap: 6px; align-items: center; }
.page-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--white); font-weight: 700; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* ══════════════════════════════════════════════════
   FORM MODAL PANEL (slide-in drawer style)
══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,37,69,0.55);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
}
.modal-overlay.open { display: flex; }

.modal-drawer {
  width: 580px;
  max-width: 100vw;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal-drawer-header {
  background: var(--navy);
  color: var(--white);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-drawer-title { font-size: 0.95rem; font-weight: 700; }
.modal-drawer-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  transition: all var(--transition);
}
.modal-drawer-close:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.modal-drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.modal-drawer-footer {
  padding: 14px 22px;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Form sections */
.form-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin: 18px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-section-title:first-child { margin-top: 0; }

/* ── Detail view fields ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin-bottom: 4px;
}
.detail-wide { grid-column: 1 / -1; }
.detail-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.detail-value {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
  line-height: 1.5;
}
.detail-empty { color: var(--text-light); font-style: italic; font-weight: 400; }

/* Alert msg */
.alert-info-bar {
  background: var(--accent-glow);
  border: 1px solid rgba(0,180,216,0.25);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.75rem;
  color: var(--steel);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-warning-bar {
  background: rgba(244,162,97,0.12);
  border: 1px solid rgba(244,162,97,0.3);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.75rem;
  color: #8B4513;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ── Searchable Select ── */
.ss-wrap { position: relative; }
.ss-control { position: relative; display: flex; align-items: center; }
.ss-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.82rem;
  z-index: 1;
}
.ss-input {
  width: 100%;
  padding-left: 30px !important;
}
.ss-input.is-invalid { border-color: #dc3545 !important; }
.ss-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  max-height: 210px;
  overflow-y: auto;
  display: none;
}
.ss-dropdown.open { display: block; }
.ss-option {
  padding: 8px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-option:hover { background: var(--panel); }
.ss-option.ss-selected { background: var(--accent-glow); color: var(--accent); font-weight: 600; }
.ss-empty { padding: 10px 14px; font-size: 0.82rem; color: var(--text-muted); font-style: italic; }

/* ── Centered modal (for import, confirm, bulk assign) ── */
#leadsImportModal,
#leadsBulkModal {
  align-items: center;
  justify-content: center;
}
.modal-center {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-width: 96vw;
  animation: fadeScaleIn .2s ease;
  max-height: 90vh;
  overflow: hidden;
}
@keyframes fadeScaleIn { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
.modal-center-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px 14px 0 0;
}
.modal-center-title { font-size: 0.9rem; font-weight: 700; }
.modal-center-body { padding: 22px; overflow-y: auto; }
.modal-center-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── CSV drop zone ── */
.csv-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px 20px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
}
.csv-drop-zone:hover,
.csv-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ── Bulk action toolbar ── */
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  animation: fadeScaleIn .15s ease;
}
.bulk-count { font-size: 0.85rem; font-weight: 600; }
.bulk-actions { display: flex; gap: 8px; }

/* ── Selected table row ── */
tr.row-selected td { background: rgba(0,180,216,0.07); }

/* ── Row checkbox styling ── */
.row-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }

/* ── Import summary ── */
.imp-summary { background: var(--panel); border-radius: var(--radius-sm); padding: 16px; }

/* ══════════════════════════════════════════════════
   LIVE ADMISSIONS PIPELINE
══════════════════════════════════════════════════ */
.pipeline-meta {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  padding-bottom: 16px;
}
.pipeline-meta-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
  border-right: 1px solid var(--border);
}
.pipeline-meta-item:last-child { border-right: none; }
.pipeline-meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.pipeline-meta-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.pipeline-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pipeline-stage {
  flex: 1;
  min-width: 100px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px 12px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-top-color var(--transition);
  text-align: center;
  position: relative;
}
.pipeline-stage:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.pipeline-stage.ps-active { box-shadow: var(--shadow); }
.pipeline-stage-count {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.pipeline-stage-name {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.3;
  margin-bottom: 8px;
}
.pipeline-stage-bar {
  height: 3px;
  background: var(--panel-dark);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.pipeline-stage-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.pipeline-stage-pct {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}
.pipeline-connector {
  display: flex;
  align-items: center;
  padding: 0 5px;
  color: var(--border);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: -3px;
}

.pipeline-exit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.pipeline-exit-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 4px;
}
.pipeline-exit-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8rem;
}
.pipeline-exit-tile:hover {
  border-color: #aaa;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.pipeline-exit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pipeline-exit-name { font-weight: 600; color: var(--text-primary); }
.pipeline-exit-count { font-weight: 800; }

/* ══════════════════════════════════════════════════
   SEARCH & FILTER BAR
══════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  flex: 1;
  max-width: 320px;
}
.filter-search i { color: var(--text-muted); font-size: 0.85rem; }
.filter-search input {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--text-primary);
  width: 100%;
}
.filter-search input::placeholder { color: var(--text-muted); }
.filter-select {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 28px 7px 10px;
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236B84A3' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border var(--transition);
}
.filter-select:focus { border-color: var(--accent); outline: none; }

/* ── Searchable staff filter ── */
.staff-srch-wrap { position: relative; display: inline-block; }
.staff-srch-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236B84A3' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  width: 160px;
  cursor: text;
}
.staff-srch-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 220px;
  overflow-y: auto;
}
.staff-srch-item {
  padding: 7px 12px;
  font-size: 0.76rem;
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}
.staff-srch-item:hover { background: var(--hover); }
.staff-srch-item.staff-srch-hidden { display: none; }

/* ── Searchable lead-name field (full-width form variant) ── */
.lead-srch-wrap { position: relative; width: 100%; }
.lead-srch-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 220px;
  overflow-y: auto;
}
.lead-srch-item {
  padding: 7px 12px;
  font-size: 0.8rem;
  color: var(--navy);
  cursor: pointer;
}
.lead-srch-item:hover { background: var(--hover); }
.lead-srch-item.lead-srch-hidden { display: none; }
.lead-srch-item-sub { font-size: 0.72rem; color: var(--text-muted); }
.lead-srch-empty { padding: 7px 12px; font-size: 0.76rem; color: var(--text-muted); }


/* ══════════════════════════════════════════════════
   COMING SOON PLACEHOLDER
══════════════════════════════════════════════════ */
.coming-soon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--white);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  min-height: 320px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.coming-soon-card i { font-size: 2.5rem; color: var(--accent); opacity: 0.5; }
.coming-soon-card p { text-align: center; }


/* ══════════════════════════════════════════════════
   GLOBAL SPINNER
══════════════════════════════════════════════════ */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,37,69,0.45);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.spinner-overlay.show { display: flex; }
.spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 500;
}
.spinner-ring {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ══════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════ */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.text-accent { color: var(--accent); }
.text-muted-custom { color: var(--text-muted); font-size: 0.72rem; }
.fw-700 { font-weight: 700; }

/* Student ID link style */
.id-link {
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  transition: color var(--transition);
}
.id-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* Expense file upload */
.exp-upload-area {
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-glow);
  cursor: pointer;
  transition: border-color var(--transition);
}
.exp-upload-area:hover { border-color: var(--accent-dark); }
.exp-file-info {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exp-file-info a { color: var(--accent); font-weight: 600; text-decoration: none; }
.exp-file-info a:hover { text-decoration: underline; }

/* Progress bar */
.progress-mini {
  height: 5px;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  width: 80px;
  display: inline-block;
  vertical-align: middle;
}
.progress-mini-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
}




/* ══════════════════════════════════════════════════
   MOBILE SIDEBAR BACKDROP
══════════════════════════════════════════════════ */
.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 199; /* just below sidebar (200) */
  animation: backdropFadeIn 0.2s ease;
}
.mobile-sidebar-backdrop.visible { display: block; }
@keyframes backdropFadeIn { from { opacity: 0; } to { opacity: 1; } }


/* ══════════════════════════════════════════════════
   RESPONSIVE — TABLET / MOBILE (≤ 900px)
══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Hide sidebar by default on mobile, slide in when toggled */
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }

  .content-area { padding: 16px 12px 32px; }

  /* Full-width drawer on mobile */
  .modal-drawer { width: 100vw; }

  /* Topbar more compact */
  .topbar { padding: 0 12px; gap: 10px; }

  /* Charts stack */
  .charts-row { grid-template-columns: 1fr; }
  .bottom-row  { grid-template-columns: 1fr; }

  /* Tables: horizontal scroll */
  .crm-table { min-width: 560px; }

  /* Filter bar: horizontal scroll instead of wrapping */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filter-bar::-webkit-scrollbar { height: 0; }
  .filter-search { min-width: 180px; max-width: 240px; flex-shrink: 0; }
  .filter-select { flex-shrink: 0; }
  .btn-accent, .btn-navy, .btn-outline { flex-shrink: 0; }

  /* Pipeline flow: horizontal scroll */
  .pipeline-flow { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pipeline-stage { min-width: 88px; }
}


/* ══════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 600px)
══════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Topbar */
  .topbar { padding: 0 10px; }
  .topbar-search { display: none; }
  .user-meta { display: none; }
  .topbar-divider { display: none; }
  .topbar-btn { width: 32px; height: 32px; }

  /* Breadcrumb */
  .breadcrumb-bar { padding: 0 12px; font-size: 0.66rem; }

  /* Panel header */
  .panel-header { flex-direction: column; gap: 10px; }
  .panel-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .panel-title { font-size: 1.1rem; }

  /* KPI grid: single column, cards stack vertically */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .kpi-card {
    padding: 14px 16px;
    gap: 12px;
    flex-direction: row;
    align-items: center;
  }
  .kpi-icon { width: 42px; height: 42px; min-width: 42px; font-size: 1rem; flex-shrink: 0; }
  .kpi-value { font-size: 1.2rem; }
  .kpi-label { font-size: 0.66rem; }
  .kpi-trend { font-size: 0.62rem; }

  /* Chart cards: full width, shorter */
  .chart-card { padding: 14px 12px; }
  .chart-card-header { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 10px; }
  .chart-title { font-size: 0.78rem; }
  .chart-wrapper { height: 200px; }
  .chart-legend { flex-wrap: wrap; gap: 4px 10px; font-size: 0.68rem; }

  /* Data cards */
  .data-card { padding: 14px 12px; }
  .data-card-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .data-card-title { font-size: 0.85rem; }

  /* Modals */
  .modal-center { max-height: 95dvh; border-radius: 14px 14px 0 0; }
  .modal-center-body { padding: 16px; }
  .modal-drawer-body { padding: 16px; }
  .modal-drawer-footer { padding: 12px 16px; }
  .detail-grid { grid-template-columns: 1fr; }

  /* Pipeline meta: scroll */
  .pipeline-meta { overflow-x: auto; }
  .pipeline-meta-item { min-width: 80px; }
  .pipeline-meta-value { font-size: 1.2rem; }

  /* Pipeline label narrower */
  .pipeline-label { min-width: 100px; width: 100px; font-size: 0.68rem; }

  /* Pagination tighter */
  .pagination-bar { font-size: 0.68rem; flex-wrap: wrap; gap: 6px; }
  .page-btn { height: 28px; min-width: 28px; }

  /* Wider touch targets for table action buttons */
  .btn-row-menu { width: 34px; height: 34px; }

  /* ── Mobile Card View for .crm-table ── */
  .crm-table.mobile-cards { min-width: 0; width: 100%; }
  .crm-table.mobile-cards thead { display: none; }
  .crm-table.mobile-cards,
  .crm-table.mobile-cards tbody { display: block; width: 100%; }
  .crm-table.mobile-cards tbody tr {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    padding: 0;
    cursor: pointer;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow var(--transition);
  }
  .crm-table.mobile-cards tbody tr:active { box-shadow: var(--shadow-lg); opacity: 0.92; }
  .crm-table.mobile-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border: none;
    border-bottom: 1px solid rgba(208,223,240,0.5);
    min-width: 0;
    font-size: 0.8rem;
    gap: 8px;
    text-align: right;
  }
  .crm-table.mobile-cards tbody td:last-child { display: none; }
  .crm-table.mobile-cards tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    min-width: 72px;
    text-align: left;
  }
  .crm-table.mobile-cards tbody td[colspan] {
    justify-content: center;
    display: flex;
    border: none;
    text-align: center;
  }
  .crm-table.mobile-cards td.mob-hide { display: none !important; }
  .crm-table.mobile-cards tbody td:last-of-type:not([colspan]) {
    border-bottom: none;
  }
  /* First td gets accent top-border to act as card "header" */
  .crm-table.mobile-cards tbody tr td:first-child {
    background: rgba(0,180,216,0.04);
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
  }
}

/* ══════════════════════════════════════════════════
   MARKETING — EMAIL & AUTOMATION
══════════════════════════════════════════════════ */
.mkt-tab-strip {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.mkt-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.mkt-tab:hover { color: var(--navy); }
.mkt-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.mkt-tab-content { display: none; }
.mkt-tab-content.active { display: block; }

.mkt-template-list { display: flex; flex-direction: column; }
.mkt-template-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.mkt-template-card:last-child { border-bottom: none; }
.mkt-template-card-name { font-weight: 700; color: var(--navy); font-size: 0.9rem; }
.mkt-template-card-subject { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }
.mkt-template-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

.mkt-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.mkt-empty i { font-size: 1.4rem; display: block; margin-bottom: 8px; }

.mkt-merge-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mkt-merge-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--steel);
  cursor: pointer;
  transition: var(--transition);
}
.mkt-merge-chip:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent-dark); }

.mkt-quill-wrap { background: var(--white); border-radius: var(--radius-sm); }
.mkt-quill-wrap .ql-toolbar { border-color: var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.mkt-quill-wrap .ql-container { border-color: var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); min-height: 180px; font-size: 0.88rem; }

.mkt-preview-pane {
  margin-top: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
}
.mkt-preview-subject { font-weight: 700; color: var(--navy); margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.mkt-preview-body { font-size: 0.85rem; line-height: 1.5; color: var(--text-primary); }
.mkt-preview-body p { margin: 0 0 10px; }
.mkt-preview-body p:last-child { margin-bottom: 0; }
.mkt-preview-body ul, .mkt-preview-body ol { margin: 0 0 10px; padding-left: 22px; }
.mkt-preview-body h1, .mkt-preview-body h2, .mkt-preview-body h3 { margin: 0 0 8px; }

