/**
 * PH Operational Modernization Platform — Design System
 * =====================================================
 * Complete visual design system for the custom frontend.
 * Loaded on every page via base.php. Pure CSS — no Tailwind.
 *
 * Brand colors are CSS custom properties and can be overridden
 * per agency via inline <style> in the page head.
 *
 * @version 1.0.0
 * @since   0.1.0
 */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
  /* ── Brand (overridable per agency via inline style) ── */
  --phmod-brand-primary: #2563eb;
  --phmod-brand-primary-light: #eff6ff;
  --phmod-brand-primary-dark: #1d4ed8;
  --phmod-brand-secondary: #0f766e;

  /* ── Semantic ── */
  --phmod-success: #059669;
  --phmod-success-light: #d1fae5;
  --phmod-warning: #d97706;
  --phmod-warning-light: #fef3c7;
  --phmod-danger: #dc2626;
  --phmod-danger-light: #fef2f2;
  --phmod-info: #2563eb;
  --phmod-info-light: #eff6ff;

  /* ── Neutrals ── */
  --phmod-text: #1e293b;
  --phmod-text-muted: #64748b;
  --phmod-text-light: #94a3b8;
  --phmod-bg: #f1f5f9;
  --phmod-surface: #ffffff;
  --phmod-border: #e2e8f0;
  --phmod-border-light: #f1f5f9;

  /* ── Spacing scale ── */
  --phmod-space-1: 0.25rem;   /* 4px */
  --phmod-space-2: 0.5rem;    /* 8px */
  --phmod-space-3: 0.75rem;   /* 12px */
  --phmod-space-4: 1rem;      /* 16px */
  --phmod-space-5: 1.25rem;   /* 20px */
  --phmod-space-6: 1.5rem;    /* 24px */
  --phmod-space-8: 2rem;      /* 32px */
  --phmod-space-10: 2.5rem;   /* 40px */
  --phmod-space-12: 3rem;     /* 48px */

  /* ── Typography ── */
  --phmod-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --phmod-font-mono: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --phmod-text-xs: 0.6875rem;   /* 11px */
  --phmod-text-sm: 0.75rem;     /* 12px */
  --phmod-text-base: 0.875rem;  /* 14px */
  --phmod-text-md: 1rem;        /* 16px */
  --phmod-text-lg: 1.25rem;     /* 20px */
  --phmod-text-xl: 1.5rem;      /* 24px */
  --phmod-text-2xl: 1.875rem;   /* 30px */

  /* ── Border radius ── */
  --phmod-radius: 6px;
  --phmod-radius-lg: 10px;
  --phmod-radius-full: 9999px;

  /* ── Shadows ── */
  --phmod-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --phmod-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --phmod-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --phmod-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --phmod-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* ── Transitions ── */
  --phmod-transition: 150ms ease;
  --phmod-transition-slow: 300ms ease;

  /* ── Layout ── */
  --phmod-topbar-height: 56px;
  --phmod-sidebar-width: 240px;
  --phmod-sidebar-collapsed: 56px;

  /* ── Z-index scale ── */
  --phmod-z-dropdown: 1000;
  --phmod-z-sticky: 1100;
  --phmod-z-sidebar: 1200;
  --phmod-z-overlay: 99999;
  --phmod-z-modal: 100000;
  --phmod-z-toast: 100010;
}


/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */

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

.phmod-wrap {
  font-family: var(--phmod-font-sans);
  font-size: var(--phmod-text-base);
  line-height: 1.5;
  color: var(--phmod-text);
  background-color: var(--phmod-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

.phmod-wrap *:focus-visible {
  outline: 2px solid var(--phmod-brand-primary);
  outline-offset: 2px;
}


/* ==========================================================================
   3. TOPBAR
   ========================================================================== */

.phmod-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--phmod-z-sticky);
  height: var(--phmod-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--phmod-space-6);
  background-color: var(--phmod-surface);
  border-bottom: 2px solid var(--phmod-brand-primary);
  box-shadow: none;
}

.phmod-topbar__left {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-3);
  min-width: 0;
}

.phmod-topbar__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--phmod-radius);
  background: transparent;
  color: var(--phmod-text);
  cursor: pointer;
  transition: background var(--phmod-transition);
}

.phmod-topbar__hamburger:hover {
  background: var(--phmod-bg);
}

.phmod-topbar__hamburger svg {
  width: 20px;
  height: 20px;
}

/* Hamburger icon via spans (base.php uses three <span> elements) */
.phmod-topbar__hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--phmod-text);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.phmod-topbar__hamburger span + span {
  margin-top: 4px;
}

/* Open state transforms */
.phmod-topbar__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.phmod-topbar__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.phmod-topbar__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

.phmod-topbar__logo {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.phmod-topbar__agency-name,
.phmod-topbar__site-name {
  font-size: var(--phmod-text-md);
  font-weight: 600;
  color: var(--phmod-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.phmod-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-4);
  flex-shrink: 0;
}

.phmod-topbar__user {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-2);
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
  padding-right: var(--phmod-space-3);
  border-right: 1px solid var(--phmod-border);
  margin-right: var(--phmod-space-1);
}

/* Topbar role badge — more visible than neutral gray */
.phmod-topbar .phmod-badge--neutral {
  background: var(--phmod-brand-primary-light);
  color: var(--phmod-brand-primary);
}

.phmod-topbar__user-name {
  font-weight: 500;
  color: var(--phmod-text);
}

/* ── Topbar links (Profile, Sign Out) — matches .phmod-topbar__link in PHP ── */

.phmod-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: var(--phmod-space-1);
  padding: var(--phmod-space-1) var(--phmod-space-3);
  font-size: var(--phmod-text-sm);
  font-weight: 500;
  color: var(--phmod-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--phmod-radius);
  background: transparent;
  cursor: pointer;
  transition: all var(--phmod-transition);
}

.phmod-topbar__link:hover {
  color: var(--phmod-text);
  background: var(--phmod-bg);
}

.phmod-topbar__link--logout:hover {
  color: var(--phmod-danger);
  background: var(--phmod-danger-light);
  border-color: rgba(220, 38, 38, 0.15);
}

/* Legacy alias — keep for backward compat */
.phmod-topbar__signout {
  display: inline-flex;
  align-items: center;
  gap: var(--phmod-space-1);
  padding: var(--phmod-space-1) var(--phmod-space-3);
  font-size: var(--phmod-text-sm);
  font-weight: 500;
  color: var(--phmod-text-muted);
  text-decoration: none;
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  background: transparent;
  cursor: pointer;
  transition: all var(--phmod-transition);
}

.phmod-topbar__signout:hover {
  color: var(--phmod-danger);
  border-color: var(--phmod-danger);
  background: var(--phmod-danger-light);
}

@media (max-width: 767px) {
  .phmod-topbar {
    padding: 0 var(--phmod-space-4);
  }

  .phmod-topbar__hamburger {
    display: flex;
  }

  .phmod-topbar__user-name,
  .phmod-topbar__user .phmod-badge {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .phmod-topbar {
    padding-left: calc(var(--phmod-sidebar-collapsed) + var(--phmod-space-6));
  }
}

@media (min-width: 1024px) {
  .phmod-topbar {
    padding-left: calc(var(--phmod-sidebar-width) + var(--phmod-space-6));
  }
}


/* ==========================================================================
   4. SIDEBAR
   ========================================================================== */

.phmod-sidebar {
  position: fixed;
  top: var(--phmod-topbar-height);
  left: 0;
  bottom: 0;
  z-index: var(--phmod-z-sidebar);
  width: var(--phmod-sidebar-width);
  background-color: var(--phmod-surface);
  border-right: 1px solid var(--phmod-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--phmod-space-3) 0;
  padding-bottom: var(--phmod-space-10);
  transition: width var(--phmod-transition-slow), transform var(--phmod-transition-slow);
}

.phmod-sidebar::-webkit-scrollbar {
  width: 4px;
}

.phmod-sidebar::-webkit-scrollbar-thumb {
  background: var(--phmod-border);
  border-radius: var(--phmod-radius-full);
}

/* ── Sidebar navigation ── */

.phmod-sidebar__group {
  padding: var(--phmod-space-1) 0;
}

.phmod-sidebar__group + .phmod-sidebar__group {
  border-top: 1px solid var(--phmod-border-light);
  margin-top: var(--phmod-space-1);
  padding-top: var(--phmod-space-2);
}

.phmod-sidebar__group-label {
  display: block;
  padding: var(--phmod-space-1) var(--phmod-space-4) var(--phmod-space-2);
  font-size: var(--phmod-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phmod-text-light);
  white-space: nowrap;
  overflow: hidden;
}

.phmod-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-3);
  padding: var(--phmod-space-2) var(--phmod-space-4);
  margin: 1px var(--phmod-space-2);
  font-size: var(--phmod-text-base);
  font-weight: 500;
  color: var(--phmod-text-muted);
  text-decoration: none;
  border-radius: var(--phmod-radius);
  border-left: 3px solid transparent;
  transition: all var(--phmod-transition);
  white-space: nowrap;
  overflow: hidden;
}

.phmod-sidebar__link:hover {
  color: var(--phmod-text);
  background: var(--phmod-bg);
}

.phmod-sidebar__link--active {
  color: var(--phmod-brand-primary);
  background: var(--phmod-brand-primary-light);
  border-left-color: var(--phmod-brand-primary);
  font-weight: 600;
}

.phmod-sidebar__link--active:hover {
  color: var(--phmod-brand-primary-dark);
  background: var(--phmod-brand-primary-light);
}

.phmod-sidebar__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.7;
}

.phmod-sidebar__link--active .phmod-sidebar__icon {
  opacity: 1;
}

.phmod-sidebar__icon svg {
  width: 18px;
  height: 18px;
}

.phmod-sidebar__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.phmod-sidebar__badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Sidebar: Tablet collapsed state ── */

@media (min-width: 768px) and (max-width: 1023px) {
  .phmod-sidebar {
    width: var(--phmod-sidebar-collapsed);
  }

  .phmod-sidebar__group-label,
  .phmod-sidebar__label,
  .phmod-sidebar__badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }

  .phmod-sidebar__link {
    justify-content: center;
    padding: var(--phmod-space-2) 0;
    margin: 1px var(--phmod-space-1);
    border-left-width: 0;
    gap: 0;
  }

  .phmod-sidebar__link--active {
    border-left-width: 0;
    border-bottom: 2px solid var(--phmod-brand-primary);
  }

  /* Expand on hover */
  .phmod-sidebar:hover {
    width: var(--phmod-sidebar-width);
    box-shadow: var(--phmod-shadow-lg);
  }

  .phmod-sidebar:hover .phmod-sidebar__group-label,
  .phmod-sidebar:hover .phmod-sidebar__label,
  .phmod-sidebar:hover .phmod-sidebar__badge {
    opacity: 1;
    width: auto;
  }

  .phmod-sidebar:hover .phmod-sidebar__link {
    justify-content: flex-start;
    padding: var(--phmod-space-2) var(--phmod-space-4);
    margin: 1px var(--phmod-space-2);
    border-left-width: 3px;
    gap: var(--phmod-space-3);
  }

  .phmod-sidebar:hover .phmod-sidebar__link--active {
    border-bottom: none;
  }
}

/* ── Sidebar: Mobile overlay ── */

@media (max-width: 767px) {
  .phmod-sidebar {
    transform: translateX(-100%);
    width: var(--phmod-sidebar-width);
    box-shadow: var(--phmod-shadow-xl);
    z-index: var(--phmod-z-overlay);
    top: 0;
    padding-top: calc(var(--phmod-topbar-height) + var(--phmod-space-3));
  }

  .phmod-sidebar--open {
    transform: translateX(0);
  }
}

/* ── Sidebar backdrop (mobile) ── */

.phmod-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--phmod-z-overlay) - 1);
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--phmod-transition-slow);
}

.phmod-sidebar-backdrop--visible {
  display: block;
  opacity: 1;
}


/* ==========================================================================
   5. MAIN CONTENT AREA
   ========================================================================== */

.phmod-main {
  padding-top: var(--phmod-topbar-height);
  min-height: 100vh;
  font-size: 15px; /* Fix 10: Bump base from 14px — more readable for government users */
}

.phmod-main__content {
  padding: var(--phmod-space-6);
  max-width: 1280px;
}

/* padding-left rules removed — layout.css owns sidebar offset via margin-left */

/* Fix 10: Form labels match main content font size */
.phmod-main .phmod-form-label {
  font-size: 15px;
}

/* Tables stay at 14px for data density */
.phmod-main .phmod-table td {
  font-size: var(--phmod-text-base);
}

@media (max-width: 767px) {
  .phmod-main__content {
    padding: var(--phmod-space-4);
  }
}


/* ==========================================================================
   6. CARDS
   ========================================================================== */

.phmod-card {
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius-lg);
  padding: var(--phmod-space-5);
  margin-bottom: var(--phmod-space-4);
}

.phmod-card--outlined {
  background: transparent;
}

.phmod-card--elevated {
  border-color: transparent;
  box-shadow: var(--phmod-shadow);
}

.phmod-card--elevated:hover {
  box-shadow: var(--phmod-shadow-md);
}

.phmod-card--clickable {
  cursor: pointer;
  transition: box-shadow var(--phmod-transition), border-color var(--phmod-transition);
}

.phmod-card--clickable:hover {
  border-color: var(--phmod-brand-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.phmod-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--phmod-space-4);
  margin-bottom: var(--phmod-space-4);
  border-bottom: 1px solid var(--phmod-border-light);
}

.phmod-card__header:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.phmod-card__title {
  font-size: var(--phmod-text-md);
  font-weight: 600;
  color: var(--phmod-text);
  margin: 0;
}

.phmod-card__subtitle {
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
  margin: var(--phmod-space-1) 0 0;
}

.phmod-card__body {
  /* Default: no special styling, just a container */
}

.phmod-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--phmod-space-3);
  padding-top: var(--phmod-space-4);
  margin-top: var(--phmod-space-4);
  border-top: 1px solid var(--phmod-border-light);
}

/* Compact card variant for lists */
.phmod-card--compact {
  padding: var(--phmod-space-3) var(--phmod-space-4);
}

.phmod-card--compact .phmod-card__header {
  padding-bottom: var(--phmod-space-3);
  margin-bottom: var(--phmod-space-3);
}

.phmod-card--compact .phmod-card__footer {
  padding-top: var(--phmod-space-3);
  margin-top: var(--phmod-space-3);
}


/* ==========================================================================
   7. BUTTONS
   ========================================================================== */

.phmod-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--phmod-space-2);
  padding: var(--phmod-space-2) var(--phmod-space-4);
  font-family: var(--phmod-font-sans);
  font-size: var(--phmod-text-base);
  font-weight: 500;
  line-height: 1.25rem;
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  background: var(--phmod-surface);
  color: var(--phmod-text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: all var(--phmod-transition);
  position: relative;
}

.phmod-btn:hover {
  background: var(--phmod-bg);
  border-color: var(--phmod-text-light);
}

.phmod-btn:active {
  transform: translateY(1px);
}

/* ── Variants ── */

.phmod-btn--primary {
  background: var(--phmod-brand-primary);
  color: #ffffff;
  border-color: var(--phmod-brand-primary);
}

.phmod-btn--primary:hover {
  background: var(--phmod-brand-primary-dark);
  border-color: var(--phmod-brand-primary-dark);
}

.phmod-btn--secondary {
  background: var(--phmod-bg);
  color: var(--phmod-text);
  border-color: var(--phmod-border);
}

.phmod-btn--secondary:hover {
  background: var(--phmod-border);
}

.phmod-btn--success {
  background: var(--phmod-success);
  color: #ffffff;
  border-color: var(--phmod-success);
}

.phmod-btn--success:hover {
  background: #047857;
  border-color: #047857;
}

.phmod-btn--danger {
  background: var(--phmod-danger);
  color: #ffffff;
  border-color: var(--phmod-danger);
}

.phmod-btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.phmod-btn--ghost {
  background: transparent;
  color: var(--phmod-text-muted);
  border-color: transparent;
}

.phmod-btn--ghost:hover {
  background: var(--phmod-bg);
  color: var(--phmod-text);
  border-color: transparent;
}

.phmod-btn--link {
  background: transparent;
  color: var(--phmod-brand-primary);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

.phmod-btn--link:hover {
  background: transparent;
  color: var(--phmod-brand-primary-dark);
  text-decoration: underline;
  border-color: transparent;
}

/* ── Sizes ── */

.phmod-btn--sm {
  padding: var(--phmod-space-1) var(--phmod-space-3);
  font-size: var(--phmod-text-sm);
  gap: var(--phmod-space-1);
}

.phmod-btn--lg {
  padding: var(--phmod-space-3) var(--phmod-space-6);
  font-size: var(--phmod-text-md);
}

/* ── Icon button ── */

.phmod-btn--icon {
  padding: var(--phmod-space-2);
  gap: 0;
}

.phmod-btn--icon.phmod-btn--sm {
  padding: var(--phmod-space-1);
}

.phmod-btn--icon.phmod-btn--lg {
  padding: var(--phmod-space-3);
}

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

.phmod-btn--lg svg {
  width: 20px;
  height: 20px;
}

/* ── Disabled ── */

.phmod-btn:disabled,
.phmod-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Loading ── */

.phmod-btn--loading {
  color: transparent;
  pointer-events: none;
}

.phmod-btn--loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: phmod-spin 0.6s linear infinite;
  /* Make the spinner visible even when text color is transparent */
}

.phmod-btn--primary.phmod-btn--loading::after {
  border-color: rgba(255, 255, 255, 0.4);
  border-right-color: transparent;
  border-top-color: #ffffff;
}

.phmod-btn--loading::after {
  border-color: rgba(0, 0, 0, 0.2);
  border-right-color: transparent;
  border-top-color: var(--phmod-text-muted);
}

/* ── Button group ── */

.phmod-btn-group {
  display: inline-flex;
}

.phmod-btn-group .phmod-btn {
  border-radius: 0;
}

.phmod-btn-group .phmod-btn + .phmod-btn {
  margin-left: -1px;
}

.phmod-btn-group .phmod-btn:first-child {
  border-radius: var(--phmod-radius) 0 0 var(--phmod-radius);
}

.phmod-btn-group .phmod-btn:last-child {
  border-radius: 0 var(--phmod-radius) var(--phmod-radius) 0;
}

.phmod-btn-group .phmod-btn:only-child {
  border-radius: var(--phmod-radius);
}


/* ==========================================================================
   8. BADGES
   ========================================================================== */

.phmod-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--phmod-space-1);
  padding: 2px var(--phmod-space-2);
  font-size: var(--phmod-text-sm);
  font-weight: 600;
  line-height: 1.25rem;
  border-radius: var(--phmod-radius-full);
  white-space: nowrap;
  background: var(--phmod-bg);
  color: var(--phmod-text-muted);
}

.phmod-badge--sm {
  padding: 1px var(--phmod-space-2);
  font-size: var(--phmod-text-xs);
  line-height: 1rem;
}

/* ── Status colors ── */

.phmod-badge--success,
.phmod-badge--green {
  background: #ecfdf5;
  color: #065f46;
}

.phmod-badge--warning,
.phmod-badge--amber {
  background: #fffbeb;
  color: #92400e;
}

.phmod-badge--danger,
.phmod-badge--red {
  background: #fef2f2;
  color: #991b1b;
}

.phmod-badge--info,
.phmod-badge--blue {
  background: #eff6ff;
  color: #1e40af;
}

.phmod-badge--neutral,
.phmod-badge--gray {
  background: #f1f5f9;
  color: #475569;
}

/* ── Pipeline stage badges ── */

.phmod-badge--stage {
  border-radius: var(--phmod-radius);
  font-size: var(--phmod-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Decision type badges ── */

.phmod-badge--continue {
  background: #ecfdf5;
  color: #065f46;
}

.phmod-badge--modify {
  background: #eff6ff;
  color: #1e40af;
}

.phmod-badge--redesign {
  background: #fffbeb;
  color: #92400e;
}

.phmod-badge--reduce {
  background: #fff7ed;
  color: #9a3412;
}

.phmod-badge--sunset {
  background: #fef2f2;
  color: #991b1b;
}

/* ── Aging badges ── */

.phmod-badge--on-track {
  background: #ecfdf5;
  color: #065f46;
}

.phmod-badge--aging-warning {
  background: #fffbeb;
  color: #92400e;
}

.phmod-badge--overdue {
  background: #fef2f2;
  color: #991b1b;
}

/* Badge with dot indicator */
.phmod-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}


/* ==========================================================================
   9. FORMS
   ========================================================================== */

.phmod-form-group {
  margin-bottom: var(--phmod-space-4);
}

.phmod-form-label {
  display: block;
  margin-bottom: var(--phmod-space-1);
  font-size: var(--phmod-text-base);
  font-weight: 600;
  color: var(--phmod-text);
}

.phmod-form-label--required::after {
  content: ' *';
  color: var(--phmod-danger);
}

.phmod-form-hint {
  display: block;
  margin-top: 2px;
  margin-bottom: var(--phmod-space-1);
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
}

.phmod-form-input,
.phmod-form-select,
.phmod-form-textarea {
  display: block;
  width: 100%;
  padding: var(--phmod-space-2) var(--phmod-space-3);
  font-family: var(--phmod-font-sans);
  font-size: var(--phmod-text-base);
  line-height: 1.5;
  color: var(--phmod-text);
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  transition: border-color var(--phmod-transition), box-shadow var(--phmod-transition);
}

.phmod-form-input::placeholder,
.phmod-form-textarea::placeholder {
  color: var(--phmod-text-light);
}

.phmod-form-input:focus,
.phmod-form-select:focus,
.phmod-form-textarea:focus {
  outline: none;
  border-color: var(--phmod-brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Error state */
.phmod-form-input--error,
.phmod-form-select--error,
.phmod-form-textarea--error {
  border-color: var(--phmod-danger);
}

.phmod-form-input--error:focus,
.phmod-form-select--error:focus,
.phmod-form-textarea--error:focus {
  border-color: var(--phmod-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.phmod-form-error {
  margin-top: var(--phmod-space-1);
  font-size: var(--phmod-text-sm);
  color: var(--phmod-danger);
}

/* Disabled */
.phmod-form-input:disabled,
.phmod-form-select:disabled,
.phmod-form-textarea:disabled {
  background: var(--phmod-bg);
  color: var(--phmod-text-muted);
  cursor: not-allowed;
}

/* Textarea */
.phmod-form-textarea {
  min-height: 5rem;
  resize: vertical;
}

/* Select arrow */
.phmod-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.15 4.65a.5.5 0 0 1 .7 0L6 7.79l3.15-3.14a.5.5 0 1 1 .7.7l-3.5 3.5a.5.5 0 0 1-.7 0l-3.5-3.5a.5.5 0 0 1 0-.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--phmod-space-3) center;
  padding-right: var(--phmod-space-8);
}

/* ── Custom checkbox ── */

.phmod-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--phmod-space-2);
  cursor: pointer;
}

.phmod-form-checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1.5px solid var(--phmod-border);
  border-radius: 4px;
  background: var(--phmod-surface);
  cursor: pointer;
  transition: all var(--phmod-transition);
  position: relative;
}

.phmod-form-checkbox input[type="checkbox"]:checked {
  background: var(--phmod-brand-primary);
  border-color: var(--phmod-brand-primary);
}

.phmod-form-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.phmod-form-checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--phmod-brand-primary);
  outline-offset: 2px;
}

.phmod-form-checkbox__label {
  font-size: var(--phmod-text-base);
  color: var(--phmod-text);
  line-height: 1.4;
}

/* ── Custom radio ── */

.phmod-form-radio {
  display: flex;
  align-items: flex-start;
  gap: var(--phmod-space-2);
  cursor: pointer;
}

.phmod-form-radio input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1.5px solid var(--phmod-border);
  border-radius: 50%;
  background: var(--phmod-surface);
  cursor: pointer;
  transition: all var(--phmod-transition);
  position: relative;
}

.phmod-form-radio input[type="radio"]:checked {
  border-color: var(--phmod-brand-primary);
}

.phmod-form-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--phmod-brand-primary);
}

.phmod-form-radio input[type="radio"]:focus-visible {
  outline: 2px solid var(--phmod-brand-primary);
  outline-offset: 2px;
}

.phmod-form-radio__label {
  font-size: var(--phmod-text-base);
  color: var(--phmod-text);
  line-height: 1.4;
}

/* ── Toggle switch ── */

.phmod-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--phmod-space-2);
  cursor: pointer;
}

.phmod-toggle__input {
  appearance: none;
  width: 40px;
  height: 22px;
  background: var(--phmod-border);
  border-radius: var(--phmod-radius-full);
  position: relative;
  cursor: pointer;
  transition: background var(--phmod-transition);
  flex-shrink: 0;
  border: none;
}

.phmod-toggle__input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: var(--phmod-shadow-sm);
  transition: transform var(--phmod-transition);
}

.phmod-toggle__input:checked {
  background: var(--phmod-brand-primary);
}

.phmod-toggle__input:checked::after {
  transform: translateX(18px);
}

.phmod-toggle__input:focus-visible {
  outline: 2px solid var(--phmod-brand-primary);
  outline-offset: 2px;
}

.phmod-toggle__input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.phmod-toggle__label {
  font-size: var(--phmod-text-base);
  color: var(--phmod-text);
}

/* ── Form row (horizontal layout) ── */

.phmod-form-row {
  display: flex;
  gap: var(--phmod-space-4);
}

.phmod-form-row > .phmod-form-group {
  flex: 1;
}

@media (max-width: 639px) {
  .phmod-form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ── Form actions ── */

.phmod-form-actions {
  display: flex;
  gap: var(--phmod-space-3);
  margin-top: var(--phmod-space-6);
  padding-top: var(--phmod-space-4);
  border-top: 1px solid var(--phmod-border);
}

.phmod-form-actions--right {
  justify-content: flex-end;
}

.phmod-form-actions--between {
  justify-content: space-between;
}


/* ==========================================================================
   10. TABLES
   ========================================================================== */

.phmod-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius-lg);
  background: var(--phmod-surface);
}

.phmod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--phmod-text-base);
}

.phmod-table th,
.phmod-table td {
  padding: var(--phmod-space-3) var(--phmod-space-4);
  text-align: left;
  border-bottom: 1px solid var(--phmod-border-light);
}

.phmod-table th {
  font-size: var(--phmod-text-sm);
  font-weight: 600;
  color: var(--phmod-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--phmod-bg);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.phmod-table th:first-child {
  border-top-left-radius: var(--phmod-radius-lg);
}

.phmod-table th:last-child {
  border-top-right-radius: var(--phmod-radius-lg);
}

/* Striped rows */
.phmod-table--striped tbody tr:nth-child(even) {
  background: var(--phmod-border-light);
}

/* Hover rows */
.phmod-table tbody tr {
  transition: background var(--phmod-transition);
}

.phmod-table tbody tr:hover {
  background: var(--phmod-brand-primary-light);
}

/* Last row has no border */
.phmod-table tbody tr:last-child td {
  border-bottom: none;
}

/* Links in tables */
.phmod-table a {
  color: var(--phmod-brand-primary);
  text-decoration: none;
  font-weight: 500;
}

.phmod-table a:hover {
  text-decoration: underline;
}

/* Sortable columns */
.phmod-table__sortable {
  cursor: pointer;
  user-select: none;
}

.phmod-table__sortable:hover {
  color: var(--phmod-text);
}

.phmod-table__sort-icon {
  display: inline-block;
  margin-left: var(--phmod-space-1);
  opacity: 0.3;
  transition: opacity var(--phmod-transition);
}

.phmod-table__sortable:hover .phmod-table__sort-icon {
  opacity: 0.6;
}

.phmod-table__sortable--asc .phmod-table__sort-icon,
.phmod-table__sortable--desc .phmod-table__sort-icon {
  opacity: 1;
}

.phmod-table__sortable--asc .phmod-table__sort-icon::after {
  content: '\2191'; /* up arrow */
}

.phmod-table__sortable--desc .phmod-table__sort-icon::after {
  content: '\2193'; /* down arrow */
}

/* Expandable rows */
.phmod-table__expand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--phmod-text-muted);
  cursor: pointer;
  border-radius: var(--phmod-radius);
  transition: all var(--phmod-transition);
}

.phmod-table__expand-toggle:hover {
  background: var(--phmod-bg);
  color: var(--phmod-text);
}

.phmod-table__expand-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--phmod-transition);
}

.phmod-table__expand-toggle--open svg {
  transform: rotate(90deg);
}

.phmod-table__expanded-row td {
  background: var(--phmod-bg);
  padding: var(--phmod-space-4) var(--phmod-space-6);
}

/* Numeric columns align right */
.phmod-table td.phmod-table__numeric,
.phmod-table th.phmod-table__numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Compact table */
.phmod-table--compact th,
.phmod-table--compact td {
  padding: var(--phmod-space-2) var(--phmod-space-3);
}


/* ==========================================================================
   11. ALERTS
   ========================================================================== */

.phmod-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--phmod-space-3);
  padding: var(--phmod-space-3) var(--phmod-space-4);
  border-radius: var(--phmod-radius);
  margin-bottom: var(--phmod-space-4);
  font-size: var(--phmod-text-base);
  line-height: 1.5;
  border: 1px solid transparent;
}

.phmod-alert--info {
  background: var(--phmod-info-light);
  color: #1e40af;
  border-color: #bfdbfe;
}

.phmod-alert--success {
  background: var(--phmod-success-light);
  color: #065f46;
  border-color: #a7f3d0;
}

.phmod-alert--warning {
  background: var(--phmod-warning-light);
  color: #92400e;
  border-color: #fde68a;
}

.phmod-alert--danger,
.phmod-alert--error {
  background: var(--phmod-danger-light);
  color: #991b1b;
  border-color: #fecaca;
}

.phmod-alert__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.phmod-alert__icon svg {
  width: 20px;
  height: 20px;
}

.phmod-alert__content {
  flex: 1;
  min-width: 0;
}

.phmod-alert__title {
  font-weight: 600;
  margin-bottom: var(--phmod-space-1);
}

.phmod-alert__dismiss {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -4px -4px -4px 0;
  padding: 0;
  border: none;
  border-radius: var(--phmod-radius);
  background: transparent;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity var(--phmod-transition);
}

.phmod-alert__dismiss:hover {
  opacity: 1;
}

.phmod-alert__dismiss svg {
  width: 16px;
  height: 16px;
}

/* Suppress empty alerts (e.g. red bar on registration form) */
.phmod-alert:empty {
  display: none;
}

.phmod-alert[hidden],
.phmod-alert--hidden {
  display: none;
}


/* ==========================================================================
   12. MODALS
   ========================================================================== */

.phmod-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--phmod-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--phmod-space-6);
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--phmod-transition-slow), visibility var(--phmod-transition-slow);
}

.phmod-modal-overlay--open {
  opacity: 1;
  visibility: visible;
}

.phmod-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - var(--phmod-space-12));
  display: flex;
  flex-direction: column;
  background: var(--phmod-surface);
  border-radius: var(--phmod-radius-lg);
  box-shadow: var(--phmod-shadow-xl);
  transform: translateY(8px) scale(0.98);
  transition: transform var(--phmod-transition-slow);
}

.phmod-modal-overlay--open .phmod-modal {
  transform: translateY(0) scale(1);
}

.phmod-modal--sm {
  max-width: 420px;
}

.phmod-modal--lg {
  max-width: 720px;
}

.phmod-modal--xl {
  max-width: 960px;
}

.phmod-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--phmod-space-4) var(--phmod-space-6);
  border-bottom: 1px solid var(--phmod-border);
  flex-shrink: 0;
}

.phmod-modal__title {
  font-size: var(--phmod-text-lg);
  font-weight: 600;
  color: var(--phmod-text);
  margin: 0;
}

.phmod-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--phmod-radius);
  background: transparent;
  color: var(--phmod-text-muted);
  cursor: pointer;
  transition: all var(--phmod-transition);
}

.phmod-modal__close:hover {
  background: var(--phmod-bg);
  color: var(--phmod-text);
}

.phmod-modal__close svg {
  width: 20px;
  height: 20px;
}

.phmod-modal__body {
  padding: var(--phmod-space-6);
  overflow-y: auto;
  flex: 1;
}

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

.phmod-modal__footer--between {
  justify-content: space-between;
}

/* Confirmation modal variant */
.phmod-modal--confirm .phmod-modal__body {
  text-align: center;
  padding: var(--phmod-space-8) var(--phmod-space-6);
}

.phmod-modal--confirm .phmod-modal__footer {
  justify-content: center;
}


/* ==========================================================================
   13. PIPELINE VISUALIZATION
   ========================================================================== */

/* ── Stage progress bar (horizontal dots with connectors) ── */

.phmod-pipeline-progress {
  display: flex;
  align-items: center;
  padding: var(--phmod-space-4) 0;
  overflow-x: auto;
}

.phmod-pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--phmod-space-2);
  min-width: 80px;
  position: relative;
}

.phmod-pipeline-stage__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--phmod-border);
  background: var(--phmod-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: all var(--phmod-transition);
}

.phmod-pipeline-stage__dot svg {
  width: 14px;
  height: 14px;
  display: none;
}

/* Completed stage */
.phmod-pipeline-stage--completed .phmod-pipeline-stage__dot {
  background: var(--phmod-success);
  border-color: var(--phmod-success);
}

.phmod-pipeline-stage--completed .phmod-pipeline-stage__dot svg {
  display: block;
  color: #ffffff;
}

/* Current stage */
.phmod-pipeline-stage--current .phmod-pipeline-stage__dot {
  background: var(--phmod-brand-primary);
  border-color: var(--phmod-brand-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.phmod-pipeline-stage--current .phmod-pipeline-stage__dot::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
}

/* Stage label */
.phmod-pipeline-stage__label {
  font-size: var(--phmod-text-xs);
  color: var(--phmod-text-muted);
  text-align: center;
  white-space: nowrap;
}

.phmod-pipeline-stage--current .phmod-pipeline-stage__label {
  color: var(--phmod-brand-primary);
  font-weight: 600;
}

.phmod-pipeline-stage--completed .phmod-pipeline-stage__label {
  color: var(--phmod-success);
}

/* Connector line between stages */
.phmod-pipeline-connector {
  flex: 1;
  height: 2px;
  background: var(--phmod-border);
  min-width: 24px;
  margin-top: -14px; /* Align with center of dots, offset for label space */
  align-self: flex-start;
  margin-top: 13px;
}

.phmod-pipeline-connector--completed {
  background: var(--phmod-success);
}

/* ── Pipeline Kanban columns ── */

.phmod-kanban {
  display: flex;
  gap: var(--phmod-space-4);
  overflow-x: auto;
  padding-bottom: var(--phmod-space-4);
  -webkit-overflow-scrolling: touch;
}

.phmod-kanban__column {
  flex: 0 0 280px;
  min-width: 280px;
  background: var(--phmod-bg);
  border-radius: var(--phmod-radius-lg);
  padding: var(--phmod-space-3);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 240px);
}

.phmod-kanban__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--phmod-space-2) var(--phmod-space-2);
  margin-bottom: var(--phmod-space-3);
}

.phmod-kanban__title {
  font-size: var(--phmod-text-sm);
  font-weight: 600;
  color: var(--phmod-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.phmod-kanban__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 var(--phmod-space-1);
  font-size: var(--phmod-text-xs);
  font-weight: 600;
  color: var(--phmod-text-muted);
  background: var(--phmod-surface);
  border-radius: var(--phmod-radius-full);
}

.phmod-kanban__cards {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--phmod-space-2);
}

/* ── Pipeline cards (inside Kanban) ── */

.phmod-pipeline-card {
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  padding: var(--phmod-space-3);
  cursor: pointer;
  transition: all var(--phmod-transition);
}

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

.phmod-pipeline-card__title {
  font-size: var(--phmod-text-base);
  font-weight: 500;
  color: var(--phmod-text);
  margin-bottom: var(--phmod-space-2);
}

.phmod-pipeline-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--phmod-space-2);
  font-size: var(--phmod-text-xs);
  color: var(--phmod-text-muted);
}

.phmod-pipeline-card__division {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==========================================================================
   14. SCORING INTERFACE
   ========================================================================== */

/* ── Score selector buttons (1-5) ── */

.phmod-score-selector {
  display: flex;
  gap: var(--phmod-space-2);
}

.phmod-score-selector__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: var(--phmod-text-md);
  font-weight: 600;
  border: 2px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  background: var(--phmod-surface);
  color: var(--phmod-text-muted);
  cursor: pointer;
  transition: all var(--phmod-transition);
}

.phmod-score-selector__btn:hover {
  border-color: var(--phmod-brand-primary);
  color: var(--phmod-brand-primary);
  background: var(--phmod-brand-primary-light);
}

.phmod-score-selector__btn--selected {
  border-color: var(--phmod-brand-primary);
  background: var(--phmod-brand-primary);
  color: #ffffff;
}

.phmod-score-selector__btn--selected:hover {
  background: var(--phmod-brand-primary-dark);
  border-color: var(--phmod-brand-primary-dark);
  color: #ffffff;
}

/* Score level descriptions */
.phmod-score-selector__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--phmod-space-1);
  font-size: var(--phmod-text-xs);
  color: var(--phmod-text-light);
}

/* ── Evidence cards ── */

.phmod-evidence-card {
  background: var(--phmod-bg);
  border: 1px solid var(--phmod-border-light);
  border-radius: var(--phmod-radius);
  padding: var(--phmod-space-3) var(--phmod-space-4);
  margin-bottom: var(--phmod-space-2);
}

.phmod-evidence-card__source {
  font-size: var(--phmod-text-xs);
  font-weight: 600;
  color: var(--phmod-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--phmod-space-1);
}

.phmod-evidence-card__text {
  font-size: var(--phmod-text-base);
  color: var(--phmod-text);
  line-height: 1.5;
}

/* ── Override flag banners ── */

.phmod-override-banner {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-3);
  padding: var(--phmod-space-3) var(--phmod-space-4);
  border-radius: var(--phmod-radius);
  margin-bottom: var(--phmod-space-4);
  font-size: var(--phmod-text-base);
  font-weight: 500;
}

.phmod-override-banner--legal {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.phmod-override-banner--equity {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.phmod-override-banner--data {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.phmod-override-banner__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.phmod-override-banner__icon svg {
  width: 20px;
  height: 20px;
}

/* ── Split panel layout ── */

.phmod-split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--phmod-space-6);
  align-items: start;
}

@media (max-width: 899px) {
  .phmod-split-panel {
    grid-template-columns: 1fr;
  }
}

.phmod-split-panel__left,
.phmod-split-panel__right {
  min-width: 0;
}

/* Sticky right panel on desktop for scoring */
.phmod-split-panel__right--sticky {
  position: sticky;
  top: calc(var(--phmod-topbar-height) + var(--phmod-space-6));
}

/* ── Weighted score progress bar ── */

.phmod-score-progress {
  margin: var(--phmod-space-4) 0;
}

.phmod-score-progress__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--phmod-space-2);
}

.phmod-score-progress__label {
  font-size: var(--phmod-text-sm);
  font-weight: 600;
  color: var(--phmod-text);
}

.phmod-score-progress__value {
  font-size: var(--phmod-text-lg);
  font-weight: 700;
  color: var(--phmod-text);
  font-variant-numeric: tabular-nums;
}

.phmod-score-progress__value span {
  font-size: var(--phmod-text-sm);
  font-weight: 400;
  color: var(--phmod-text-muted);
}

.phmod-score-progress__bar {
  width: 100%;
  height: 8px;
  background: var(--phmod-border);
  border-radius: var(--phmod-radius-full);
  overflow: hidden;
}

.phmod-score-progress__fill {
  height: 100%;
  border-radius: var(--phmod-radius-full);
  background: var(--phmod-brand-primary);
  transition: width var(--phmod-transition-slow);
}

/* Score thresholds color coding */
.phmod-score-progress__fill--continue {
  background: var(--phmod-success);
}

.phmod-score-progress__fill--modify {
  background: var(--phmod-brand-primary);
}

.phmod-score-progress__fill--redesign {
  background: var(--phmod-warning);
}

.phmod-score-progress__fill--discontinue {
  background: var(--phmod-danger);
}

/* Score breakdown rows */
.phmod-score-breakdown {
  margin-top: var(--phmod-space-4);
}

.phmod-score-breakdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--phmod-space-2) 0;
  border-bottom: 1px solid var(--phmod-border-light);
  font-size: var(--phmod-text-sm);
}

.phmod-score-breakdown__row:last-child {
  border-bottom: none;
}

.phmod-score-breakdown__dimension {
  color: var(--phmod-text);
}

.phmod-score-breakdown__weight {
  font-size: var(--phmod-text-xs);
  color: var(--phmod-text-light);
  margin-left: var(--phmod-space-1);
}

.phmod-score-breakdown__score {
  font-weight: 600;
  color: var(--phmod-text);
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   15. METRICS CARDS
   ========================================================================== */

.phmod-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--phmod-space-4);
  margin-bottom: var(--phmod-space-6);
}

.phmod-metric-card {
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius-lg);
  padding: var(--phmod-space-5);
  display: flex;
  flex-direction: column;
}

.phmod-metric-card__value {
  font-size: var(--phmod-text-2xl);
  font-weight: 700;
  color: var(--phmod-text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.phmod-metric-card__label {
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
  margin-top: var(--phmod-space-1);
}

.phmod-metric-card__trend {
  display: inline-flex;
  align-items: center;
  gap: var(--phmod-space-1);
  margin-top: var(--phmod-space-2);
  font-size: var(--phmod-text-xs);
  font-weight: 600;
}

.phmod-metric-card__trend--up {
  color: var(--phmod-success);
}

.phmod-metric-card__trend--down {
  color: var(--phmod-danger);
}

.phmod-metric-card__trend--neutral {
  color: var(--phmod-text-muted);
}

.phmod-metric-card__trend-icon {
  width: 14px;
  height: 14px;
}

/* Up arrow */
.phmod-metric-card__trend--up .phmod-metric-card__trend-icon::before {
  content: '\2191';
}

/* Down arrow */
.phmod-metric-card__trend--down .phmod-metric-card__trend-icon::before {
  content: '\2193';
}

/* Flat */
.phmod-metric-card__trend--neutral .phmod-metric-card__trend-icon::before {
  content: '\2192';
}

/* Metric card with accent border */
.phmod-metric-card--accent {
  border-top: 3px solid var(--phmod-brand-primary);
}

.phmod-metric-card--success {
  border-top: 3px solid var(--phmod-success);
}

.phmod-metric-card--warning {
  border-top: 3px solid var(--phmod-warning);
}

.phmod-metric-card--danger {
  border-top: 3px solid var(--phmod-danger);
}


/* ==========================================================================
   16. TYPOGRAPHY
   ========================================================================== */

.phmod-wrap h1,
.phmod-wrap h2,
.phmod-wrap h3,
.phmod-wrap h4 {
  margin: 0 0 var(--phmod-space-3);
  color: var(--phmod-text);
  font-weight: 600;
  line-height: 1.3;
}

.phmod-wrap h1 {
  font-size: var(--phmod-text-2xl);
  font-weight: 700;
}

.phmod-wrap h2 {
  font-size: var(--phmod-text-xl);
}

.phmod-wrap h3 {
  font-size: var(--phmod-text-lg);
}

.phmod-wrap h4 {
  font-size: var(--phmod-text-md);
}

/* Page header */
.phmod-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--phmod-space-3);
  margin-bottom: var(--phmod-space-6);
}

.phmod-page-header h1 {
  margin: 0;
}

.phmod-page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-3);
  flex-shrink: 0;
}

/* Section heading */
.phmod-section-heading {
  font-size: var(--phmod-text-md);
  font-weight: 700;
  color: var(--phmod-text);
  margin: var(--phmod-space-6) 0 var(--phmod-space-3);
  padding-bottom: var(--phmod-space-2);
  border-bottom: 2px solid var(--phmod-border);
}

.phmod-section-heading:first-child {
  margin-top: 0;
}

/* Text utilities */
.phmod-text-xs    { font-size: var(--phmod-text-xs); }
.phmod-text-sm    { font-size: var(--phmod-text-sm); }
.phmod-text-base  { font-size: var(--phmod-text-base); }
.phmod-text-md    { font-size: var(--phmod-text-md); }
.phmod-text-lg    { font-size: var(--phmod-text-lg); }
.phmod-text-xl    { font-size: var(--phmod-text-xl); }
.phmod-text-2xl   { font-size: var(--phmod-text-2xl); }

.phmod-text-left    { text-align: left; }
.phmod-text-center  { text-align: center; }
.phmod-text-right   { text-align: right; }

.phmod-font-normal  { font-weight: 400; }
.phmod-font-medium  { font-weight: 500; }
.phmod-font-semibold { font-weight: 600; }
.phmod-font-bold    { font-weight: 700; }

.phmod-text-muted   { color: var(--phmod-text-muted); }
.phmod-text-light   { color: var(--phmod-text-light); }
.phmod-text-primary { color: var(--phmod-brand-primary); }
.phmod-text-success { color: var(--phmod-success); }
.phmod-text-warning { color: var(--phmod-warning); }
.phmod-text-danger  { color: var(--phmod-danger); }

.phmod-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phmod-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.phmod-line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.phmod-mono {
  font-family: var(--phmod-font-mono);
}

.phmod-tabular-nums {
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
   17. SPACING & LAYOUT UTILITIES
   ========================================================================== */

/* ── Margin top ── */
.phmod-mt-0  { margin-top: 0; }
.phmod-mt-1  { margin-top: var(--phmod-space-1); }
.phmod-mt-2  { margin-top: var(--phmod-space-2); }
.phmod-mt-3  { margin-top: var(--phmod-space-3); }
.phmod-mt-4  { margin-top: var(--phmod-space-4); }
.phmod-mt-6  { margin-top: var(--phmod-space-6); }
.phmod-mt-8  { margin-top: var(--phmod-space-8); }

/* ── Margin bottom ── */
.phmod-mb-0  { margin-bottom: 0; }
.phmod-mb-1  { margin-bottom: var(--phmod-space-1); }
.phmod-mb-2  { margin-bottom: var(--phmod-space-2); }
.phmod-mb-3  { margin-bottom: var(--phmod-space-3); }
.phmod-mb-4  { margin-bottom: var(--phmod-space-4); }
.phmod-mb-6  { margin-bottom: var(--phmod-space-6); }
.phmod-mb-8  { margin-bottom: var(--phmod-space-8); }

/* ── Padding ── */
.phmod-p-0  { padding: 0; }
.phmod-p-1  { padding: var(--phmod-space-1); }
.phmod-p-2  { padding: var(--phmod-space-2); }
.phmod-p-3  { padding: var(--phmod-space-3); }
.phmod-p-4  { padding: var(--phmod-space-4); }
.phmod-p-6  { padding: var(--phmod-space-6); }
.phmod-p-8  { padding: var(--phmod-space-8); }

.phmod-px-4 { padding-left: var(--phmod-space-4); padding-right: var(--phmod-space-4); }
.phmod-px-6 { padding-left: var(--phmod-space-6); padding-right: var(--phmod-space-6); }
.phmod-py-2 { padding-top: var(--phmod-space-2); padding-bottom: var(--phmod-space-2); }
.phmod-py-4 { padding-top: var(--phmod-space-4); padding-bottom: var(--phmod-space-4); }

/* ── Flexbox helpers ── */
.phmod-flex          { display: flex; }
.phmod-flex-col      { display: flex; flex-direction: column; }
.phmod-flex-wrap     { flex-wrap: wrap; }
.phmod-flex-1        { flex: 1 1 0%; }
.phmod-flex-shrink-0 { flex-shrink: 0; }

.phmod-items-start   { align-items: flex-start; }
.phmod-items-center  { align-items: center; }
.phmod-items-end     { align-items: flex-end; }
.phmod-items-stretch { align-items: stretch; }

.phmod-justify-start   { justify-content: flex-start; }
.phmod-justify-center  { justify-content: center; }
.phmod-justify-end     { justify-content: flex-end; }
.phmod-justify-between { justify-content: space-between; }

.phmod-gap-1 { gap: var(--phmod-space-1); }
.phmod-gap-2 { gap: var(--phmod-space-2); }
.phmod-gap-3 { gap: var(--phmod-space-3); }
.phmod-gap-4 { gap: var(--phmod-space-4); }
.phmod-gap-6 { gap: var(--phmod-space-6); }

/* ── Grid helpers ── */
.phmod-grid        { display: grid; gap: var(--phmod-space-4); }
.phmod-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.phmod-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.phmod-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 767px) {
  .phmod-grid-cols-2,
  .phmod-grid-cols-3,
  .phmod-grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .phmod-grid-cols-3,
  .phmod-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Visibility ── */
.phmod-hidden { display: none; }

.phmod-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive show/hide */
@media (max-width: 767px) {
  .phmod-hide-mobile { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .phmod-hide-tablet { display: none; }
}

@media (min-width: 1024px) {
  .phmod-hide-desktop { display: none; }
}

@media (min-width: 768px) {
  .phmod-show-mobile { display: none; }
}

/* ── Misc ── */
.phmod-w-full     { width: 100%; }
.phmod-max-w-sm   { max-width: 420px; }
.phmod-max-w-md   { max-width: 560px; }
.phmod-max-w-lg   { max-width: 720px; }
.phmod-max-w-xl   { max-width: 960px; }

.phmod-mx-auto    { margin-left: auto; margin-right: auto; }
.phmod-ml-auto    { margin-left: auto; }

.phmod-relative   { position: relative; }
.phmod-overflow-hidden { overflow: hidden; }


/* ==========================================================================
   18. LOADING STATES
   ========================================================================== */

/* ── Spinner ── */

@keyframes phmod-spin {
  to { transform: rotate(360deg); }
}

.phmod-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--phmod-border);
  border-top-color: var(--phmod-brand-primary);
  border-radius: 50%;
  animation: phmod-spin 0.6s linear infinite;
}

.phmod-spinner--sm {
  width: 14px;
  height: 14px;
}

.phmod-spinner--lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ── Loading container ── */

.phmod-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--phmod-space-3);
  padding: var(--phmod-space-12);
  color: var(--phmod-text-muted);
  font-size: var(--phmod-text-base);
}

/* ── Skeleton placeholders ── */

@keyframes phmod-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.phmod-skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    var(--phmod-border-light) 25%,
    var(--phmod-border) 37%,
    var(--phmod-border-light) 63%
  );
  background-size: 200% 100%;
  animation: phmod-shimmer 1.5s ease infinite;
  border-radius: var(--phmod-radius);
}

.phmod-skeleton--text {
  height: 14px;
  width: 100%;
  margin-bottom: var(--phmod-space-2);
}

.phmod-skeleton--text:last-child {
  width: 60%;
}

.phmod-skeleton--heading {
  height: 24px;
  width: 40%;
  margin-bottom: var(--phmod-space-3);
}

.phmod-skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.phmod-skeleton--card {
  height: 120px;
  width: 100%;
  margin-bottom: var(--phmod-space-4);
}

.phmod-skeleton--btn {
  height: 36px;
  width: 100px;
  border-radius: var(--phmod-radius);
}

.phmod-skeleton--badge {
  height: 22px;
  width: 64px;
  border-radius: var(--phmod-radius-full);
}

/* ── Page loading overlay ── */

.phmod-page-loading {
  position: fixed;
  inset: 0;
  z-index: var(--phmod-z-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--phmod-space-4);
  background: rgba(241, 245, 249, 0.9);
}

.phmod-page-loading__text {
  font-size: var(--phmod-text-base);
  color: var(--phmod-text-muted);
}


/* ==========================================================================
   19. EMPTY STATE
   ========================================================================== */

.phmod-empty {
  text-align: center;
  padding: var(--phmod-space-12) var(--phmod-space-4);
  color: var(--phmod-text-muted);
}

.phmod-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--phmod-space-4);
  background: var(--phmod-bg);
  border-radius: 50%;
  color: var(--phmod-text-light);
}

.phmod-empty__icon svg {
  width: 28px;
  height: 28px;
}

.phmod-empty__title {
  font-size: var(--phmod-text-md);
  font-weight: 600;
  color: var(--phmod-text);
  margin-bottom: var(--phmod-space-2);
}

.phmod-empty__description {
  font-size: var(--phmod-text-base);
  color: var(--phmod-text-muted);
  max-width: 420px;
  margin: 0 auto var(--phmod-space-4);
  line-height: 1.5;
}

.phmod-empty .phmod-btn {
  margin-top: var(--phmod-space-2);
}

.phmod-empty p {
  margin-top: 0;
  margin-bottom: var(--phmod-space-2);
}

.phmod-empty p:last-of-type {
  margin-bottom: var(--phmod-space-3);
}


/* ==========================================================================
   20. FILTER BAR
   ========================================================================== */

.phmod-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--phmod-space-3);
  align-items: center;
  margin-bottom: var(--phmod-space-4);
  padding: var(--phmod-space-3) var(--phmod-space-4);
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius-lg);
}

.phmod-filter-bar > * {
  flex-shrink: 0;
}

.phmod-filter-bar .phmod-filter-spacer {
  flex: 1 1 auto;
}

.phmod-filter-bar .phmod-form-input,
.phmod-filter-bar .phmod-form-select {
  width: auto;
  min-width: 160px;
}

.phmod-filter-bar .phmod-form-input--search {
  min-width: 220px;
  padding-left: var(--phmod-space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: var(--phmod-space-3) center;
}


/* ==========================================================================
   21. PAGINATION
   ========================================================================== */

.phmod-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--phmod-space-1);
  margin-top: var(--phmod-space-4);
  font-size: var(--phmod-text-sm);
}

.phmod-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--phmod-space-2);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  background: var(--phmod-surface);
  color: var(--phmod-text);
  font-size: var(--phmod-text-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--phmod-transition);
}

.phmod-pagination__btn:hover {
  background: var(--phmod-bg);
  border-color: var(--phmod-text-light);
}

.phmod-pagination__btn--active {
  background: var(--phmod-brand-primary);
  border-color: var(--phmod-brand-primary);
  color: #ffffff;
}

.phmod-pagination__btn--active:hover {
  background: var(--phmod-brand-primary-dark);
  border-color: var(--phmod-brand-primary-dark);
}

.phmod-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.phmod-pagination__info {
  color: var(--phmod-text-muted);
  margin: 0 var(--phmod-space-3);
}


/* ==========================================================================
   22. DETAIL PAGE
   ========================================================================== */

.phmod-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--phmod-space-4) var(--phmod-space-8);
}

@media (max-width: 767px) {
  .phmod-detail-grid {
    grid-template-columns: 1fr;
  }
}

.phmod-detail-field {
  margin-bottom: var(--phmod-space-3);
}

.phmod-detail-field dt {
  font-size: var(--phmod-text-sm);
  font-weight: 600;
  color: var(--phmod-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.phmod-detail-field dd {
  margin: 0;
  font-size: var(--phmod-text-base);
  color: var(--phmod-text);
  line-height: 1.5;
}

.phmod-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--phmod-space-2);
}


/* ==========================================================================
   23. TABS
   ========================================================================== */

.phmod-tabs {
  display: flex;
  border-bottom: 1px solid var(--phmod-border);
  margin-bottom: var(--phmod-space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.phmod-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--phmod-space-2);
  padding: var(--phmod-space-3) var(--phmod-space-4);
  font-size: var(--phmod-text-base);
  font-weight: 500;
  color: var(--phmod-text-muted);
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--phmod-transition);
  margin-bottom: -1px;
}

.phmod-tabs__tab:hover {
  color: var(--phmod-text);
}

.phmod-tabs__tab--active {
  color: var(--phmod-brand-primary);
  border-bottom-color: var(--phmod-brand-primary);
  font-weight: 600;
}

.phmod-tabs__tab .phmod-badge {
  margin-left: var(--phmod-space-1);
}


/* ==========================================================================
   24. DROPDOWN / POPOVER
   ========================================================================== */

.phmod-dropdown {
  position: relative;
  display: inline-block;
}

.phmod-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--phmod-z-dropdown);
  min-width: 180px;
  padding: var(--phmod-space-1) 0;
  margin-top: var(--phmod-space-1);
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  box-shadow: var(--phmod-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--phmod-transition);
}

.phmod-dropdown__menu--right {
  left: auto;
  right: 0;
}

.phmod-dropdown__menu--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.phmod-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-2);
  width: 100%;
  padding: var(--phmod-space-2) var(--phmod-space-3);
  font-size: var(--phmod-text-base);
  color: var(--phmod-text);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background var(--phmod-transition);
  text-align: left;
}

.phmod-dropdown__item:hover {
  background: var(--phmod-bg);
}

.phmod-dropdown__item--danger {
  color: var(--phmod-danger);
}

.phmod-dropdown__item--danger:hover {
  background: var(--phmod-danger-light);
}

.phmod-dropdown__divider {
  height: 1px;
  background: var(--phmod-border-light);
  margin: var(--phmod-space-1) 0;
}

.phmod-dropdown__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}


/* ==========================================================================
   25. TOOLTIP
   ========================================================================== */

.phmod-tooltip {
  position: relative;
}

.phmod-tooltip__content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--phmod-space-1) var(--phmod-space-2);
  margin-bottom: 6px;
  font-size: var(--phmod-text-xs);
  font-weight: 500;
  color: #ffffff;
  background: var(--phmod-text);
  border-radius: var(--phmod-radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all var(--phmod-transition);
  z-index: var(--phmod-z-dropdown);
}

.phmod-tooltip__content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--phmod-text);
}

.phmod-tooltip:hover .phmod-tooltip__content {
  opacity: 1;
  visibility: visible;
}


/* ==========================================================================
   26. BREADCRUMBS
   ========================================================================== */

.phmod-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--phmod-space-1);
  margin-bottom: var(--phmod-space-4);
  font-size: var(--phmod-text-sm);
}

.phmod-breadcrumbs__item {
  color: var(--phmod-text-muted);
  text-decoration: none;
}

.phmod-breadcrumbs__item:hover {
  color: var(--phmod-brand-primary);
  text-decoration: underline;
}

.phmod-breadcrumbs__separator {
  color: var(--phmod-text-light);
  font-size: var(--phmod-text-xs);
}

.phmod-breadcrumbs__separator::after {
  content: '/';
}

.phmod-breadcrumbs__current {
  color: var(--phmod-text);
  font-weight: 500;
}


/* ==========================================================================
   27. TOAST NOTIFICATIONS
   ========================================================================== */

.phmod-toast-container {
  position: fixed;
  top: calc(var(--phmod-topbar-height) + var(--phmod-space-4));
  right: var(--phmod-space-4);
  z-index: var(--phmod-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--phmod-space-2);
  max-width: 400px;
}

.phmod-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--phmod-space-3);
  padding: var(--phmod-space-3) var(--phmod-space-4);
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  box-shadow: var(--phmod-shadow-lg);
  animation: phmod-toast-in 0.3s ease;
}

@keyframes phmod-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.phmod-toast--success {
  border-left: 3px solid var(--phmod-success);
}

.phmod-toast--warning {
  border-left: 3px solid var(--phmod-warning);
}

.phmod-toast--danger {
  border-left: 3px solid var(--phmod-danger);
}

.phmod-toast--info {
  border-left: 3px solid var(--phmod-info);
}

.phmod-toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.phmod-toast__content {
  flex: 1;
  min-width: 0;
}

.phmod-toast__title {
  font-size: var(--phmod-text-base);
  font-weight: 600;
  color: var(--phmod-text);
}

.phmod-toast__message {
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
  margin-top: 2px;
}

.phmod-toast__dismiss {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--phmod-radius);
  background: transparent;
  color: var(--phmod-text-light);
  cursor: pointer;
  transition: all var(--phmod-transition);
}

.phmod-toast__dismiss:hover {
  background: var(--phmod-bg);
  color: var(--phmod-text);
}


/* ==========================================================================
   28. PROGRESS STEPS (Evaluation A-H)
   ========================================================================== */

.phmod-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--phmod-space-6);
  overflow-x: auto;
  padding: var(--phmod-space-2) 0;
}

.phmod-step {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-2);
  padding: var(--phmod-space-2) var(--phmod-space-3);
  font-size: var(--phmod-text-sm);
  font-weight: 500;
  color: var(--phmod-text-muted);
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--phmod-radius);
  transition: all var(--phmod-transition);
}

.phmod-step:hover {
  background: var(--phmod-bg);
  color: var(--phmod-text);
}

.phmod-step__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: var(--phmod-text-xs);
  font-weight: 600;
  background: var(--phmod-bg);
  color: var(--phmod-text-muted);
  flex-shrink: 0;
}

.phmod-step--completed .phmod-step__number {
  background: var(--phmod-success);
  color: #ffffff;
}

.phmod-step--current {
  color: var(--phmod-brand-primary);
}

.phmod-step--current .phmod-step__number {
  background: var(--phmod-brand-primary);
  color: #ffffff;
}

.phmod-step__connector {
  width: 24px;
  height: 1px;
  background: var(--phmod-border);
  flex-shrink: 0;
}

.phmod-step--completed + .phmod-step__connector {
  background: var(--phmod-success);
}


/* ==========================================================================
   29. AVATAR
   ========================================================================== */

.phmod-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--phmod-brand-primary-light);
  color: var(--phmod-brand-primary);
  font-size: var(--phmod-text-sm);
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.phmod-avatar--sm {
  width: 24px;
  height: 24px;
  font-size: var(--phmod-text-xs);
}

.phmod-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: var(--phmod-text-md);
}

.phmod-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ==========================================================================
   30. DIVIDERS
   ========================================================================== */

.phmod-divider {
  border: none;
  border-top: 1px solid var(--phmod-border);
  margin: var(--phmod-space-4) 0;
}

.phmod-divider--light {
  border-top-color: var(--phmod-border-light);
}

.phmod-divider--thick {
  border-top-width: 2px;
}


/* ==========================================================================
   31. LOGIN PAGE
   ========================================================================== */

.phmod-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--phmod-space-6);
  background: var(--phmod-bg);
}

.phmod-login__card {
  width: 100%;
  max-width: 400px;
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius-lg);
  box-shadow: var(--phmod-shadow-md);
  padding: var(--phmod-space-8);
}

.phmod-login__logo {
  display: block;
  max-height: 48px;
  margin: 0 auto var(--phmod-space-6);
}

.phmod-login__title {
  text-align: center;
  font-size: var(--phmod-text-xl);
  font-weight: 700;
  color: var(--phmod-text);
  margin-bottom: var(--phmod-space-2);
}

.phmod-login__subtitle {
  text-align: center;
  font-size: var(--phmod-text-base);
  color: var(--phmod-text-muted);
  margin-bottom: var(--phmod-space-6);
}

.phmod-login__footer {
  margin-top: var(--phmod-space-6);
  text-align: center;
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
}

.phmod-login__footer a {
  color: var(--phmod-brand-primary);
  text-decoration: none;
}

.phmod-login__footer a:hover {
  text-decoration: underline;
}


/* ==========================================================================
   32. AUTH (LOGIN / REGISTER) PAGES
   ========================================================================== */

.phmod-auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--phmod-space-6);
  background: var(--phmod-bg);
}

.phmod-auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--phmod-space-8) var(--phmod-space-8) var(--phmod-space-6);
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius-lg);
  box-shadow: var(--phmod-shadow-lg);
}

.phmod-auth-header {
  text-align: center;
  margin-bottom: var(--phmod-space-6);
}

.phmod-auth-title {
  margin: 0 0 var(--phmod-space-1);
  font-size: var(--phmod-text-xl);
  font-weight: 700;
  color: var(--phmod-text);
}

.phmod-auth-subtitle {
  margin: 0;
  font-size: var(--phmod-text-base);
  color: var(--phmod-text-muted);
}

.phmod-auth-form .phmod-form-group {
  margin-bottom: var(--phmod-space-4);
}

.phmod-auth-form .phmod-form-group--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--phmod-space-2);
}

.phmod-auth-form .phmod-form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--phmod-space-2);
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
  cursor: pointer;
}

.phmod-auth-link {
  font-size: var(--phmod-text-sm);
  color: var(--phmod-brand-primary);
  text-decoration: none;
  transition: color var(--phmod-transition);
}

.phmod-auth-link:hover {
  color: var(--phmod-brand-primary-dark);
  text-decoration: underline;
}

/* Block button — used on auth pages and elsewhere */
.phmod-btn--block {
  display: flex;
  width: 100%;
  justify-content: center;
}

.phmod-auth-form .phmod-btn--block {
  margin-top: var(--phmod-space-4);
}


/* ==========================================================================
   33. SUMMARY BAR
   ========================================================================== */

.phmod-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--phmod-space-4, 16px);
  padding: var(--phmod-space-4, 16px);
  margin-bottom: var(--phmod-space-4, 16px);
  background: var(--phmod-surface, #ffffff);
  border: 1px solid var(--phmod-border, #e2e8f0);
  border-radius: var(--phmod-radius-lg, 12px);
}

.phmod-summary-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: var(--phmod-space-2, 8px) var(--phmod-space-3, 12px);
}

.phmod-summary-bar__number {
  display: block;
  font-size: var(--phmod-text-2xl, 1.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--phmod-text, #1e293b);
}

.phmod-summary-bar__label {
  display: block;
  font-size: var(--phmod-text-xs, 0.75rem);
  color: var(--phmod-text-muted, #64748b);
  text-align: center;
  margin-top: var(--phmod-space-1, 4px);
  white-space: nowrap;
}

.phmod-summary-bar__item--alert .phmod-summary-bar__number {
  color: var(--phmod-danger, #ef4444);
}

.phmod-summary-bar__item--alert .phmod-summary-bar__label {
  color: var(--phmod-danger, #ef4444);
}


/* ==========================================================================
   33b. SUMMARY CARDS (grid container for SummaryCard components)
   ========================================================================== */

.phmod-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--phmod-space-4);
  margin-bottom: var(--phmod-space-6);
}

@media (max-width: 639px) {
  .phmod-summary-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--phmod-space-3);
  }
}

.phmod-summary-card {
  padding: var(--phmod-space-5);
  text-align: center;
}

.phmod-summary-card__number {
  font-size: var(--phmod-text-xl);
  font-weight: 700;
  line-height: 1.2;
  color: var(--phmod-text);
  margin-bottom: var(--phmod-space-1);
}

.phmod-summary-card__label {
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
  line-height: 1.3;
}

.phmod-summary-card--alert {
  border-left: 4px solid var(--phmod-danger);
}

/* Alert note — for read-only config notes */
.phmod-alert--note {
  background: var(--phmod-bg-muted, #f3f4f6);
  border: 1px solid var(--phmod-border, #e5e7eb);
  color: var(--phmod-text-muted);
}


/* ==========================================================================
   34. SIDEBAR ICONS (data-icon attribute)
   ========================================================================== */

.phmod-sidebar__icon[data-icon]::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.phmod-sidebar__icon[data-icon="home"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="chart"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="folder"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="pipeline"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 3 21 3 21 8'/%3E%3Cline x1='4' y1='20' x2='21' y2='3'/%3E%3Cpolyline points='21 16 21 21 16 21'/%3E%3Cline x1='15' y1='15' x2='21' y2='21'/%3E%3Cline x1='4' y1='4' x2='9' y2='9'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="dollar"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="impact"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="gavel"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cline x1='12' y1='3' x2='12' y2='9'/%3E%3Cpath d='M6 9h12l-1 7H7z'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="flag"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z'/%3E%3Cline x1='4' y1='22' x2='4' y2='15'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="grid"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="equity"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="finance"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="users"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 00-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 010 7.75'/%3E%3C/svg%3E");
}

.phmod-sidebar__icon[data-icon="gear"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z'/%3E%3C/svg%3E");
}

/* Ensure SVG icons inherit color from parent link */
.phmod-sidebar__link .phmod-sidebar__icon[data-icon]::before {
  filter: brightness(0) saturate(100%) invert(40%) sepia(9%) saturate(605%) hue-rotate(182deg);
}

.phmod-sidebar__link--active .phmod-sidebar__icon[data-icon]::before {
  filter: brightness(0) saturate(100%) invert(30%) sepia(93%) saturate(1750%) hue-rotate(215deg) brightness(95%);
}

.phmod-sidebar__link:hover .phmod-sidebar__icon[data-icon]::before {
  filter: brightness(0) saturate(100%) invert(15%) sepia(12%) saturate(600%) hue-rotate(182deg);
}


/* ==========================================================================
   35. UI ANALYSIS FIXES (2026-04-07)
   ========================================================================== */

/* ── Fix 5: Stat card grid for dashboard and home pages ── */

.phmod-stats-grid,
.phmod-home-stats,
.phmod-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--phmod-space-4);
  margin-bottom: var(--phmod-space-6);
}

.phmod-stats-grid .phmod-card {
  border-left: 4px solid var(--phmod-brand-primary);
}

.phmod-stats-grid .phmod-card:nth-child(2) {
  border-left-color: var(--phmod-brand-secondary);
}

.phmod-stats-grid .phmod-card:nth-child(3) {
  border-left-color: var(--phmod-success);
}

.phmod-stats-grid .phmod-card:nth-child(4) {
  border-left-color: var(--phmod-warning);
}

.phmod-stat-value {
  font-size: var(--phmod-text-2xl);
  font-weight: 700;
  color: var(--phmod-text);
  line-height: 1.1;
  margin-bottom: var(--phmod-space-1);
}

.phmod-stat-label {
  font-size: var(--phmod-text-sm);
  color: var(--phmod-text-muted);
  font-weight: 500;
}

/* ── Dashboard grid ── */

.phmod-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--phmod-space-4);
  margin-bottom: var(--phmod-space-8);
}

.phmod-dashboard-grid .phmod-metric-card__value {
  font-size: var(--phmod-text-2xl);
  font-weight: 700;
  color: var(--phmod-text);
  margin-bottom: var(--phmod-space-1);
}

/* ── Metric card accent borders ── */

.phmod-metric-card:first-child {
  border-left: 4px solid var(--phmod-brand-primary);
}

.phmod-metric-card:nth-child(2) {
  border-left: 4px solid var(--phmod-brand-secondary);
}

.phmod-metric-card:nth-child(3) {
  border-left: 4px solid var(--phmod-success);
}

.phmod-metric-card:nth-child(4) {
  border-left: 4px solid var(--phmod-warning);
}


/* ── Fix 6: Form button fallback (unstyled buttons in .phmod-main) ── */

.phmod-main button:not([class*="phmod-"]),
.phmod-main input[type="submit"]:not([class*="phmod-"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--phmod-space-2);
  padding: var(--phmod-space-2) var(--phmod-space-4);
  font-family: var(--phmod-font-sans);
  font-size: var(--phmod-text-base);
  font-weight: 500;
  line-height: 1.25rem;
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  background: var(--phmod-surface);
  color: var(--phmod-text);
  cursor: pointer;
  transition: all var(--phmod-transition);
}

.phmod-main button:not([class*="phmod-"]):hover {
  background: var(--phmod-bg);
  border-color: var(--phmod-text-light);
}


/* ── Fix 9: FPHS checklist container ── */

.phmod-fphs-checklist,
.phmod-checklist-scroll {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  padding: var(--phmod-space-3);
  background: var(--phmod-surface);
}

.phmod-fphs-checklist::-webkit-scrollbar,
.phmod-checklist-scroll::-webkit-scrollbar {
  width: 4px;
}

.phmod-fphs-checklist::-webkit-scrollbar-thumb,
.phmod-checklist-scroll::-webkit-scrollbar-thumb {
  background: var(--phmod-border);
  border-radius: var(--phmod-radius-full);
}


/* ── Fix 11: Page title brand accent ── */

.phmod-page-header__title,
.phmod-page-header h1 {
  position: relative;
  padding-bottom: var(--phmod-space-3);
}

.phmod-page-header__title::after,
.phmod-page-header h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--phmod-brand-primary);
  border-radius: 2px;
}


/* ── Fix 12: Back link / breadcrumb styling ── */

.phmod-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--phmod-space-1);
  margin-bottom: var(--phmod-space-3);
  font-size: var(--phmod-text-sm);
  font-weight: 500;
  color: var(--phmod-brand-primary);
  text-decoration: none;
  transition: color var(--phmod-transition);
}

.phmod-back-link:hover {
  color: var(--phmod-brand-primary-dark);
}

.phmod-back-link::before {
  content: '\2190';
  font-size: 1em;
}


/* ── Fix 15: Checkbox and radio fallback styling ── */

.phmod-main input[type="checkbox"]:not(.phmod-form-checkbox input):not(.phmod-toggle__input) {
  accent-color: var(--phmod-brand-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.phmod-main input[type="radio"]:not(.phmod-form-radio input) {
  accent-color: var(--phmod-brand-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}


/* ── Bool badges (Yes/No columns in program tables) ── */

.phmod-table .phmod-bool-badge--yes {
  display: inline-flex;
  padding: 1px var(--phmod-space-2);
  font-size: var(--phmod-text-xs);
  font-weight: 600;
  border-radius: var(--phmod-radius-full);
  background: #ecfdf5;
  color: #065f46;
}

.phmod-table .phmod-bool-badge--no {
  display: inline-flex;
  padding: 1px var(--phmod-space-2);
  font-size: var(--phmod-text-xs);
  font-weight: 600;
  border-radius: var(--phmod-radius-full);
  background: var(--phmod-bg);
  color: var(--phmod-text-light);
}


/* ── FPHS tag chips ── */

.phmod-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--phmod-space-3);
  font-size: var(--phmod-text-xs);
  font-weight: 500;
  background: var(--phmod-brand-primary-light);
  color: var(--phmod-brand-primary);
  border-radius: var(--phmod-radius-full);
  border: 1px solid rgba(37, 99, 235, 0.2);
}


/* ── Landing page footer enhancement ── */

.phmod-landing-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--phmod-space-4);
  text-align: left;
}

.phmod-landing-footer__links {
  display: flex;
  gap: var(--phmod-space-6);
}


/* ==========================================================================
   36. PRINT STYLES
   ========================================================================== */

@media print {
  .phmod-topbar,
  .phmod-sidebar,
  .phmod-sidebar-backdrop,
  .phmod-toast-container {
    display: none;
  }

  .phmod-main {
    padding-left: 0;
    padding-top: 0;
  }

  .phmod-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .phmod-btn,
  .phmod-pagination {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}


/* ==========================================================================
   37. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================================================
   35. Pipeline Board & List Toggle
   ======================================================================== */

/* Board visible on wide screens, list hidden */
.phmod-pipeline-list-responsive {
  display: none;
}

/* Column header styling */
.phmod-pipeline-column__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0.75rem;
  background: var(--phmod-bg);
  border-bottom: 2px solid var(--phmod-brand-primary);
  border-radius: var(--phmod-radius) var(--phmod-radius) 0 0;
}

.phmod-pipeline-column__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--phmod-brand-primary);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}

/* Count badge in column header — small circle */
.phmod-pipeline-column__header > .phmod-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  background: var(--phmod-brand-primary);
  color: #ffffff;
  flex-shrink: 0;
}

.phmod-pipeline-column__body {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 80px;
}

.phmod-pipeline-column__empty {
  text-align: center;
  font-size: 0.75rem;
  color: var(--phmod-text-light);
  padding: 1.5rem 0.5rem;
  font-style: italic;
}

.phmod-pipeline-column {
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  min-width: 0;
}

/* Pipeline card polish */
.phmod-pipeline-card {
  display: block;
  text-decoration: none;
  color: var(--phmod-text);
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius);
  padding: 0.75rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.phmod-pipeline-card:hover {
  border-color: var(--phmod-brand-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.phmod-pipeline-card__name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  color: var(--phmod-brand-primary);
}

.phmod-pipeline-card__period {
  font-size: 0.75rem;
  color: var(--phmod-text-muted);
  margin-bottom: 0.5rem;
}

.phmod-pipeline-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.phmod-pipeline-card__days {
  font-size: 0.6875rem;
  color: var(--phmod-text-light);
}

.phmod-pipeline-card__owner {
  margin-top: 0.25rem;
}

.phmod-pipeline-card__hold {
  margin-top: 0.375rem;
}

/* Pipeline count in filter bar */
.phmod-pipeline-count {
  font-size: 0.8125rem;
  color: var(--phmod-text-muted);
  font-weight: 600;
}

/* Completed section */
.phmod-pipeline-completed {
  margin-top: 1.5rem;
  border-top: 1px solid var(--phmod-border);
  padding-top: 1rem;
}

.phmod-pipeline-completed__toggle {
  margin-bottom: 0.75rem;
}

.phmod-pipeline-completed__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}

/* Mobile: show list, hide board */
@media (max-width: 1200px) {
  .phmod-pipeline-board {
    display: none;
  }
  .phmod-pipeline-list-responsive {
    display: block;
  }
}

/* ========================================================================
   35b. Stage Progress Bar (Pipeline / StageControls)
   ======================================================================== */

/* Keyframe for active-stage pulse */
@keyframes phmod-stage-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.phmod-stage-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  padding: 1rem 0.5rem;
}

.phmod-stage-progress__segment {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.phmod-stage-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 0;
}

/* Dots: 12px circles — small, clean, and precise */
.phmod-stage-progress__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--phmod-border);
  font-size: 0;
  color: transparent;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Completed dots: solid green fill */
.phmod-stage-progress__step--completed .phmod-stage-progress__dot {
  background: var(--phmod-success);
  border-color: var(--phmod-success);
  color: transparent;
}

/* Active dot: brand primary with pulse animation */
.phmod-stage-progress__step--active .phmod-stage-progress__dot {
  background: var(--phmod-brand-primary);
  border-color: var(--phmod-brand-primary);
  color: transparent;
  animation: phmod-stage-pulse 2s infinite;
}

/* Labels: small text below each dot */
.phmod-stage-progress__label {
  font-size: 0.625rem;
  color: var(--phmod-text-muted);
  text-align: center;
  line-height: 1.2;
  max-width: 5.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Active label: brand primary + bold */
.phmod-stage-progress__step--active .phmod-stage-progress__label {
  color: var(--phmod-brand-primary);
  font-weight: 700;
}

/* Completed label: green */
.phmod-stage-progress__step--completed .phmod-stage-progress__label {
  color: var(--phmod-success);
}

/* Connectors: thin lines between dots */
.phmod-stage-progress__connector {
  flex: 1;
  height: 2px;
  background: var(--phmod-border);
  margin-top: 0.3125rem; /* vertically center with 12px dot */
  min-width: 0.5rem;
}

/* Filled connector (completed segments): green */
.phmod-stage-progress__connector--filled {
  background: var(--phmod-success);
}

/* Responsive: mobile — hide labels, shrink dots to 8px */
@media (max-width: 768px) {
  .phmod-stage-progress {
    padding: 0.75rem 0.25rem;
  }

  .phmod-stage-progress__label {
    display: none;
  }

  .phmod-stage-progress__dot {
    width: 0.5rem;
    height: 0.5rem;
  }

  .phmod-stage-progress__connector {
    margin-top: 0.1875rem; /* center with 8px dot */
  }
}

/* ========================================================================
   36. Evaluation Form Stepper Enhancement
   ======================================================================== */

/* Stepper container */
.phmod-eval-stepper {
  background: var(--phmod-surface);
  border: 1px solid var(--phmod-border);
  border-radius: var(--phmod-radius-lg);
  padding: 0.5rem 0;
  position: sticky;
  top: calc(56px + 1.5rem);
}

.phmod-eval-stepper__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.phmod-eval-stepper__item {
  border-bottom: 1px solid var(--phmod-border-light);
}

.phmod-eval-stepper__item:last-child {
  border-bottom: none;
}

.phmod-eval-stepper__btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--phmod-text);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.phmod-eval-stepper__btn:hover {
  background: var(--phmod-bg);
}

.phmod-eval-stepper__btn--active {
  background: var(--phmod-brand-primary-light, #eff6ff);
  border-left-color: var(--phmod-brand-primary);
  font-weight: 600;
  color: var(--phmod-brand-primary);
}

.phmod-eval-stepper__indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--phmod-border-light);
  color: var(--phmod-text-muted);
  border: 2px solid var(--phmod-border);
}

.phmod-eval-stepper__indicator--complete {
  background: var(--phmod-success);
  color: #fff;
  border-color: var(--phmod-success);
}

.phmod-eval-stepper__btn--active .phmod-eval-stepper__indicator {
  background: var(--phmod-brand-primary);
  color: #fff;
  border-color: var(--phmod-brand-primary);
}

.phmod-eval-stepper__label {
  flex: 1;
  min-width: 0;
}

/* Context bar (program name + stage info) */
.phmod-eval-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Save status indicator */
.phmod-save-status {
  font-size: 0.75rem;
  font-weight: 500;
}

.phmod-save-status--saving { color: var(--phmod-text-muted); }
.phmod-save-status--saved { color: var(--phmod-success); }
.phmod-save-status--error { color: var(--phmod-danger); }
