/* ============================================================================
   PRECISION PAPER v2.0 — GeM Bid Intelligence Design System
   ============================================================================
   Single source of truth for colour tokens, typography, spacing, and component
   styles. Loaded AFTER Bootstrap/Tailwind, BEFORE any page-specific overrides.

   Guiding brief: "Calm. Precise. Trustworthy."
   Decoration never competes with bid values, deadlines, or win rates.
   ============================================================================ */


/* ============================================================================
   SECTION 0: FONT FACES
   ============================================================================
   Production: replace these URLs with local .woff2 files in this directory
   (agent_dash/static/fonts/) to eliminate 200-400ms Google Fonts CDN latency
   on Indian connections. Use @font-face src: url('/static/fonts/...') format.
   ============================================================================ */

/* --- Inter (UI font) — weights 400, 500, 600 --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
}

/* --- Instrument Serif (display font) — italic only --- */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/instrumentserif/v4/jizBRFtNs2ka5fCjOQ3OCpRqpGwf4Cy0lR2jqw.woff2') format('woff2');
}

/* --- Geist Mono (data font) — weights 400, 500 --- */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/geistmono/v1/or3yQ6H-1_WPzULT6mdH3GRDPOndMmC7R5sH.woff2') format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/geistmono/v1/or3yQ6H-1_WPzULT6mdH3GRDPOndMmC7R5sH.woff2') format('woff2');
}


/* ============================================================================
   SECTION 1: CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================ */

:root {
  /* --- Background --- */
  --bg-page: #F8F7F4;
  --bg-surface: #FFFFFF;
  --bg-hover: #F3F4F8;

  /* --- Borders --- */
  --border-base: #E8E9EE;
  --border-strong: #C8CAD4;

  /* --- Ink (text) --- */
  --ink-primary: #0E1117;
  --ink-secondary: #4A5066;
  --ink-tertiary: #6B7280;   /* Darkened from #8C93A8 per 6.10 — WCAG AA 4.6:1 on white */
  --ink-disabled: #C2C7D6;

  /* --- Blue (only: active nav, links, primary CTAs, bid IDs, focus) --- */
  --blue: #1B3FBF;
  --blue-subtle: #EEF1FB;
  --blue-border: #B8C4F0;

  /* --- Status: green --- */
  --green: #166534;
  --green-subtle: #DCFCE7;

  /* --- Status: amber --- */
  --amber: #92400E;
  --amber-subtle: #FEF3C7;

  /* --- Status: red --- */
  --red: #991B1B;
  --red-subtle: #FEE2E2;

  /* --- Decision bar (dark) --- */
  --ink-inverse: #FFFFFF;
  --surface-dark: #0E1117;
  --muted-dark: #6B7280;

  /* --- KPI accent (single allowed extra) --- */
  --purple: #7C3AED;

  /* --- Font stacks --- */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-data: 'Geist Mono', 'JetBrains Mono', monospace;
  --font-ui: 'Inter', system-ui, sans-serif;

  /* --- Spacing (4px grid) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* --- Radii --- */
  --radius-badge: 4px;
  --radius-btn: 6px;
  --radius-input: 6px;
  --radius-card: 10px;
  --radius-shell: 14px;

  /* --- Sidebar --- */
  --sidebar-collapsed: 48px;
  --sidebar-expanded: 220px;

  /* --- Topbar --- */
  --topbar-height: 48px;

  /* --- Status ribbon (optional) --- */
  --ribbon-height: 30px;

  /* --- Content padding --- */
  --content-pad: 20px;
}


/* ============================================================================
   SECTION 2: "NEVER" RULES — Precision Paper Constraints
   ============================================================================
   The design system forbids decorative chrome that competes with data.
   These overrides enforce the constraint globally. They are intentionally
   !important so per-component styles cannot accidentally reintroduce them.
   ============================================================================ */

/* Remove all box-shadows (the single defining Precision Paper constraint) */
*, *::before, *::after {
  box-shadow: none !important;
}

/* Remove gradients from backgrounds */
.pp-no-gradient,
.pp-card,
.pp-sidebar,
.pp-topbar,
.pp-decision-bar,
.pp-pipeline-bar,
.pp-badge,
.pp-btn-primary,
.pp-btn-ghost,
.pp-btn-action {
  background-image: none !important;
}

/* Remove backdrop-filter */
.pp-card,
.pp-sidebar,
.pp-topbar {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}


/* ============================================================================
   SECTION 3: BASE TYPOGRAPHY
   ============================================================================ */

body {
  font-family: var(--font-ui);
  color: var(--ink-secondary);
  background: var(--bg-page);
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink-primary);
  font-family: var(--font-ui);
  font-weight: 600;
}

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

a:hover {
  text-decoration: underline;
}

/* --- Font family utilities --- */
.font-display { font-family: var(--font-display); }
.font-data    { font-family: var(--font-data); }
.font-ui      { font-family: var(--font-ui); }

/* --- Type scale classes (per Section 1B.2) --- */

/* Column headers: 9px, Inter 600, 0.08em letter-spacing, uppercase */
.text-col-header {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}

/* KPI label: 10px, Inter 500, 0.04em */
.text-kpi-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-tertiary);
}

/* Badge text: 10px, Inter 500 */
.text-badge {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
}

/* Body small: 11px, Inter 400 */
.text-body-sm {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-secondary);
}

/* Body: 12px, Inter 500 */
.text-body {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
}

/* Navigation: 12px, Inter 500 */
.text-nav {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
}

/* Topbar title: 13px, Inter 600 */
.text-topbar-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

/* Data (monospace): 12px, Geist Mono — bid IDs, timestamps, money */
.text-data {
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-primary);
}

/* KPI value: 28px, Instrument Serif italic — large headline numbers */
.text-kpi-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink-primary);
}

/* Page title: 22px, Instrument Serif italic */
.text-page-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink-primary);
}

/* KPI value small: 20px, Instrument Serif italic — right-rail stats */
.text-kpi-value-sm {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink-primary);
}


/* ============================================================================
   SECTION 4: SPACING UTILITIES (4px grid)
   ============================================================================ */

.gap-1 { gap: var(--space-1); }  /* 4px  */
.gap-2 { gap: var(--space-2); }  /* 8px  */
.gap-3 { gap: var(--space-3); }  /* 12px */
.gap-4 { gap: var(--space-4); }  /* 16px */
.gap-5 { gap: var(--space-5); }  /* 20px */
.gap-6 { gap: var(--space-6); }  /* 24px */

.p-pp-1 { padding: var(--space-1); }
.p-pp-2 { padding: var(--space-2); }
.p-pp-3 { padding: var(--space-3); }
.p-pp-4 { padding: var(--space-4); }
.p-pp-5 { padding: var(--space-5); }
.p-pp-6 { padding: var(--space-6); }

.m-pp-1 { margin: var(--space-1); }
.m-pp-2 { margin: var(--space-2); }
.m-pp-3 { margin: var(--space-3); }
.m-pp-4 { margin: var(--space-4); }
.m-pp-5 { margin: var(--space-5); }
.m-pp-6 { margin: var(--space-6); }

.mt-pp-1 { margin-top: var(--space-1); }
.mt-pp-2 { margin-top: var(--space-2); }
.mt-pp-3 { margin-top: var(--space-3); }
.mt-pp-4 { margin-top: var(--space-4); }

.mb-pp-1 { margin-bottom: var(--space-1); }
.mb-pp-2 { margin-bottom: var(--space-2); }
.mb-pp-3 { margin-bottom: var(--space-3); }
.mb-pp-4 { margin-bottom: var(--space-4); }


/* ============================================================================
   SECTION 5: CARD COMPONENT
   ============================================================================ */

.pp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}

.pp-card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pp-card-header h3,
.pp-card-header h4 {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0;
}

.pp-card-body {
  padding: 14px 16px;
}

/* Highlighted card (blue border) */
.pp-card-highlight {
  border-color: var(--blue-border);
}


/* ============================================================================
   SECTION 6: KPI CARD
   ============================================================================ */

.pp-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-card);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

/* Coloured accent line (top-left, 3px wide, 24px tall) */
.pp-kpi::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  width: 3px;
  height: 24px;
  border-radius: 0 2px 2px 0;
  background: var(--blue);
}

.pp-kpi-green::before  { background: var(--green); }
.pp-kpi-amber::before  { background: var(--amber); }
.pp-kpi-red::before    { background: var(--red); }
.pp-kpi-purple::before { background: var(--purple); }

.pp-kpi .text-kpi-label {
  margin-bottom: var(--space-1);
}

.pp-kpi .text-kpi-value {
  margin: 0;
}


/* ============================================================================
   SECTION 7: BADGES
   ============================================================================ */

.pp-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  padding: 2px 8px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

/* Neutral / default */
.pp-badge-neutral {
  background: var(--bg-hover);
  color: var(--ink-secondary);
}

/* Pending (amber) */
.pp-badge-pending {
  background: var(--amber-subtle);
  color: var(--amber);
}

/* Success (green) */
.pp-badge-success {
  background: var(--green-subtle);
  color: var(--green);
}

/* Error (red) */
.pp-badge-error {
  background: var(--red-subtle);
  color: var(--red);
}

/* Info (blue) */
.pp-badge-info {
  background: var(--blue-subtle);
  color: var(--blue);
}

/* Badge with leading dot indicator */
.pp-badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}


/* ============================================================================
   SECTION 8: BUTTONS
   ============================================================================ */

/* Shared button reset */
.pp-btn-primary,
.pp-btn-ghost,
.pp-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pp-btn-primary:active,
.pp-btn-ghost:active,
.pp-btn-action:active {
  transform: scale(0.98);
}

/* Primary (blue fill) */
.pp-btn-primary {
  background: var(--blue);
  color: var(--ink-inverse);
  border-color: var(--blue);
}

.pp-btn-primary:hover {
  background: #16339E;
  border-color: #16339E;
  text-decoration: none;
}

.pp-btn-primary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Ghost (border only) */
.pp-btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border-color: var(--border-base);
}

.pp-btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
  border-color: var(--border-strong);
  text-decoration: none;
}

.pp-btn-ghost:focus-visible {
  border-color: var(--blue);
}

/* Action (subtle blue bg — for table row actions) */
.pp-btn-action {
  background: var(--blue-subtle);
  color: var(--blue);
  border-color: transparent;
  padding: 4px 10px;
  font-size: 11px;
}

.pp-btn-action:hover {
  background: var(--blue-border);
  text-decoration: none;
}

/* Small variant */
.pp-btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

/* Disabled state */
.pp-btn-primary:disabled,
.pp-btn-ghost:disabled,
.pp-btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}


/* ============================================================================
   SECTION 9: TABLE
   ============================================================================ */

.pp-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 12px;
}

.pp-table thead th {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-base);
  text-align: left;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pp-table tbody td {
  padding: 10px 12px;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--border-base);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-table tbody tr:hover {
  background: var(--bg-hover);
}

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

/* Monospace cells (bid IDs, money, timestamps) */
.pp-table .td-data {
  font-family: var(--font-data);
  font-size: 12px;
}

/* Compact table variant */
.pp-table-compact thead th {
  padding: 6px 8px;
}

.pp-table-compact tbody td {
  padding: 6px 8px;
  font-size: 11px;
}


/* ============================================================================
   SECTION 10: SIDEBAR
   ============================================================================ */

.pp-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-base);
  width: var(--sidebar-expanded);
  min-width: var(--sidebar-collapsed);
  transition: width 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.pp-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Sidebar navigation link */
.pp-sidebar .nav-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  border-radius: var(--radius-btn);
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  gap: var(--space-3);
}

.pp-sidebar .nav-link:hover {
  background: var(--bg-hover);
  color: var(--ink-primary);
  text-decoration: none;
}

.pp-sidebar .nav-link.active {
  background: var(--blue-subtle);
  color: var(--blue);
}

.pp-sidebar .nav-link i {
  width: 18px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* Sidebar section label */
.pp-sidebar .nav-section-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-disabled);
  padding: 16px 12px 4px;
}


/* ============================================================================
   SECTION 11: TOPBAR
   ============================================================================ */

.pp-topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  padding: 0 var(--content-pad);
  flex-shrink: 0;
}

.pp-topbar-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}


/* ============================================================================
   SECTION 12: STATUS RIBBON
   ============================================================================ */

.pp-status-ribbon {
  height: var(--ribbon-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  padding: 0 var(--content-pad);
  gap: var(--space-4);
  font-size: 11px;
  color: var(--ink-tertiary);
}

.pp-status-ribbon .ribbon-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* 1px vertical dividers between ribbon items */
.pp-status-ribbon .ribbon-item + .ribbon-item::before {
  content: '';
  display: block;
  width: 1px;
  height: 14px;
  background: var(--border-base);
  margin-right: var(--space-4);
}


/* ============================================================================
   SECTION 13: DECISION BAR (Bid Detail — Dark Surface)
   ============================================================================ */

.pp-decision-bar {
  background: var(--surface-dark);
  color: var(--ink-inverse);
  padding: 16px var(--content-pad);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.pp-decision-bar .decision-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

.pp-decision-bar .decision-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink-inverse);
  line-height: 1.2;
}

.pp-decision-bar .decision-secondary {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--muted-dark);
}

/* Decision bar badge variants (on dark bg) */
.pp-decision-bar .pp-badge-bid {
  background: rgba(22, 101, 52, 0.25);
  color: #86EFAC;
}

.pp-decision-bar .pp-badge-nobid {
  background: rgba(153, 27, 27, 0.25);
  color: #FCA5A5;
}

.pp-decision-bar .pp-badge-review {
  background: rgba(146, 64, 14, 0.25);
  color: #FDE68A;
}


/* ============================================================================
   SECTION 14: PIPELINE BAR (5-Step Horizontal Strip)
   ============================================================================ */

.pp-pipeline-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  gap: 0;
}

.pp-pipeline-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 8px;
  position: relative;
}

/* Connector line between steps */
.pp-pipeline-step + .pp-pipeline-step::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--border-base);
  flex-shrink: 0;
}

.pp-pipeline-step.completed + .pp-pipeline-step::before {
  background: var(--green);
}

/* Step indicator circle */
.pp-pipeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1.5px solid var(--border-base);
  background: var(--bg-surface);
  color: var(--ink-tertiary);
}

.pp-pipeline-step.completed .pp-pipeline-dot {
  background: var(--green-subtle);
  border-color: var(--green);
  color: var(--green);
}

.pp-pipeline-step.active .pp-pipeline-dot {
  background: var(--blue-subtle);
  border-color: var(--blue);
  color: var(--blue);
}

.pp-pipeline-step.error .pp-pipeline-dot {
  background: var(--red-subtle);
  border-color: var(--red);
  color: var(--red);
}

.pp-pipeline-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-tertiary);
  white-space: nowrap;
}

.pp-pipeline-step.completed .pp-pipeline-label { color: var(--green); }
.pp-pipeline-step.active .pp-pipeline-label    { color: var(--blue); }
.pp-pipeline-step.error .pp-pipeline-label     { color: var(--red); }


/* ============================================================================
   SECTION 15: SCOPE SWITCHER
   ============================================================================ */

.pp-scope-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover);
  border-radius: var(--radius-btn);
  padding: 2px;
  gap: 2px;
}

.pp-scope-switcher button {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-tertiary);
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pp-scope-switcher button:hover {
  color: var(--ink-primary);
}

.pp-scope-switcher button.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-weight: 600;
}


/* ============================================================================
   SECTION 16: INPUT
   ============================================================================ */

.pp-input {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-input);
  padding: 8px 12px;
  width: 100%;
  transition: border-color 0.15s ease;
}

.pp-input::placeholder {
  color: var(--ink-disabled);
}

.pp-input:hover {
  border-color: var(--border-strong);
}

.pp-input:focus {
  outline: none;
  border-color: var(--blue);
}

.pp-input:disabled {
  background: var(--bg-hover);
  color: var(--ink-disabled);
  cursor: not-allowed;
}

/* Select variant */
select.pp-input {
  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='%234A5066' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* Textarea variant */
textarea.pp-input {
  resize: vertical;
  min-height: 80px;
}


/* ============================================================================
   SECTION 17: INTERACTION STATES
   ============================================================================ */

/* Focus ring global — border-based, not box-shadow (respects "never" rules) */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Table row hover — already handled in .pp-table tbody tr:hover */

/* Nav hover and active — handled in .pp-sidebar .nav-link */


/* ============================================================================
   SECTION 18: EMPTY STATE PATTERN (Section 1B.5)
   ============================================================================ */

.pp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

.pp-empty-state-icon {
  font-size: 24px;
  color: var(--ink-disabled);
  margin-bottom: var(--space-3);
}

.pp-empty-state-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: var(--space-1);
}

.pp-empty-state-desc {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-secondary);
  max-width: 320px;
  margin-bottom: var(--space-4);
}


/* ============================================================================
   SECTION 19: LAYOUT UTILITIES
   ============================================================================ */

/* Content wrapper with standard padding */
.pp-content {
  padding: var(--content-pad);
}

/* KPI grid (dashboard — 5 columns) */
.pp-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
}

/* Card grid (2, 3, or 4 columns) */
.pp-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.pp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.pp-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

/* Flex row */
.pp-flex {
  display: flex;
  align-items: center;
}

.pp-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pp-flex-col {
  display: flex;
  flex-direction: column;
}

/* Right rail (200px, bid detail + dashboard only) */
.pp-right-rail {
  width: 200px;
  flex-shrink: 0;
}

/* Main + rail layout */
.pp-layout-rail {
  display: flex;
  gap: var(--space-5);
}

.pp-layout-rail .pp-main {
  flex: 1;
  min-width: 0;
}


/* ============================================================================
   SECTION 20: COLOUR UTILITY CLASSES
   ============================================================================ */

.text-ink-primary   { color: var(--ink-primary); }
.text-ink-secondary { color: var(--ink-secondary); }
.text-ink-tertiary  { color: var(--ink-tertiary); }
.text-ink-disabled  { color: var(--ink-disabled); }
.text-blue          { color: var(--blue); }
.text-green         { color: var(--green); }
.text-amber         { color: var(--amber); }
.text-red           { color: var(--red); }
.text-purple        { color: var(--purple); }
.text-inverse       { color: var(--ink-inverse); }

.bg-page    { background: var(--bg-page); }
.bg-surface { background: var(--bg-surface); }
.bg-hover   { background: var(--bg-hover); }

.border-base   { border-color: var(--border-base); }
.border-strong { border-color: var(--border-strong); }
.border-blue   { border-color: var(--blue-border); }


/* ============================================================================
   SECTION 21: RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 1024px) {
  .pp-kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .pp-right-rail {
    display: none;
  }

  .pp-layout-rail {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .pp-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .pp-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pp-grid-4 { grid-template-columns: repeat(2, 1fr); }

  :root {
    --content-pad: 12px;
  }
}

@media (max-width: 480px) {
  .pp-kpi-row {
    grid-template-columns: 1fr;
  }

  .pp-grid-2 { grid-template-columns: 1fr; }
  .pp-grid-3 { grid-template-columns: 1fr; }
}


/* ============================================================================
   SECTION 22: TRANSITION HELPERS
   ============================================================================ */

.pp-transition {
  transition: all 0.15s ease;
}

.pp-transition-slow {
  transition: all 0.3s ease;
}


/* ============================================================================
   SECTION 23: SCROLLBAR STYLING (subtle)
   ============================================================================ */

.pp-scroll::-webkit-scrollbar {
  width: 6px;
}

.pp-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.pp-scroll::-webkit-scrollbar-thumb {
  background: var(--border-base);
  border-radius: 3px;
}

.pp-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}


/* ============================================================================
   SECTION 24: LOADING / SKELETON (for async panels)
   ============================================================================ */

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

.pp-skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-base) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: pp-shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-badge);
}

.pp-skeleton-line {
  height: 12px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-badge);
}

.pp-skeleton-block {
  height: 60px;
  border-radius: var(--radius-card);
}

/* Pipeline step label/status (used in bid_detail pipeline bar) */
.pp-pipeline-step-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-tertiary);
  margin-bottom: 4px;
}

.pp-pipeline-step-status {
  font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
  font-weight: 600;
  font-size: 11px;
}
