:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --paper: #ffffff;
  --canvas: #f4f7f9;
  --surface-soft: #f8fafc;
  --green: #067a62;
  --green-dark: #055f4d;
  --green-pale: #ecfdf5;
  --green-border: #a7f3d0;
  --amber-bg: #fffbeb;
  --amber-ink: #b45309;
  --amber-border: #fde68a;
  --blue-bg: #eff6ff;
  --blue-ink: #1d4ed8;
  --blue-border: #bfdbfe;
  --red-bg: #fef2f2;
  --red-ink: #b91c1c;
  --red-border: #fecaca;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 14px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px -6px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, a, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(6, 122, 98, 0.45); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { overflow-wrap: break-word; }

.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;
}

.skip-link {
  position: absolute;
  z-index: 60;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  transform: translateY(-180%);
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 48px));
  min-height: 72px;
  margin: auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark { display: grid; width: 38px; height: 38px; color: var(--green); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.brand-name > span, .footer-brand > span { color: var(--green); }
.brand-name small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface-soft); }
.nav-link.is-active {
  color: var(--green-dark);
  background: var(--green-pale);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.account-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-role-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.account-role-pill[data-role="ADMIN"] { background: var(--amber-bg); color: var(--amber-ink); }
.account-role-pill[data-role="SELLER"] { background: var(--blue-bg); color: var(--blue-ink); }

/* Buttons */
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.button:not(:disabled):hover { transform: translateY(-1px); }
.button:not(:disabled):active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button-small { min-height: 36px; padding: 0 13px; font-size: 13px; }
.button-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 2px rgba(6, 122, 98, 0.25);
}
.button-primary:not(:disabled):hover {
  background: var(--green-dark);
  box-shadow: 0 4px 12px rgba(6, 122, 98, 0.28);
}
.button-quiet { background: transparent; color: var(--ink-soft); }
.button-quiet:not(:disabled):hover { background: var(--surface-soft); color: var(--ink); }
.button-outline {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.button-outline:not(:disabled):hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-pale);
}
.button-danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red-ink);
}
.button-danger:not(:disabled):hover {
  border-color: #f87171;
  background: #fee2e2;
}

/* Main Shell & Notice */
.page-shell {
  width: min(1240px, calc(100% - 48px));
  min-height: calc(100vh - 148px);
  margin: 0 auto;
  padding: 24px 0 72px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  margin-bottom: 22px;
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  background: var(--green-pale);
  color: #065f46;
}
.notice[data-tone="error"] {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red-ink);
}
.notice-icon {
  display: grid;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.notice-icon svg { width: 100%; height: 100%; }
.notice p { margin: 0; font-size: 13px; line-height: 1.5; }
.notice strong { margin-right: 4px; font-weight: 700; }

/* Eyebrow & Typography */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.eyebrow-line {
  display: inline-block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
}

.card-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 40px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(620px circle at 92% 14%, rgba(6, 122, 98, 0.09), transparent 58%),
    radial-gradient(480px circle at 10% 90%, rgba(29, 78, 216, 0.05), transparent 55%),
    var(--paper);
  box-shadow: var(--shadow-sm);
}

.hero h1, .workspace-heading h1, .auth-intro h1 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.05rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero h1 span, .workspace-heading h1 span, .auth-intro h1 span { color: var(--green); }

.hero-intro {
  max-width: 520px;
  margin: 18px 0 26px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}
.hero-pills svg {
  width: 15px;
  height: 15px;
  color: var(--green);
  flex-shrink: 0;
}

/* Hero Live Preview Shell */
.hero-preview { position: relative; }
.preview-shell {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  box-shadow: var(--shadow-md);
}
.preview-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.preview-dots { display: flex; gap: 5px; }
.preview-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.preview-label {
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.preview-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.preview-kpi {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.kpi-value {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.kpi-accent { color: var(--green-dark); }

.preview-featured {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.preview-featured-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.preview-featured-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.preview-featured-meta {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}
.preview-featured-meta code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.preview-pipeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.pipe-step {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.pipe-step.is-done { background: var(--green-pale); color: var(--green-dark); }
.pipe-step.is-active { background: var(--blue-bg); color: var(--blue-ink); }
.pipe-sep { flex: 1; height: 2px; background: var(--line); }

/* Lifecycle Strip */
.lifecycle-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.lifecycle-step {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.lifecycle-num {
  display: grid;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.lifecycle-step h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.lifecycle-step p { margin: 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; }

/* Role Grid */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 0 18px;
}
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.section-heading > p { max-width: 340px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.role-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.seller-card { border-top-color: #2563eb; }
.admin-card { border-top-color: #d97706; }
.role-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.role-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.role-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: var(--green-pale);
  color: var(--green-dark);
}
.seller-card .role-icon { background: var(--blue-bg); color: var(--blue-ink); }
.admin-card .role-icon { background: var(--amber-bg); color: var(--amber-ink); }
.role-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.role-tag { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.role-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.role-card > p { margin: 0 0 14px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; }
.role-features {
  margin: 0 0 18px;
  padding: 0 0 0 16px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
  flex: 1;
}
.role-features li + li { margin-top: 4px; }

.text-link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link span { padding-left: 4px; }

.trust-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}
.trust-icon { display: grid; width: 20px; height: 20px; color: var(--green); flex-shrink: 0; }
.trust-icon svg { width: 100%; height: 100%; }
.trust-strip p { flex: 1; margin: 0; color: var(--ink-soft); font-size: 13px; }
.trust-strip p strong { margin-right: 4px; color: var(--ink); }
.trust-caption { color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 700; }

/* Auth View */
.auth-view {
  display: grid;
  grid-template-columns: 1fr minmax(360px, 460px);
  align-items: center;
  gap: clamp(30px, 6vw, 80px);
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(500px circle at 90% 10%, rgba(6, 122, 98, 0.08), transparent 60%),
    var(--paper);
  box-shadow: var(--shadow-sm);
}
.auth-lead { max-width: 460px; margin: 16px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.65; }
.auth-highlights { display: grid; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; max-width: 440px; }
.auth-highlights li {
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.highlight-icon { display: grid; width: 20px; height: 20px; color: var(--green); flex-shrink: 0; margin-top: 2px; }
.highlight-icon svg { width: 100%; height: 100%; }
.auth-highlights strong { display: block; font-size: 13.5px; color: var(--ink); }
.auth-highlights span { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; }

.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
.auth-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.auth-card-heading h2 { margin: 4px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.auth-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--green-border);
  border-radius: 999px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.auth-tab {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.auth-tab.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-field { display: grid; gap: 6px; margin: 0 0 16px; }
.form-field label { color: var(--ink); font-size: 13px; font-weight: 600; }
.form-field label span { color: var(--muted); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field textarea { padding: 10px 12px; min-height: 110px; line-height: 1.55; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 122, 98, 0.16);
}
.form-field input[aria-invalid="true"], .form-field select[aria-invalid="true"] { border-color: #dc2626; }
.field-hint { color: var(--muted); font-size: 12px; }

.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch { margin: 16px 0 0; color: var(--ink-soft); font-size: 13px; text-align: center; }
.auth-switch button { padding: 0; border: 0; background: transparent; color: var(--green-dark); cursor: pointer; font-weight: 700; }
.auth-switch button:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-feedback, .tender-feedback {
  margin: 0 0 16px;
  padding: 11px 14px;
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  background: var(--green-pale);
  color: #065f46;
  font-size: 13px;
  line-height: 1.5;
}
.tender-feedback { margin: 16px 0 0; }
.auth-feedback[data-tone="error"], .tender-feedback[data-tone="error"] {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red-ink);
}
.auth-feedback[data-tone="info"] {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink-soft);
}

/* Workspace Headings & Metrics Strip */
.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(480px circle at 92% 18%, rgba(6, 122, 98, 0.08), transparent 60%),
    var(--paper);
  box-shadow: var(--shadow-xs);
}
.workspace-heading h1 { font-size: clamp(1.75rem, 3vw, 2.45rem); }
.workspace-intro { max-width: 650px; margin: 10px 0 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

.preview-badge {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--green-border);
  border-radius: 999px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.metric-card {
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric-value {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.metric-sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

/* Filters & Toolbars */
.browse-tools, .buyer-filters {
  display: grid;
  grid-template-columns: 160px minmax(200px, 1.4fr) 150px 150px auto auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.browse-tools .form-field, .buyer-filters .form-field { margin: 0; }
.buyer-filters { grid-template-columns: 180px 1fr auto; }

.check-field {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.check-field input { width: 16px; height: 16px; accent-color: var(--green); }

.buyer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.buyer-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.buyer-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.buyer-tabs button[aria-selected="true"] {
  background: var(--green-pale);
  color: var(--green-dark);
}

/* Cards, Grids, Badges */
.tender-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.empty-state, .loading-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 120px;
  place-content: center;
  justify-items: center;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.tender-card, .tender-detail-card, .tender-form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}

.tender-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.tender-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tender-card-heading, .card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tender-card-heading h2, .tender-detail-card h2, .tender-form-card h2, .procurement-section > .card-heading h2 {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.tender-code {
  display: inline-block;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.status-draft { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.status-published, .status-submitted, .status-qualified { background: var(--green-pale); border-color: var(--green-border); color: #047857; }
.status-closed { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-ink); }
.status-awarded { background: var(--blue-bg); border-color: var(--blue-border); color: var(--blue-ink); }
.status-cancelled, .status-rejected, .status-withdrawn, .status-disqualified { background: var(--red-bg); border-color: var(--red-border); color: var(--red-ink); }

.tender-description {
  margin: 12px 0 16px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.tender-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.tender-meta div { min-width: 0; }
.tender-meta dt, .tender-detail-grid dt {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tender-meta dd, .tender-detail-grid dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.tender-deadline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.tender-deadline-pill.is-open { color: #047857; }
.tender-deadline-pill.is-closed { color: var(--muted); }

.tender-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Stage Stepper inside Detail / Review */
.stage-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  overflow-x: auto;
}
.stage-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.stage-node.is-done {
  border-color: var(--green-border);
  background: var(--green-pale);
  color: var(--green-dark);
}
.stage-node.is-current {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: var(--blue-ink);
}
.stage-node.is-cancelled {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red-ink);
}
.stage-line { flex: 1; min-width: 14px; height: 2px; background: var(--line); }
.stage-line.is-done { background: var(--green); }

/* Detail & Form Cards */
.tender-form-card, .tender-detail-card { margin-top: 16px; padding: 24px; }
.tender-form { display: grid; gap: 4px; margin-top: 20px; }
.tender-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tender-submit { width: min(240px, 100%); margin-top: 6px; }
.tender-detail-heading { margin-bottom: 16px; }
.tender-detail-description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.tender-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}
.tender-detail-grid div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

/* Procurement Sections, Forms & Tables */
.procurement-section {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.procurement-form {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.procurement-form h3, .tender-detail-card > h3 {
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 700;
}
.procurement-form h4 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.procurement-form .form-field { margin-bottom: 14px; }
.score-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.bid-review-list { display: grid; gap: 14px; margin-top: 16px; }
.bid-review-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.bid-review-card > .card-heading strong {
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.opened-proposal, .bid-own-details {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 13.5px;
}
.opened-proposal summary, .bid-own-details summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}
.opened-proposal p, .bid-own-details p {
  margin: 10px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.review-summary {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  background: var(--green-pale);
  color: #065f46;
  font-size: 13.5px;
  line-height: 1.6;
}
.review-summary p { margin: 4px 0; }
.card-note, .card-copy { color: var(--ink-soft); font-size: 13.5px; line-height: 1.6; }
.card-note { margin: 12px 0 0; }
.card-copy { margin: 12px 0; }

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.data-table th, .data-table td {
  min-width: 90px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table th {
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table tbody tr.is-top-rank { background: #f0fdf4; }
.data-table tr:last-child td { border-bottom: 0; }
.recommendation-form { margin-top: 20px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner {
  display: flex;
  width: min(1240px, calc(100% - 48px));
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: auto;
}
.footer-brand { color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.footer-inner > p { margin: 0; color: var(--muted); font-size: 13px; }
.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* Responsive */
@media (max-width: 980px) {
  .header-inner, .page-shell, .footer-inner { width: min(100% - 32px, 860px); }
  .hero { grid-template-columns: 1fr; padding: 32px; gap: 28px; }
  .lifecycle-strip { grid-template-columns: repeat(2, 1fr); }
  .role-grid { grid-template-columns: 1fr; }
  .auth-view { grid-template-columns: 1fr; padding: 32px; }
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .browse-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browse-tools .button { width: 100%; }
  .tender-list { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .header-inner { width: calc(100% - 28px); min-height: 64px; flex-wrap: wrap; gap: 8px 12px; padding: 10px 0 0; }
  .brand { margin-right: auto; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 17px; }
  .header-actions .button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .account-summary { max-width: 145px; padding: 4px 8px; font-size: 11px; }
  .primary-nav { order: 3; width: 100%; justify-content: space-between; gap: 4px; padding-bottom: 8px; overflow-x: auto; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
  .page-shell { width: calc(100% - 28px); padding-top: 16px; }
  .hero, .workspace-heading, .auth-view { padding: 24px 20px; }
  .lifecycle-strip, .metrics-strip, .form-grid-two, .tender-form-grid, .score-grid { grid-template-columns: 1fr; }
  .workspace-heading { flex-direction: column; align-items: flex-start; gap: 14px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 8px; }
  .browse-tools, .buyer-filters { grid-template-columns: 1fr; }
  .buyer-toolbar { flex-direction: column; align-items: stretch; }
  .buyer-toolbar > .button { width: 100%; }
  .buyer-tabs { width: 100%; overflow-x: auto; }
  .buyer-tabs button { flex: 1; white-space: nowrap; }
  .tender-meta, .tender-detail-grid { grid-template-columns: 1fr; }
  .procurement-section { padding: 16px; }
  .preview-kpis { grid-template-columns: 1fr; }
  .footer-inner { width: calc(100% - 28px); flex-wrap: wrap; padding: 16px 0; }
  .footer-inner > p { order: 3; width: 100%; }
}

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