/* ============================================================
   Digital Penang SME Matching Platform — Stylesheet
   Palette: navy #0a2540, green #1b5e3b, teal #00897b
   Font: DM Sans + DM Serif Display
   ============================================================ */

:root {
  --navy: #0a2540;
  --navy-light: #133a5e;
  --green: #1b5e3b;
  --green-light: #e8f5e9;
  --teal: #00897b;
  --red: #c62828;
  --red-light: #ffebee;
  --amber: #f57f17;
  --amber-light: #fff8e1;
  --blue-light: #e3f2fd;
  --bg: #f4f7f4;
  --white: #ffffff;
  --border: #e5e7eb;
  --border-dark: #d0d7de;
  --text: #1a2332;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 4px rgba(10, 37, 64, 0.08), 0 4px 16px rgba(10, 37, 64, 0.06);
  --shadow-md:
    0 4px 12px rgba(10, 37, 64, 0.12), 0 8px 32px rgba(10, 37, 64, 0.08);
}

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

html {
  font-size: 16px;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1,
h2,
h3 {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  line-height: 1.3;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
}
.brand-icon {
  font-size: 20px;
  opacity: 0.9;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
}
.brand-logo {
  display: block;
  width: auto;
}
.brand-logo--states {
  height: 40px;
}
.brand-logo--dp {
  height: 28px;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: white;
  border-radius: 2px;
}

/* Side drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 280px;
  max-width: 85vw;
  background: var(--navy);
  color: white;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.25);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
body.drawer-open .drawer {
  transform: translateX(0);
}
body.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.drawer-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.drawer-links {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 4px;
}
.drawer-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  text-decoration: none;
}
.drawer-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-decoration: none;
}
.drawer-link--sme {
  background: var(--green);
  color: white;
  font-weight: 600;
  margin-top: 8px;
}
.drawer-link--provider {
  background: var(--teal);
  color: white;
  font-weight: 600;
}

/* User menu — topbar pill (desktop) + drawer footer (mobile) */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  margin-left: auto;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal, #0ea5a4);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-form {
  margin: 0;
}
.user-logout {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

.drawer-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}
.drawer-user .user-email {
  flex: 1;
  max-width: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
}
.nav-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  transition: opacity 0.15s;
}
.nav-btn:hover {
  opacity: 0.9;
  text-decoration: none;
}
.nav-btn--sme {
  background: var(--green);
  color: white;
}
.nav-btn--provider {
  background: var(--teal);
  color: white;
}

/* ============================================================
   FLASH
   ============================================================ */
.flash {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.flash--success {
  background: var(--green);
  color: white;
}
.flash--error {
  background: var(--red);
  color: white;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  padding: 16px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer a {
  color: rgba(255, 255, 255, 0.7);
}
.footer a:hover {
  color: white;
}
.footer-sep {
  opacity: 0.4;
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column-reverse;
    align-items: start;
  }
  .footer-sep {
    display: none;
  }
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: 28px;
}
.back-link {
  font-size: 13px;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 8px;
}
.back-link:hover {
  color: var(--teal);
}
.page-title {
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 4px;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.hero {
  text-align: center;
  padding: 48px 16px 40px;
}
.hero-badge {
  display: inline-block;
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.hero-title {
  font-size: 44px;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero-title em {
  color: var(--teal);
  font-style: italic;
}
.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0 24px;
}
.landing-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    box-shadow 0.2s,
    transform 0.2s,
    border-color 0.2s;
  text-decoration: none;
  color: var(--text);
}
.landing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.landing-card--sme:hover {
  border-color: var(--green);
}
.landing-card--provider:hover {
  border-color: var(--teal);
}
.landing-card-icon {
  font-size: 36px;
}
.landing-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.landing-card--sme .landing-card-label {
  color: var(--green);
}
.landing-card--provider .landing-card-label {
  color: var(--teal);
}
.landing-card-title {
  font-size: 22px;
  color: var(--navy);
}
.landing-card-desc {
  font-size: 15px;
  color: var(--text-muted);
  flex: 1;
}
.landing-card-cta {
  font-weight: 600;
  font-size: 15px;
}
.landing-card--sme .landing-card-cta {
  color: var(--green);
}
.landing-card--provider .landing-card-cta {
  color: var(--teal);
}

.landing-footer-link {
  text-align: center;
  margin-top: 8px;
}
.link-subtle {
  color: var(--text-muted);
  font-size: 14px;
}
.link-subtle:hover {
  color: var(--navy);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card--quote {
  border-left: 4px solid var(--teal);
}
.card-title {
  font-size: 16px;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 16px;
}
.card-title-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}
.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 12px;
}

/* ============================================================
   FORMS
   ============================================================ */
.survey-form {
  max-width: 800px;
}
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.form-section--consent {
  text-align: center;
  background: var(--bg);
  border-color: var(--border);
}
.form-section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.form-section-num {
  width: 36px;
  height: 36px;
  background: var(--navy);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.form-section-title {
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 2px;
  font-family: "DM Serif Display", serif;
}
.form-section-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
  border-color: var(--red);
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.required {
  color: var(--red);
}
.form-input,
.form-textarea {
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background: var(--white);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 94, 59, 0.1);
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
}
.form-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
}

/* Radio / Checkbox options */
.radio-grid,
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition:
    border-color 0.15s,
    background 0.15s;
  user-select: none;
}
.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--green);
  background: var(--green-light);
}
.radio-option.selected,
.checkbox-option.selected {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
}
.radio-option input,
.checkbox-option input {
  accent-color: var(--green);
  flex-shrink: 0;
}

.radio-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  user-select: none;
}
.radio-option-row:hover {
  border-color: var(--green);
  background: var(--green-light);
}
.radio-option-row.selected {
  border-color: var(--green);
  background: var(--green-light);
}
.radio-option-row input {
  margin-top: 3px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.radio-label {
  font-size: 14px;
  font-weight: 500;
}
.radio-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Urgency grid */
.urgency-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.urgency-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 10px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  user-select: none;
}
.urgency-option:hover {
  border-color: var(--green);
  background: var(--green-light);
}
.urgency-option.selected {
  border-color: var(--green);
  background: var(--green-light);
}
.urgency-option input {
  display: none;
}
.urgency-icon {
  font-size: 22px;
}
.urgency-label {
  font-size: 13px;
  font-weight: 600;
}
.urgency-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  max-width: 600px;
  margin: 0 auto 20px;
  text-align: left;
}
.consent-label input {
  margin-top: 3px;
  accent-color: var(--green);
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition:
    opacity 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
  white-space: nowrap;
}
.btn:hover {
  opacity: 0.9;
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--navy);
  color: white;
}
.btn-secondary {
  background: white;
  color: var(--navy);
  border-color: var(--border-dark);
}
.btn-success {
  background: var(--teal);
  color: white;
}
.btn-danger {
  background: var(--red);
  color: white;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg);
}
.btn-lg {
  padding: 12px 28px;
  font-size: 16px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn-block {
  width: 100%;
}
.btn-block + .btn-block {
  margin-top: 8px;
}

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge--new {
  background: var(--blue-light);
  color: #1565c0;
}
.badge--urgent {
  background: var(--red-light);
  color: var(--red);
}
.badge--warning {
  background: var(--amber-light);
  color: var(--amber);
}
.badge--ok {
  background: var(--green-light);
  color: var(--green);
}
.badge--neutral {
  background: #f3f4f6;
  color: #6b7280;
}
.badge--danger {
  background: var(--red-light);
  color: var(--red);
}

.tag {
  display: inline-block;
  background: #f0f4f8;
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}
.tag--sector {
  background: var(--green-light);
  color: var(--green);
}

/* ============================================================
   SUCCESS PAGE
   ============================================================ */
.success-page {
  max-width: 520px;
  margin: 60px auto;
  text-align: center;
}
.success-icon {
  width: 64px;
  height: 64px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 24px;
}
.success-title {
  font-size: 32px;
  color: var(--navy);
  margin-bottom: 16px;
}
.success-body {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 12px;
}
.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stats-row--large .stat-num {
  font-size: 40px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card--urgent {
  border-top: 3px solid var(--red);
}
.stat-card--ok {
  border-top: 3px solid var(--green);
}
.stat-num {
  font-size: 36px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-link {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1.5px solid var(--border-dark);
  background: white;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-link:hover {
  border-color: var(--navy);
  color: var(--navy);
  text-decoration: none;
}
.filter-link.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}
.filter-links--wrap {
  flex-wrap: wrap;
}
.search-form {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.search-input {
  min-width: 220px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead {
  background: #f8fafc;
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: #fafafa;
}
.table-name {
  font-weight: 600;
  color: var(--navy);
}
.table-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.table-challenge {
  max-width: 200px;
  font-size: 13px;
}
.table-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}
.pagination-info {
  font-size: 14px;
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

/* Detail layout */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.detail-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-key {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 2px;
}
.detail-val {
  color: var(--text);
}
.problem-quote {
  font-size: 16px;
  color: var(--text);
  line-height: 1.7;
  border-left: 3px solid var(--teal);
  padding-left: 16px;
  font-style: italic;
}

/* Match cards */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.match-card {
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: border-color 0.15s;
}
.match-card:hover {
  border-color: var(--teal);
}
.match-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.match-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}
.match-card-headline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.match-score-wrap {
  text-align: center;
  flex-shrink: 0;
}
.match-score-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.match-score-label {
  font-size: 11px;
  color: var(--text-muted);
}
.match-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.match-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
  border-radius: 3px;
  transition: width 0.3s;
}
.match-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.match-card-footer {
  display: flex;
  justify-content: flex-end;
}

/* Providers grid */
.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.provider-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.provider-card:hover {
  box-shadow: var(--shadow-md);
}
.provider-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.provider-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}
.provider-card-headline {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.provider-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.provider-card-sectors {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.provider-card-footer {
  margin-top: auto;
}

/* Match detail */
.match-parties {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.match-party {
  flex: 1;
}
.match-party--sme {
  border-right: 1px solid var(--border);
  padding-right: 20px;
}
.match-party--provider {
  border-left: 1px solid var(--border);
  padding-left: 20px;
  text-align: right;
}
.match-party-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.match-party-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}
.match-party-detail {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.match-score-display {
  text-align: center;
  flex-shrink: 0;
}
.match-score-circle {
  width: 72px;
  height: 72px;
  border: 3px solid var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 auto;
}
.match-score-circle--lg {
  width: 80px;
  height: 80px;
  font-size: 28px;
}
.match-score-circle-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Timeline */
.timeline-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 600px;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.timeline-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 32px;
}
.timeline-line.done {
  background: var(--teal);
}
.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}
.timeline-step.done .timeline-dot {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.timeline-step.active .timeline-dot {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.timeline-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  max-width: 80px;
  font-weight: 500;
}
.timeline-step.active .timeline-label {
  color: var(--navy);
  font-weight: 700;
}

/* Intro boxes */
.intro-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 15px;
  line-height: 1.7;
  border-left: 3px solid var(--border);
}
.intro-box--sme {
  border-left-color: var(--green);
}
.intro-box--provider {
  border-left-color: var(--teal);
}
.intro-textarea {
  font-size: 14px;
  line-height: 1.6;
}

/* Match generate */
.match-gen-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 860px;
}
.match-gen-summary {
}
.match-gen-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
}
.match-gen-party {
  padding: 12px;
  border-radius: var(--radius-sm);
}
.match-gen-party--sme {
  background: var(--green-light);
}
.match-gen-party--provider {
  background: var(--blue-light);
}
.match-gen-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.match-gen-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
}
.match-gen-detail {
  font-size: 12px;
  color: var(--text-muted);
}
.match-gen-challenge,
.match-gen-headline,
.match-gen-budget {
  font-size: 13px;
  margin-top: 4px;
}
.match-gen-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.match-gen-actions .btn-primary {
  margin-left: auto;
}

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 40px;
  gap: 10px;
  align-items: center;
}
.bar-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.bar-track {
  height: 20px;
  background: #f0f4f8;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.bar-fill--blue {
  background: linear-gradient(90deg, #1565c0, #1976d2);
}
.bar-fill--green {
  background: linear-gradient(90deg, var(--green), var(--teal));
}
.bar-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
}

.score-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.score-bar {
  height: 8px;
  width: 60px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 4px;
}

/* Utility */
.mt-4 {
  margin-top: 16px;
}
.mt-6 {
  margin-top: 24px;
}
.text-muted {
  color: var(--text-muted);
}
.small {
  font-size: 12px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .landing-cards {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .match-parties {
    flex-direction: column;
    text-align: center;
  }
  .match-party--sme,
  .match-party--provider {
    border: none;
    padding: 0;
    text-align: center;
  }
  .urgency-grid {
    grid-template-columns: 1fr 1fr;
  }
  .match-gen-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar-inner > .user-menu {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .brand-logo--states {
    height: 34px;
  }
  .brand-logo--dp {
    height: 24px;
    padding-left: 10px;
  }
  .brand {
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 20px 16px;
  }
  .topbar-inner {
    padding: 0 16px;
  }
  .hero-title {
    font-size: 28px;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .radio-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
  .urgency-grid {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-form {
    margin-left: 0;
  }
  .search-input {
    min-width: 0;
  }
  .bar-row {
    grid-template-columns: 120px 1fr 36px;
  }
}

/* ============================================================
   AUTH — user strip, logout, login page
   ============================================================ */
.user-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 32px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border);
}
.user-strip strong {
  color: var(--text);
  font-weight: 500;
}
.user-strip-form {
  margin: 0;
  display: inline;
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #2563eb);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.link-button:hover {
  opacity: 0.8;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #fafbfc 0%, #f1f3f6 100%);
}
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  text-align: center;
}
.brand--center {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 28px;
}
.login-title {
  font-family: "DM Serif Display", serif;
  font-size: 28px;
  margin: 0 0 8px;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  color: #3c4043;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    box-shadow 0.15s,
    background 0.15s;
}
.google-btn:hover:not(:disabled) {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  background: #f8f9fa;
}
.google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-back-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.login-back-link:hover {
  text-decoration: underline;
}
