/* ================================================================
   Pharmacy Intelligence — Main Stylesheet
   ================================================================ */

:root {
  --blue:        #1a56db;
  --blue-light:  #e8f0fe;
  --blue-dark:   #1245b0;
  --green:       #057a55;
  --green-light: #def7ec;
  --amber:       #c27803;
  --amber-light: #fef3c7;
  --red:         #c81e1e;
  --red-light:   #fde8e8;
  --grey-50:     #f9fafb;
  --grey-100:    #f3f4f6;
  --grey-200:    #e5e7eb;
  --grey-400:    #9ca3af;
  --grey-600:    #4b5563;
  --grey-800:    #1f2937;
  --white:       #ffffff;
  --radius:      6px;
  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--grey-800);
  background: var(--grey-50);
}

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

/* ── Navigation ───────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 52px;
  background: var(--grey-800);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand { display: flex; align-items: center; gap: 8px; }
.nav-logo  { font-size: 18px; }
.nav-title { font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; flex: 1; }

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--grey-400);
  font-size: 13px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,.1); text-decoration: none; }
.nav-link.active { color: var(--white); background: rgba(255,255,255,.15); }

.nav-user   { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-username { font-size: 13px; color: var(--grey-400); }
.nav-logout { font-size: 12px; color: var(--grey-400); }
.nav-logout:hover { color: var(--white); }

/* ── Layout ───────────────────────────────────────────── */
.main-content { max-width: 1200px; margin: 0 auto; padding: 24px 24px 48px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.page-title    { font-size: 22px; font-weight: 700; color: var(--grey-800); }
.page-subtitle { font-size: 13px; color: var(--grey-600); margin-top: 2px; }
.breadcrumb    { font-size: 13px; color: var(--grey-600); display: block; margin-bottom: 4px; }
.breadcrumb:hover { color: var(--blue); }

/* ── Stat chips ───────────────────────────────────────── */
.stat-chips { display: flex; gap: 12px; }
.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 8px 16px;
  min-width: 72px;
}
.stat-chip--highlight { border-color: var(--blue); background: var(--blue-light); }
.stat-value { font-size: 20px; font-weight: 700; color: var(--grey-800); }
.stat-label { font-size: 11px; color: var(--grey-600); text-transform: uppercase; letter-spacing: .5px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn--primary  { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-dark); text-decoration: none; color: var(--white); }
.btn--secondary { background: var(--white); color: var(--grey-600); border-color: var(--grey-200); }
.btn--secondary:hover { background: var(--grey-100); }
.btn--outline  { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--outline:hover { background: var(--blue-light); }
.btn--small    { padding: 4px 10px; font-size: 12px; }
.btn--full     { width: 100%; justify-content: center; }

/* ── Form elements ────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.form-input  {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.alert--error {
  background: var(--red-light);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Login page ───────────────────────────────────────── */
.login-page { background: var(--grey-100); }
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-header  { text-align: center; margin-bottom: 28px; }
.login-logo    { font-size: 36px; margin-bottom: 8px; }
.login-title   { font-size: 20px; font-weight: 700; }
.login-subtitle { font-size: 13px; color: var(--grey-600); margin-top: 4px; }
.login-form    { display: flex; flex-direction: column; gap: 4px; }

/* ── Data table ───────────────────────────────────────── */
.table-wrapper { overflow-x: auto; margin-top: 8px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  background: var(--grey-50);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--grey-600);
  border-bottom: 1px solid var(--grey-200);
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--grey-100);
  font-size: 13px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--grey-50); }
.table-primary { font-weight: 500; }
.table-link    { color: var(--blue); font-weight: 500; }
.text-right    { text-align: right; }
.text-muted    { color: var(--grey-600); }
.text-muted--faint { color: var(--grey-400); }
.company-number { font-size: 12px; color: var(--grey-400); }
.site-count    { font-weight: 600; }

/* ── Status & priority badges ─────────────────────────── */
.status-badge, .priority-badge, .confidence-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.status-badge--active   { background: var(--green-light);  color: var(--green); }
.status-badge--inactive { background: var(--grey-100);     color: var(--grey-600); }
.status-badge--unknown  { background: var(--amber-light);  color: var(--amber); }
.status-badge--closed   { background: var(--red-light);    color: var(--red); }

.priority-badge--high   { background: var(--red-light);    color: var(--red); }
.priority-badge--medium { background: var(--amber-light);  color: var(--amber); }
.priority-badge--low    { background: var(--grey-100);     color: var(--grey-600); }

.confidence-badge--verified { background: var(--green-light); color: var(--green); }
.confidence-badge--likely   { background: var(--blue-light);  color: var(--blue); }
.confidence-badge--possible { background: var(--grey-100);    color: var(--grey-600); }

/* ── Directory controls ───────────────────────────────── */
.directory-controls { margin-bottom: 16px; }
.search-form  { display: flex; gap: 8px; margin-bottom: 12px; }
.search-input { flex: 1; padding: 7px 12px; border: 1px solid var(--grey-200); border-radius: var(--radius); font-size: 13px; }
.search-input:focus { outline: none; border-color: var(--blue); }

.alphabet-filter { display: flex; flex-wrap: wrap; gap: 2px; }
.alpha-btn {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-600);
  transition: background .1s, color .1s;
}
.alpha-btn:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }
.alpha-btn.active { background: var(--blue); color: var(--white); }

/* ── Pagination ───────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}
.page-btn  { font-size: 13px; color: var(--blue); }
.page-info { font-size: 13px; color: var(--grey-600); }

/* ── Tab navigation ───────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--grey-200);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grey-600);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--blue); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Overview grid ────────────────────────────────────── */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.info-card__title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--grey-600); margin-bottom: 12px; }
.info-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.info-dl dt { font-size: 12px; color: var(--grey-600); }
.info-dl dd { font-size: 13px; font-weight: 500; }

/* ── Signal list ──────────────────────────────────────── */
.signal-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.signal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.signal-date { margin-left: auto; font-size: 11px; color: var(--grey-400); }

/* ── Alert feed ───────────────────────────────────────── */
.alert-feed { display: flex; flex-direction: column; gap: 12px; }
.alert-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-left: 4px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.alert-card.priority--high   { border-left-color: var(--red); }
.alert-card.priority--medium { border-left-color: var(--amber); }
.alert-card.priority--low    { border-left-color: var(--grey-400); }
.alert-card--unseen          { background: #fffbf0; }

.alert-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.alert-card__meta  { display: flex; align-items: center; gap: 8px; }
.signal-type       { font-size: 12px; color: var(--grey-600); }
.alert-card__date  { font-size: 11px; color: var(--grey-400); }
.alert-card__title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.alert-card__summary { font-size: 13px; color: var(--grey-600); }
.alert-card__footer { margin-top: 10px; }
.alert-card__link  { font-size: 12px; color: var(--blue); }

/* ── Dispensing ───────────────────────────────────────── */
.dispensing-kpi-row { display: flex; gap: 16px; margin-bottom: 20px; }
.kpi-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 160px;
}
.kpi-label { font-size: 11px; color: var(--grey-600); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--grey-800); }
.kpi-value--up   { color: var(--green); }
.kpi-value--down { color: var(--red); }
.kpi-sub   { font-size: 11px; color: var(--grey-400); margin-top: 2px; }

.chart-container {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--grey-600); margin-bottom: 8px; }

.bar-cell { width: 120px; background: var(--grey-100); border-radius: 3px; height: 8px; overflow: hidden; }
.bar      { height: 100%; background: var(--blue); border-radius: 3px; }

/* ── People grid ──────────────────────────────────────── */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.person-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.person-card__header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.person-name { font-weight: 600; font-size: 14px; }
.person-role { font-size: 12px; color: var(--grey-600); }
.person-since { font-size: 11px; color: var(--grey-400); }

.cross-group-banner {
  background: var(--amber-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cross-link { color: var(--amber); font-weight: 600; }
.cross-link:hover { text-decoration: underline; }

.saved-contacts { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--grey-100);
}
.contact-type  { color: var(--grey-400); min-width: 50px; font-size: 11px; text-transform: uppercase; }
.contact-value { flex: 1; color: var(--grey-800); font-family: monospace; font-size: 12px; }

.enrichment-panel { margin-top: 8px; }
.enrich-results {
  margin-top: 8px;
  padding: 8px;
  background: var(--grey-50);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.enrich-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.conditions-flag { color: var(--amber); font-weight: 500; font-size: 12px; }

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--grey-600);
}
.empty-state__icon  { font-size: 40px; margin-bottom: 12px; }
.empty-state__title { font-size: 18px; font-weight: 600; color: var(--grey-800); margin-bottom: 8px; }
.empty-state__text  { font-size: 14px; color: var(--grey-600); margin-bottom: 16px; }

/* ════════════════════════════════════════════════════════════
   v2 additions — Companies / Pharmacies / Groups / Dashboard
════════════════════════════════════════════════════════════ */

/* ── Country summary cards ─────────────────────────────────── */
.country-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.country-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--grey-200);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.country-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.country-card.eng { border-top-color: #3b82f6; }
.country-card.sco { border-top-color: #0ea5e9; }
.country-card.wal { border-top-color: #10b981; }
.country-card.ni  { border-top-color: #f59e0b; }
.country-flag  { font-size: 22px; margin-bottom: 6px; }
.country-name  { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.country-stats { display: flex; flex-direction: column; gap: 5px; }
.country-stat  { display: flex; justify-content: space-between; font-size: 12px; }
.country-stat-label { color: var(--grey-600); }
.country-stat-val   { font-weight: 700; }
.country-stat-val.items { color: #7c3aed; }
.drill-hint { font-size: 11px; color: #a78bfa; margin-top: 10px; font-weight: 600; }

/* ── Summary stat row ──────────────────────────────────────── */
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.summary-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid #7c3aed;
}
.summary-card.blue  { border-left-color: #3b82f6; }
.summary-card.green { border-left-color: #10b981; }
.summary-card.amber { border-left-color: #f59e0b; }
.summary-num   { font-size: 26px; font-weight: 800; color: #2e1760; }
.summary-label { font-size: 12px; color: var(--grey-600); margin-top: 2px; }
.summary-sub   { font-size: 11px; color: var(--grey-400); margin-top: 4px; }

/* ── Band strip (dashboard + groups page) ──────────────────── */
.band-strip { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.band-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  flex: 1;
  min-width: 110px;
  text-align: center;
  text-decoration: none;
  display: block;
  color: inherit;
}
.band-card:hover { border-color: #c4b5fd; box-shadow: var(--shadow-md); text-decoration: none; }
.band-card.active { border-color: #7c3aed; background: #f5f3ff; }
.band-icon  { font-size: 20px; margin-bottom: 4px; }
.band-name  { font-size: 13px; font-weight: 700; }
.band-range { font-size: 11px; color: var(--grey-400); margin-top: 2px; }
.band-count { font-size: 20px; font-weight: 800; color: #7c3aed; margin-top: 6px; }

/* ── Band badges ───────────────────────────────────────────── */
.band-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.band-badge-enterprise { background: #1e0f4a; color: #a78bfa; }
.band-badge-large      { background: #2e1760; color: #c4b5fd; }
.band-badge-medium     { background: #ede9fe; color: #7c3aed; }
.band-badge-small      { background: var(--grey-100); color: var(--grey-600); }
.band-badge-independent{ background: var(--grey-50); color: var(--grey-400); border: 1px solid var(--grey-200); }

/* ── Nation badges ─────────────────────────────────────────── */
.nation-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.nation-eng { background: #dbeafe; color: #1d4ed8; }
.nation-sco { background: #e0f2fe; color: #0369a1; }
.nation-wal { background: #d1fae5; color: #059669; }
.nation-ni  { background: #fef3c7; color: #d97706; }

/* ── Volume bar ────────────────────────────────────────────── */
.vol-bar-wrap { display: flex; align-items: center; gap: 8px; }
.vol-bar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #7c3aed, #a78bfa); flex-shrink: 0; }
.vol-num { font-size: 12px; font-weight: 700; color: #2e1760; white-space: nowrap; }

/* ── County bar list ───────────────────────────────────────── */
.county-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-100);
  cursor: pointer;
}
.county-row:last-child { border-bottom: none; }
.county-row:hover .county-name { color: var(--blue); }
.county-name { font-size: 13px; font-weight: 500; width: 180px; flex-shrink: 0; }
.county-bar-wrap { flex: 1; height: 6px; background: var(--grey-100); border-radius: 3px; }
.county-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--blue), #7c3aed); }
.county-count { font-size: 12px; font-weight: 700; color: #2e1760; width: 40px; text-align: right; }

/* ── Pharmacy search results ───────────────────────────────── */
.pharm-result {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}
.pharm-result:hover { border-color: #c4b5fd; box-shadow: var(--shadow-md); text-decoration: none; }
.pharm-icon { width: 38px; height: 38px; background: #ede9fe; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.pharm-name { font-size: 14px; font-weight: 700; }
.pharm-addr { font-size: 12px; color: var(--grey-600); margin-top: 2px; }
.pharm-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.pharm-right { margin-left: auto; text-align: right; flex-shrink: 0; }
.pharm-company { font-size: 12px; font-weight: 600; color: #7c3aed; }
.pharm-items { font-size: 20px; font-weight: 800; color: #2e1760; }
.pharm-items-label { font-size: 10px; color: var(--grey-400); }

/* ── Settings page ─────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--grey-100);
}
.settings-row:last-child { border-bottom: none; }
.settings-band-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--grey-50); flex-shrink: 0; }
.settings-band-info { flex: 1; }
.settings-band-name { font-size: 14px; font-weight: 700; }
.settings-band-desc { font-size: 12px; color: var(--grey-600); }
.threshold-wrap { display: flex; align-items: center; gap: 6px; }
.threshold-input { width: 80px; padding: 6px 10px; border: 1.5px solid var(--grey-200); border-radius: var(--radius); font-size: 14px; font-weight: 700; color: #2e1760; text-align: center; }
.threshold-input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.threshold-input:disabled { background: var(--grey-50); color: var(--grey-400); }
.threshold-label { font-size: 12px; color: var(--grey-400); }
.settings-count { font-size: 12px; color: var(--grey-600); margin-left: 20px; white-space: nowrap; }
.settings-count strong { color: #2e1760; }

/* ── Profile header (company detail) ───────────────────────── */
.profile-header {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.profile-icon { width: 56px; height: 56px; background: #ede9fe; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.profile-name { font-size: 22px; font-weight: 800; color: var(--grey-800); }
.profile-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--grey-600); }
.profile-stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.profile-stat { text-align: center; padding: 10px; background: var(--grey-50); border-radius: var(--radius); }
.profile-stat-num { font-size: 20px; font-weight: 800; color: #2e1760; }
.profile-stat-label { font-size: 11px; color: var(--grey-400); margin-top: 2px; }

/* ── Sortable table headers ─────────────────────────────────── */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { background: #3d1f7d; }
th[data-sort] .sort-icon { opacity: 0.4; margin-left: 4px; font-size: 10px; }
th[data-sort].sorted-asc .sort-icon::after  { content: ' ▲'; opacity: 1; }
th[data-sort].sorted-desc .sort-icon::after { content: ' ▼'; opacity: 1; }

/* ── Filter row ─────────────────────────────────────────────── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-chip {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--grey-200);
  background: var(--white);
  color: var(--grey-600);
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.filter-chip:hover  { border-color: #7c3aed; color: #7c3aed; text-decoration: none; }
.filter-chip.active { border-color: #7c3aed; background: #ede9fe; color: #7c3aed; }
.filter-divider { width: 1px; height: 20px; background: var(--grey-200); }
.filter-label { font-size: 12px; color: var(--grey-600); font-weight: 500; white-space: nowrap; }

/* ── Mono cell ──────────────────────────────────────────────── */
.mono { font-family: 'Courier New', monospace; font-size: 12px; color: var(--grey-600); }

/* ── Disp KPI row ───────────────────────────────────────────── */
.dispensing-kpi-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.kpi-card { background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 14px 18px; flex: 1; min-width: 140px; }
.kpi-label { font-size: 11px; color: var(--grey-600); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.kpi-value { font-size: 22px; font-weight: 700; color: var(--grey-800); }
.kpi-sub   { font-size: 11px; color: var(--grey-400); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════
   v2 additions — additional helper classes
════════════════════════════════════════════════════════════ */

/* ── Button aliases (single-dash convention) ────────────────── */
.btn-primary   { background: #2E1760; color: #fff; border: none; }
.btn-primary:hover { background: #3d1f7d; text-decoration: none; color: #fff; }
.btn-secondary { background: #F3F4F6; color: #374151; border: 1.5px solid #E5E7EB; }
.btn-secondary:hover { background: #E5E7EB; text-decoration: none; color: #374151; }
.btn-small { padding: 5px 12px; font-size: 12px; }

/* ── Back link ──────────────────────────────────────────────── */
.back-link { font-size: 13px; color: #7C3AED; font-weight: 500; display: inline-block; margin-bottom: 12px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ── Section label ──────────────────────────────────────────── */
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #6B7280; margin-bottom: 10px; }

/* ── Panel grid (company detail) ────────────────────────────── */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.panel.full { grid-column: 1 / -1; }
.panel-title { font-size: 13px; font-weight: 700; color: #1a1a2e; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.view-all { font-size: 11px; font-weight: 500; color: #7C3AED; cursor: pointer; }

/* ── Dispensing KPI row ─────────────────────────────────────── */
.disp-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.disp-kpi { background: #F9FAFB; border-radius: 10px; padding: 14px 16px; border: 1.5px solid #F3F4F6; }
.disp-kpi-val { font-size: 22px; font-weight: 800; color: #2E1760; }
.disp-kpi-label { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

/* ── Mini signal list ───────────────────────────────────────── */
.mini-signal { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F3F4F6; }
.mini-signal:last-child { border-bottom: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.dot-high { background: #EF4444; }
.dot-med  { background: #F59E0B; }
.dot-low  { background: #A78BFA; }
.dot-medium { background: #F59E0B; }
.mini-sig-text { font-size: 12px; color: #374151; flex: 1; line-height: 1.4; }
.mini-sig-date { font-size: 11px; color: #9CA3AF; white-space: nowrap; }

/* ── Companies House detail rows ────────────────────────────── */
.ch-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #F3F4F6; font-size: 12px; }
.ch-row:last-child { border-bottom: none; }
.ch-key { color: #6B7280; }
.ch-val { color: #1a1a2e; font-weight: 600; text-align: right; }

/* ── Settings card wrapper ──────────────────────────────────── */
.settings-card { background: #fff; border-radius: 12px; padding: 0 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 16px; }

/* ── Profile stats (alias) ──────────────────────────────────── */
.profile-stats { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-top: 14px; }

/* ── Status dot ─────────────────────────────────────────────── */
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-dot.active::before   { background: #10B981; }
.status-dot.inactive::before { background: #D1D5DB; }
.status-dot.unknown::before  { background: #F59E0B; }

/* ── Empty table cell ───────────────────────────────────────── */
.empty { text-align: center; padding: 28px; color: #9CA3AF; font-size: 13px; }

/* ── Badge aliases for country/status ──────────────────────── */
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-eng    { background: #DBEAFE; color: #1D4ED8; }
.badge-sco    { background: #E0F2FE; color: #0369A1; }
.badge-wal    { background: #D1FAE5; color: #059669; }
.badge-ni     { background: #FEF3C7; color: #D97706; }
.badge-active { background: #D1FAE5; color: #059669; }
.badge-closed { background: #FEE2E2; color: #DC2626; }

/* ── Tab bar (v2 style) ─────────────────────────────────────── */
.tab-bar { display: flex; gap: 2px; background: #fff; border-radius: 12px; padding: 6px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); width: fit-content; }
.tab { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; color: #6B7280; cursor: pointer; transition: all 0.15s; }
.tab:hover { background: #F3F4F6; color: #1a1a2e; }
.tab.active { background: #2E1760; color: #fff; }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; }

/* ── Individuals — role badges ──────────────────────────────── */
.role-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-right: 3px; }
.role-director  { background: #e0e7ff; color: #3730a3; }
.role-psc       { background: #fef3c7; color: #92400e; }
.role-secretary { background: #f3f4f6; color: #4b5563; }

/* ── Individuals — company count pills ─────────────────────── */
.company-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; font-weight: 700; }
.count-multi { background: #fde8e8; color: #c81e1e; }
.count-two   { background: #fef3c7; color: #c27803; }
.count-one   { background: #f3f4f6; color: #6b7280; }
