/* ===================================================================
   Synergy Cost — Product Design System
   Editorial corporate style: precise, legible, authoritative.
   No emojis. No purple. No dark mode.
   ===================================================================

   TABLE OF CONTENTS
   1.  Design tokens
   2.  Reset & base
   3.  Typography scale
   4.  Page shell & layout
   5.  Page header & breadcrumb
   6.  Buttons
   7.  Forms & inputs
   8.  Cards & panels
   9.  KPI grid
   10. Data tables
   11. Badges
   12. Alerts & flash messages
   13. Next-step & orientation blocks
   14. Provider-specific components
   15. Utility classes
   16. Login layout
   17. Landing layout
   18. Modal (base)
   19. Responsive
   20. Demo compatibility aliases

   =================================================================== */


/* ── 1. DESIGN TOKENS ─────────────────────────────────────────────── */

:root {
  /* Background & surface */
  --bg:              #f5f7fa;
  --surface:         #ffffff;
  --surface-soft:    #eef1f7;
  --surface-raised:  #e4e9f2;

  /* Borders */
  --border:          #d6dbe8;
  --border-soft:     #e4e9f2;

  /* Text */
  --text:            #111827;
  --text-secondary:  #374151;
  --muted:           #6b7280;
  --muted-light:     #9ca3af;

  /* Primary action — deep corporate navy */
  --primary:         #0e2240;
  --primary-hover:   #071630;
  --primary-light:   #e6ecf5;

  /* Semantic link color */
  --link:            #1a4fb5;
  --link-hover:      #133d96;

  /* State palettes */
  --success:         #0a6245;
  --success-bg:      #ecfdf5;
  --success-border:  #a7f3d0;
  --success-text:    #064e35;

  --warning:         #92400e;
  --warning-bg:      #fffbeb;
  --warning-border:  #fde68a;
  --warning-text:    #78350f;

  --danger:          #b91c1c;
  --danger-bg:       #fef2f2;
  --danger-border:   #fecaca;
  --danger-text:     #991b1b;

  --info:            #1a4fb5;
  --info-bg:         #eff6ff;
  --info-border:     #bfdbfe;
  --info-text:       #1e40af;

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:   0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:      0 2px 6px -1px rgba(15, 23, 42, 0.08), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover:0 6px 14px -3px rgba(15, 23, 42, 0.1), 0 3px 6px -3px rgba(15, 23, 42, 0.05);

  /* Radii */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius:    6px;
  --radius-md: 8px;
  --radius-lg: 12px;

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

  /* Typography */
  --font-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Mono",
               Consolas, monospace;

  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   17px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  28px;

  --leading:         1.55;
  --leading-tight:   1.25;
  --leading-heading: 1.2;
}


/* ── 2. RESET & BASE ─────────────────────────────────────────────── */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
}

pre {
  padding: var(--sp-3) var(--sp-4);
  overflow-x: auto;
  white-space: pre-wrap;
}


/* ── 3. TYPOGRAPHY SCALE ────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-sans);
  line-height: var(--leading-heading);
  color: var(--text);
}

h1 {
  font-size: 1.625rem;   /* 26 px */
  font-weight: 650;
  letter-spacing: -0.025em;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.0625rem;  /* 17 px */
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 0.9375rem;  /* 15 px */
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 1.25rem 0 0.4rem;
}

p {
  margin: 0.35rem 0;
}

strong {
  font-weight: 600;
}


/* ── 4. PAGE SHELL & LAYOUT ─────────────────────────────────────── */

/* Standard product shell — max-width content container */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

.app-shell-md {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

.app-shell-sm {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

.app-shell-xs {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

/* Two-column split */
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

/* Auto-fit grid for field groups */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem 1rem;
}


/* ── 5. PAGE HEADER & BREADCRUMB ────────────────────────────────── */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow);
}

.page-header > div:first-child {
  min-width: 0;
  flex: 1 1 420px;
}

.page-title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.page-subtitle {
  margin: var(--sp-3) 0 0;
  color: var(--muted);
  font-size: var(--text-md);
  max-width: 820px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.page-eyebrow {
  margin: 0 0 10px;
  color: var(--info);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
}

.page-header > .cta-row {
  align-self: flex-start;
  margin-left: auto;
}

/* Breadcrumb */
.breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--sp-4);
  line-height: 1.45;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-xs);
}

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

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Section count label next to h2 */
.section-count {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  margin-left: var(--sp-2);
  vertical-align: middle;
}

/* Field label + value pairs */
.field-label {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.field-value {
  font-size: var(--text-md);
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Brand slot with SVG logo fallback to wordmark */
.brand-slot {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}

.brand-logo {
  display: block;
  max-width: 220px;
  width: auto;
  height: auto;
  max-height: 34px;
  object-fit: contain;
}

.brand-wordmark {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.brand-slot--header {
  margin-bottom: var(--sp-3);
}


/* ── 6. BUTTONS ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: normal;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  background: var(--primary-hover);
  color: #fff;
  text-decoration: none;
}

/* Primary — explicit alias */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

/* Secondary — white with border */
.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

/* Ghost — no fill */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.btn-danger:hover {
  background: #991b1b;
  color: #fff;
}

/* Award — positive green action */
.btn-award {
  background: #086641;
  color: #fff;
  border-color: transparent;
}

.btn-award:hover {
  background: #065535;
  color: #fff;
}

/* Size variants */
.btn-sm {
  font-size: var(--text-xs);
  padding: 5px 11px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Login submit alias */
.btn-submit {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--sp-2);
  transition: background 0.12s ease;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

/* Inline action link list */
.actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.actions-inline a {
  color: var(--link);
  font-weight: 500;
  font-size: var(--text-base);
  text-decoration: none;
}

.actions-inline a:hover {
  text-decoration: underline;
}

/* Flex button group */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-top: var(--sp-3);
}

/* Inline <form> inside a td */
.action-form {
  display: inline;
}


/* ── 7. FORMS & INPUTS ───────────────────────────────────────────── */

label {
  display: block;
  margin: 0 0 var(--sp-1);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
input:not([type]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  line-height: var(--leading);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  appearance: none;
  -webkit-appearance: none;
}

select {
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(26, 79, 181, 0.12);
}

input[readonly],
input[disabled],
select[disabled],
textarea[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: default;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.hint {
  margin: var(--sp-1) 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.4;
}

.required::after {
  content: " *";
  color: var(--danger);
}

/* Auto-fit form grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
}

/* Read-only section in forms */
.readonly-section {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-top: var(--sp-3);
}

.readonly-section p {
  margin: 3px 0;
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* Provider add-form block */
.provider-add-form {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-4) 0 var(--sp-5);
}

.provider-add-form h2 {
  margin: 0 0 0.35rem;
  border-bottom: none;
  padding: 0;
  font-size: var(--text-md);
}

.provider-add-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  min-height: 78px;
}

.provider-add-actions {
  margin-top: var(--sp-2);
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Delivery link inline blocks */
.delivery-group {
  margin: 0.4rem 0;
}

.delivery-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.delivery-inline {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.delivery-inline input {
  min-width: 260px;
  max-width: 100%;
  flex: 1;
  padding: 4px 8px;
  font-size: var(--text-xs);
}

.delivery-note {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.4;
}


/* ── 8. CARDS & PANELS ───────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: var(--sp-5);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.72) 0%, #ffffff 100%);
}

.card h2,
.card h3 {
  border-bottom: none;
  padding-bottom: 0;
  margin: 0 0 var(--sp-3);
  font-size: var(--text-md);
  font-weight: 600;
}

.card + .card,
.card + section.card {
  margin-top: var(--sp-3);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  flex: 1;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.card-body {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.card-body p {
  margin: 3px 0;
}

/* Rate request row cards */
.rr-card {
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.75rem var(--sp-4);
  margin-bottom: 0.75rem;
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}

.rr-card .family-label {
  font-weight: 600;
  font-size: var(--text-md);
  flex: 1;
  color: var(--text);
}

.rr-card .meta {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Family status blocks */
.fs-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 0.75rem;
}

.fs-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--text-base);
}

.fs-row:last-child {
  border-bottom: none;
}

.fs-family {
  font-weight: 600;
  flex: 1;
  color: var(--text);
}

.fs-meta {
  font-size: var(--text-xs);
  color: var(--muted);
}

.proposals-family-block {
  margin-bottom: 1.25rem;
}

.proposals-family-title {
  font-weight: 600;
  font-size: var(--text-md);
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.panel-block {
  margin-bottom: var(--sp-7);
}

.panel-block > h2 {
  margin-top: 0;
}

.panel-block > h3 {
  margin-top: var(--sp-5);
}

.panel-primary {
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.panel-primary .proposals-family-title {
  color: var(--text);
}

.panel-secondary-ops {
  border-top: 1px solid var(--border-soft);
  padding-top: var(--sp-5);
}

.campaign-summary-note {
  margin: calc(var(--sp-2) * -1) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.homologation-secondary {
  margin-top: var(--sp-4);
  border: 1px solid rgba(191, 203, 221, 0.72);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 28%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: var(--shadow-sm);
}

.homologation-secondary > summary {
  padding: 16px 20px;
  cursor: pointer;
  color: var(--text);
  font-weight: 650;
  font-size: var(--text-sm);
  list-style: none;
}

.homologation-secondary-content {
  padding: 0 20px 20px;
}

.table-wrap-subtle {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}

.homologation-stack,
.homologation-archive-list {
  display: grid;
  gap: 16px;
}

.homologation-card,
.homologation-archive-group {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f8fafc 100%);
  box-shadow: var(--shadow-sm);
}

.homologation-card {
  padding: 22px;
}

.homologation-card-head,
.homologation-archive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.homologation-card-copy {
  min-width: 0;
  flex: 1 1 320px;
}

.homologation-card-title,
.homologation-archive-title {
  margin: 0;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.homologation-card-title {
  font-size: clamp(1.2rem, 1.8vw, 1.65rem);
}

.homologation-archive-title {
  font-size: 1rem;
}

.homologation-card-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.homologation-card-meta,
.homologation-archive-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.homologation-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.homologation-secondary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.homologation-archive-group {
  padding: 20px;
}

.homologation-archive-group > h3 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.homologation-archive-card {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.64);
  border-radius: 20px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.88) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.homologation-archive-card-rejected {
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.06), transparent 32%),
    linear-gradient(180deg, rgba(254, 242, 242, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.homologation-archive-reason {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  overflow-wrap: anywhere;
}


/* ── 9. KPI GRID ─────────────────────────────────────────────────── */

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

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.78) 0%, #ffffff 100%);
}

.kpi-card-clickable {
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

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

.kpi-label {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kpi-value {
  margin: var(--sp-2) 0 0;
  font-size: var(--text-2xl);
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.kpi-note {
  margin: 4px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}


/* ── 10. DATA TABLES ─────────────────────────────────────────────── */

/* Table wrapper — horizontal scroll on narrow screens */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-sm);
}

/* Base table — covers bare <table> elements in customer templates */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

th {
  background: var(--surface-soft);
  text-align: left;
  padding: 9px var(--sp-3);
  border-bottom: 2px solid var(--border);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.055em;
  white-space: normal;
  overflow-wrap: anywhere;
}

td {
  padding: 9px var(--sp-3);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface-soft);
}

/* Classed data-table — used in provider portal */
.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.data-table-wide {
  min-width: 960px;
}

.data-table th,
.data-table td {
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  text-align: left;
  font-size: var(--text-base);
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  white-space: normal;
  border-bottom: 2px solid var(--border);
}

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

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

/* Row state variants */
.row-awarded td,
.winner-row td {
  background: #f0fdf8;
}

/* Misc table cells */
.counter-cell {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.reason-cell {
  font-size: var(--text-sm);
  color: var(--muted);
  max-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Inline cell progress meter */
.meter {
  margin-top: 6px;
  height: 5px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.meter-fill.negative {
  background: var(--danger);
}


/* ── 11. BADGES ──────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

/* Neutral — draft, closed, expired, not-enabled, pending-ish */
.badge-neutral,
.badge-draft,
.badge-closed,
.badge-expired,
.badge-not_enabled,
.badge-not-enabled,
.badge-attention-waiting,
.badge-notif-none,
.badge-progress-not_started,
.badge-fs-no_proposals {
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.94) 0%, rgba(248, 250, 252, 0.98) 100%);
  color: #667085;
  border-color: rgba(191, 203, 221, 0.82);
}

/* Info / blue — open, invited, active states */
.badge-info,
.badge-open,
.badge-invited,
.badge-opened,
.badge-not_started,
.badge-not-started,
.badge-attention-decide,
.badge-fs-open {
  background: linear-gradient(180deg, rgba(224, 236, 255, 0.96) 0%, rgba(239, 246, 255, 0.98) 100%);
  color: #1d4ed8;
  border-color: rgba(147, 197, 253, 0.84);
}

/* Success / green — approved, awarded, sent */
.badge-success,
.badge-approved,
.badge-awarded,
.badge-attention-closed,
.badge-fs-awarded,
.badge-notif-sent,
.badge-progress-awarded,
.badge-awarded-row {
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.98) 0%, rgba(240, 253, 244, 1) 100%);
  color: #047857;
  border-color: rgba(110, 231, 183, 0.84);
}

/* Warning / amber — submitted, pending review, draft-in-progress */
.badge-warning,
.badge-submitted,
.badge-attention-review,
.badge-notif-pending,
.badge-progress-draft,
.badge-progress-submitted {
  background: linear-gradient(180deg, rgba(255, 247, 214, 0.98) 0%, rgba(255, 251, 235, 1) 100%);
  color: #a16207;
  border-color: rgba(252, 211, 77, 0.88);
}

/* Danger / red — rejected, not-awarded, failed */
.badge-danger,
.badge-rejected,
.badge-not_awarded,
.badge-notif-failed,
.badge-progress-not_awarded {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.98) 0%, rgba(254, 242, 242, 1) 100%);
  color: #b91c1c;
  border-color: rgba(252, 165, 165, 0.88);
}


/* ── 12. ALERTS & FLASH MESSAGES ────────────────────────────────── */

.alert {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--text-base);
  line-height: var(--leading);
}

.alert ul {
  margin: 0;
  padding-left: 1.2rem;
}

.alert ul li {
  margin: var(--sp-1) 0;
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.alert-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-text);
}

.alert-danger,
.alert-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.alert-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info-text);
}

/* Workspace award/reject outcome banners */
.alert-awarded {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  border-radius: var(--radius-sm);
  padding: 10px var(--sp-4);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.alert-not_awarded {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: var(--radius-sm);
  padding: 10px var(--sp-4);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

/* Flash messages (Jinja get_flashed_messages) */
.flash {
  border-radius: var(--radius-sm);
  padding: 10px var(--sp-4);
  margin-bottom: 0.75rem;
  font-size: var(--text-base);
  border: 1px solid transparent;
}

.flash-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.flash-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

/* Contextual small info boxes (used in login, home) */
.notice-box {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-3);
  font-size: var(--text-sm);
  margin: 3px 0 var(--sp-4);
  line-height: 1.45;
}

.info-box {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-text);
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-3);
  font-size: var(--text-sm);
  margin: 3px 0 var(--sp-4);
  line-height: 1.45;
}

.error-box {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-3);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
}


/* ── 13. NEXT-STEP & ORIENTATION BLOCKS ─────────────────────────── */

/* Recommended next action — prominent but contained */
.next-step {
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  border-radius: 16px;
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-4) 0 var(--sp-5);
  box-shadow: var(--shadow-xs);
}

.next-step h2 {
  border-bottom: none;
  margin: 0 0 0.35rem;
  padding: 0;
  font-size: var(--text-md);
  color: var(--info-text);
}

.next-step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-base);
}

.next-step-cta {
  margin-top: var(--sp-3);
}

/* Workspace orientation block — same visual weight */
.orientation {
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  border-radius: 16px;
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-xs);
}

.orientation h2 {
  border-bottom: none;
  margin: 0 0 0.35rem;
  padding: 0;
  font-size: var(--text-md);
  color: var(--info-text);
}

.orientation p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* Progress summary bar */
.progress-summary {
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  border-radius: var(--radius);
  padding: 10px var(--sp-4);
  margin-bottom: 0.75rem;
  font-size: var(--text-sm);
  color: var(--text);
}

.progress-note {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: block;
  margin-top: 4px;
}

/* Meta row in workspace cards */
.meta-row {
  display: flex;
  gap: 2rem;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--sp-2);
}


/* ── 14. PROVIDER-SPECIFIC COMPONENTS ───────────────────────────── */

/* Workspace family cards inherit .card; extra header logic via .card-header */

/* Award done inline indicator */
.award-done {
  color: var(--success);
  font-size: var(--text-xs);
  font-weight: 600;
}

.fs-awarded-name {
  color: var(--success);
  font-weight: 600;
}


/* ── 15. UTILITY CLASSES ─────────────────────────────────────────── */

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--text-sm);
}

.note {
  font-size: var(--text-sm);
  color: var(--muted);
}

.empty-msg {
  color: var(--muted-light);
  font-style: italic;
  font-size: var(--text-base);
  padding: var(--sp-4) 0;
}

.see-all {
  margin-top: 0.75rem;
}

.list-compact {
  margin: var(--sp-2) 0 0;
  padding-left: 18px;
}

.list-compact li {
  margin: 4px 0;
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* Back link (login page) */
.back-link {
  display: block;
  margin-top: var(--sp-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted);
}

.back-link a {
  color: var(--link);
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}


/* ── 16. LOGIN LAYOUT ─────────────────────────────────────────────── */

/* If the login page ever removes its inline <style>,
   these rules provide the complete centered layout. */

.login-page-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: var(--sp-8) var(--sp-8);
  width: 100%;
  max-width: 420px;
}

.login-card h1 {
  font-size: 1.35rem;
  margin: 0 0 var(--sp-5);
  letter-spacing: -0.018em;
}

.login-card label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  margin-bottom: var(--sp-4);
}


/* ── 17. LANDING LAYOUT ──────────────────────────────────────────── */

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  margin: 0 0 0.45rem;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.5;
}

.flows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-top: var(--sp-4);
}

@media (min-width: 640px) {
  .flows {
    grid-template-columns: 1fr 1fr;
  }
}

.flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-xs);
}

.flow h2 {
  margin: 0 0 0.5rem;
  font-size: var(--text-md);
  border-bottom: none;
  padding: 0;
  color: var(--text);
}

.flow p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.5;
}

.demo-link {
  margin-top: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--muted-light);
}

.demo-link a {
  color: var(--muted);
  text-decoration: none;
}

.demo-link a:hover {
  text-decoration: underline;
}


/* ── 18. MODAL (BASE) ─────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--sp-4);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: var(--sp-5) var(--sp-6) var(--sp-3);
  border-bottom: 1px solid var(--border-soft);
}

.modal-header h2 {
  margin: 0;
  font-size: var(--text-lg);
  border: none;
  padding: 0;
}

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

.modal-footer {
  padding: var(--sp-3) var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
}


/* ── 19. RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 960px) {
  .app-shell,
  .app-shell-md {
    padding: var(--sp-5) var(--sp-4);
  }

  .split-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-5);
  }

  .page-header .cta-row {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.375rem;
  }

  .app-shell,
  .app-shell-md,
  .app-shell-sm,
  .app-shell-xs {
    padding: var(--sp-4) var(--sp-3);
  }

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

  .login-card {
    padding: var(--sp-6);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }

  .kpi-value {
    font-size: var(--text-xl);
  }

  .btn {
    font-size: var(--text-sm);
    padding: 6px 12px;
  }

  .data-table th,
  .data-table td,
  th,
  td {
    padding: 7px var(--sp-3);
    font-size: var(--text-xs);
  }

  .actions-inline {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ── 20. DEMO COMPATIBILITY ALIASES ─────────────────────────────── */
/*
   portal.html and provider_access_error.html use .demo-body and
   .demo-shell. These aliases keep them working without touching templates.
*/

body.demo-body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.demo-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

@media (max-width: 960px) {
  .demo-shell {
    padding: var(--sp-5) var(--sp-4);
  }
}

@media (max-width: 640px) {
  .demo-shell {
    padding: var(--sp-4) var(--sp-3);
  }
}


/* ── ADDITIONAL PATTERNS (audit tool & shared) ─────────────────── */

/* Generic centered container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* Form field group with spacing */
.form-group {
  margin-bottom: var(--sp-4);
}

.form-group label {
  margin-bottom: var(--sp-1);
}

/* Summary card grid (audit tool) */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-xs);
}

.summary-card.alert-green {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.summary-card.alert-red {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.card-label {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.card-value {
  font-size: var(--text-xl);
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Audit section */
.audit-section {
  margin-top: var(--sp-6);
}

.audit-subtitle {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--sp-4);
}

/* Diff cell states */
td.diff-over {
  color: var(--danger-text);
  font-weight: 600;
}

td.diff-ok {
  color: var(--success-text);
  font-weight: 600;
}

td.diff-unknown {
  color: var(--muted-light);
  font-style: italic;
}

/* ── CUSTOMER BACKOFFICE PATTERNS ───────────────────────────────── */

/* Breadcrumb bar — breadcrumb text left, logout action right */
.breadcrumb-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* Small meta line below page title — ID, status, secondary info */
.page-meta {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: var(--sp-3) 0 0;
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  line-height: 1.4;
}

.page-meta > .page-meta-item {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  white-space: normal;
}

.page-meta > .page-meta-badge {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.page-meta > .badge,
.page-meta > .page-meta-badge {
  flex: 0 0 auto;
}

.page-meta-sep {
  display: none;
}

.campaign-status-badge {
  padding-inline: 11px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

/* Fixed toast banner (JS-driven) */
.result-banner {
  display: none;
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  padding: 10px var(--sp-5);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  z-index: 200;
  box-shadow: var(--shadow);
  max-width: 380px;
}

/* Modal overlay & box */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.38);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: var(--sp-6);
  max-width: 480px;
  width: 90%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
}

.modal-box h3 {
  margin: 0 0 var(--sp-2);
  font-size: var(--text-lg);
  font-weight: 650;
  letter-spacing: -0.015em;
}

.modal-box p {
  margin: 0 0 var(--sp-3);
  font-size: var(--text-base);
  color: var(--muted);
}

.modal-actions {
  margin-top: var(--sp-5);
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
}

/* Table-card wrapper: gives a bordered panel to plain tables */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-4);
}

.table-wrap table {
  margin: 0;
  min-width: 720px;
}

/* Form-in-a-card layout (campaign new / edit) */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: var(--sp-6) var(--sp-6);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.form-card h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 650;
  margin: 0 0 3px;
  letter-spacing: -0.03em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

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

.form-group label {
  margin-bottom: var(--sp-1);
}

.form-group textarea {
  min-height: 130px;
}

.form-hint {
  margin: var(--sp-1) 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.form-actions {
  margin-top: var(--sp-5);
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}


/* Alert color variants (summary cards) */
.alert-green {
  color: var(--success-text);
}

.alert-red {
  color: var(--danger-text);
}


/* ── PROVIDER AREA PATTERNS ─────────────────────────────────────── */

/* Status banners inside workspace family cards */
.family-awarded-banner {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  border-radius: 12px;
  padding: var(--sp-2) var(--sp-3);
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-3);
}

.family-not-awarded-banner {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  padding: var(--sp-2) var(--sp-3);
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-3);
}

/* Small metadata row at bottom of workspace family cards */
.meta-row {
  display: flex;
  gap: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

/* Read-only data block for submitted homologation */
.readonly-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: var(--sp-4) var(--sp-5);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.82) 0%, #ffffff 100%);
}

.readonly-block .field-label {
  margin-top: var(--sp-3);
}

.readonly-block .field-label:first-child {
  margin-top: 0;
}

.readonly-status {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
  font-size: var(--text-sm);
}

.readonly-status-approved {
  color: var(--success-text);
  font-weight: 600;
}

.readonly-status-rejected {
  color: var(--danger-text);
  font-weight: 600;
}

.readonly-status-muted {
  color: var(--muted);
}

/* Muted italic for disabled / not_enabled family in workspace */
.family-disabled-note {
  color: var(--muted);
  font-style: italic;
  font-size: var(--text-sm);
  margin: 0;
}

/* No-link notice inside family card */
.family-no-link {
  font-size: var(--text-xs);
  color: var(--muted-light);
  margin-top: var(--sp-2);
}

/* Context card shown to approved providers before they prepare tender pricing */
.tender-context-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 22px;
  align-items: start;
  margin: var(--sp-5) 0;
  padding: 24px;
  border: 1px solid rgba(191, 203, 221, 0.76);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 0 18px 44px -30px rgba(15, 23, 42, 0.58), var(--shadow-sm);
}

.tender-context-copy {
  min-width: 0;
}

.tender-context-kicker {
  margin: 0 0 8px;
  color: var(--info);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tender-context-card h2 {
  margin: 0 0 14px;
  padding: 0;
  border-bottom: none;
  color: var(--text);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 650;
  letter-spacing: 0;
}

.tender-context-card p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.tender-context-card p:last-child {
  margin-bottom: 0;
}

.tender-context-side {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--border-soft);
}

.tender-context-fact {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(191, 203, 221, 0.68);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.tender-context-fact span {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.tender-context-fact strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tender-context-map-link {
  width: 100%;
  margin-top: 2px;
}

/* Gap between KPI grid and first form section in portal */
.portal-overview-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--sp-5);
}

.portal-overview-card {
  min-width: 0;
  border-radius: 24px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.portal-overview-value {
  margin: 10px 0 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text);
  overflow-wrap: anywhere;
}

.portal-overview-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.portal-form {
  margin-top: var(--sp-5);
}

.portal-section-card {
  border-radius: 28px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.portal-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.portal-section-copy {
  min-width: 0;
  flex: 1 1 420px;
}

.portal-section-kicker,
.portal-coverage-kicker,
.portal-condition-kicker,
.portal-submit-kicker {
  margin: 0 0 8px;
  color: var(--info);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portal-section-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.65;
  max-width: 860px;
  overflow-wrap: anywhere;
}

.portal-chip-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(191, 203, 221, 0.82);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.portal-table-shell {
  margin-top: 18px;
  border-radius: 24px;
  border-color: rgba(191, 203, 221, 0.7);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.portal-pricing-table.data-table-wide {
  min-width: 1080px;
}

.portal-matrix-table.data-table-wide {
  width: max-content;
  min-width: 0;
  table-layout: auto;
}

.portal-matrix-table th,
.portal-matrix-table td {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.portal-weight-head,
.portal-weight-cell {
  position: sticky;
  left: 0;
  min-width: 220px;
  width: 220px;
}

.portal-weight-head {
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(233, 238, 247, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
}

.portal-weight-cell {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 1px 0 0 rgba(191, 203, 221, 0.72);
}

.portal-matrix-table tbody tr:hover .portal-weight-cell {
  background:
    linear-gradient(180deg, rgba(240, 244, 250, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.portal-weight-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.portal-weight-title {
  font-weight: 650;
  color: var(--text);
  line-height: 1.45;
}

.portal-weight-meta {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-zone-head {
  text-align: center;
  white-space: nowrap;
}

.portal-pricing-table .portal-price-cell {
  min-width: 152px;
}

.portal-matrix-table .portal-price-cell {
  min-width: 0;
}

.portal-price-input {
  width: 100%;
  min-width: 136px;
  min-height: 46px;
  box-sizing: border-box;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.portal-matrix-table .portal-price-input {
  min-width: 0;
}

/* Notes textarea in portal (conditions section) — shorter than default */
.portal-notes-group {
  margin-top: var(--sp-4);
}

.portal-notes-group textarea {
  min-height: 92px;
}

.portal-notes-card {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.portal-coverage-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.portal-coverage-card {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.68);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.portal-coverage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.portal-coverage-zone {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
}

.portal-coverage-count {
  min-width: 78px;
  padding: 10px 12px;
  border: 1px solid rgba(191, 203, 221, 0.76);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.portal-coverage-count strong {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text);
}

.portal-coverage-count span {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.portal-coverage-codes {
  margin: 16px 0 0;
  color: var(--text-secondary);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.portal-conditions-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.portal-condition-card {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.68);
  border-radius: 24px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.portal-condition-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.portal-condition-copy {
  min-width: 0;
  flex: 1 1 320px;
}

.portal-condition-title {
  margin: 0;
  font-size: clamp(1.08rem, 1.55vw, 1.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.portal-condition-body {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.portal-condition-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(200px, 240px) minmax(320px, 1fr);
  margin-top: 18px;
  align-items: start;
}

.portal-condition-field {
  margin: 0;
}

.portal-condition-label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-condition-field textarea {
  min-height: 108px;
}

.portal-submit-card {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.portal-guidance-banner {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid transparent;
  font-size: var(--text-base);
  line-height: 1.6;
}

.portal-guidance-banner-success {
  color: var(--success-text);
  border-color: rgba(134, 239, 172, 0.7);
  background:
    linear-gradient(180deg, rgba(240, 253, 244, 0.96) 0%, rgba(236, 253, 245, 0.98) 100%);
}

.portal-submit-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 8px;
}

.portal-submit-option {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.68);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.portal-submit-option-accent {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(240, 253, 244, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.portal-submit-option h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.portal-submit-option p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.portal-submit-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  justify-content: flex-end;
}

@media (max-width: 1024px) {
  .portal-section-card {
    padding: 20px;
  }

  .portal-chip-row {
    justify-content: flex-start;
  }

  .portal-matrix-table.data-table-wide {
    min-width: 0;
  }

  .portal-weight-head,
  .portal-weight-cell {
    min-width: 200px;
    width: 200px;
  }

  .portal-pricing-table .portal-price-cell {
    min-width: 132px;
  }

  .portal-price-input {
    min-width: 120px;
  }

  .portal-matrix-table .portal-price-cell,
  .portal-matrix-table .portal-price-input {
    min-width: 0;
  }

  .portal-condition-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .portal-section-card {
    padding: 18px;
    border-radius: 24px;
  }

  .tender-context-card {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 22px;
  }

  .tender-context-side {
    padding-left: 0;
    padding-top: 16px;
    border-left: none;
    border-top: 1px solid var(--border-soft);
  }

  .portal-overview-grid {
    grid-template-columns: 1fr;
  }

  .portal-coverage-head {
    flex-direction: column;
  }

  .portal-coverage-count {
    align-items: flex-start;
  }

  .portal-submit-actions {
    justify-content: stretch;
  }

  .portal-submit-actions .btn,
  .portal-submit-actions .btn-secondary {
    width: 100%;
  }
}

/* Footer note at bottom of workspace and provider pages */
.provider-footer-note {
  margin-top: var(--sp-8);
  padding-bottom: var(--sp-6);
  font-size: var(--text-xs);
  color: var(--muted-light);
  text-align: center;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  border-bottom: none;
  padding: 0;
}

.section-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
  max-width: 780px;
}

.form-card-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.form-card-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.actions-tight {
  margin-top: 0;
  gap: var(--sp-1);
}

.delivery-note-top {
  margin: 0 0 var(--sp-3);
}

.delivery-inline-compact {
  margin-top: var(--sp-1);
}

.delivery-inline-relaxed {
  margin-top: var(--sp-2);
}

.delivery-group-spaced {
  margin-top: var(--sp-3);
}

.form-textarea-compact {
  min-height: 72px;
}

.form-textarea-tall {
  min-height: 120px;
}

.panel-block {
  margin-bottom: var(--sp-5);
}

.panel-block > h2 {
  margin: 0 0 16px;
  border-bottom: none;
  padding: 0;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.panel-block > h3 {
  margin: 22px 0 12px;
  border-bottom: none;
  padding: 0;
  font-size: 18px;
}

.panel-summary,
.panel-primary {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.74) 0%, #ffffff 100%);
  box-shadow: var(--shadow-sm);
}

.panel-summary {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.panel-primary {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.campaign-card-grid,
.campaign-summary-grid,
.provider-progress-stack,
.proposal-family-stack,
.provider-delivery-stack {
  display: grid;
  gap: 18px;
}

.campaign-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.campaign-card-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.campaign-surface-card,
.proposal-family-card,
.provider-progress-card,
.provider-delivery-card,
.campaign-summary-card,
.empty-state-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f8fafc 100%);
}

.campaign-surface-card,
.campaign-summary-card,
.empty-state-card {
  padding: 20px;
}

.campaign-surface-card-strong,
.proposal-family-card,
.provider-progress-card,
.provider-delivery-card {
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f8fafc 100%);
}

.proposal-family-card,
.provider-progress-card,
.provider-delivery-card {
  padding: 22px;
}

.campaign-card-head,
.proposal-family-head,
.provider-progress-head,
.provider-delivery-head,
.provider-delivery-family-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.campaign-card-title,
.provider-progress-name,
.provider-delivery-title,
.provider-delivery-family-title,
.proposal-card-name {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.campaign-card-title,
.provider-delivery-title {
  font-size: clamp(1.2rem, 1.7vw, 1.55rem);
  font-weight: 650;
}

.provider-progress-name {
  font-size: clamp(1.2rem, 1.9vw, 1.7rem);
  font-weight: 650;
}

.provider-delivery-family-title,
.proposal-card-name {
  font-size: 1rem;
  font-weight: 650;
}

.campaign-card-copy,
.provider-progress-subtitle,
.provider-progress-note,
.proposal-card-copy,
.empty-state-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.campaign-card-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.campaign-card-footnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.campaign-metric-grid,
.provider-progress-families {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.campaign-metric-grid {
  margin-top: 18px;
}

.campaign-metric-card,
.provider-progress-family,
.campaign-summary-card {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.68);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.campaign-metric-card,
.provider-progress-family {
  padding: 14px 16px;
}

.campaign-metric-label,
.campaign-summary-label,
.proposal-family-count {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.proposal-family-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(191, 203, 221, 0.68);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.campaign-metric-value,
.campaign-summary-value {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.proposal-family-head,
.provider-delivery-head {
  margin-bottom: 18px;
}

.proposal-card-list,
.provider-delivery-family-list {
  display: grid;
  gap: 14px;
}

.proposal-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px 18px;
}

.proposal-card-awarded {
  border-color: var(--success-border);
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(240, 253, 248, 0.98) 0%, #ffffff 100%);
}

.proposal-card-main,
.provider-progress-copy {
  min-width: 0;
  flex: 1 1 320px;
}

.proposal-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.proposal-card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.proposal-card-meta-item,
.proposal-card-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.proposal-card-state {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

.proposal-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 1 260px;
}

.campaign-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.campaign-summary-card {
  padding: 18px 20px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.provider-progress-head {
  margin-bottom: 16px;
}

.provider-progress-subtitle {
  margin-top: 6px;
  font-size: var(--text-sm);
}

.provider-progress-note {
  margin-top: 10px;
  font-size: var(--text-sm);
}

.provider-progress-family {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background:
    linear-gradient(180deg, rgba(241, 245, 249, 0.78) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.provider-progress-family-name {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.provider-delivery-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.provider-delivery-panel {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.68);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.88) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.provider-delivery-panel-top,
.provider-link-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.provider-delivery-field {
  margin-top: 16px;
}

.provider-link-box {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.provider-link-box input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.78);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
  box-sizing: border-box;
}

.provider-delivery-family-card {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.62);
  border-radius: 20px;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.04), transparent 32%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.84) 0%, rgba(255, 255, 255, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.empty-state-card {
  border-style: dashed;
}

.empty-state-card-tight {
  padding: 18px;
}

.empty-state-title {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.provider-add-form-feature {
  margin: 0 0 26px;
  padding: 24px;
  border-radius: 24px;
  border-color: var(--border);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-sm);
}

.provider-add-form-feature textarea {
  min-height: 104px;
  background: rgba(255, 255, 255, 0.94);
  box-sizing: border-box;
}

.provider-add-form-feature h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.panel-secondary-ops {
  border-top: 0;
  padding-top: 22px;
}

.campaign-list-stack {
  display: grid;
  gap: 18px;
}

.campaign-list-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f8fafc 100%);
}

.campaign-list-head,
.campaign-list-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.campaign-list-copy {
  min-width: 0;
  flex: 1 1 320px;
}

.campaign-list-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.campaign-list-subtitle,
.campaign-list-date {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.campaign-list-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.campaign-list-metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 18px;
}

.campaign-list-metric {
  min-width: 0;
  border: 1px solid rgba(191, 203, 221, 0.64);
  border-radius: 20px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.88) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.campaign-list-metric-value {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.campaign-list-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.86);
  align-items: center;
}

@media (max-width: 900px) {
  .proposal-card,
  .provider-progress-family,
  .provider-delivery-head,
  .provider-delivery-family-head,
  .campaign-list-head,
  .campaign-list-footer {
    align-items: flex-start;
  }

  .proposal-card-actions {
    justify-content: flex-start;
    flex-basis: 100%;
  }

  .campaign-list-badges {
    justify-content: flex-start;
  }
}

/* ── ERROR PAGES ─────────────────────────────────────────────────── */

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

.error-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8) var(--sp-8);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow);
}

.error-code {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.error-title {
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.01em;
}

.error-body {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: var(--sp-5);
}

@media (max-width: 600px) {
  .error-card {
    padding: var(--sp-6) var(--sp-5);
  }
  .error-code {
    font-size: 2rem;
  }
}


/* Rejection reason note inside readonly-status */
.readonly-status .note {
  margin-top: var(--sp-2);
}

/* ── LANDING PAGE ─────────────────────────────────────────────────── */

.landing-body {
  background: var(--bg);
  min-height: 100vh;
}

.landing-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.brand-slot--landing {
  display: block;
  margin-bottom: 28px;
}

.brand-slot--landing .brand-wordmark {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  user-select: none;
}

.landing-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 20px;
  margin-bottom: 22px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, 0.1), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow);
}

.landing-hero-main {
  min-width: 0;
}

.landing-eyebrow,
.landing-card-eyebrow {
  margin: 0 0 10px;
  color: var(--info);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-headline {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.03;
  color: var(--text);
  margin: 0;
}

.landing-desc {
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 18px 0 0;
  max-width: 620px;
}

.landing-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.landing-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.landing-chip-success {
  border-color: #86efac;
  background: rgba(236, 253, 245, 0.94);
  color: #166534;
}

.landing-chip-neutral {
  border-color: #bfdbfe;
  background: rgba(239, 246, 255, 0.88);
  color: #1e3a8a;
}

.landing-cta {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.landing-btn-enter {
  min-width: 148px;
  padding: 12px 28px;
  font-size: var(--text-md);
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(5, 150, 105, 0.18);
}

.landing-cta-note {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.landing-hero-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.landing-hero-figure {
  padding: 22px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid #a7f3d0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.landing-hero-number {
  margin: 0;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.06em;
  color: #0f172a;
}

.landing-hero-caption {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.landing-hero-secondary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.landing-mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.landing-mini-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, #ffffff 100%);
  box-shadow: var(--shadow-xs);
}

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

.landing-mini-value {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.landing-mini-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.landing-section {
  margin-top: 18px;
}

.landing-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.landing-section-head h2 {
  margin: 0;
  border-bottom: none;
  padding: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.landing-feature-card {
  border-radius: 14px;
  padding: 22px;
  overflow: hidden;
}

.landing-feature-card--primary {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.landing-feature-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.landing-feature-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.landing-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.landing-step {
  position: relative;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.landing-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12) 0%, rgba(37, 99, 235, 0.12) 100%);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.landing-step h3 {
  margin: 16px 0 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.landing-step p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 920px) {
  .landing-shell {
    padding: 40px 20px 56px;
  }

  .landing-hero-card,
  .landing-feature-grid,
  .landing-step-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero-card {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .landing-headline {
    font-size: 2rem;
  }

  .landing-shell {
    padding: 32px 16px 44px;
  }

  .brand-slot--landing {
    margin-bottom: 22px;
  }

  .landing-hero-card {
    gap: 16px;
    padding: 18px;
    border-radius: 14px;
  }

  .landing-section-head h2 {
    font-size: 24px;
  }

  .landing-feature-card,
  .landing-step,
  .landing-mini-card {
    padding: 18px;
  }
}


/* ── AUTH / LOGIN PAGE ──────────────────────────────────────────────── */

.auth-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-slot--auth {
  margin-bottom: var(--sp-5);
}

.brand-slot--auth .brand-wordmark {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  user-select: none;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 36px 32px;
  width: 100%;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.auth-title {
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  color: var(--text);
  margin: 0 0 3px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0 0 var(--sp-5);
  line-height: 1.45;
}

.auth-provider-note {
  font-size: var(--text-sm);
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-3);
  margin: 0 0 var(--sp-5);
  line-height: 1.5;
}

.auth-field {
  margin-bottom: var(--sp-4);
}

.auth-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
}

.auth-field input {
  /* inherits global input styles */
  margin-bottom: 0;
}

.auth-field input:last-child {
  margin-bottom: 0;
}

.auth-submit {
  margin-top: var(--sp-2);
}

.auth-back {
  margin-top: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--muted-light);
  text-align: center;
}

.auth-back a {
  color: var(--muted);
  text-decoration: none;
}

.auth-back a:hover {
  color: var(--link);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .auth-card {
    padding: var(--sp-6) var(--sp-5) var(--sp-5);
  }
}
