/* ── Component Styles ────────────────────────────────────────────────────── */

/* ── Button ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
  line-height: 1;
  border: 1px solid transparent;
}

.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Sizes */
.btn-sm { font-size: var(--fs-body-sm); height: 30px; padding: 0 12px; }
.btn-md { font-size: var(--fs-body);    height: 36px; padding: 0 16px; }

/* Primary */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Secondary (outline) */
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-muted); border-color: var(--border-strong); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-muted); color: var(--text); }

/* Danger */
.btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
  border-color: #f0b6b2;
}
.btn-danger:hover { background: #f5cbc9; }

.btn-icon { flex-shrink: 0; width: 16px; height: 16px; }

/* ── Status Pill / Badge ──────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-caption);
  font-weight: 600;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.pill-neutral  { background: var(--status-neutral-bg);  color: var(--status-neutral-fg); }
.pill-info     { background: var(--status-info-bg);     color: var(--status-info-fg); }
.pill-progress { background: var(--status-progress-bg); color: var(--status-progress-fg); }
.pill-success  { background: var(--status-success-bg);  color: var(--status-success-fg); }
.pill-danger   { background: var(--status-danger-bg);   color: var(--status-danger-fg); }
.pill-purple   { background: var(--status-purple-bg);   color: var(--status-purple-fg); }

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-body { padding: var(--sp-5); }

/* Section card */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-4);
}

.section-card-title {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
}

.section-card-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.section-card-body { padding: var(--sp-5); }

/* ── KPI Card ────────────────────────────────────────────────────────────── */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.kpi-card-label {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.kpi-card-sub {
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

.kpi-card-accent { border-top: 3px solid var(--accent); }
.kpi-card-success { border-top: 3px solid var(--status-success-fg); }
.kpi-card-progress { border-top: 3px solid var(--status-progress-fg); }
.kpi-card-danger { border-top: 3px solid var(--status-danger-fg); }
.kpi-card-purple { border-top: 3px solid var(--status-purple-fg); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}

.data-table thead tr {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  font-size: var(--fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  background: var(--surface);
}

.data-table th.align-right,
.data-table td.align-right { text-align: right; }

.data-table td {
  padding: 11px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background 0.1s;
}

.data-table tbody tr:hover { background: var(--surface-muted); }

.data-table tbody tr.clickable { cursor: pointer; }

/* Checkbox column */
.data-table th.col-check,
.data-table td.col-check {
  width: 40px;
  padding-right: 0;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.tab-item {
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab-item:hover { color: var(--text); }

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.filter-select {
  height: 34px;
  padding: 0 28px 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s;
}

.filter-select:focus { outline: none; border-color: var(--accent); }

.filter-search {
  flex: 1;
  max-width: 240px;
  height: 34px;
  padding: 0 10px 0 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  color: var(--text);
  outline: none;
  position: relative;
  transition: border-color 0.15s;
}

.filter-search:focus { border-color: var(--accent); }
.filter-search::placeholder { color: var(--text-muted); }

.filter-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 240px;
}

.filter-search-wrapper svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-search-wrapper input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.filter-search-wrapper input:focus { border-color: var(--accent); }
.filter-search-wrapper input::placeholder { color: var(--text-muted); }

.filter-clear {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 var(--sp-1);
  transition: color 0.12s;
}

.filter-clear:hover { color: var(--accent); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,24,40,.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.15s ease;
}

.modal-lg { max-width: 800px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title { font-size: var(--fs-subhead); font-weight: 600; }

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s;
  background: none;
  border: none;
  font-size: 16px;
}

.modal-close:hover { background: var(--surface-muted); }

.modal-body {
  padding: var(--sp-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Drawer ──────────────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,24,40,.25);
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 520px;
  max-width: 90vw;
  background: var(--surface);
  box-shadow: -4px 0 24px rgba(16,24,40,.12);
  z-index: 201;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.2s ease;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title { font-size: var(--fs-subhead); font-weight: 600; }

.drawer-body { padding: var(--sp-6); overflow-y: auto; flex: 1; }

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  flex-wrap: nowrap;
}

.breadcrumb-sep { color: var(--text-muted); font-size: 10px; }

.breadcrumb a {
  color: var(--text-secondary);
  transition: color 0.12s;
}

.breadcrumb a:hover { color: var(--accent); text-decoration: none; }

.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.page-header-left { display: flex; flex-direction: column; gap: var(--sp-2); }

.page-header-title-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.page-header-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-header-subtitle {
  font-size: var(--fs-body);
  color: var(--text-secondary);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  padding-top: 4px;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
  gap: var(--sp-4);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  opacity: .6;
}

.empty-state-title {
  font-size: var(--fs-subhead);
  font-weight: 600;
  color: var(--text);
}

.empty-state-desc {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.6;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 16px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  max-width: 380px;
  animation: toastIn 0.25s ease;
  pointer-events: all;
  cursor: default;
}

.toast-success { background: var(--status-success-fg); }
.toast-info    { background: var(--accent); }
.toast-danger  { background: var(--status-danger-fg); }

.toast-out { animation: toastOut 0.25s ease forwards; }

/* ── Progress Bar ────────────────────────────────────────────────────────── */
.progress-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-bar-label { font-size: var(--fs-body-sm); font-weight: 500; }
.progress-bar-pct   { font-size: var(--fs-body-sm); color: var(--text-secondary); }

.progress-bar-track {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.progress-bar-fill.fill-success { background: var(--status-success-fg); }
.progress-bar-fill.fill-progress { background: var(--status-progress-fg); }
.progress-bar-fill.fill-danger   { background: var(--status-danger-fg); }

/* ── Field Row / Definition List ─────────────────────────────────────────── */
.def-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px var(--sp-6);
  align-items: baseline;
}

.def-label {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.def-value {
  font-size: var(--fs-body-sm);
  color: var(--text);
}

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-size: var(--fs-caption);
  line-height: 1;
}

.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }

/* Avatar colors are set inline via JS deterministic hash */

/* Avatar group */
.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar {
  border: 2px solid var(--surface);
  margin-left: -6px;
}

.avatar-group .avatar:first-child { margin-left: 0; }

/* ── KPI Grid ────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

/* ── Inline form elements ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text);
}

.form-input {
  height: 36px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47,111,237,.1);
}

/* ── Pipeline Board ──────────────────────────────────────────────────────── */
.pipeline-board-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: var(--sp-1);
}

.pipeline-board {
  display: flex;
  gap: 0;
  min-width: max-content;
  width: 100%;
}

.pipeline-col {
  flex: 1;
  min-width: 148px;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.pipeline-col:last-child { border-right: none; }

.pipeline-col-header {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-muted);
  gap: var(--sp-2);
  border-top: 2px solid transparent;
}

.pipeline-col-header.accent-blue   { border-top-color: var(--accent); }
.pipeline-col-header.accent-amber  { border-top-color: var(--status-progress-fg); }
.pipeline-col-header.accent-purple { border-top-color: var(--status-purple-fg); }
.pipeline-col-header.accent-green  { border-top-color: var(--status-success-fg); }

.pipeline-col-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pipeline-col-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 99px;
  padding: 1px 7px;
  line-height: 1.5;
  flex-shrink: 0;
}

.pipeline-col-count.has-items {
  background: var(--accent-soft);
  color: var(--accent);
}

.pipeline-cards {
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 72px;
}

.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: box-shadow 0.12s, border-color 0.12s, background 0.12s;
  position: relative;
}

.pipeline-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.pipeline-card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pipeline-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
}

.pipeline-card-cat {
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pipeline-card-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.blocker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-danger-fg);
  flex-shrink: 0;
}

.pipeline-more {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 6px;
  cursor: pointer;
  transition: color 0.12s;
}

.pipeline-more:hover { color: var(--accent); }

.pipeline-empty {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 6px;
  font-style: italic;
}

/* ── My Actions Panel ─────────────────────────────────────────────────────── */
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.action-item:last-child { border-bottom: none; }

.action-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.action-indicator.high   { background: var(--status-danger-fg); }
.action-indicator.medium { background: var(--status-progress-fg); }
.action-indicator.low    { background: var(--accent); }

.action-body { flex: 1; min-width: 0; }

.action-label {
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.action-project-name {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-meta {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Activity Feed ────────────────────────────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-content { flex: 1; min-width: 0; }

.activity-text {
  font-size: var(--fs-body-sm);
  color: var(--text);
  line-height: 1.4;
}

.activity-time {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Blocker Panel Items ──────────────────────────────────────────────────── */
.blocker-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.blocker-item:last-child { border-bottom: none; }

.blocker-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--status-danger-bg);
  color: var(--status-danger-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blocker-body { flex: 1; min-width: 0; }

.blocker-reason {
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.blocker-project {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}

.blocker-owner {
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

/* ── KPI card clickable state ─────────────────────────────────────────────── */
.kpi-card {
  cursor: default;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.kpi-card.kpi-clickable { cursor: pointer; }

.kpi-card.kpi-clickable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.kpi-card.kpi-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm);
}

/* ── Filter bar active indicator ──────────────────────────────────────────── */
.filter-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-caption);
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 99px;
  padding: 2px 8px;
}

.filter-active-badge-x {
  cursor: pointer;
  opacity: .7;
  line-height: 1;
}

.filter-active-badge-x:hover { opacity: 1; }

/* ── Dashboard two-col layout ─────────────────────────────────────────────── */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  align-items: start;
}

.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 284px;
  gap: var(--sp-5);
  align-items: start;
  margin-top: var(--sp-5);
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* ── Misc utilities ──────────────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2         { gap: var(--sp-2); }
.gap-3         { gap: var(--sp-3); }
.gap-4         { gap: var(--sp-4); }
.gap-6         { gap: var(--sp-6); }
.mt-4          { margin-top: var(--sp-4); }
.mt-6          { margin-top: var(--sp-6); }
.mb-4          { margin-bottom: var(--sp-4); }
.mb-6          { margin-bottom: var(--sp-6); }
.p-5           { padding: var(--sp-5); }
.w-full        { width: 100%; }

/* Clickable row */
.row-link { cursor: pointer; }

/* Code / id chips */
.id-chip {
  font-size: var(--fs-caption);
  font-family: 'SFMono-Regular', Consolas, monospace;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 2 — Projects & Briefs
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Form controls (used in modals / drawers) ────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: var(--sp-4);
}
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text);
}
.form-label .req { color: var(--status-danger-fg); margin-left: 2px; }

.form-control {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font);
  font-size: var(--fs-body-sm);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.form-control { resize: vertical; min-height: 72px; line-height: 1.5; }
.form-control[disabled] { background: var(--surface-muted); color: var(--text-muted); cursor: not-allowed; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.form-hint {
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

/* ── Row actions (kebab menu) ─────────────────────────────────────────────── */
.row-actions-cell {
  position: relative;
  width: 36px;
  text-align: center;
  padding: 0 !important;
}

.row-actions-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
  font-family: inherit;
}

tr:hover .row-actions-btn,
.row-actions-btn.open { opacity: 1; }
.row-actions-btn:hover { background: var(--surface-muted); color: var(--text); }

.row-actions-dropdown {
  position: fixed;   /* fixed so it escapes table overflow:hidden */
  z-index: 300;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 4px 0;
  display: none;
}
.row-actions-dropdown.open { display: block; }

.row-actions-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: var(--fs-body-sm);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}
.row-actions-item:hover { background: var(--surface-muted); }
.row-actions-item.danger { color: var(--status-danger-fg); }

/* ── Project Workspace ───────────────────────────────────────────────────── */
.proj-workspace-tabs { margin-top: var(--sp-4); }

.proj-workspace-body {
  margin-top: var(--sp-5);
  animation: fadeIn 0.15s ease;
}

/* ── Workspace Overview — Summary Cards ──────────────────────────────────── */
.workspace-summary-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.workspace-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.workspace-summary-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.wsc-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.wsc-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.wsc-sub {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* ── Project Overview — Detail Panel ─────────────────────────────────────── */
.proj-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}

/* ── Brief Tab — header bar ──────────────────────────────────────────────── */
.brief-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}

/* ── Brief Stepper ───────────────────────────────────────────────────────── */
.brief-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  row-gap: 6px;
}

.brief-step {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--text-muted);
}
.brief-step:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--border-strong);
  margin: 0 4px;
}

.brief-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}

.brief-step.done  { color: var(--status-success-fg); }
.brief-step.done  .brief-step-dot  { background: var(--status-success-fg); }
.brief-step.active { color: var(--accent); font-weight: 700; }
.brief-step.active .brief-step-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.brief-step.skipped { opacity: .5; }

.brief-rev-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.brief-rev-select {
  font-family: var(--font);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
}
.brief-rev-select:focus { border-color: var(--accent); }

/* ── Brief Actions Bar ───────────────────────────────────────────────────── */
.brief-actions-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.brief-actions-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 var(--sp-1);
}

/* ── Brief Changed Banner ────────────────────────────────────────────────── */
.brief-changed-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #FEF3E2;
  border: 1px solid #F6AD55;
  border-radius: var(--radius);
  font-size: var(--fs-body-sm);
  color: #92400E;
  margin-bottom: var(--sp-4);
  line-height: 1.4;
}

/* ── Brief Collapsible Sections ──────────────────────────────────────────── */
.brief-section-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-2);
  background: var(--surface);
  overflow: hidden;
}

.brief-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px var(--sp-4);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.brief-section-hdr:hover { background: var(--surface-muted); }

.brief-section-title {
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--text);
}

.brief-section-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.18s;
  flex-shrink: 0;
}
.brief-section-wrap[data-open="false"] .brief-section-chevron { transform: rotate(-90deg); }

.brief-section-body {
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.brief-section-wrap[data-open="false"] .brief-section-body { display: none; }

/* ── Compare Revisions Modal ─────────────────────────────────────────────── */
.compare-selectors {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.compare-vs { color: var(--text-muted); font-size: var(--fs-body-sm); }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}
.compare-table th {
  text-align: left;
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.compare-table td {
  padding: 8px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.compare-table tr.changed { background: #FFFBEB; }
.compare-table tr.changed .compare-from { color: var(--status-progress-fg); text-decoration: line-through; }
.compare-table tr.changed .compare-to   { color: var(--status-success-fg); font-weight: 500; }
.compare-field-label { color: var(--text-secondary); font-size: var(--fs-caption); }

/* ── Tab placeholder (unbuilt tabs) ──────────────────────────────────────── */
.tab-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.tab-placeholder-icon { width: 44px; height: 44px; color: var(--border-strong); margin-bottom: var(--sp-4); }
.tab-placeholder-title { font-size: var(--fs-subhead); font-weight: 700; color: var(--text); margin-bottom: var(--sp-2); }
.tab-placeholder-desc { font-size: var(--fs-body-sm); color: var(--text-secondary); max-width: 380px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 3 — Suppliers & Quotes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Utility additions ───────────────────────────────────────────────────── */
.text-danger { color: var(--status-danger-fg); }

/* ── RFQ alert chips ─────────────────────────────────────────────────────── */
.rfq-alert {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.rfq-alert-danger  { background: var(--status-danger-bg);   color: var(--status-danger-fg); }
.rfq-alert-warning { background: var(--status-progress-bg); color: var(--status-progress-fg); }
.rfq-alert-info    { background: var(--status-info-bg);     color: var(--status-info-fg); }

/* ── RFQ meta bar (proposal detail header) ───────────────────────────────── */
.rfq-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: var(--sp-4);
}
.rfq-meta-item  { display: flex; flex-direction: column; gap: 2px; }
.rfq-meta-label {
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rfq-meta-value { font-size: var(--fs-body-sm); color: var(--text); font-weight: 500; }

/* ── Proposal section grid ───────────────────────────────────────────────── */
.proposal-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4) var(--sp-5);
}
.proposal-field-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}
.proposal-field-value { font-size: var(--fs-body-sm); color: var(--text); }

/* ── Feasibility indicators ──────────────────────────────────────────────── */
.feas-yes  { color: var(--status-success-fg); font-weight: 700; }
.feas-cond { color: var(--status-progress-fg); font-weight: 700; }
.feas-no   { color: var(--status-danger-fg);  font-weight: 700; }

/* ── Communication thread ────────────────────────────────────────────────── */
.comm-thread { display: flex; flex-direction: column; gap: var(--sp-3); }
.comm-message {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.comm-message.internal { background: var(--surface-muted); border-left: 3px solid var(--accent); }
.comm-message.shared   { background: #F0FDF4;              border-left: 3px solid var(--status-success-fg); }
.comm-message-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.comm-message-author { font-size: var(--fs-body-sm); font-weight: 600; color: var(--text); }
.comm-message-date   { font-size: 11px; color: var(--text-muted); }
.comm-visibility-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}
.comm-visibility-tag.internal { background: #DBEAFE; color: #1D4ED8; }
.comm-visibility-tag.shared   { background: #D1FAE5; color: #065F46; }

/* ── Selection banner ────────────────────────────────────────────────────── */
.selection-banner {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
}
.selection-banner.selected {
  border-color: var(--status-success-fg);
  background: #F0FDF4;
}

/* ── Compare matrix table ────────────────────────────────────────────────── */
.compare-matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.compare-matrix th {
  background: var(--surface-muted);
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.compare-matrix th.supplier-col { text-align: center; min-width: 160px; }
.compare-matrix td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-body-sm);
  color: var(--text);
  vertical-align: top;
}
.compare-matrix .dim-label {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 200px;
  background: var(--surface-muted);
}
.compare-matrix .over-target   { color: var(--status-danger-fg);  font-weight: 700; }
.compare-matrix .within-target { color: var(--status-success-fg); font-weight: 700; }

/* ── Supplier header in compare matrix ───────────────────────────────────── */
.compare-sup-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  text-align: center;
}
.compare-sup-name     { font-size: var(--fs-body); font-weight: 700; }
.compare-sup-country  { font-size: 11px; color: var(--text-muted); }
.compare-sup-selected { font-size: 11px; font-weight: 700; color: var(--status-success-fg); }

/* ── Candidate supplier cards ────────────────────────────────────────────── */
.candidate-supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3);
}
.candidate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.candidate-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.candidate-card.is-selected {
  border-color: var(--status-success-fg);
  background: #F0FDF4;
}
.candidate-card-name {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.candidate-card-meta { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 4 — Products, Configurations & SKUs
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Inline user cell (table) ────────────────────────────────────────────── */
.prod-inline-user {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ── Product stat strip (overview tab) ───────────────────────────────────── */
.prod-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.prod-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  cursor: default;
}
.prod-stat-label { font-size: var(--fs-caption); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.prod-stat-value { font-size: var(--fs-subhead); font-weight: 700; color: var(--text); }
.prod-stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── SKU config badge (SKU table) ────────────────────────────────────────── */
.sku-cfg-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ── Product cards grid (workspace tab) ──────────────────────────────────── */
.prod-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.prod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.prod-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.prod-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.prod-card-code  { margin-bottom: 4px; }
.prod-card-name  { font-size: var(--fs-body-sm); font-weight: 700; color: var(--text); }
.prod-card-stats {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}
.prod-card-stat     { color: var(--text-secondary); }
.prod-card-stat-sep { color: var(--border-strong); }
.prod-card-supplier { margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════════════════
   Module 5 — Documents & Drawing Revision
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Embedded context bar ────────────────────────────────────────────────── */
.doc-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
}
.doc-context-label { display: flex; align-items: center; }

/* ── Current released drawing banner ─────────────────────────────────────── */
.doc-released-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--sp-3) var(--sp-4);
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-body-sm);
  flex-wrap: wrap;
}
.doc-released-label  { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: #166534; text-transform: uppercase; }
.doc-released-name   { font-weight: 700; color: var(--text); }
.doc-released-rev    { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; font-family: var(--font-mono, monospace); background: #DCFCE7; border: 1px solid #86EFAC; border-radius: 4px; padding: 1px 6px; color: #166534; }
.doc-released-date   { font-size: 11px; color: #166534; }

/* ── Category filter chips ───────────────────────────────────────────────── */
.doc-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.doc-cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.doc-cat-chip:hover  { border-color: var(--accent); color: var(--accent); }
.doc-cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Visibility tag ──────────────────────────────────────────────────────── */
.doc-vis-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.doc-vis-shared   { background: #FEF9C3; color: #854D0E; border-color: #FDE68A; }
.doc-vis-released { background: #F0FDF4; color: #166534; border-color: #86EFAC; }

/* ── Document preview mock (drawer) ─────────────────────────────────────── */
.doc-preview-mock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
  color: var(--text-muted);
  text-align: center;
}
.doc-preview-icon { color: var(--text-muted); }

/* ── Revision history chain (drawer) ─────────────────────────────────────── */
.doc-rev-history  { display: flex; flex-direction: column; gap: 0; margin-bottom: var(--sp-4); }
.doc-rev-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-left: 2px solid var(--border);
  padding-left: var(--sp-3);
  position: relative;
}
.doc-rev-item.is-current { border-left-color: var(--accent); }
.doc-rev-dot {
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--surface);
  flex-shrink: 0;
}
.doc-rev-item.is-current .doc-rev-dot { background: var(--accent); }
.doc-rev-body  { flex: 1; }
.doc-rev-header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ── Drawer section title ─────────────────────────────────────────────────── */
.drawer-section-title {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: var(--sp-4) 0 var(--sp-2);
}

/* ── File drop zone (shared — also used in bom.js) ───────────────────────── */
.doc-file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background: var(--surface-muted);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--sp-3);
}
.doc-file-drop:hover { border-color: var(--accent); background: var(--surface); }

/* ── Locked note (released doc, export) ──────────────────────────────────── */
.doc-locked-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   Module 6 — BOM & Commercial Reference
   ══════════════════════════════════════════════════════════════════════════ */

/* ── BOM revision bar ────────────────────────────────────────────────────── */
.bom-rev-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-body-sm);
  flex-wrap: wrap;
}

/* ── Inner tab bar (BOM 7-tab strip) ─────────────────────────────────────── */
.bom-inner-tabs {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.bom-inner-content {
  padding-top: var(--sp-4);
}

/* ── BOM code cells ──────────────────────────────────────────────────────── */
.bom-code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
}

/* ── Commercial reference ─────────────────────────────────────────────────── */
.bom-comm-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-body-sm);
  flex-wrap: wrap;
}
.bom-comm-banner.is-approved { background: #F0FDF4; border-color: #BBF7D0; }
.bom-comm-banner-label { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }

.bom-comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.bom-comm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.bom-comm-card-title {
  font-size: var(--fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}
.bom-comm-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-body-sm);
}
.bom-comm-row:last-child { border-bottom: none; }
.bom-comm-label  { color: var(--text-muted); flex-shrink: 0; }
.bom-comm-label.restricted { color: var(--text-muted); font-style: italic; }
.bom-comm-value  { font-weight: 600; text-align: right; }
.bom-comm-value.highlight  { color: var(--accent); font-weight: 700; }
.bom-comm-value.restricted { color: var(--text-muted); font-style: italic; }

/* ── Packaging card ──────────────────────────────────────────────────────── */
.bom-pkg-card {
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

/* ── Revision compare ─────────────────────────────────────────────────────── */
.bom-compare-wrap { }
.bom-compare-selectors {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.bom-diff-summary {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.bom-diff-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
}
/* Row-level diff coloring */
.bom-diff-row.bom-diff-added    td { background: rgba(34, 197, 94, .08); }
.bom-diff-row.bom-diff-removed  td { background: rgba(239, 68, 68, .08); }
.bom-diff-row.bom-diff-qty-changed  td { background: rgba(245, 158, 11, .08); }
.bom-diff-row.bom-diff-material-changed td { background: rgba(99, 102, 241, .08); }
.bom-diff-row.bom-diff-dim-changed td { background: rgba(14, 165, 233, .08); }

/* Diff tags */
.bom-diff-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.bom-diff-added            { background: #DCFCE7; color: #166534; border-color: #86EFAC; }
.bom-diff-removed          { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.bom-diff-qty-changed      { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
.bom-diff-material-changed { background: #EDE9FE; color: #4338CA; border-color: #C4B5FD; }
.bom-diff-dim-changed      { background: #E0F2FE; color: #0C4A6E; border-color: #7DD3FC; }

/* ── Export / Import cards ────────────────────────────────────────────────── */
.bom-export-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 520px;
}
.bom-export-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.bom-export-card-title {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Module 7 — Samples, Prototypes & Issues
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tab content wrapper ─────────────────────────────────────────────────── */
.sample-tab-content { padding: var(--sp-4) 0; }

/* ── Blocking banners ────────────────────────────────────────────────────── */
.sample-banners {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.sample-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: var(--fs-body-sm);
  border-left: 4px solid transparent;
}
.sample-banner-critical {
  background: #FEF2F2;
  border-left-color: var(--danger);
  color: #991B1B;
}
.sample-banner-major {
  background: #FFFBEB;
  border-left-color: #F59E0B;
  color: #92400E;
}
.sample-banner-eco {
  background: #EFF6FF;
  border-left-color: #3B82F6;
  color: #1E40AF;
}
.sample-banner-icon { font-size: 16px; flex-shrink: 0; }
.sample-banner-ids  { margin-left: auto; display: flex; gap: var(--sp-1); flex-wrap: wrap; }

/* ── Review Gallery ──────────────────────────────────────────────────────── */
.sample-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
}
.sample-gallery-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow 0.12s;
}
.sample-gallery-card:hover { box-shadow: var(--shadow-md); }
.sample-gallery-photo {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.sample-gallery-meta { padding: 10px 12px; }
.sample-annot-pin {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* ── Photo card (in drawer) ──────────────────────────────────────────────── */
.sample-gallery {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.sample-photo-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100px;
}
.sample-photo-placeholder {
  height: 70px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.sample-photo-label { padding: 4px 6px; font-size: 11px; color: var(--text-muted); }
.sample-annotation-pin {
  position: absolute;
  top: 8px; right: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Linked issue chip (in sample drawer) ────────────────────────────────── */
.sample-linked-issue {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
}

/* ── Issue row severity coloring ─────────────────────────────────────────── */
.issue-row-critical td { background: rgba(239, 68, 68, .06) !important; }
.issue-row-major    td { background: rgba(245, 158, 11, .06) !important; }

/* ── ECO badge ───────────────────────────────────────────────────────────── */
.eco-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  white-space: nowrap;
}

/* ── Issue severity banner (in drawer) ───────────────────────────────────── */
.issue-severity-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-3);
  background: var(--surface-muted);
}
.sev-critical { background: #FEF2F2; border-left: 3px solid var(--danger); }
.sev-major    { background: #FFFBEB; border-left: 3px solid #F59E0B; }
.sev-minor    { background: #EFF6FF; border-left: 3px solid #60A5FA; }
.sev-observation { background: var(--surface-muted); border-left: 3px solid var(--border-strong); }

/* ── Issue description / corrective action ───────────────────────────────── */
.issue-description, .issue-corrective-action {
  font-size: var(--fs-body-sm);
  line-height: 1.55;
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: var(--sp-3);
}

/* ── Timeline ────────────────────────────────────────────────────────────── */
.sample-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--sp-2) 0;
  max-width: 640px;
}
.sample-timeline-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.sample-timeline-item:last-child { border-bottom: none; }
.tl-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.tl-body { flex: 1; }
.tl-date  { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.tl-label { font-size: var(--fs-body-sm); font-weight: 600; color: var(--text); }
.tl-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Module 8 — Market & Product Readiness
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout ──────────────────────────────────────────────────────────────── */
.readiness-inner { padding: var(--sp-4) 0; }
.readiness-toggle-row {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

/* ── Status row ──────────────────────────────────────────────────────────── */
.readiness-status-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.readiness-section-title {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text);
}

/* ── Progress cards ──────────────────────────────────────────────────────── */
.readiness-progress-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
@media (max-width: 900px) {
  .readiness-progress-cards { grid-template-columns: repeat(3, 1fr); }
}
.readiness-progress-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}
.rdy-card-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.rdy-card-label { font-size: 11px; font-weight: 600; }
.rdy-card-success  { background: #F0FDF4; border-color: #BBF7D0; }
.rdy-card-success  .rdy-card-value { color: #166534; }
.rdy-card-neutral  { background: var(--surface-muted); }
.rdy-card-neutral  .rdy-card-value { color: var(--text-secondary); }
.rdy-card-progress { background: #EFF6FF; border-color: #BFDBFE; }
.rdy-card-progress .rdy-card-value { color: #1D4ED8; }
.rdy-card-danger   { background: #FEF2F2; border-color: #FCA5A5; }
.rdy-card-danger   .rdy-card-value { color: #991B1B; }
.rdy-card-muted    { background: var(--surface-muted); }
.rdy-card-muted    .rdy-card-value { color: var(--text-muted); }

/* ── Gate panel ──────────────────────────────────────────────────────────── */
.readiness-gate-panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.readiness-gate-panel.gate-open    { background: #F0FDF4; border-color: #86EFAC; }
.readiness-gate-panel.gate-blocked { background: #FFF7ED; border-color: #FCD34D; }
.readiness-gate-title {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.gate-status-open    { background: #DCFCE7; color: #166534; padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.gate-status-blocked { background: #FEF3C7; color: #92400E; padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.readiness-gate-conditions { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.gate-condition-row   { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-body-sm); }
.gate-cond-icon       { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.gate-cond-label      { color: var(--text); }
.gate-cond-unmet      { color: #B45309; font-weight: 600; }
.readiness-gate-action { display: flex; justify-content: flex-end; padding-top: var(--sp-3); border-top: 1px solid var(--border); }

/* ── Blocker panel ───────────────────────────────────────────────────────── */
.readiness-blocker-panel {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.readiness-blocker-title {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  color: #991B1B;
  margin-bottom: var(--sp-3);
}
.readiness-blocker-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.readiness-blocker-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 10px;
  background: #FFF;
  border-radius: var(--radius-sm);
  border: 1px solid #FECACA;
}

/* ── Checklist table ─────────────────────────────────────────────────────── */
.readiness-table-wrap { margin-bottom: var(--sp-4); }
.readiness-mandatory-dot { color: var(--danger); font-size: 14px; }
.readiness-row-blocking td { background: rgba(239,68,68,.05) !important; }
.readiness-row-pass     td { background: rgba(34,197,94,.04) !important; }
.readiness-action-btns  { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Approval summary ────────────────────────────────────────────────────── */
.readiness-approval-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  background: var(--surface);
  margin-top: var(--sp-4);
}
.readiness-signoff-list  { display: flex; flex-direction: column; gap: var(--sp-2); }
.readiness-signoff-row   {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Module 9 — Change, Approval & Release
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout ──────────────────────────────────────────────────────────────── */
.release-inner { padding: var(--sp-4) 0; }
.release-section { margin-bottom: var(--sp-6); }
.release-section-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--border);
}
.release-section-title {
  font-size: var(--fs-subhead);
  font-weight: 700;
  color: var(--text);
}

/* ── Approval queue group ────────────────────────────────────────────────── */
.approval-group { margin-bottom: var(--sp-4); }
.approval-group-type {
  font-size: var(--fs-body-sm);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: var(--sp-2);
  padding: 4px 10px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ── Release stepper ─────────────────────────────────────────────────────── */
.release-stepper, .eco-stepper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-muted);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.release-step, .eco-step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 11px;
}
.release-step.done .release-step-dot,
.eco-step.done .eco-step-dot    { background: var(--status-success-bg); color: var(--status-success-fg); }
.release-step.active .release-step-dot,
.eco-step.active .eco-step-dot  { background: var(--accent); color: #fff; }
.release-step-dot, .eco-step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.release-step-label, .eco-step-label { font-size: 11px; white-space: nowrap; color: var(--text-secondary); }
.release-step.active .release-step-label,
.eco-step.active .eco-step-label { color: var(--text); font-weight: 700; }
.release-step-conn, .eco-step-conn {
  flex: 1; min-width: 12px; max-width: 28px;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
}
.release-step-conn.done, .eco-step-conn.done { background: var(--status-success-bg); }

/* ── Supplier view toggle ────────────────────────────────────────────────── */
.release-supplier-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  padding: 10px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.release-supplier-badge {
  font-size: 11px;
  font-weight: 700;
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FCD34D;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Package manifest ────────────────────────────────────────────────────── */
.release-manifest { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.release-manifest-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.release-manifest-item.missing { opacity: .6; }
.release-manifest-item.mandatory { border-left: 3px solid var(--accent); }
.manifest-check { font-size: 14px; flex-shrink: 0; }
.manifest-ref   { flex-shrink: 0; }
.manifest-label { flex: 1; }
.manifest-mandatory { color: var(--danger); font-size: 10px; flex-shrink: 0; }

/* ── Acknowledgement card (internal view) ────────────────────────────────── */
.release-ack-card {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.release-ack-confirmed { font-size: var(--fs-body-sm); font-weight: 700; color: #166534; }

/* ── ECO before/after ────────────────────────────────────────────────────── */
.eco-before-after {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface-muted);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
}
.eco-ba-col    { flex: 1; }
.eco-ba-label  { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.eco-ba-value  { font-size: var(--fs-body-sm); color: var(--text); }
.eco-ba-after  { color: #166534; font-weight: 600; }
.eco-ba-arrow  { font-size: 20px; color: var(--accent); padding-top: 16px; flex-shrink: 0; }
.eco-affected-list { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.eco-affected-item { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-body-sm); }
.eco-affected-dot  { color: var(--accent); font-size: 10px; flex-shrink: 0; }
.eco-approvers     { display: flex; flex-direction: column; gap: var(--sp-2); }
.eco-approver-row  { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-body-sm); }

/* ═══════════════════════════════════════════════════════════════════════════
   Module 10 — Partner Portal & Acknowledgement
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Portal header ───────────────────────────────────────────────────────── */
.partner-header {
  background: linear-gradient(135deg, #0F766E 0%, #0D9488 100%);
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.partner-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.partner-header-title {
  font-size: var(--fs-subhead);
  font-weight: 800;
  letter-spacing: -.01em;
}
.partner-header-sub {
  font-size: var(--fs-body-sm);
  opacity: .75;
}
.partner-header-role {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-body-sm);
}
.partner-role-name { font-weight: 700; }

/* ── Role switcher ───────────────────────────────────────────────────────── */
.partner-role-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.partner-role-btns  { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.partner-role-btn   {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all .12s;
}
.partner-role-btn:hover  { border-color: var(--accent); color: var(--accent); }
.partner-role-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.partner-isolation-note  {
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  background: #FFFBEB;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

/* ── Task panel ──────────────────────────────────────────────────────────── */
.partner-task-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.partner-task-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}
.partner-task-title  { font-weight: 700; font-size: var(--fs-body); }

/* ── Task type badge ─────────────────────────────────────────────────────── */
.partner-task-type-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

/* ── Status badges ───────────────────────────────────────────────────────── */
.partner-status-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.partner-status-new        { background: #EFF6FF; color: #1D4ED8; }
.partner-status-viewed     { background: #F3F4F6; color: #374151; }
.partner-status-submitted  { background: #FEF3C7; color: #92400E; }
.partner-status-ack        { background: #DCFCE7; color: #166534; }
.partner-status-overdue    { background: #FEE2E2; color: #991B1B; }

/* ── Release detail (partner view) ──────────────────────────────────────── */
.partner-release-status-bar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-3);
}
.partner-file-list { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.partner-file-row  {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.partner-dl-btn { font-size: 11px !important; padding: 0 8px !important; height: 24px !important; }

/* ── Acknowledgement record ──────────────────────────────────────────────── */
.partner-ack-record {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.partner-ack-confirmed { font-size: var(--fs-body-sm); font-weight: 700; color: #166534; margin-bottom: var(--sp-3); }
.partner-ack-conf-label { font-size: var(--fs-body-sm); font-weight: 600; margin-bottom: var(--sp-2); }
.partner-ack-conf-text  {
  font-size: var(--fs-body-sm);
  font-style: italic;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  margin-bottom: var(--sp-3);
}

/* ── Partner proposal row ────────────────────────────────────────────────── */
.partner-proposal-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODULE 11 — Settings & Administration
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Settings layout ─────────────────────────────────────────────────────── */
.settings-page { display: flex; flex-direction: column; }
.settings-layout {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  align-items: flex-start;
}

/* ── Settings left nav ───────────────────────────────────────────────────── */
.settings-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2) 0;
  position: sticky;
  top: var(--sp-4);
  align-self: flex-start;
  overflow: hidden;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 9px 16px;
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-nav-item:hover  { background: var(--surface-muted); color: var(--text); }
.settings-nav-item.active {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.settings-nav-icon { font-size: 15px; flex-shrink: 0; }
.settings-nav-sep {
  height: 1px;
  background: var(--border);
  margin: var(--sp-2) var(--sp-3);
}

/* ── Settings content panel ──────────────────────────────────────────────── */
.settings-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sp-4);
}

/* ── Settings section header ─────────────────────────────────────────────── */
.settings-section-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.settings-section-title {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--sp-1);
}
.settings-section-desc {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin: 0;
}

/* ── Settings sub-tabs ───────────────────────────────────────────────────── */
.settings-tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.settings-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.settings-tab-btn:hover { color: var(--text); }
.settings-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Settings card wrapper ───────────────────────────────────────────────── */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}

/* ── Supplier org grid ───────────────────────────────────────────────────── */
.settings-org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.settings-org-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
}
.settings-org-card-name {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-1);
}
.settings-org-card-meta {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}
.settings-org-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.settings-org-tag {
  font-size: 11px;
  padding: 2px 7px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
}

/* ── Template grid (project / brief / product) ───────────────────────────── */
.settings-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.settings-template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stc-header {
  padding: 12px var(--sp-3);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.stc-name {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text);
}
.stc-body {
  padding: var(--sp-3);
  flex: 1;
}
.stc-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--sp-1);
}
.stc-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--sp-2);
}
.stc-stage-pill {
  font-size: 11px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border-radius: 10px;
  font-weight: 500;
}
.stc-list {
  margin: 0;
  padding-left: 16px;
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
}
.stc-list li { margin-bottom: 3px; }
.stc-footer {
  padding: 10px var(--sp-3);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--sp-2);
}

/* ── Brief template grid ─────────────────────────────────────────────────── */
.settings-brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-3);
}
.settings-brief-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-brief-card-hdr {
  padding: 12px var(--sp-3);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.settings-brief-card-name {
  font-weight: 700;
  font-size: var(--fs-body);
  color: var(--text);
}
.settings-brief-card-body { padding: var(--sp-3); }
.settings-brief-section-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.settings-brief-section-row:last-child { border-bottom: none; }
.settings-brief-num {
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.settings-brief-section-name {
  font-size: var(--fs-body-sm);
  color: var(--text);
  font-weight: 500;
}
.settings-brief-req {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ── Readiness templates list ────────────────────────────────────────────── */
.settings-readiness-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.settings-readiness-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.settings-readiness-row:last-child { border-bottom: none; }
.settings-readiness-num {
  width: 22px;
  height: 22px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.settings-readiness-item { font-size: var(--fs-body-sm); color: var(--text); }

/* ── Workflow cards (approval rules) ─────────────────────────────────────── */
.settings-workflow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
  overflow: hidden;
}
.settings-workflow-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--sp-3);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: var(--fs-body);
}
.settings-workflow-steps {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.settings-workflow-step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-body-sm);
  color: var(--text);
}
.settings-workflow-step-num {
  width: 22px;
  height: 22px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-workflow-step-role {
  font-size: 11px;
  padding: 2px 7px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* ── Info note strip ─────────────────────────────────────────────────────── */
.settings-info-note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: 10px 14px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
}
.settings-info-note-icon { flex-shrink: 0; }

/* ── Code pattern display ────────────────────────────────────────────────── */
.settings-code-pattern {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  color: var(--text);
  display: inline-block;
}

/* ── Permission toggle (roles matrix) ───────────────────────────────────── */
.perm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.perm-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.perm-toggle-knob {
  display: inline-block;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.perm-toggle-knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.perm-toggle input:checked + .perm-toggle-knob {
  background: var(--accent);
}
.perm-toggle input:checked + .perm-toggle-knob::after {
  transform: translateX(14px);
}
.perm-toggle input:focus-visible + .perm-toggle-knob {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Danger variant */
.perm-toggle-danger .perm-toggle-knob { background: #FCA5A5; }
.perm-toggle-danger input:checked + .perm-toggle-knob { background: #EF4444; }

/* ── Roles permission matrix ─────────────────────────────────────────────── */
.roles-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}
.roles-matrix-table th {
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}
.roles-matrix-table th:first-child { text-align: left; }
.roles-matrix-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.roles-matrix-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}
.roles-matrix-table tr:hover td { background: var(--surface-muted); }
.roles-matrix-danger td:first-child { color: #EF4444; font-weight: 600; }


/* ═══════════════════════════════════════════════════════════════════════════
   NOTIFICATION FLYOUT PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.notif-panel {
  width: 360px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: var(--fs-body);
  color: var(--text);
  flex-shrink: 0;
}
.notif-panel-header-count {
  font-size: 11px;
  padding: 2px 7px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
}
.notif-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-1) 0;
}
.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-muted); }
.notif-item.unread {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.notif-item.unread:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.notif-item-top {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-bottom: 4px;
}
.notif-unread-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.notif-item-msg {
  font-size: var(--fs-body-sm);
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}
.notif-item-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: var(--sp-2);
}
.notif-item-link {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 2px;
  padding-left: 16px;
  text-decoration: none;
}
.notif-item-link:hover { text-decoration: underline; }
.notif-panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.notif-empty {
  padding: var(--sp-6);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SOURCING PLATFORM MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.sourcing-platform-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, #1e3a5f 0%, #2563EB 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) var(--sp-4);
}
.sourcing-platform-logo {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.sourcing-platform-title {
  font-size: var(--fs-body);
  font-weight: 700;
  color: #fff;
}
.sourcing-platform-sub {
  font-size: var(--fs-body-sm);
  color: rgba(255,255,255,.75);
}
.sourcing-results-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.sourcing-source-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.sourcing-source-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.sourcing-source-item:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.sourcing-source-item.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.sourcing-source-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.sourcing-source-body { flex: 1; min-width: 0; }
.sourcing-source-title {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.sourcing-source-meta {
  font-size: var(--fs-body-sm);
  color: var(--text-secondary);
}
.sourcing-source-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  align-self: flex-start;
}
.sourcing-source-badge.search-result  { background: #EFF6FF; color: #1D4ED8; }
.sourcing-source-badge.supplier-profile { background: #F0FDF4; color: #166534; }
.sourcing-source-badge.product-ref    { background: #FFF7ED; color: #C2410C; }
.sourcing-action-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}
.sourcing-action-or {
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════════════════
   ACTIVITY TIMELINE TAB
   ═══════════════════════════════════════════════════════════════════════════ */

.activity-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 24px;
}
.activity-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.activity-item {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  position: relative;
}
.activity-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  z-index: 1;
  flex-shrink: 0;
}
.activity-dot.dot-create  { border-color: #22C55E; background: #F0FDF4; }
.activity-dot.dot-update  { border-color: var(--accent); background: #EFF6FF; }
.activity-dot.dot-approve { border-color: #F59E0B; background: #FFFBEB; }
.activity-dot.dot-submit  { border-color: #8B5CF6; background: #F5F3FF; }
.activity-dot.dot-close   { border-color: var(--text-muted); background: var(--surface-muted); }
.activity-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}
.activity-action {
  font-size: var(--fs-body-sm);
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 3px;
}
.activity-action strong { font-weight: 600; }
.activity-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: 11px;
  color: var(--text-muted);
}
.activity-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-secondary);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH DROPDOWN ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.search-dropdown-section {
  padding: 4px 0 0;
}
.search-dropdown-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 14px 2px;
}
.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px 14px;
  cursor: pointer;
  font-size: var(--fs-body-sm);
  color: var(--text);
  transition: background 0.08s;
}
.search-dropdown-item:hover { background: var(--surface-muted); }
.search-dropdown-item-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  color: var(--text-secondary);
}
.search-dropdown-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-dropdown-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.search-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-1) 0;
}
.search-no-results {
  padding: var(--sp-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

/* ── Topbar notification bell badge ──────────────────────────────────────── */
.topbar-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid var(--surface);
  pointer-events: none;
}

/* ── Create (+) menu ─────────────────────────────────────────────────────── */
.create-menu {
  position: fixed;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  z-index: 200;
  padding: var(--sp-1) 0;
  overflow: hidden;
}
.create-menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 9px 16px;
  font-size: var(--fs-body-sm);
  color: var(--text);
  cursor: pointer;
  transition: background 0.08s;
}
.create-menu-item:hover { background: var(--surface-muted); }
.create-menu-item-icon { font-size: 15px; width: 18px; text-align: center; }
.create-menu-sep { height: 1px; background: var(--border); margin: var(--sp-1) 0; }
