/* ══════════════════════════════════════════════════════
   EHQ Design System
   Bootstrap 5.3.3 companion — purple-accent palette
   ══════════════════════════════════════════════════════ */

/* ── CSS VARIABLES ──────────────────────────────────── */
:root {
  --ehq-purple:    #534AB7;
  --ehq-purple-light: #EEEDFE;
  --ehq-purple-dark: #3C3489;
  --ehq-teal:      #1D9E75;
  --ehq-teal-light:#E1F5EE;
  --ehq-blue:      #185FA5;
  --ehq-blue-light:#E6F1FB;
  --ehq-blue-dark: #0C447C;
  --ehq-red:       #A32D2D;
  --ehq-red-light: #FCEBEB;
  --ehq-green-light:#EAF3DE;
  --ehq-green-dark:#27500A;
  --ehq-amber:     #BA7517;
  --ehq-amber-light:#FAEEDA;
  --ehq-amber-dark:#633806;
  --ehq-coral:     #D85A30;
  --ehq-coral-light:#FAECE7;
  --ehq-coral-dark:#712B13;
  --ehq-pink:      #D4537E;
  --ehq-pink-light:#FBEAF0;
  --ehq-pink-dark: #72243E;
  --ehq-green:     #639922;
  --ehq-teal-dark: #085041;
  --ehq-gray-50:   #F8F7F5;
  --ehq-gray-100:  #F1EFE8;
  --ehq-gray-200:  #E4E2DB;
  --ehq-gray-400:  #B4B2A9;
  --ehq-gray-600:  #888780;
  --ehq-gray-800:  #444441;
  --ehq-gray-900:  #2C2C2A;
  --ehq-border:    rgba(0,0,0,0.08);
  --ehq-radius:    10px;
  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ehq-gray-50);
  color: var(--ehq-gray-900);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ────────────────────────────────────────── */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--ehq-border);
  padding: 1.25rem 0;
  z-index: 100;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.25s ease;
}
.sidebar-brand {
  padding: 0 1.25rem 1.25rem;
  font-size: 18px;
  font-weight: 600;
  color: var(--ehq-purple);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-brand a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-brand i { font-size: 20px; }
.sidebar-section {
  padding: 0.75rem 1.25rem 0.35rem;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ehq-gray-400);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 1.25rem;
  font-size: 13px;
  color: var(--ehq-gray-600);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-link:hover {
  color: var(--ehq-gray-900);
  background: var(--ehq-gray-50);
}
.sidebar-link.active {
  color: var(--ehq-purple);
  background: var(--ehq-purple-light);
  border-left-color: var(--ehq-purple);
  font-weight: 500;
}
.sidebar-link i { font-size: 16px; width: 18px; text-align: center; }

/* Sidebar sub-links (dropdown items) */
.sidebar-sub-links {
  display: none;
  padding-left: 1.25rem;
}
.sidebar-sub-links.show { display: block; }
.sidebar-sub-link {
  display: block;
  padding: 5px 1.25rem 5px 2rem;
  font-size: 12px;
  color: var(--ehq-gray-600);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-sub-link:hover { color: var(--ehq-gray-900); }
.sidebar-sub-link.active { color: var(--ehq-purple); font-weight: 500; }

/* ── TOPBAR ─────────────────────────────────────────── */
.app-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid var(--ehq-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 90;
  transition: left 0.25s ease;
}
.topbar-search {
  background: var(--ehq-gray-50);
  border: 1px solid var(--ehq-border);
  border-radius: 8px;
  padding: 6px 12px 6px 34px;
  font-size: 13px;
  width: 260px;
  color: var(--ehq-gray-800);
  font-family: inherit;
  transition: border-color 0.15s;
}
.topbar-search:focus { outline: none; border-color: var(--ehq-purple); }
.search-wrap { position: relative; }
.search-wrap > i {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ehq-gray-400);
  font-size: 14px;
  pointer-events: none;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ehq-gray-600);
}
.topbar-user .avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ehq-purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--ehq-purple-dark);
}
.topbar-user a { color: inherit; text-decoration: none; }
.topbar-user .dropdown-toggle::after { display: none; }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--ehq-gray-600);
  cursor: pointer;
  padding: 4px;
}

/* ── MAIN ───────────────────────────────────────────── */
.app-main {
  margin-left: var(--sidebar-width);
  padding: 52px 0 0;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}
.page-content-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

/* ── PAGE HEADER ────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}
.page-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ehq-gray-900);
  line-height: 1.2;
  margin: 0;
}
.page-subtitle {
  font-size: 13px;
  color: var(--ehq-gray-600);
  margin-top: 3px;
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── BACK LINK ──────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ehq-gray-400);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--ehq-gray-800); }

/* ── BADGES ─────────────────────────────────────────── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.badge-new    { background: var(--ehq-blue-light);  color: #0C447C; }
.badge-active { background: var(--ehq-green-light); color: var(--ehq-green-dark); }
.badge-no     { background: var(--ehq-red-light);   color: #791F1F; }
.badge-warm   { background: var(--ehq-amber-light); color: #633806; }
.badge-won    { background: var(--ehq-green-light); color: var(--ehq-green-dark); }

/* ── PRODUCT DOTS ──────────────────────────────────── */
.product-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  cursor: default;
}
.badge-lost   { background: var(--ehq-gray-100);    color: var(--ehq-gray-600); }
.badge-neutral { background: var(--ehq-gray-100);   color: var(--ehq-gray-800); }

/* ── BUTTONS ────────────────────────────────────────── */
.btn-ehq {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--ehq-border);
  background: #fff;
  color: var(--ehq-gray-800);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.btn-ehq:hover { background: var(--ehq-gray-50); border-color: var(--ehq-gray-200); color: var(--ehq-gray-800); }
.btn-ehq:active { transform: scale(0.98); }
.btn-ehq-primary {
  background: var(--ehq-purple);
  color: #fff;
  border-color: var(--ehq-purple);
}
.btn-ehq-primary:hover { background: var(--ehq-purple-dark); border-color: var(--ehq-purple-dark); color: #fff; }
.btn-ehq-danger {
  color: var(--ehq-red);
  border-color: #F09595;
}
.btn-ehq-danger:hover { background: var(--ehq-red-light); color: var(--ehq-red); }
.btn-ehq-success {
  background: var(--ehq-teal);
  color: #fff;
  border-color: var(--ehq-teal);
}
.btn-ehq-success:hover { background: #178762; border-color: #178762; color: #fff; }
.btn-ehq-secondary {
  background: var(--ehq-gray-50);
  color: var(--ehq-gray-700);
  border-color: var(--ehq-gray-200);
}
.btn-ehq-secondary:hover { background: var(--ehq-gray-100); border-color: var(--ehq-gray-300); color: var(--ehq-gray-800); }
.btn-ehq-warning {
  background: #FFF3E0;
  color: #E65100;
  border-color: #FFCC80;
}
.btn-ehq-warning:hover { background: #FFE0B2; border-color: #FFB74D; color: #E65100; }
.btn-ehq-info {
  background: #E3F2FD;
  color: #1565C0;
  border-color: #90CAF9;
}
.btn-ehq-info:hover { background: #BBDEFB; border-color: #64B5F6; color: #1565C0; }
.btn-ehq-sm { padding: 5px 12px; font-size: 12px; }
.btn-ehq-xs { padding: 3px 8px; font-size: 11px; }
.btn-ehq-block { width: 100%; justify-content: center; }
a.btn-ehq { display: inline-flex; }

/* ── CARDS ──────────────────────────────────────────── */
.card-ehq {
  background: #fff;
  border: 1px solid var(--ehq-border);
  border-radius: var(--ehq-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card-ehq:has(.dropdown.show) {
  position: relative;
  z-index: 1050;
}
.card-ehq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--ehq-border);
}
.card-ehq-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ehq-gray-900);
  margin: 0;
}

/* ── SECTION LABELS ────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ehq-gray-400);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-total {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ehq-gray-400);
  background: var(--ehq-gray-100);
  padding: 1px 8px;
  border-radius: 99px;
}

/* ── CONTACT ROWS ──────────────────────────────────── */
.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.contact-row + .contact-row { border-top: 1px solid var(--ehq-border); }
.contact-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--ehq-gray-50);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--ehq-gray-600);
  font-size: 15px;
}
.contact-label { font-size: 12px; color: var(--ehq-gray-400); line-height: 1.2; }
.contact-value { font-size: 14px; color: var(--ehq-gray-900); }
.contact-value a { color: var(--ehq-blue); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }
.text-empty {
  color: var(--ehq-gray-400);
  font-style: italic;
  font-size: 13px;
}

/* ── DETAIL GRID ───────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.detail-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--ehq-border);
}
.detail-item:nth-last-child(-n+2) { border-bottom: none; }
.detail-item:nth-child(odd) { padding-right: 16px; }
.detail-item:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--ehq-border); }
.detail-label { font-size: 12px; color: var(--ehq-gray-400); margin-bottom: 2px; display: block; }
.detail-value { font-size: 14px; color: var(--ehq-gray-900); display: block; }

/* ── PIPELINE ROWS ─────────────────────────────────── */
.pipeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.pipeline-row + .pipeline-row { border-top: 1px solid var(--ehq-border); }
.pipeline-label { font-size: 13px; color: var(--ehq-gray-600); }

/* ── PRODUCT TAGS ──────────────────────────────────── */
.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--ehq-border);
  font-size: 13px;
  color: var(--ehq-gray-900);
  background: #fff;
  margin: 0 6px 6px 0;
}
.product-tag.inactive { opacity: 0.4; }
.product-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── NOTES ──────────────────────────────────────────── */
.note-input {
  width: 100%;
  border: 1px solid var(--ehq-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
  color: var(--ehq-gray-800);
  transition: border-color 0.15s;
}
.note-input:focus { outline: none; border-color: var(--ehq-purple); }
.note-item { padding: 12px 0; }
.note-item + .note-item { border-top: 1px solid var(--ehq-border); }
.note-meta {
  font-size: 12px;
  color: var(--ehq-gray-400);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.note-author { font-weight: 500; color: var(--ehq-gray-800); }
.note-text { font-size: 14px; color: var(--ehq-gray-900); line-height: 1.5; }

/* ── FILES ──────────────────────────────────────────── */
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.file-row + .file-row { border-top: 1px solid var(--ehq-border); }
.file-icon-box {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--ehq-blue-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--ehq-blue);
  font-size: 16px;
}
.file-name {
  font-size: 13px;
  color: var(--ehq-blue);
  word-break: break-all;
  cursor: pointer;
  text-decoration: none;
}
.file-name:hover { text-decoration: underline; }
.file-meta-text { font-size: 12px; color: var(--ehq-gray-400); margin-top: 1px; }
.file-status-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--ehq-blue-light);
  color: #0C447C;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── FOOTER META ───────────────────────────────────── */
.meta-strip {
  display: flex;
  gap: 2rem;
  padding: 14px 0;
  border-top: 1px solid var(--ehq-border);
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.meta-key { font-size: 11px; color: var(--ehq-gray-400); }
.meta-val { font-size: 13px; color: var(--ehq-gray-600); margin-top: 1px; }

/* ── MERGE ──────────────────────────────────────────── */
.merge-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ehq-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ehq-gray-600);
  background: #fff;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.merge-select:focus { outline: none; border-color: var(--ehq-purple); }

/* ── TABLES ─────────────────────────────────────────── */
.table-ehq {
  width: 100%;
  font-size: 13px;
}
.table-ehq th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ehq-gray-400);
  padding: 8px 12px;
  border-bottom: 1px solid var(--ehq-border);
  background: transparent;
  white-space: nowrap;
}
.table-ehq th a.th-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.table-ehq th a.th-sort:hover { color: var(--ehq-gray-800); }
.table-ehq td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ehq-border);
  color: var(--ehq-gray-800);
  vertical-align: middle;
}
.table-ehq tbody tr:last-child td { border-bottom: none; }
.table-ehq tbody tr:hover { background: var(--ehq-gray-50); }
.table-ehq a { color: var(--ehq-blue); text-decoration: none; }
.table-ehq a:hover { text-decoration: underline; }
.table-ehq a.btn-ehq { color: inherit; text-decoration: none; }
.table-ehq a.btn-ehq-primary,
.table-ehq a.btn-ehq-success { color: #fff; }
.table-ehq a.btn-ehq-primary:hover,
.table-ehq a.btn-ehq-success:hover { color: #fff; text-decoration: none; }

/* ── FORMS ──────────────────────────────────────────── */
.form-ehq .form-control,
.form-ehq .form-select {
  border: 1px solid var(--ehq-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ehq-gray-800);
  transition: border-color 0.15s;
}
.form-ehq .form-control:focus,
.form-ehq .form-select:focus {
  outline: none;
  border-color: var(--ehq-purple);
  box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.08);
}
.form-ehq .form-label,
.form-ehq label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ehq-gray-600);
  margin-bottom: 4px;
}
.form-ehq .form-text {
  font-size: 12px;
  color: var(--ehq-gray-400);
}

/* Override BS5 default form styles within our app */
.app-main .form-control,
.app-main .form-select {
  border-color: var(--ehq-border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--ehq-gray-800);
}
.app-main .form-control:focus,
.app-main .form-select:focus {
  border-color: var(--ehq-purple);
  box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.08);
}

/* ── ALERTS ─────────────────────────────────────────── */
.alert-ehq {
  border-radius: var(--ehq-radius);
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid;
}
.alert-ehq-info {
  background: var(--ehq-blue-light);
  color: var(--ehq-blue);
  border-color: rgba(24, 95, 165, 0.15);
}
.alert-ehq-success {
  background: var(--ehq-green-light);
  color: var(--ehq-green-dark);
  border-color: rgba(39, 80, 10, 0.15);
}
.alert-ehq-warning {
  background: var(--ehq-amber-light);
  color: #633806;
  border-color: rgba(186, 117, 23, 0.15);
}
.alert-ehq-danger {
  background: var(--ehq-red-light);
  color: var(--ehq-red);
  border-color: rgba(163, 45, 45, 0.15);
}

/* ── STAT CARDS ─────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--ehq-border);
  border-radius: var(--ehq-radius);
  padding: 1.25rem;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--ehq-gray-900);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-card-label {
  font-size: 12px;
  color: var(--ehq-gray-400);
  margin-top: 4px;
}
.stat-card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* ── LEAD HEADER (detail pages) ─────────────────────── */
.lead-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.lead-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.avatar-lg {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--ehq-purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 500; color: var(--ehq-purple-dark);
  flex-shrink: 0;
}
.lead-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ehq-gray-900);
  line-height: 1.2;
}
.lead-subtitle {
  font-size: 13px;
  color: var(--ehq-gray-600);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lead-subtitle a { color: var(--ehq-blue); text-decoration: none; }
.lead-subtitle a:hover { text-decoration: underline; }
.dot-sep { color: var(--ehq-gray-200); }

/* ── TABS ───────────────────────────────────────────── */
.tabs-ehq {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ehq-border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.tabs-ehq .nav-link {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ehq-gray-600);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  white-space: nowrap;
  background: transparent;
}
.tabs-ehq .nav-link:hover {
  color: var(--ehq-gray-900);
}
.tabs-ehq .nav-link.active {
  color: var(--ehq-purple);
  border-bottom-color: var(--ehq-purple);
  background: transparent;
}

/* ── PAGINATION ─────────────────────────────────────── */
.pagination-ehq .page-link {
  border: 1px solid var(--ehq-border);
  border-radius: 6px;
  color: var(--ehq-gray-800);
  font-size: 13px;
  padding: 6px 12px;
  margin: 0 2px;
}
.pagination-ehq .page-link:hover {
  background: var(--ehq-gray-50);
}
.pagination-ehq .page-item.active .page-link {
  background: var(--ehq-purple);
  border-color: var(--ehq-purple);
  color: #fff;
}

/* ── FILTER BAR ─────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1rem;
}
.filter-bar .form-control,
.filter-bar .form-select {
  max-width: 200px;
  font-size: 13px;
}

/* ── TIMELINE (audit logs) ──────────────────────────── */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
}
.timeline-item + .timeline-item { border-top: 1px solid var(--ehq-border); }
.timeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ehq-purple);
  flex-shrink: 0;
  margin-top: 6px;
}
.timeline-dot.create { background: var(--ehq-teal); }
.timeline-dot.update { background: var(--ehq-blue); }
.timeline-dot.delete { background: var(--ehq-red); }

/* ── PROGRESS BAR ───────────────────────────────────── */
.progress-ehq {
  height: 8px;
  border-radius: 4px;
  background: var(--ehq-gray-100);
  overflow: hidden;
}
.progress-ehq-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--ehq-purple);
  transition: width 0.3s ease;
}

/* ── NOTIFICATION DROPDOWN ──────────────────────────── */
.notification-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 50%;
  background: var(--ehq-red);
  color: #fff;
}

/* ── HIJACK BAR ─────────────────────────────────────── */
.hijack-bar {
  background: var(--ehq-amber-light);
  color: #633806;
  padding: 6px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.35s ease both;
}
.fade-up-d1 { animation-delay: 0.04s; }
.fade-up-d2 { animation-delay: 0.08s; }
.fade-up-d3 { animation-delay: 0.12s; }
.fade-up-d4 { animation-delay: 0.16s; }
.fade-up-d5 { animation-delay: 0.20s; }
.fade-up-d6 { animation-delay: 0.24s; }
.fade-up-d7 { animation-delay: 0.28s; }

/* ── AVATAR ─────────────────────────────────────────── */
.avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ehq-purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--ehq-purple-dark);
}

/* ── AUTH PAGES (standalone) ────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ehq-gray-50);
  padding: 2rem;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--ehq-border);
  border-radius: var(--ehq-radius);
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-brand {
  font-size: 22px;
  font-weight: 600;
  color: var(--ehq-purple);
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-brand i { font-size: 24px; }

/* ── SELECT2 OVERRIDES ──────────────────────────────── */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border: 1px solid var(--ehq-border) !important;
  border-radius: 8px !important;
  min-height: 38px !important;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--ehq-purple) !important;
  box-shadow: 0 0 0 3px rgba(83, 74, 183, 0.08) !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--ehq-purple) !important;
}
.select2-dropdown {
  border-color: var(--ehq-border) !important;
  border-radius: 8px !important;
  font-size: 13px;
}

/* ── SIDEBAR OVERLAY (mobile) ───────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
}

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar-toggle { display: block; }

  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .sidebar-backdrop.show {
    display: block;
  }

  .app-topbar {
    left: 0;
  }
  .app-main {
    margin-left: 0;
  }

  .page-content,
  .page-content-wide {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-item:nth-child(even) {
    padding-left: 0;
    border-left: none;
  }
  .detail-item:nth-child(odd) {
    padding-right: 0;
  }
  .detail-item:nth-last-child(-n+2) {
    border-bottom: 1px solid var(--ehq-border);
  }
  .detail-item:last-child {
    border-bottom: none;
  }

  .lead-header {
    flex-direction: column;
  }

  .table-ehq {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .topbar-search {
    width: 160px;
  }
}

@media (max-width: 576px) {
  .topbar-search { width: 120px; }
  .topbar-user span { display: none; }
}

/* ── STAT PILLS ────────────────────────────────────── */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-pill {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--ehq-border);
  border-radius: 99px; padding: 6px 16px 6px 10px;
  font-size: 13px; color: var(--ehq-gray-600);
}
.stat-pill-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.stat-pill-value { font-weight: 500; color: var(--ehq-gray-900); }

/* ── TOOLBAR ───────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 1rem;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.filter-group {
  display: flex; border: 1px solid var(--ehq-border);
  border-radius: 8px; overflow: hidden; background: #fff;
}
.filter-btn {
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  font-family: inherit; border: none; background: transparent;
  color: var(--ehq-gray-600); cursor: pointer;
  transition: all 0.15s; border-right: 1px solid var(--ehq-border);
  text-decoration: none; display: flex; align-items: center;
}
.filter-btn:last-child { border-right: none; }
.filter-btn:hover { background: var(--ehq-gray-50); color: var(--ehq-gray-900); }
.filter-btn.active { background: var(--ehq-purple); color: #fff; }
.type-filter {
  padding: 6px 12px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--ehq-border); border-radius: 8px;
  background: #fff; color: var(--ehq-gray-600); cursor: pointer;
  transition: border-color 0.15s;
}
.type-filter:focus { outline: none; border-color: var(--ehq-purple); }
.search-input {
  background: #fff; border: 1px solid var(--ehq-border);
  border-radius: 8px; padding: 6px 12px 6px 32px;
  font-size: 13px; width: 220px; color: var(--ehq-gray-800);
  font-family: inherit; transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--ehq-purple); }
.search-input-wrap { position: relative; }
.search-input-wrap > i {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ehq-gray-400); font-size: 13px; pointer-events: none;
}

/* ── LOG TABLE ─────────────────────────────────────── */
.log-card {
  background: #fff; border: 1px solid var(--ehq-border);
  border-radius: var(--ehq-radius); overflow: hidden;
}
.log-table { width: 100%; border-collapse: collapse; }
.log-table thead th {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ehq-gray-400);
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--ehq-border);
  background: var(--ehq-gray-50);
  position: sticky; top: 0; z-index: 1;
}
.log-table tbody tr { transition: background 0.1s; }
.log-table tbody tr:hover { background: var(--ehq-gray-50); }
.log-table tbody td {
  padding: 10px 16px; font-size: 13px;
  border-bottom: 1px solid var(--ehq-border);
  color: var(--ehq-gray-800); vertical-align: middle;
}
.log-table tbody tr:last-child td { border-bottom: none; }

/* Action badge */
.action-cell { display: flex; align-items: center; gap: 10px; }
.action-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.action-label { font-size: 13px; font-weight: 500; }
.act-create .action-icon { background: var(--ehq-green-light); color: var(--ehq-green); }
.act-create .action-label { color: var(--ehq-green-dark); }
.act-update .action-icon { background: var(--ehq-blue-light); color: var(--ehq-blue); }
.act-update .action-label { color: #0C447C; }
.act-delete .action-icon { background: var(--ehq-red-light); color: var(--ehq-red); }
.act-delete .action-label { color: #791F1F; }

/* Entity link */
.entity-link { color: var(--ehq-blue); text-decoration: none; font-weight: 500; }
.entity-link:hover { text-decoration: underline; }
.entity-type {
  font-size: 11px; font-weight: 500; color: var(--ehq-gray-400);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* User cell */
.user-cell { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; flex-shrink: 0;
}
.user-name { font-size: 13px; color: var(--ehq-gray-800); }

/* Time cell */
.time-abs { font-size: 13px; color: var(--ehq-gray-800); }
.time-rel { font-size: 12px; color: var(--ehq-gray-400); }

/* Detail cell */
.detail-text {
  font-size: 12px; color: var(--ehq-gray-600);
  max-width: 260px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4;
}
.changes-link {
  font-size: 12px; color: var(--ehq-purple);
  text-decoration: none; font-weight: 500;
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 2px;
}
.changes-link:hover { text-decoration: underline; }

/* Pagination bar */
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--ehq-border);
}
.pagination-info { font-size: 12px; color: var(--ehq-gray-400); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--ehq-border); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ehq-gray-600);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
  text-decoration: none;
}
.page-btn:hover { background: var(--ehq-gray-50); border-color: var(--ehq-gray-200); color: var(--ehq-gray-600); }
.page-btn.active { background: var(--ehq-purple); color: #fff; border-color: var(--ehq-purple); }
.page-btn.disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* ── PRODUCT METRIC CARD ───────────────────────────── */
.product-metric {
  background: #fff;
  border: 1px solid var(--ehq-border);
  border-radius: var(--ehq-radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.2s;
  height: 100%;
}
.product-metric:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.product-metric-link { display: block; text-decoration: none; color: inherit; height: 100%; }
.product-metric-link:hover { text-decoration: none; color: inherit; }
.product-metric-link:hover .product-metric { border-color: var(--ehq-gray-300); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.product-metric-link .product-metric { transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s; }
.product-metric-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; font-weight: 600;
}
.product-metric-info { flex: 1; min-width: 0; }
.product-metric-name {
  font-size: 13px; font-weight: 500;
  color: var(--ehq-gray-800); line-height: 1.2;
}
.product-metric-name a{
  text-decoration: none;
}
.product-metric-count {
  font-size: 26px; font-weight: 500;
  letter-spacing: -0.03em; line-height: 1.15;
}
.product-bar-wrap {
  height: 4px; background: var(--ehq-gray-100);
  border-radius: 99px; overflow: hidden; margin-top: 6px;
}
.product-bar {
  height: 100%; border-radius: 99px;
  transition: width 0.8s ease;
}

/* ── TABLE CARD ────────────────────────────────────── */
.table-card {
  background: #fff;
  border: 1px solid var(--ehq-border);
  border-radius: var(--ehq-radius);
  overflow: hidden;
}
.table-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ehq-border);
}
.table-card-title {
  font-size: 14px; font-weight: 500; color: var(--ehq-gray-900);
  display: flex; align-items: center; gap: 8px;
}
.table-card-title i { color: var(--ehq-gray-400); font-size: 15px; }
.table-card-subtitle {
  font-size: 12px; color: var(--ehq-gray-400);
}
.avg-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px;
  font-size: 13px; font-weight: 500;
  background: var(--ehq-purple-light); color: var(--ehq-purple-dark);
}

/* ── REPORT TABLE ──────────────────────────────────── */
.report-table { width: 100%; border-collapse: collapse; }
.report-table thead th {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ehq-gray-400);
  padding: 10px 18px; text-align: left;
  border-bottom: 1px solid var(--ehq-border);
  background: var(--ehq-gray-50);
}
.report-table thead th:last-child { text-align: right; }
.report-table tbody tr { transition: background 0.1s; }
.report-table tbody tr:hover { background: var(--ehq-gray-50); }
.report-table tbody td {
  padding: 9px 18px; font-size: 13px;
  border-bottom: 1px solid var(--ehq-border);
  color: var(--ehq-gray-800);
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody td:last-child { text-align: right; }
.report-table tbody td a {
  color: var(--ehq-blue); text-decoration: none; font-weight: 500;
}
.report-table tbody td a:hover { text-decoration: underline; }

/* ── DAYS INDICATOR ────────────────────────────────── */
.days-pill {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 500;
}
.days-fast { background: var(--ehq-green-light); color: var(--ehq-green-dark); }
.days-mid  { background: var(--ehq-amber-light); color: var(--ehq-amber-dark); }
.days-slow { background: var(--ehq-red-light); color: #791F1F; }
.days-ok   { background: var(--ehq-blue-light); color: #0C447C; }
.days-cell {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.days-bar-track {
  width: 60px; height: 4px;
  background: var(--ehq-gray-100);
  border-radius: 99px; overflow: hidden; flex-shrink: 0;
}
.days-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.6s ease;
}

/* ── UTILITY ────────────────────────────────────────── */
.icon-2x { font-size: 2rem; }
.icon-3x { font-size: 3rem; }
