/* ══════════════════════════════════════════════════════════════
   ClearPath Suite — COMPONENT STYLES
   Module-specific, charts, forms, specialized components
   v1.5.0 — Date Range Bar, Favourites, Bulk Actions, Dark Mode
══════════════════════════════════════════════════════════════ */

/* ── BADGE SEVERITY PILLS (used in KPI Trends, Admin, etc.) ──── */
.badge-red    { background: var(--red-100);   color: var(--red-600);   }
.badge-orange { background: #FFF3E0;           color: #E65100;          }
.badge-yellow { background: #FFFDE7;           color: #F57F17;          }
.badge-blue   { background: #DBEAFE;           color: #1D4ED8;          }
.badge-grey   { background: var(--grey-100);   color: var(--grey-600);  }
.badge-green  { background: var(--green-100);  color: var(--green-600); }

/* ── STATUS PILLS (shared across modules) ──────────────────── */
.status-approved   { background: var(--green-100);  color: var(--green-600); }
.status-draft      { background: var(--grey-100);   color: var(--grey-600);  }
.status-submitted  { background: #DBEAFE;           color: #1D4ED8;          }
.status-under_review { background: var(--amber-100); color: var(--amber-600); }
.status-rejected   { background: var(--red-100);    color: var(--red-600);   }
.status-archived   { background: var(--grey-100);   color: var(--grey-400);  }
.status-open       { background: #DBEAFE;           color: #1565C0;          }
.status-in_progress{ background: var(--green-100);  color: var(--green-600); }
.status-blocked    { background: var(--red-100);    color: #C62828;          }
.status-done       { background: var(--grey-100);   color: var(--grey-500);  }
.status-closed     { background: var(--grey-100);   color: var(--grey-400);  }

/* ── DASHBOARD ──────────────────────────────────────────────── */

/* stat-icon WFS brand colour (red) */
.stat-icon.wfs { background: var(--wfs-100); color: var(--wfs-700); }

/* ── Date Range Filter Bar ──────── */
.dash-date-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-light, var(--grey-150));
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.dash-date-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-date-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.dash-date-pill {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--grey-200);
  background: var(--grey-50);
  color: var(--grey-600);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.dash-date-pill:hover { background: var(--grey-100); border-color: var(--grey-300); }
.dash-date-pill.active {
  background: var(--wfs-600);
  color: #fff;
  border-color: var(--wfs-600);
  box-shadow: 0 2px 8px rgba(232,25,44,.25);
}
.dash-date-range-label {
  font-size: .76rem;
  color: var(--wfs-600);
  font-weight: 700;
  padding: 4px 10px;
  background: var(--wfs-50);
  border-radius: 999px;
  border: 1px solid var(--wfs-100);
  white-space: nowrap;
}

/* ── Favourites Bar ─────────────── */
.dash-fav-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-light, var(--grey-150));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.dash-fav-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.dash-fav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.dash-fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--grey-200);
  background: var(--grey-50);
  color: var(--grey-700);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.dash-fav-chip:hover { background: var(--wfs-50); border-color: var(--wfs-600); color: var(--wfs-700); }
.dash-fav-chip .fa-star, .dash-fav-chip .fa-bookmark { color: var(--gold-500); }
.dash-fav-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--grey-400);
  font-size: .65rem;
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.dash-fav-remove:hover { background: var(--red-100); color: var(--red-600); }

/* ── Bulk Action Bar (Tasks) ──────── */
.bulk-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: #F0F7FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
  margin-bottom: 12px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.bulk-count {
  font-size: .84rem;
  font-weight: 700;
  color: #1E40AF;
  white-space: nowrap;
  padding-right: 8px;
  border-right: 1px solid #BFDBFE;
}
.bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.bulk-sel {
  padding: 5px 10px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--grey-700);
}
.bulk-input {
  padding: 5px 10px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: .8rem;
  font-family: inherit;
  color: var(--grey-700);
  min-width: 150px;
}
.task-row-selected { background: rgba(232,25,44,.04) !important; }
.task-row-selected td { border-bottom-color: rgba(232,25,44,.1) !important; }

/* ── Activity Feed ─────────────── */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--grey-100);
  font-size: .82rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.activity-text { flex: 1; color: var(--grey-800); line-height: 1.4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: .72rem; color: var(--grey-400); white-space: nowrap; flex-shrink: 0; margin-left: 4px; }

/* ── Alerts Feed ───────────────── */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--grey-100);
  cursor: pointer;
  transition: var(--transition);
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { opacity: .8; }
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: .85rem; font-weight: 600; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-meta { font-size: .72rem; color: var(--grey-400); margin-top: 2px; }

/* ── Escalation badge ───────────────────── */
.esc-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 700;
  background: #FFF3E0; color: #BF360C;
  border: 1px solid #FFAB91;
  border-radius: 10px; padding: 1px 8px;
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
/* Alerts module escalated alert row */
#module-container .alert-item.alert-escalated {
  border-left: 3px solid #BF360C;
  background: #FFFDE7;
}
html.dark-mode #module-container .alert-item.alert-escalated {
  background: rgba(191,54,12,.1);
  border-color: #BF360C;
}
/* Read count link */
.alert-read-count:hover { text-decoration: underline; }

/* ── Priority Action — info variant */
.priority-action.info { border-color: #60A5FA; background: #EFF6FF; }
html.dark-mode .priority-action.info { background: rgba(29,78,216,.12); border-color: #3B82F6; }

.health-score-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 8px solid var(--grey-150);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.health-score-ring .score-val { font-size: 1.6rem; font-weight: 800; color: var(--wfs-600); }
.health-score-ring.good { border-color: var(--green-400); }
.health-score-ring.warn { border-color: var(--amber-400); }
.health-score-ring.bad { border-color: var(--red-400); }

.priority-panel { display: flex; flex-direction: column; gap: 8px; }
.priority-action {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--grey-50);
  border-radius: var(--radius);
  border-left: 3px solid var(--wfs-500);
  font-size: .85rem;
  transition: var(--transition);
}
.priority-action:hover { background: var(--wfs-50); }
.priority-action .pa-icon { font-size: .9rem; color: var(--wfs-600); flex-shrink: 0; }
.priority-action .pa-text { flex: 1; color: var(--grey-800); }
.priority-action .pa-tag { font-size: .72rem; color: var(--grey-400); white-space: nowrap; }
.priority-action.critical { border-color: var(--red-500); background: #FFF5F5; }
.priority-action.warning { border-color: var(--amber-400); background: var(--amber-100); }

.ranking-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grey-100); }
.ranking-row:last-child { border-bottom: none; }
.ranking-num { font-size: .8rem; font-weight: 700; color: var(--grey-400); width: 20px; text-align: center; }
.ranking-site { flex: 1; font-size: .88rem; font-weight: 500; color: var(--grey-900); }
.ranking-score { font-size: .88rem; font-weight: 700; color: var(--wfs-600); }
.ranking-trend { font-size: .75rem; margin-left: 4px; }
.ranking-trend.up { color: var(--green-500); }
.ranking-trend.down { color: var(--red-500); }

/* ── PROJECT MODULE ─────────────────────────────────────────── */
.project-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-150);
  transition: var(--transition);
  cursor: pointer;
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--wfs-100); transform: translateY(-1px); }
.project-card-archived { opacity: .7; background: var(--grey-50) !important; border-style: dashed !important; }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.project-name { font-weight: 700; font-size: 1rem; color: var(--grey-900); }
.project-code { font-size: .75rem; color: var(--grey-400); font-weight: 500; margin-top: 2px; }
.project-meta { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.project-meta-row { display: flex; justify-content: space-between; font-size: .8rem; }
.project-meta-label { color: var(--grey-500); }
.project-meta-value { color: var(--grey-800); font-weight: 500; }
.project-progress-label { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: 4px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* View toggle active state */
.proj-view-btn.active-view { background: var(--wfs-100) !important; color: var(--wfs-700) !important; border-color: var(--wfs-300) !important; }

/* ── PROJECT KANBAN ──────────────────────────────────────────── */
.proj-kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) { .proj-kanban-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .proj-kanban-board { grid-template-columns: 1fr; } }

.proj-kanban-col {
  background: var(--grey-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-150);
  overflow: hidden;
}
.proj-kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--grey-150);
  background: #fff;
  font-size: .85rem;
}
.proj-kanban-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.proj-kanban-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--grey-150);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}
.proj-kanban-card:hover { box-shadow: var(--shadow); border-color: var(--wfs-100); transform: translateY(-1px); }

/* dark mode kanban */
html.dark-mode .proj-kanban-col { background: var(--surface-card); border-color: var(--border-color); }
html.dark-mode .proj-kanban-col-header { background: var(--surface-sidebar); }
html.dark-mode .proj-kanban-card { background: var(--surface-card); border-color: var(--border-color); }

/* ── KPI MODULE ─────────────────────────────────────────────── */
.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--grey-150);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow); border-color: var(--wfs-100); }
.kpi-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.kpi-name { font-weight: 700; font-size: .95rem; color: var(--grey-900); }
.kpi-category { font-size: .73rem; background: var(--wfs-100); color: var(--wfs-700); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.kpi-values { display: flex; gap: 16px; margin: 10px 0; }
.kpi-val-block { text-align: center; }
.kpi-val-num { font-size: 1.3rem; font-weight: 800; color: var(--grey-900); line-height: 1; }
.kpi-val-label { font-size: .72rem; color: var(--grey-400); margin-top: 2px; }
.kpi-formula { font-size: .78rem; color: var(--grey-500); background: var(--grey-50); padding: 6px 10px; border-radius: var(--radius-sm); margin-top: 8px; font-family: monospace; }

/* ── DATA INPUT MODULE ──────────────────────────────────────── */
.data-entry-form { max-width: 720px; }
.data-entry-form .field-group { margin-bottom: 14px; }
.upload-zone {
  border: 2px dashed var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--grey-50);
}
.upload-zone:hover { border-color: var(--wfs-500); background: var(--wfs-50); }
.upload-zone.drag-over { border-color: var(--wfs-600); background: var(--wfs-100); }
.upload-icon { font-size: 2.5rem; color: var(--grey-300); margin-bottom: 12px; }
.upload-zone h4 { font-size: 1rem; color: var(--grey-700); margin-bottom: 4px; }
.upload-zone p { font-size: .82rem; color: var(--grey-400); }
.validation-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: .85rem;
}
.validation-banner.success { background: var(--green-100); color: var(--green-600); }
.validation-banner.error { background: var(--red-100); color: var(--red-600); }
.validation-banner.warning { background: var(--amber-100); color: var(--amber-600); }

/* ── REPORT BUILDER ─────────────────────────────────────────── */
.report-template-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px solid var(--grey-150);
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}
.report-template-card:hover { border-color: var(--wfs-500); box-shadow: var(--shadow); }
.report-template-card.selected { border-color: var(--wfs-600); background: var(--wfs-50); }
.report-template-icon { font-size: 2rem; color: var(--wfs-600); margin-bottom: 10px; }
.report-template-card h4 { font-size: .9rem; font-weight: 700; color: var(--grey-900); margin-bottom: 4px; }
.report-template-card p { font-size: .78rem; color: var(--grey-500); }
.report-preview {
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 32px;
  font-size: .88rem;
  line-height: 1.6;
}
.report-header-section {
  border-bottom: 3px solid var(--blue-700);
  padding-bottom: 16px;
  margin-bottom: 24px;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.report-title-main { font-size: 1.4rem; font-weight: 800; color: var(--blue-900); }
.report-title-sub { font-size: .85rem; color: var(--grey-500); }
.report-section { margin-bottom: 20px; }
.report-section-title { font-size: 1rem; font-weight: 700; color: var(--blue-700); border-bottom: 1px solid var(--grey-150); padding-bottom: 6px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; font-size: .82rem; }

/* ── CI TOOLKIT ─────────────────────────────────────────────── */
.a3-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a3-cell {
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}
.a3-cell-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--blue-700); margin-bottom: 8px; }
.a3-cell textarea { width: 100%; border: none; outline: none; resize: vertical; min-height: 80px; font-size: .88rem; color: var(--grey-800); }

.dmaic-phases { display: flex; gap: 0; margin-bottom: 20px; overflow: hidden; border-radius: var(--radius); }
.dmaic-phase {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: .82rem;
  transition: var(--transition);
  color: rgba(255,255,255,.7);
}
.dmaic-phase.active { color: #fff; }
.dmaic-phase:nth-child(1) { background: #1565C0; }
.dmaic-phase:nth-child(2) { background: #0277BD; }
.dmaic-phase:nth-child(3) { background: #00838F; }
.dmaic-phase:nth-child(4) { background: #2E7D32; }
.dmaic-phase:nth-child(5) { background: #558B2F; }
.dmaic-phase:hover { filter: brightness(1.1); }
.dmaic-phase.active { filter: brightness(1.15); color: #fff; box-shadow: inset 0 -3px 0 rgba(255,255,255,.4); }

.fishbone-container { overflow-x: auto; background: var(--grey-50); border-radius: var(--radius); padding: 20px; }
.fishbone-canvas { min-width: 600px; }

.five-why-row {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 10px;
  padding: 12px;
  background: var(--grey-50);
  border-radius: var(--radius);
}
.why-num {
  width: 28px; height: 28px;
  background: var(--blue-700);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.five-why-row textarea { flex: 1; border: 1.5px solid var(--grey-200); border-radius: var(--radius-sm); padding: 8px 10px; font-size: .88rem; min-height: 60px; resize: vertical; }
.five-why-row textarea:focus { outline: none; border-color: var(--blue-500); }

/* ── CI TOOLKIT dark-mode card tones ─────────────────────────── */
html.dark-mode .tk-tool-card,
html.dark-mode .toolkit-card {
  background: var(--surface-card);
  border-color: var(--border-color);
}
html.dark-mode .tk-tool-card h3,
html.dark-mode .toolkit-card h3 { color: var(--text-primary); }
html.dark-mode .tk-tool-card p,
html.dark-mode .toolkit-card p  { color: var(--text-muted-var); }

/* ── CI TOOLKIT EXPANDED ─────────────────────────────────────── */
.tk-category { margin-bottom: 32px; }
.tk-cat-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--grey-100);
}
.tk-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.tk-tool-card {
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--grey-150);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tk-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--grey-200);
}
.tk-tool-card .toolkit-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.tk-tool-card h3 { font-size: .88rem; font-weight: 700; color: var(--grey-900); margin: 0; line-height: 1.3; }
.tk-tool-card p  { font-size: .78rem; color: var(--grey-500); line-height: 1.4; margin: 0; }

/* SWOT Grid */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.swot-cell {
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--grey-200);
}
.swot-s { background: #E8F5E9; border-left: 4px solid #2E7D32; }
.swot-w { background: #FFF3E0; border-left: 4px solid #E65100; }
.swot-o { background: #E3F2FD; border-left: 4px solid #1565C0; }
.swot-t { background: #FCE4EC; border-left: 4px solid #C62828; }
.swot-label { font-size: .82rem; font-weight: 700; color: var(--grey-700); margin-bottom: 8px; }
.swot-cell textarea { width: 100%; border: none; outline: none; background: transparent; resize: vertical; min-height: 100px; font-size: .88rem; color: var(--grey-800); }

/* ── DOCUMENTS ──────────────────────────────────────────────── */
.doc-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--grey-150);
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
  cursor: pointer;
}
.doc-card:hover { box-shadow: var(--shadow); border-color: var(--blue-200); }
.doc-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.doc-icon.excel { background: #E8F5E9; color: #2E7D32; }
.doc-icon.pdf { background: var(--red-100); color: var(--red-600); }
.doc-icon.ppt { background: #FFF3E0; color: #E65100; }
.doc-icon.link { background: var(--blue-100); color: var(--blue-700); }
.doc-icon.word { background: #E3F2FD; color: #1565C0; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: .88rem; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: .75rem; color: var(--grey-400); margin-top: 2px; }
.doc-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.doc-tag { background: var(--grey-100); color: var(--grey-600); padding: 2px 8px; border-radius: 10px; font-size: .7rem; font-weight: 500; }
.doc-version-badge { background: var(--wfs-100); color: var(--wfs-700); padding: 1px 7px; border-radius: 10px; font-size: .7rem; font-weight: 700; margin-left: 6px; letter-spacing: .3px; }

/* ── BENCHMARKING ───────────────────────────────────────────── */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding: 20px 0; }
.podium-place { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.podium-block {
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-weight: 800; color: #fff; font-size: 1.5rem;
  width: 70px;
}
.podium-block.gold { height: 100px; background: linear-gradient(135deg, #FFD700, #FFA000); }
.podium-block.silver { height: 76px; background: linear-gradient(135deg, #9E9E9E, #616161); }
.podium-block.bronze { height: 58px; background: linear-gradient(135deg, #CD7F32, #8D4E1A); }
.podium-label { font-size: .78rem; font-weight: 700; color: var(--grey-700); text-align: center; max-width: 80px; }
.podium-score { font-size: .82rem; color: var(--grey-500); }

.bench-matrix { overflow-x: auto; }
.bench-matrix table th:first-child, .bench-matrix table td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
.bench-cell-high { background: var(--green-100); color: var(--green-700); font-weight: 600; border-radius: 4px; }
.bench-cell-mid { background: var(--amber-100); color: var(--amber-700); font-weight: 600; border-radius: 4px; }
.bench-cell-low { background: var(--red-100); color: var(--red-700); font-weight: 600; border-radius: 4px; }

/* ── SETTINGS ───────────────────────────────────────────────── */
.settings-section { margin-bottom: 32px; }
.settings-section h3 { font-size: 1rem; font-weight: 700; color: var(--grey-900); border-bottom: 1px solid var(--grey-150); padding-bottom: 8px; margin-bottom: 16px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-100);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: .88rem; font-weight: 500; color: var(--grey-800); }
.settings-desc { font-size: .78rem; color: var(--grey-400); margin-top: 2px; }
.toggle-switch {
  width: 40px; height: 22px;
  background: var(--grey-200);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--blue-700); }
.toggle-switch::after {
  content: '';
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch.on::after { transform: translateX(18px); }

.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-100);
}
.user-row:last-child { border-bottom: none; }
.user-row-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-100); color: var(--blue-700); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.user-row-info { flex: 1; }
.user-row-name { font-weight: 600; font-size: .9rem; color: var(--grey-900); }
.user-row-email { font-size: .78rem; color: var(--grey-400); }
.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.role-admin { background: var(--blue-100); color: var(--blue-800); }
.role-ci_manager { background: var(--green-100); color: var(--green-700); }
.role-ci_analyst { background: var(--amber-100); color: var(--amber-700); }
.role-site_user { background: var(--grey-100); color: var(--grey-700); }

/* ── AUDIT LOG ──────────────────────────────────────────────── */
.audit-entry {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-100);
  font-size: .84rem;
}
.audit-entry:last-child { border-bottom: none; }
.audit-time { font-size: .75rem; color: var(--grey-400); white-space: nowrap; min-width: 80px; }
.audit-user { font-weight: 600; color: var(--grey-800); min-width: 120px; }
.audit-action { flex: 1; color: var(--grey-700); }
.audit-resource { font-size: .75rem; background: var(--grey-100); padding: 1px 8px; border-radius: 10px; color: var(--grey-600); white-space: nowrap; }

/* ── CHART BUILDER ──────────────────────────────────────────── */
.chart-type-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.chart-type-btn {
  padding: 12px 8px;
  border: 2px solid var(--grey-150);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: .78rem;
  font-weight: 500;
  color: var(--grey-600);
}
.chart-type-btn:hover { border-color: var(--blue-400); color: var(--blue-700); }
.chart-type-btn.selected { border-color: var(--blue-700); background: var(--blue-50); color: var(--blue-700); }
.chart-type-btn i { display: block; font-size: 1.4rem; margin-bottom: 6px; }
.chart-canvas-wrap { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--grey-150); padding: 20px; min-height: 300px; display: flex; align-items: center; justify-content: center; }

/* ── ONBOARDING WIZARD STEPS ────────────────────────────────── */
.wizard-steps { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.wizard-step { display: flex; align-items: center; flex: 1; }
.wizard-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--grey-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  color: var(--grey-400);
  flex-shrink: 0;
  transition: var(--transition);
}
.wizard-step.done .wizard-step-circle { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.wizard-step.active .wizard-step-circle { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.wizard-step-line { flex: 1; height: 2px; background: var(--grey-150); }
.wizard-step.done .wizard-step-line { background: var(--green-400); }

/* ── INFO BOXES ─────────────────────────────────────────────── */
.info-box {
  display: flex; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .84rem;
  margin-bottom: 12px;
}
.info-box.blue { background: #DBEAFE; color: #1E3A8A; border-left: 3px solid #2563EB; }
.info-box.green { background: var(--green-100); color: var(--green-700); border-left: 3px solid var(--green-500); }
.info-box.amber { background: var(--amber-100); color: var(--amber-700); border-left: 3px solid var(--amber-500); }
.info-box.red    { background: var(--red-100);    color: var(--red-700);    border-left: 3px solid var(--red-500); }
.info-box.orange { background: var(--amber-100);  color: var(--amber-700);  border-left: 3px solid var(--amber-600); }
.info-box.purple { background: #EDE7F6;            color: #512DA8;           border-left: 3px solid #7C4DFF; }
.info-box i { flex-shrink: 0; margin-top: 1px; }

/* ── DATA TABLE TOOLBAR ─────────────────────────────────────── */
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.table-search-input {
  padding: 7px 12px 7px 34px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: .85rem;
  width: 220px;
  position: relative;
}
.table-search-wrap { position: relative; }
.table-search-wrap .fa-search { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--grey-400); font-size: .8rem; pointer-events: none; }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; justify-content: flex-end; }
.page-btn {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--grey-600);
  transition: var(--transition);
  border: 1px solid transparent;
}
.page-btn:hover { background: var(--grey-100); }
.page-btn.active { background: var(--blue-700); color: #fff; border-color: var(--blue-700); }
.page-btn:disabled { opacity: .4; pointer-events: none; }

/* ── SECTION SEPARATOR ──────────────────────────────────────── */
.section-sep { height: 1px; background: var(--grey-150); margin: 20px 0; }

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION INBOX
══════════════════════════════════════════════════════════════ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--grey-50);
  border: 1px solid var(--grey-150);
  transition: var(--transition);
}
.notif-item:hover { border-color: var(--grey-300); background: #fff; }
.notif-unread { background: #EFF6FF; border-color: #BFDBFE; }
.notif-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .88rem; font-weight: 700; color: var(--grey-900); margin-bottom: 2px; }
.notif-text { font-size: .82rem; color: var(--grey-600); margin-bottom: 6px; line-height: 1.4; }
.notif-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notif-type-badge { font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.notif-time { font-size: .72rem; color: var(--grey-400); }
.notif-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
@media (max-width: 600px) {
  .notif-item { flex-wrap: wrap; }
  .notif-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}

/* ══════════════════════════════════════════════════════════════
   PEOPLE HUB — MESSAGING
══════════════════════════════════════════════════════════════ */
.convo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--grey-100);
}
.convo-row:hover { background: var(--grey-50); }
.convo-row.active { background: var(--wfs-50); }
.convo-row:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   PROJECT GANTT
══════════════════════════════════════════════════════════════ */
.gantt-project-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--grey-100);
  transition: background .15s;
}
.gantt-project-row:hover { background: var(--grey-50); }
.gantt-project-row.active { background: var(--wfs-50); border-left: 3px solid var(--wfs-600); }
.gantt-project-row:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   TEAM TRACKER — PENDING VALIDATION
══════════════════════════════════════════════════════════════ */
.pending-val-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-100);
}
.pending-val-row:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   KPI TREND ALERTS
══════════════════════════════════════════════════════════════ */
.trend-alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--grey-50);
  border: 1px solid var(--grey-150);
  margin-bottom: 6px;
  font-size: .84rem;
}
.trend-alert-row.critical { border-color: var(--wfs-300, #F47C88); background: var(--wfs-50); }
.trend-alert-row.high { border-color: var(--amber-300, #FFCC80); background: var(--amber-50, #FFF8E1); }
.trend-severity-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   SITE PACK
══════════════════════════════════════════════════════════════ */
.site-pack-card {
  border-left: 4px solid var(--wfs-600);
}
.site-pack-week {
  font-size: .75rem;
  color: var(--grey-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ══════════════════════════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════════════════════════ */
.admin-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--grey-100);
  font-size: .84rem;
}
.admin-stat-row:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   ROLE BADGE
══════════════════════════════════════════════════════════════ */
.role-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.role-badge.role-admin { background: var(--wfs-100); color: var(--wfs-700); }
.role-badge.role-ci_manager { background: var(--blue-100); color: var(--blue-800); }
.role-badge.role-ci_analyst { background: var(--green-100); color: var(--green-700); }
.role-badge.role-site_user { background: var(--grey-100); color: var(--grey-600); }

/* ══════════════════════════════════════════════════════════════
   DATA TABLE (shared)
══════════════════════════════════════════════════════════════ */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--grey-150);
  border-radius: var(--radius);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.data-table th {
  background: var(--grey-50);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--grey-600);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--grey-150);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 12px;
  vertical-align: middle;
}
.data-table tr:hover td {
  background: var(--grey-50);
}

/* ══════════════════════════════════════════════════════════════
   CAPA / ACTION TRACKER
══════════════════════════════════════════════════════════════ */
.detail-section {
  background: var(--grey-50);
  border: 1px solid var(--grey-150);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.detail-section-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--grey-700);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.detail-section-body {
  font-size: .88rem;
  color: var(--grey-700);
  line-height: 1.65;
  white-space: pre-wrap;
}

/* Severity badges for CAPA */
.severity-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.severity-critical { background: #FEE2E2; color: #991B1B; }
.severity-high     { background: #FEF3C7; color: #92400E; }
.severity-medium   { background: #DBEAFE; color: #1E40AF; }
.severity-low      { background: #F3F4F6; color: #374151; }

/* ══════════════════════════════════════════════════════════════
   PERSONAL PERFORMANCE INDICATORS (PPI)
══════════════════════════════════════════════════════════════ */

/* PPI Cards Grid */
.ppi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.ppi-card {
  background: #fff;
  border: 1px solid var(--grey-150);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: box-shadow .15s, transform .1s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ppi-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

.ppi-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: space-between;
}

.ppi-progress-wrap {
  flex: 1;
}

.ppi-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--grey-100);
  padding-top: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

/* Mini grid inside supervisor cards on Supervisors tab */
.ppi-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

/* Hierarchy / Job Title badges for sidebar */
.jt-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 4px;
}

/* Role separation info box in user dropdown */
.dd-job-title-wrap {
  font-size: .72rem;
  font-weight: 600;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 8px;
  display: inline-block;
}

/* Hierarchy org chart */
.hierarchy-level-bar {
  height: 4px;
  border-radius: 4px;
  background: var(--grey-200);
  margin: 4px 0;
  overflow: hidden;
}
.hierarchy-level-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

/* Manager metrics badge in sidebar/nav */
.nav-item .manager-badge {
  font-size: .6rem;
  background: var(--wfs-100);
  color: var(--wfs-700);
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: auto;
  font-weight: 700;
}

/* PPI dark-mode card */
html.dark-mode .ppi-card {
  background: var(--surface-card);
  border-color: var(--border-color);
}
html.dark-mode .ppi-card-footer {
  border-top-color: var(--border-color);
}

/* PPI status colours */
.ppi-status-on_track  { background: #D1FAE5; color: #065F46; }
.ppi-status-at_risk   { background: #FEF3C7; color: #92400E; }
.ppi-status-off_track { background: #FEE2E2; color: #991B1B; }

/* ── COMMAND PALETTE (Cmd/Ctrl+K) ──────────────────────────── */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(2px);
  animation: fadeIn .12s ease;
}
.cmd-palette-overlay.hidden { display: none; }
.cmd-palette-box {
  width: min(640px, 94vw);
  background: var(--surface-card, #fff);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28), 0 2px 12px rgba(0,0,0,.12);
  overflow: hidden;
  border: 1px solid var(--grey-150);
}
.cmd-palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--grey-100);
}
.cmd-palette-icon {
  font-size: 1.1rem;
  color: var(--grey-400);
  flex-shrink: 0;
}
.cmd-palette-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: var(--grey-900);
  background: transparent;
  font-weight: 500;
}
.cmd-palette-search input::placeholder { color: var(--grey-400); font-weight: 400; }
.cmd-esc-hint {
  font-size: .7rem;
  background: var(--grey-100);
  color: var(--grey-500);
  border: 1px solid var(--grey-200);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  flex-shrink: 0;
}
.cmd-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}
.cmd-palette-group-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--grey-400);
  padding: 8px 12px 4px;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s;
  border: none;
  width: 100%;
  text-align: left;
  background: transparent;
}
.cmd-palette-item:hover,
.cmd-palette-item.active {
  background: var(--wfs-50, #FFF0F1);
}
.cmd-palette-item.active { background: var(--wfs-100, #FFDCE0); }
.cmd-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.cmd-item-text { flex: 1; min-width: 0; }
.cmd-item-label { font-size: .875rem; font-weight: 600; color: var(--grey-900); }
.cmd-item-desc  { font-size: .75rem; color: var(--grey-400); margin-top: 1px; }
.cmd-item-kbd   { font-size: .68rem; background: var(--grey-100); color: var(--grey-500); border: 1px solid var(--grey-200); border-radius: 4px; padding: 2px 6px; font-family: monospace; flex-shrink: 0; }
.cmd-palette-footer {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--grey-100);
  background: var(--grey-50);
}
.cmd-palette-footer span { font-size: .72rem; color: var(--grey-400); display: flex; align-items: center; gap: 4px; }
.cmd-palette-footer kbd { background: var(--grey-100); border: 1px solid var(--grey-200); border-radius: 3px; padding: 1px 5px; font-size: .7rem; font-family: monospace; color: var(--grey-600); }

/* Dark mode overrides */
html.dark-mode .cmd-palette-box {
  background: var(--surface-card, #1E293B);
  border-color: var(--border-color);
}
html.dark-mode .cmd-palette-search { border-bottom-color: var(--border-color); }
html.dark-mode .cmd-palette-search input { color: var(--grey-100); }
html.dark-mode .cmd-palette-footer { background: rgba(255,255,255,.04); border-top-color: var(--border-color); }
html.dark-mode .cmd-palette-item:hover,
html.dark-mode .cmd-palette-item.active { background: rgba(232,25,44,.14); }
html.dark-mode .cmd-item-label { color: var(--grey-100); }
html.dark-mode .cmd-esc-hint,
html.dark-mode .cmd-palette-footer kbd { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); color: var(--grey-400); }

@media (max-width: 640px) {
  .ppi-cards-grid { grid-template-columns: 1fr; }
  .ppi-mini-grid  { grid-template-columns: 1fr 1fr; }
}

