:root {
  --q-bg: #f5f5f3;
  --q-panel: #ffffff;
  --q-sidebar: #f0f0ee;
  --q-ink: #17191c;
  --q-muted: #6f7378;
  --q-soft: #f2f3f3;
  --q-line: #e1e3e3;
  --q-blue: #2c6fd4;
  --q-blue-soft: #eaf2ff;
  --q-green: #167a50;
  --q-green-soft: #e8f5ee;
  --q-amber: #9b6415;
  --q-amber-soft: #fff2d9;
  --q-red: #b94141;
  --q-red-soft: #fdeaea;
  --q-radius: 14px;
  --q-shadow: 0 4px 18px rgba(17, 22, 28, .05);
}

* { box-sizing: border-box; }

body {
  color: var(--q-ink);
  background: var(--q-bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.hidden { display: none !important; }

/* Qonto-inspired refresh for the existing executive dashboard. */
.sidebar {
  width: 224px !important;
  background: var(--q-sidebar) !important;
  color: var(--q-ink) !important;
  border-right: 1px solid var(--q-line) !important;
  box-shadow: none !important;
}

.main { margin-left: 224px !important; background: var(--q-bg) !important; }
.app-shell .main { margin-left: 0 !important; }
.sidebar-head { border-bottom-color: var(--q-line) !important; }
.brand-logo-box { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.brand-logo-box img { filter: none !important; }
.brand-product, .workspace-label, .user-role { color: var(--q-muted) !important; }
.workspace { background: transparent !important; border-color: var(--q-line) !important; }
.workspace-name, .user-name { color: var(--q-ink) !important; }
.nav-section { color: #919599 !important; letter-spacing: .08em !important; }
.nav-btn {
  color: #4f5358 !important;
  border-radius: 9px !important;
  text-decoration: none;
}
.nav-btn:hover { background: #e7e7e4 !important; color: var(--q-ink) !important; }
.nav-btn.active {
  color: var(--q-ink) !important;
  background: #dededb !important;
  box-shadow: none !important;
}
.nav-icon { color: #777b7f !important; }
.nav-badge { background: #fff !important; color: #565a5f !important; border: 1px solid #d5d7d7; }
.sidebar-foot { border-top-color: var(--q-line) !important; }
.user-chip { background: rgba(255,255,255,.72) !important; border: 1px solid var(--q-line) !important; }
.avatar { background: var(--q-ink) !important; color: #fff !important; box-shadow: none !important; }
.logout { color: var(--q-muted) !important; }

.topbar {
  min-height: 67px !important;
  background: rgba(255,255,255,.95) !important;
  border-bottom-color: var(--q-line) !important;
  box-shadow: none !important;
}
.sync-pill, .top-control, .top-btn, .period-note {
  background: #fff !important;
  border-color: var(--q-line) !important;
  box-shadow: none !important;
}
.top-btn.accent {
  background: var(--q-ink) !important;
  border-color: var(--q-ink) !important;
  color: #fff !important;
  border-radius: 999px !important;
}
.content { max-width: 1540px !important; padding: 30px 32px 52px !important; }
.page-title h1 { letter-spacing: -.035em !important; }
.page-title p { color: var(--q-muted) !important; }
.eyebrow { color: var(--q-green) !important; }
.demo-strip {
  background: #fff !important;
  border: 1px solid var(--q-line) !important;
  color: var(--q-muted) !important;
  box-shadow: none !important;
}

.kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 14px !important; }
.kpi, .card, .exec-card {
  background: #fff !important;
  color: var(--q-ink) !important;
  border: 1px solid var(--q-line) !important;
  box-shadow: none !important;
  border-radius: var(--q-radius) !important;
}
.kpi:hover, .card.clickable:hover {
  border-color: #c8cbcc !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--q-shadow) !important;
}
.kpi::after, .exec-card::after { display: none !important; }
.kpi-label, .kpi-foot, .card-sub, .exec-card .eyebrow { color: var(--q-muted) !important; }
.kpi-value, .card h3, .exec-card h2, .exec-card .card-title, .exec-card .brief-main,
.exec-card .brief-stat b, .brief-list, .brief-list li, .brief-list strong { color: var(--q-ink) !important; }
.exec-card .brief-stat { border-color: var(--q-line) !important; background: var(--q-soft) !important; }
.exec-card .brief-stat span { color: var(--q-muted) !important; }
.exec-card .ai-tag { color: var(--q-green) !important; background: var(--q-green-soft) !important; border-color: #c9e7d9 !important; }
.kpi-detail-hint { color: var(--q-blue) !important; }
.exec-stat { background: var(--q-soft) !important; border-color: var(--q-line) !important; }
.exec-stat strong { color: var(--q-ink) !important; }
.brief-list li::before { color: var(--q-green) !important; }
.status.bad, .delta.down { color: var(--q-red) !important; }
.status.good, .delta.up { color: var(--q-green) !important; }
.drawer, .metric-modal { border-color: var(--q-line) !important; box-shadow: -18px 0 50px rgba(17,22,28,.12) !important; }

.dashboard-shortcuts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 20px;
}
.dashboard-shortcuts a, .dashboard-shortcuts button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  color: var(--q-ink);
  background: #fff;
  border: 1px solid #cfd2d3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.dashboard-shortcuts a:first-child {
  color: #fff;
  background: var(--q-ink);
  border-color: var(--q-ink);
}
.dashboard-shortcuts a:hover, .dashboard-shortcuts button:hover { transform: translateY(-1px); }

/* Harmonisation de la vue prévisionnelle historique. */
.forecast-page .shell { grid-template-columns: 224px minmax(0,1fr); }
.forecast-page .main { margin-left: 0 !important; }
.forecast-page .brand img { filter: none; }
.forecast-page .brand small, .forecast-page .user span { color: var(--q-muted); }
.forecast-page .nav-label { color: #989b9e; }
.forecast-page .nav a { color: #4f5358; }
.forecast-page .nav a:hover, .forecast-page .nav a.active { color: var(--q-ink); background: #dededb; }
.forecast-page .nav-icon { color: #686c70; background: rgba(255,255,255,.62); border: 1px solid #dadcdd; }
.forecast-page .side-foot { border-top-color: var(--q-line); }
.forecast-page .logout { color: var(--q-muted); border-color: var(--q-line); }
.forecast-page .pagehead h1 { color: var(--q-ink); }
.forecast-page .notice { color: #71531e; background: var(--q-amber-soft); border-color: #ebd6af; }

/* Harmonisation de l’administration historique. */
.admin-page .shell { grid-template-columns: 224px minmax(0,1fr); }
.admin-page .side { width: 224px; padding: 22px 16px 16px; color: var(--q-ink); background: var(--q-sidebar); border-right: 1px solid var(--q-line); }
.admin-page .logo { width: 148px; margin: 0 8px; filter: none; }
.admin-page .side-kicker { margin: 24px 10px 7px; color: #989b9e; }
.admin-page .side-kicker.admin-section { margin-top: 18px; }
.admin-page .side-link { margin: 2px 0; min-height: 39px; padding: 9px 11px; color: #4f5358; border-radius: 9px; font-size: 11px; font-weight: 700; }
.admin-page .side-link:hover, .admin-page .side-link.active { color: var(--q-ink); background: #dededb; }
.admin-page .side-foot { right: 16px; bottom: 16px; left: 16px; color: var(--q-ink); background: rgba(255,255,255,.68); border-color: var(--q-line); }
.admin-page .side-foot span { color: var(--q-muted); }
.admin-page .metric, .admin-page .panel { box-shadow: none; border-radius: var(--q-radius); }
.admin-page .btn { min-height: 38px; color: #fff; background: var(--q-ink); border: 1px solid var(--q-ink); border-radius: 999px; }
.admin-page .btn.secondary { color: var(--q-ink); background: #fff; border-color: #cfd2d3; }
.admin-page .connector { background: #fff; }

/* Shared application shell for the new management pages. */
.portal-body { margin: 0; min-height: 100vh; background: var(--q-bg); }
.portal-shell { min-height: 100vh; }
.portal-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 224px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--q-sidebar);
  border-right: 1px solid var(--q-line);
}
.portal-brand { padding: 0 8px 19px; border-bottom: 1px solid var(--q-line); }
.portal-brand img { width: 148px; height: auto; display: block; }
.portal-brand small { display: block; margin-top: 8px; color: var(--q-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.portal-workspace { margin: 15px 8px 8px; }
.portal-workspace span { color: #8b8f93; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.portal-workspace strong { display: block; margin-top: 5px; font-size: 12px; }
.portal-nav { min-height: 0; display: grid; flex: 1 1 auto; align-content: start; gap: 4px; margin-top: 14px; overflow-y: auto; overscroll-behavior: contain; }
.portal-nav:not(.shell-ready) { visibility: hidden; }
.portal-nav-label { margin: 16px 10px 6px; color: #989b9e; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.portal-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 41px;
  padding: 9px 11px;
  color: #4f5358;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.portal-nav a:hover { color: var(--q-ink); background: #e7e7e4; }
.portal-nav a.active { color: var(--q-ink); background: #dededb; }
.nav-glyph {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #686c70;
  background: rgba(255,255,255,.62);
  border: 1px solid #dadcdd;
  border-radius: 7px;
  font-size: 11px;
}
.portal-user {
  margin-top: auto;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,.68);
  border: 1px solid var(--q-line);
  border-radius: 11px;
}
.portal-account-name { text-decoration: none; }
.portal-account-name:hover strong { text-decoration: underline; }
.portal-user-actions { display: flex; align-items: center; gap: 2px; }
.portal-user-actions a, .portal-user-actions button { width: 26px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--q-muted); background: transparent; text-decoration: none; cursor: pointer; }
.portal-user-actions a:hover, .portal-user-actions button:hover { color: var(--q-ink); background: #fff; }
.portal-user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--q-ink);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.portal-user strong, .portal-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-user strong { font-size: 11px; }
.portal-user small { margin-top: 2px; color: var(--q-muted); font-size: 9px; }
.portal-user button { border: 0; background: transparent; color: var(--q-muted); cursor: pointer; }

.sidebar > .nav { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.sidebar-head, .workspace, .sidebar-foot, .portal-brand, .portal-workspace, .portal-user { flex: 0 0 auto; }

.portal-main { min-height: 100vh; margin-left: 224px; }
.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 30px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--q-line);
  backdrop-filter: blur(12px);
}
.portal-menu-btn { display: none; }
.portal-search {
  flex: 1;
  max-width: 580px;
  position: relative;
}
.portal-search::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-54%);
  color: #777b80;
  font-size: 21px;
}
.portal-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 14px 9px 43px;
  background: #f5f5f4;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
}
.portal-search input:focus { background: #fff; border-color: #aeb3b7; box-shadow: 0 0 0 3px rgba(44,111,212,.09); }
.topbar-spacer { flex: 1; }
.data-freshness {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--q-muted);
  font-size: 10px;
  white-space: nowrap;
}
.fresh-dot { width: 7px; height: 7px; border-radius: 50%; background: #3da874; box-shadow: 0 0 0 3px #dff2e7; }

.portal-content { max-width: 1560px; margin: 0 auto; padding: 34px 34px 64px; }
.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-intro-eyebrow { color: var(--q-green); font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.page-intro h1 { margin: 7px 0 7px; font-size: clamp(27px,3vw,40px); line-height: 1; letter-spacing: -.045em; }
.page-intro p { max-width: 690px; margin: 0; color: var(--q-muted); font-size: 13px; line-height: 1.55; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  color: var(--q-ink);
  background: #fff;
  border: 1px solid #cfd2d3;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: #aeb2b4; transform: translateY(-1px); }
.btn.primary { color: #fff; background: var(--q-ink); border-color: var(--q-ink); }
.btn.soft { background: var(--q-soft); border-color: transparent; }
.btn.blue { color: #145fc6; background: var(--q-blue-soft); border-color: #cfe0fb; }
.btn.danger { color: var(--q-red); background: var(--q-red-soft); border-color: #f4cdcd; }
.btn.square { width: 39px; padding: 0; border-radius: 10px; }
.btn:disabled { opacity: .48; pointer-events: none; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.stat-card {
  min-height: 122px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--q-line);
  border-radius: var(--q-radius);
}
.stat-label { color: var(--q-muted); font-size: 10px; font-weight: 700; }
.stat-value { margin-top: 15px; font-size: clamp(21px,2vw,29px); font-weight: 780; letter-spacing: -.04em; }
.stat-meta { margin-top: 7px; color: var(--q-muted); font-size: 10px; line-height: 1.4; }
.stat-meta.good { color: var(--q-green); }
.stat-meta.warn { color: var(--q-amber); }

.panel {
  background: #fff;
  border: 1px solid var(--q-line);
  border-radius: var(--q-radius);
}
.panel-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--q-line);
}
.panel-title { font-size: 14px; font-weight: 780; }
.panel-subtitle { margin-top: 3px; color: var(--q-muted); font-size: 10px; }
.panel-body { padding: 18px; }
.panel-empty { padding: 52px 20px; color: var(--q-muted); text-align: center; }

.filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--q-line);
  border-radius: var(--q-radius);
  margin-bottom: 13px;
}
.filterbar input, .filterbar select, .form-control {
  min-height: 38px;
  padding: 8px 11px;
  color: var(--q-ink);
  background: #fff;
  border: 1px solid #d6d9da;
  border-radius: 9px;
  outline: none;
}
.filterbar input:focus, .filterbar select:focus, .form-control:focus { border-color: #8d9397; box-shadow: 0 0 0 3px rgba(44,111,212,.08); }
.filterbar .grow { flex: 1; min-width: 220px; }
.filter-count { margin-left: auto; color: var(--q-muted); font-size: 10px; }
.filter-title { color: var(--q-ink); font-size: 11px; font-weight: 750; }

.management-note { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 13px; margin-bottom: 18px; padding: 14px 16px; background: #eef5ff; border: 1px solid #d6e4f7; border-radius: var(--q-radius); }
.management-note-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #255fa9; background: #fff; border-radius: 9px; font-weight: 850; }
.management-note strong { display: block; font-size: 11px; }
.management-note p { margin: 4px 0 0; color: #586676; font-size: 10px; line-height: 1.45; }
.source-pill { padding: 6px 9px; color: var(--q-green); background: var(--q-green-soft); border-radius: 999px; font-size: 9px; font-weight: 750; }
.customer-avatar { background: #2d5f91; }
.share-cell { min-width: 105px; }
.share-cell span { display: block; margin-bottom: 5px; font-size: 9px; font-weight: 750; }
.share-cell i { display: block; width: 100%; height: 5px; overflow: hidden; background: #e8e9e9; border-radius: 999px; }
.share-cell b { display: block; height: 100%; background: var(--q-blue); border-radius: inherit; }
.source-link { color: var(--q-green); font-size: 10px; font-weight: 750; text-decoration: none; }
.method-copy { margin: 0; color: #4f575f; font-size: 12px; line-height: 1.6; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.method-grid > div { padding: 13px; background: var(--q-soft); border: 1px solid var(--q-line); border-radius: 10px; }
.method-grid span, .method-grid strong { display: block; }
.method-grid span { color: var(--q-muted); font-size: 9px; }
.method-grid strong { margin-top: 6px; font-size: 10px; line-height: 1.4; }
.contract-avatar { color: #6b4d20; background: #f0d9ab; }
.contract-note { background: #fff8ea; border-color: #ecd9b5; }
.contract-note .management-note-icon { color: var(--q-amber); }
.document-roadmap { grid-template-columns: 34px minmax(0,1fr); margin-top: 18px; margin-bottom: 0; }
.contract-modal { width: min(720px,100%); }
.checkbox-field { display: flex; align-items: center; padding-top: 22px; }
.checkbox-field label { display: flex; align-items: center; gap: 8px; color: var(--q-ink); text-transform: none; }
.checkbox-field input { width: 17px; height: 17px; margin: 0; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 11px 13px;
  color: #7a7e82;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .075em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--q-line);
  white-space: nowrap;
}
.data-table td {
  padding: 13px;
  font-size: 11px;
  border-bottom: 1px solid #eceeed;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr.interactive { cursor: pointer; }
.data-table tbody tr.interactive:hover { background: #f8f8f7; }
.data-table .amount { font-weight: 760; text-align: right; white-space: nowrap; }
.entity-cell { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.entity-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #182234;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 850;
}
.entity-cell strong, .entity-cell small { display: block; }
.entity-cell strong { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.entity-cell small { margin-top: 3px; color: var(--q-muted); font-size: 9px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 5px 8px;
  color: #55595e;
  background: #f0f1f1;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; background: var(--chip-color,#8e9498); border-radius: 50%; }
.chip.good { color: var(--q-green); background: var(--q-green-soft); --chip-color: var(--q-green); }
.chip.warn { color: var(--q-amber); background: var(--q-amber-soft); --chip-color: #d89a38; }
.chip.risk { color: var(--q-red); background: var(--q-red-soft); --chip-color: var(--q-red); }
.chip.blue { color: #245eaf; background: var(--q-blue-soft); --chip-color: var(--q-blue); }
.suggestion-cell { min-width: 190px; }
.suggestion-card-inline { display: flex; align-items: center; gap: 7px; }
.mini-action {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--q-ink);
  background: #fff;
  border: 1px solid #d6d8d9;
  border-radius: 8px;
  cursor: pointer;
}
.mini-action.accept { color: var(--q-green); }
.mini-action.reject { color: var(--q-red); }

.bulkbar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 13px;
  color: #fff;
  background: var(--q-ink);
  border-radius: 11px;
}
.bulkbar.visible { display: flex; }
.bulkbar span { font-size: 11px; font-weight: 700; }
.bulkbar .btn { min-height: 32px; }
.bulkbar .btn:first-of-type { margin-left: auto; }

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #efefed;
  border-radius: 10px;
}
.segmented button {
  min-height: 32px;
  padding: 7px 13px;
  color: var(--q-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.segmented button.active { color: var(--q-ink); background: #fff; box-shadow: 0 1px 5px rgba(20,25,30,.08); }
.sales-period-controls { width: 100%; display: flex; align-items: end; justify-content: flex-end; gap: 8px; }
.sales-period-controls label { display: grid; gap: 4px; color: var(--q-muted); font-size: 9px; font-weight: 750; }
.sales-period-controls .form-control { min-width: 142px; }
.sales-period-help { align-self: center; max-width: 180px; color: var(--q-muted); font-size: 9px; line-height: 1.35; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  opacity: 0;
  background: rgba(21,26,32,.48);
  backdrop-filter: blur(2px);
  transition: opacity .2s ease, visibility .2s ease;
}
.backdrop.open { visibility: visible; opacity: 1; }
.side-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 90;
  width: min(780px,100vw);
  overflow-y: auto;
  transform: translateX(102%);
  background: #fff;
  border-left: 1px solid var(--q-line);
  box-shadow: -24px 0 60px rgba(17,22,28,.16);
  transition: transform .24s ease;
}
.side-drawer.open { transform: translateX(0); }
.drawer-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--q-line);
  backdrop-filter: blur(12px);
}
.drawer-kicker { font-size: 10px; font-weight: 800; }
.drawer-content { padding: 22px; }
.supplier-hero { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.supplier-hero .entity-avatar { width: 54px; height: 54px; flex-basis: 54px; border-radius: 14px; font-size: 15px; }
.supplier-hero h2 { margin: 3px 0 5px; font-size: 25px; letter-spacing: -.035em; }
.supplier-hero p { margin: 0; color: var(--q-muted); font-size: 10px; }
.drawer-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin-bottom: 18px; }
.drawer-stat { padding: 13px; background: #f5f6f6; border: 1px solid var(--q-line); border-radius: 11px; }
.drawer-stat span, .drawer-stat strong { display: block; }
.drawer-stat span { color: var(--q-muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.drawer-stat strong { margin-top: 9px; font-size: 15px; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.detail-card { padding: 16px; border: 1px solid var(--q-line); border-radius: 12px; }
.detail-card.full { grid-column: 1 / -1; }
.detail-card h3 { margin: 0 0 13px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; border-bottom: 1px solid #eceeed; font-size: 10px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--q-muted); }
.detail-row strong { max-width: 60%; text-align: right; }
.drawer-tabs { display: flex; gap: 3px; margin: 20px 0 12px; padding: 4px; background: #f0f1f1; border-radius: 10px; }
.drawer-tabs button { flex: 1; min-height: 36px; color: var(--q-muted); background: transparent; border: 0; border-radius: 8px; font-size: 10px; font-weight: 750; cursor: pointer; }
.drawer-tabs button.active { color: var(--q-ink); background: #fff; box-shadow: 0 1px 5px rgba(20,25,30,.08); }
.drawer-tab { display: none; }
.drawer-tab.active { display: block; }

.suggestion-panel {
  padding: 15px;
  background: linear-gradient(145deg,#eff6ff,#f7faff);
  border: 1px solid #d4e3fb;
  border-radius: 12px;
}
.suggestion-panel-head { display: flex; justify-content: space-between; gap: 14px; }
.suggestion-panel h3 { margin: 0; font-size: 12px; }
.suggestion-panel p { margin: 8px 0 0; color: #5d6670; font-size: 10px; line-height: 1.5; }
.suggestion-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.suggestion-actions label { margin-left: auto; color: #52575d; font-size: 9px; }

.registry-results { display: grid; gap: 8px; margin-top: 12px; }
.registry-result {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--q-line);
  border-radius: 10px;
  cursor: pointer;
}
.registry-result:hover { border-color: #aab0b4; }
.registry-result strong, .registry-result small { display: block; }
.registry-result small { margin-top: 4px; color: var(--q-muted); font-size: 9px; line-height: 1.45; }
.registry-result em { align-self: center; color: var(--q-blue); font-size: 10px; font-style: normal; font-weight: 800; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #666b70; font-size: 9px; font-weight: 750; }
.form-field textarea { min-height: 92px; resize: vertical; }

.category-groups { display: grid; gap: 12px; }
.category-group { overflow: hidden; background: #fff; border: 1px solid var(--q-line); border-radius: 12px; }
.category-parent {
  min-height: 58px;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) repeat(3,minmax(72px,auto));
  align-items: center;
  gap: 13px;
  padding: 10px 14px;
  background: #fbfbfa;
  border-bottom: 1px solid var(--q-line);
}
.category-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; font-size: 13px; }
.category-parent strong { font-size: 12px; }
.category-metric { color: var(--q-muted); font-size: 9px; text-align: right; }
.category-metric b { display: block; margin-bottom: 3px; color: var(--q-ink); font-size: 11px; }
.category-child {
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) repeat(3,minmax(72px,auto));
  align-items: center;
  gap: 13px;
  padding: 9px 14px 9px 28px;
  border-bottom: 1px solid #eceeed;
}
.category-child:last-child { border-bottom: 0; }
.category-dot { width: 7px; height: 7px; border-radius: 50%; }
.category-child strong { font-size: 10px; }

.forecast-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(300px,.7fr); gap: 14px; margin-bottom: 14px; }
.chart-card { min-height: 350px; padding: 18px; background: #fff; border: 1px solid var(--q-line); border-radius: var(--q-radius); }
.chart-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.chart-head h2 { margin: 0; font-size: 14px; }
.chart-head p { margin: 4px 0 0; color: var(--q-muted); font-size: 9px; }
.cash-chart { width: 100%; height: 250px; display: block; }
.upcoming-card { padding: 18px; background: #fff; border: 1px solid var(--q-line); border-radius: var(--q-radius); }
.upcoming-card h2 { margin: 0 0 14px; font-size: 14px; }
.upcoming-list { display: grid; gap: 2px; }
.upcoming-item { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eceeed; }
.upcoming-date { width: 36px; padding: 5px 2px; color: #555b60; background: #f1f2f2; border-radius: 8px; font-size: 8px; font-weight: 800; text-align: center; text-transform: uppercase; }
.upcoming-item strong, .upcoming-item small { display: block; }
.upcoming-item strong { font-size: 10px; }
.upcoming-item small { margin-top: 3px; color: var(--q-muted); font-size: 8px; }
.upcoming-amount { font-size: 10px; font-weight: 800; white-space: nowrap; }
.upcoming-amount.credit { color: var(--q-green); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(21,26,32,.5);
}
.modal-backdrop.open { display: grid; }
.modal {
  width: min(560px,100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(17,22,28,.22);
}
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.modal-head { border-bottom: 1px solid var(--q-line); }
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; }
.modal-foot { border-top: 1px solid var(--q-line); justify-content: flex-end; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 150; display: grid; gap: 8px; }
.app-toast { max-width: 360px; padding: 12px 15px; color: #fff; background: #202327; border-radius: 10px; box-shadow: 0 10px 30px rgba(17,22,28,.18); font-size: 10px; line-height: 1.45; animation: toast-in .18s ease both; }
.app-toast.error { background: #9d3535; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.skeleton { position: relative; overflow: hidden; color: transparent !important; background: #eceeed !important; border-radius: 7px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent); animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .forecast-layout { grid-template-columns: 1fr; }
  .portal-topbar { padding-inline: 20px; }
  .portal-content { padding-inline: 22px; }
}

@media (max-width: 760px) {
  .sidebar { transform: translateX(-105%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .content { padding: 22px 13px 40px !important; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .dashboard-shortcuts { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .dashboard-shortcuts a { white-space: nowrap; }
  .portal-sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(17,22,28,.15); }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-main { margin-left: 0; }
  .portal-menu-btn { width: 38px; height: 38px; display: grid; place-items: center; background: #fff; border: 1px solid var(--q-line); border-radius: 9px; }
  .portal-topbar { padding: 10px 13px; }
  .portal-search { max-width: none; }
  .data-freshness { display: none; }
  .portal-content { padding: 24px 13px 48px; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 108px; padding: 14px; }
  .drawer-stats { grid-template-columns: 1fr 1fr; }
  .drawer-grid, .form-grid { grid-template-columns: 1fr; }
  .form-field.full, .detail-card.full { grid-column: auto; }
  .category-parent, .category-child { grid-template-columns: 30px minmax(0,1fr) auto; }
  .category-parent .category-metric:nth-of-type(2), .category-parent .category-metric:nth-of-type(3),
  .category-child .category-metric:nth-of-type(2), .category-child .category-metric:nth-of-type(3) { display: none; }
  .filterbar select { max-width: calc(50% - 6px); }
  .management-note { grid-template-columns: 34px minmax(0,1fr); }
  .management-note .btn { grid-column: 1 / -1; }
  .method-grid { grid-template-columns: 1fr; }
  .forecast-page .shell { grid-template-columns: 1fr; }
  .forecast-page .sidebar { left: 0; }
  .admin-page .shell { grid-template-columns: 1fr; }
  .admin-page .side { width: 100%; height: auto; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 96px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .sales-period-controls { align-items: stretch; flex-direction: column; }
  .sales-period-controls .form-control { width: 100%; }
  .drawer-content { padding: 16px 13px; }
  .drawer-toolbar { padding-inline: 13px; }
  .supplier-hero h2 { font-size: 21px; }
}

.read-only #syncBtn,
.read-only #newSupplierBtn,
.read-only #editSupplierBtn,
.read-only .mini-action,
.read-only .suggestion-actions { display: none !important; }
.read-only .registry-result { pointer-events: none; }
.read-only .registry-result em { display: none; }
.decision-note { color: var(--muted); font-size: 10px; }

/* Ventes, imports et rapprochement */
.sales-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.sales-commercial-tools { margin-bottom: 18px; }
.sales-quick-filters { display: flex; gap: 8px; padding: 16px 18px 8px; overflow-x: auto; }
.sales-quick-filters .btn { flex: 0 0 auto; }
.sales-quick-filters .btn.active { color: #fff; background: var(--q-ink); border-color: var(--q-ink); }
.sales-filter-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 8px 18px 18px; }
.sales-filter-grid label { display: grid; gap: 7px; color: var(--q-muted); font-size: 9px; font-weight: 750; }
.sales-search-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 16px; border-top: 1px solid var(--q-line); }
.sales-search-results article { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 70px; padding: 12px; background: #fafaf8; border: 1px solid var(--q-line); border-radius: 11px; }
.sales-search-results article > span:first-child { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; color: #245f87; background: #e0eff9; border-radius: 999px; font-size: 8px; font-weight: 800; }
.sales-search-results strong, .sales-search-results small { display: block; }
.sales-search-results small { margin-top: 4px; color: var(--q-muted); font-size: 8px; line-height: 1.4; }
.sales-search-results b { color: var(--q-ink); font-size: 11px; white-space: nowrap; }
.prescriber-stats { grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 18px; }
.prescriber-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.45fr); gap: 16px; margin-top: 18px; }
.prescriber-layout > .panel, .sales-two-columns > .panel { min-width: 0; }
.prescriber-layout .data-table-wrap, .sales-two-columns .data-table-wrap { max-width: 100%; }
.prescriber-table { min-width: 1120px; }
.mobile-partner-type { display: none; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.prescriber-suggestion { display: grid; gap: 4px; min-width: 165px; max-width: 220px; padding: 9px; background: #f7f7f5; border: 1px solid var(--q-line); border-radius: 10px; }
.prescriber-suggestion small { color: #176a47; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.prescriber-suggestion strong { color: var(--q-ink); font-size: 10px; }
.prescriber-suggestion span { color: var(--q-muted); font-size: 8px; line-height: 1.35; }
.prescriber-suggestion .btn { min-height: 28px; margin-top: 3px; padding: 5px 9px; font-size: 8px; }
.qualification-complete { color: #176a47; font-size: 9px; font-weight: 800; }
.qualification-pending { color: var(--q-muted); font-size: 8px; line-height: 1.4; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 10px 16px; border-top: 1px solid var(--q-line); }
.table-pagination > span { color: var(--q-muted); font-size: 9px; }
.table-pagination > div { display: flex; align-items: center; gap: 8px; }
.table-pagination label { display: flex; align-items: center; gap: 7px; color: var(--q-muted); font-size: 9px; }
.table-pagination select { min-height: 34px; padding: 5px 26px 5px 9px; }
.table-pagination strong { min-width: 48px; color: var(--q-ink); font-size: 9px; text-align: center; }
.table-pagination .btn:disabled { opacity: .35; cursor: default; }
.channel-list { display: grid; }
.channel-list > div:not(.panel-empty) { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 12px 16px; border-top: 1px solid var(--q-line); }
.channel-list span, .channel-list strong, .channel-list small { display: block; }
.channel-list strong { color: var(--q-ink); font-size: 10px; }
.channel-list small { margin-top: 4px; color: var(--q-muted); font-size: 8px; }
.channel-list b { color: var(--q-ink); font-size: 12px; white-space: nowrap; }
.channel-analysis-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 12px 16px; color: inherit; background: transparent; border: 0; border-top: 1px solid var(--q-line); text-align: left; cursor: pointer; }
.channel-analysis-row:hover, .channel-analysis-row:focus-visible, .channel-analysis-row.active { background: #f2f8f3; outline: none; }
.channel-analysis-row > span:first-child, .channel-analysis-row strong, .channel-analysis-row small { display: block; }
.channel-analysis-row strong { color: var(--q-ink); font-size: 10px; }
.channel-analysis-row small { margin-top: 4px; color: var(--q-muted); font-size: 8px; }
.channel-analysis-row b { color: var(--q-ink); font-size: 12px; white-space: nowrap; }
.channel-drilldown { border-top: 1px solid var(--q-line); }
.channel-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: #f2f8f3; }
.channel-detail-head span, .channel-detail-head strong { display: block; }
.channel-detail-head span { color: var(--q-muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.channel-detail-head strong { margin-top: 4px; color: var(--q-ink); font-size: 15px; }
.channel-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--q-line); }
.channel-metrics > div { padding: 14px 16px; border-right: 1px solid var(--q-line); }
.channel-metrics > div:last-child { border-right: 0; }
.channel-metrics span, .channel-metrics strong { display: block; }
.channel-metrics span { color: var(--q-muted); font-size: 8px; }
.channel-metrics strong { margin-top: 6px; color: var(--q-ink); font-size: 12px; }
.channel-sources { display: grid; gap: 10px; padding: 14px 16px 16px; }
.channel-sources article { display: grid; gap: 10px; padding: 13px; background: #fafaf8; border: 1px solid var(--q-line); border-radius: 11px; }
.channel-sources article > div:first-child strong, .channel-sources article > div:first-child small { display: block; }
.channel-sources article > div:first-child small { margin-top: 4px; color: var(--q-muted); font-size: 8px; }
.channel-source-amounts { display: flex; flex-wrap: wrap; gap: 6px; }
.channel-source-amounts span { padding: 4px 7px; color: var(--q-muted); background: #fff; border: 1px solid var(--q-line); border-radius: 999px; font-size: 8px; }
.channel-sources ul { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.channel-sources li { display: grid; grid-template-columns: minmax(90px,.6fr) minmax(120px,1fr) auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--q-line); color: var(--q-muted); font-size: 8px; }
.channel-sources li strong { color: var(--q-ink); }
.attribution-badge { margin-top: 4px; }
.mini-attribution { width: 30px; height: 30px; min-width: 30px; padding: 0; }
.attribution-modal { width: min(560px,100%); }
.form-stack { display: grid; gap: 14px; }
.form-stack label { display: grid; gap: 7px; color: var(--q-muted); font-size: 9px; font-weight: 750; }
.form-stack > div { display: grid; gap: 14px; }
.projection-panel { margin-top: 18px; }
.sales-projection-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--q-line); }
.sales-projection-grid > div { min-height: 132px; padding: 20px; border-right: 1px solid var(--q-line); }
.sales-projection-grid > div:last-child { border-right: 0; }
.sales-projection-grid span, .sales-projection-grid small { display: block; color: var(--q-muted); }
.sales-projection-grid span { font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.sales-projection-grid strong { display: block; margin: 14px 0 8px; color: var(--q-ink); font-size: clamp(20px,2vw,30px); letter-spacing: -.04em; }
.sales-projection-grid small { font-size: 9px; line-height: 1.45; }
.projection-note { margin: 0; padding: 13px 20px; color: var(--q-muted); background: #f8f8f6; border-top: 1px solid var(--q-line); font-size: 9px; line-height: 1.55; }
.import-panel { margin-top: 18px; }
.sales-dropzone { display: grid; justify-items: center; gap: 7px; margin: 18px; padding: 30px 20px; color: var(--q-muted); background: #fafaf8; border: 1px dashed #b9bcb9; border-radius: 14px; text-align: center; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.sales-dropzone:hover, .sales-dropzone:focus, .sales-dropzone.dragging { color: var(--q-ink); background: #f2f8f3; border-color: var(--q-green); outline: none; transform: translateY(-1px); }
.sales-dropzone strong { color: var(--q-ink); font-size: 13px; }
.sales-dropzone span { font-size: 9px; }
.dropzone-icon { display: grid; place-items: center; width: 40px; height: 40px; color: #fff; background: var(--q-ink); border-radius: 12px; font-size: 18px; }
.import-source-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 0 18px 18px; }
.import-source-card { display: flex; align-items: center; gap: 10px; min-height: 67px; padding: 12px; background: #f7f7f5; border: 1px solid var(--q-line); border-radius: 11px; }
.import-source-card > span { display: grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 900; }
.import-source-card.ready > span { color: #176a47; background: #dcf2e5; }
.import-source-card.missing > span { color: #8b611d; background: #f7e9c9; }
.import-source-card strong, .import-source-card small { display: block; }
.import-source-card strong { color: var(--q-ink); font-size: 10px; }
.import-source-card small { margin-top: 4px; color: var(--q-muted); font-size: 8px; line-height: 1.35; overflow-wrap: anywhere; }
.import-progress { display: grid; gap: 5px; margin: 0 18px 18px; padding: 12px; background: #f7f7f5; border-radius: 10px; font-size: 9px; }
.import-progress .success { color: #176a47; }
.import-progress .error { color: #9d3535; }
.sales-two-columns { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 16px; margin-top: 18px; }
.reconciliation-list { display: grid; }
.reconciliation-list > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 48px; padding: 10px 16px; border-top: 1px solid var(--q-line); }
.reconciliation-list span { color: var(--q-muted); font-size: 9px; }
.reconciliation-list strong { color: var(--q-ink); font-size: 12px; }
.reconciliation-list p { margin: 0; padding: 14px 16px; color: var(--q-muted); background: #f8f8f6; border-top: 1px solid var(--q-line); font-size: 8px; line-height: 1.5; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; color: #50555a; background: #eceeed; border-radius: 999px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.status-badge.success { color: #176a47; background: #dcf2e5; }
.status-badge.warning { color: #8b611d; background: #f7e9c9; }
.status-badge.info { color: #245f87; background: #e0eff9; }
.row-warning { display: block; margin-top: 4px; color: #9d3535; font-weight: 700; }
.import-history { display: grid; }
.import-history-row { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 10px 16px; border-top: 1px solid var(--q-line); }
.import-history-row strong, .import-history-row small { display: block; }
.import-history-row strong { font-size: 10px; }
.import-history-row small { margin-top: 3px; color: var(--q-muted); font-size: 8px; }
.status-dot { width: 8px; height: 8px; background: #c9ccca; border-radius: 50%; }
.status-dot.active { background: var(--q-green); box-shadow: 0 0 0 4px rgba(51,151,98,.12); }
.read-only .editor-only { display: none !important; }

/* Répertoire, qualification contextuelle et encaissements clients. */
.compact-stat { font-size: 17px; line-height: 1.2; }
.directory-table { min-width: 1080px; }
.selection-column { width: 42px; min-width: 42px; text-align: center; }
.selection-column input { width: 16px; height: 16px; margin: 0; accent-color: var(--q-green); cursor: pointer; }
.directory-table tr.selected-row td { background: #f1f8f4; }
.directory-bulkbar { position: sticky; top: 68px; z-index: 8; margin: 0 12px 12px; box-shadow: 0 12px 30px rgba(17,22,28,.16); }
.directory-quick-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: -3px 0 14px; }
.directory-quick-filters .btn { min-height: 34px; }
.directory-quick-filters .btn.active { color: #fff; background: var(--q-ink); border-color: var(--q-ink); }
.bulk-disabled .directory-table .selection-column, .bulk-disabled .directory-bulkbar { display: none !important; }
.entity-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.entity-cell strong, .entity-cell small { display: block; }
.entity-cell strong { font-size: 11px; }
.entity-cell small { max-width: 250px; margin-top: 3px; overflow: hidden; color: var(--q-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.entity-avatar { width: 34px; height: 34px; display: grid; flex: 0 0 34px; place-items: center; color: #fff; background: #315e78; border-radius: 10px; font-size: 9px; font-weight: 850; }
.entity-avatar.person-avatar { color: #5b3e77; background: #efe4f8; border-radius: 50%; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; }
.chip-list span, .classification-label { display: inline-flex; min-height: 22px; align-items: center; padding: 3px 7px; color: #53595d; background: #f0f1f1; border: 1px solid #e2e3e3; border-radius: 999px; font-size: 8px; font-weight: 700; }
.classification-label { margin: 2px; color: #245f87; background: #eaf2f7; border-color: #d7e6ee; }
.actionable-status { min-height: 27px; padding: 4px 9px; color: #805715; background: #fff2d9; border: 1px solid #ead2a4; border-radius: 999px; font-size: 8px; font-weight: 850; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.actionable-status:hover, .actionable-status:focus { color: #4d3410; border-color: #c79d50; outline: 2px solid rgba(155,100,21,.12); }
.detail-drawer { position: fixed; inset: 0 0 0 auto; z-index: 105; width: min(760px,94vw); overflow-y: auto; background: #fff; border-left: 1px solid var(--q-line); box-shadow: -20px 0 60px rgba(17,22,28,.14); transform: translateX(105%); transition: transform .22s ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(22,27,33,.34); }
.drawer-backdrop.open { display: block; }
.drawer-toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; min-height: 65px; padding: 12px 20px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--q-line); backdrop-filter: blur(10px); }
.drawer-content { padding: 25px 22px 48px; }
.muted-copy { color: var(--q-muted); font-size: 10px; line-height: 1.5; }
.timeline-event { display: grid; grid-template-columns: 105px minmax(130px,.6fr) minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #eceeed; }
.timeline-event span, .timeline-event small { color: var(--q-muted); font-size: 9px; }
.timeline-event strong { font-size: 9px; text-transform: capitalize; }
.confirmation-line { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; padding: 12px; color: #79531c; background: var(--q-amber-soft); border-radius: 9px; font-size: 10px; }
.qualification-modal { width: min(680px,100%); }
.scope-field { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 13px; border: 1px solid var(--q-line); border-radius: 10px; }
.scope-field legend { padding: 0 5px; color: var(--q-muted); font-size: 9px; font-weight: 750; }
.scope-field label { display: flex; align-items: center; gap: 6px; color: var(--q-ink); }
.qualification-preview { display: grid; gap: 6px; margin-top: 17px; padding: 14px; color: #4c5962; background: #f0f6fb; border: 1px solid #d8e7f1; border-radius: 11px; font-size: 10px; line-height: 1.45; }
.qualification-preview strong { color: var(--q-ink); }
.qualification-preview span::before { content: "✓"; margin-right: 7px; color: var(--q-green); font-weight: 850; }
.qualification-queue { display: grid; gap: 9px; }
.qualification-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto auto; align-items: center; gap: 12px; min-height: 70px; padding: 12px 14px; background: #fff; border: 1px solid var(--q-line); border-radius: 12px; text-decoration: none; }
.qualification-item:hover { border-color: #b8bcbe; box-shadow: var(--q-shadow); }
.qualification-item-icon { width: 36px; height: 36px; display: grid; place-items: center; color: #7b551b; background: var(--q-amber-soft); border-radius: 10px; font-weight: 850; }
.qualification-item strong, .qualification-item small { display: block; }
.qualification-item strong { font-size: 11px; }
.qualification-item small { margin-top: 4px; color: var(--q-muted); font-size: 9px; line-height: 1.4; }
.confidence-meter { min-width: 80px; color: var(--q-muted); font-size: 9px; text-align: right; }
.receipt-table { min-width: 1020px; }
.receipt-amount { color: var(--q-green); font-size: 12px; font-weight: 850; white-space: nowrap; }
.processing-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 10px; color: #52585c; background: #f2f3f3; border: 1px solid #dedfdf; border-radius: 999px; font-size: 9px; font-weight: 800; cursor: pointer; }
.processing-toggle.processed { color: #176a47; background: var(--q-green-soft); border-color: #c9e5d7; }
.processing-toggle:disabled { cursor: not-allowed; opacity: .68; }
.processing-toggle span { width: 15px; height: 15px; display: grid; place-items: center; background: #fff; border: 1px solid #cfd2d3; border-radius: 5px; font-size: 9px; }
.processing-toggle.processed span { color: #fff; background: var(--q-green); border-color: var(--q-green); }
.processing-meta { display: block; max-width: 240px; margin-top: 5px; color: var(--q-muted); font-size: 8px; line-height: 1.35; }
.restricted-sidebar .portal-nav { margin-top: 22px; }
.restricted-sidebar .portal-nav-label { display: none; }
.privacy-banner { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; margin-bottom: 18px; padding: 14px 16px; color: #31505f; background: #edf5f8; border: 1px solid #d7e7ed; border-radius: 13px; }
.privacy-banner span { width: 32px; height: 32px; display: grid; place-items: center; background: #fff; border-radius: 9px; }
.privacy-banner strong, .privacy-banner small { display: block; }
.privacy-banner small { margin-top: 4px; color: #617985; font-size: 9px; line-height: 1.45; }
.anomaly-list { display: grid; gap: 8px; }
.anomaly-item { padding: 12px; color: #794141; background: #fff5f5; border: 1px solid #f0d8d8; border-radius: 10px; font-size: 9px; line-height: 1.5; }
.account-card { max-width: 680px; padding: 24px; }
.profile-hint { display: block; max-width: 230px; margin-top: 5px; color: var(--q-muted); font-size: 8px; line-height: 1.35; }

@media (max-width: 760px) {
  .directory-table { min-width: 0; table-layout: auto; }
  .directory-table th:nth-child(3), .directory-table td:nth-child(3),
  .directory-table th:nth-child(5), .directory-table td:nth-child(5),
  .directory-table th:nth-child(7), .directory-table td:nth-child(7) { display: none; }
  .directory-bulkbar { top: 58px; align-items: stretch; flex-wrap: wrap; }
  .directory-bulkbar span { width: 100%; }
  .directory-bulkbar .btn:first-of-type { margin-left: 0; }
  .directory-quick-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .directory-quick-filters .btn { flex: 0 0 auto; }
  .timeline-event { grid-template-columns: 1fr; gap: 4px; }
  .qualification-item { grid-template-columns: 34px minmax(0,1fr) auto; }
  .confidence-meter { display: none; }
  .receipt-table { min-width: 0; }
  .receipt-table th:nth-child(3), .receipt-table td:nth-child(3),
  .receipt-table th:nth-child(4), .receipt-table td:nth-child(4) { display: none; }
  .processing-meta { max-width: 150px; }
}

@media (max-width: 1100px) {
  .sales-stats, .prescriber-stats, .sales-projection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sales-filter-grid, .channel-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .channel-metrics > div:nth-child(2) { border-right: 0; }
  .channel-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--q-line); }
  .sales-projection-grid > div:nth-child(2) { border-right: 0; }
  .sales-projection-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--q-line); }
  .sales-two-columns, .prescriber-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sales-stats, .prescriber-stats, .sales-projection-grid, .import-source-grid { grid-template-columns: 1fr; }
  .sales-filter-grid, .sales-search-results, .channel-metrics { grid-template-columns: 1fr; }
  .sales-filter-grid { padding-inline: 13px; }
  .sales-quick-filters { padding-inline: 13px; }
  .sales-search-results { padding: 13px; }
  .sales-search-results article { grid-template-columns: 1fr auto; }
  .sales-search-results article > span:first-child { grid-column: 1 / -1; justify-self: start; }
  .channel-metrics > div { border-right: 0; border-bottom: 1px solid var(--q-line); }
  .channel-metrics > div:last-child { border-bottom: 0; }
  .channel-analysis-row { grid-template-columns: minmax(0,1fr) auto; }
  .channel-analysis-row > span:last-child { display: none; }
  .channel-sources li { grid-template-columns: 1fr auto; }
  .channel-sources li span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .sales-projection-grid > div { min-height: 110px; border-right: 0; border-bottom: 1px solid var(--q-line); }
  .sales-projection-grid > div:last-child { border-bottom: 0; }
  .sales-dropzone { margin: 13px; padding: 24px 13px; }
  .import-source-grid { padding: 0 13px 13px; }
  .sales-table { min-width: 1050px; }
  .prescriber-table { min-width: 0; table-layout: auto; }
  .prescriber-table th:nth-child(2), .prescriber-table td:nth-child(2),
  .prescriber-table th:nth-child(4), .prescriber-table td:nth-child(4),
  .prescriber-table th:nth-child(6), .prescriber-table td:nth-child(6),
  .prescriber-table th:nth-child(7), .prescriber-table td:nth-child(7),
  .prescriber-table th:nth-child(8), .prescriber-table td:nth-child(8) { display: none; }
  .prescriber-table .mobile-partner-type { display: inline-flex; margin-top: 7px; }
  .prescriber-table th:nth-child(5), .prescriber-table td:nth-child(5) { text-align: right; }
  .prescriber-suggestion { min-width: 138px; }
  .prescriber-suggestion span { display: none; }
  .panel-head .panel-actions { width: 100%; justify-content: flex-start; }
  .table-pagination { align-items: flex-start; flex-direction: column; }
  .table-pagination > div { width: 100%; justify-content: space-between; }
}
