:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --link: #2563eb;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --brand-red: #e30613;
  --magenta: #BB0615;
  --magenta-soft: #FBC6CB;
  --purple: #1C7F4A;
  --purple-soft: #CDE9DA;
  --success: #2e7d32;
  --warning: #ed6c02;
  --danger: #d32f2f;
  --banner-blue: #e8f1fb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --radius: 10px;
  --nav-h: 56px;
  --font: "DM Sans", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

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

a:hover {
  text-decoration: underline;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page-root {
  flex: 1 0 auto;
}

.app-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.app-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Top navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.top-nav__left,
.top-nav__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: 4px;
}

.brand__logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  border-radius: 6px;
}

.brand__app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}

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

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #cfd8e3;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}

/* Sub nav */
.sub-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.sub-nav__tab {
  height: 100%;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  cursor: default;
}

.more-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}

.more-btn:hover {
  background: var(--bg);
  color: var(--text);
}

/* Page shell */
.page {
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-title {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Suppliers list toolbar */
.list-card {
  overflow: hidden;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.list-toolbar__title {
  margin: 0;
  margin-right: auto;
  font-size: 16px;
  font-weight: 700;
}

.search {
  position: relative;
  width: min(280px, 100%);
}

.search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fafafa;
  gap: 2px;
}

.segmented button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--accent);
  border-color: #93c5fd;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.toolbar-actions {
  display: inline-flex;
  gap: 4px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table.suppliers {
  width: 100%;
  border-collapse: collapse;
}

table.suppliers th,
table.suppliers td {
  padding: 16px 20px;
  text-align: left;
  white-space: nowrap;
}

table.suppliers th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

table.suppliers td {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

table.suppliers tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

table.suppliers tbody tr:hover {
  background: #f8fafc;
}

table.suppliers tbody tr:last-child td {
  border-bottom: 0;
}

.supplier-link {
  color: var(--link);
  font-weight: 600;
}

.row-chevron {
  color: var(--text-soft);
  text-align: right !important;
  width: 40px;
}

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

.connect-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #c5d9f2;
  border-radius: 8px;
  background: #f3f8ff;
  color: #1a3a5c;
  font-size: 14px;
}

.connect-banner a {
  color: #0056b3;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.connect-banner a:hover {
  text-decoration: underline;
}

/* Detail page */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--link);
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.detail-header h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.meta-row strong {
  color: var(--text);
  font-weight: 600;
}

.detail-status {
  text-align: right;
  min-width: 200px;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 6px;
}

.status-line .warn {
  color: var(--warning);
}

.score-line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin: 8px 0 6px;
}

.score-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.score-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.score-hint {
  font-size: 11px;
  color: var(--text-soft);
}

.updated {
  color: var(--text-soft);
  font-size: 12px;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 18px 0 20px;
  background: transparent;
}

.section-tabs a {
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  position: relative;
}

.section-tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.section-tabs a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* Meeting banner */
.meeting-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, #eaf3fb 0%, #eaf3fb 55%, transparent 100%),
    radial-gradient(circle at 85% 30%, #7eb6e8 0%, transparent 28%),
    radial-gradient(circle at 92% 70%, #4f8fc9 0%, transparent 24%),
    linear-gradient(135deg, #d7e8f7, #b9d4ef);
  border: 1px solid #d5e4f3;
  margin-bottom: 28px;
}

.meeting-banner h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.meeting-banner p {
  margin: 0;
  color: #3b4d63;
  max-width: 520px;
}

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

.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

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

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: #93c5fd;
}

.btn-secondary:hover {
  background: var(--accent-soft);
}

/* Sections */
.section {
  margin-bottom: 32px;
  scroll-margin-top: 80px;
}

.section__head {
  margin-bottom: 12px;
}

.section__head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
}

.section__head p {
  margin: 0;
  color: var(--text-muted);
  max-width: 720px;
}

.section__head--filter {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.month-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.month-filter__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.month-filter select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.month-filter select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 16px 18px 12px;
  min-height: 260px;
}

.panel h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.panel__title-row h3 {
  margin-bottom: 0;
}

.panel__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-menu {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.panel-sub {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 12px;
}

.metric-block--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.metric-target {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.review-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.review-field__head label {
  margin-bottom: 0;
}

.soon-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.chart-box {
  position: relative;
  height: 220px;
}

.chart-box--sm {
  height: 140px;
}

.metric-block {
  margin-bottom: 10px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.metric-value.magenta {
  color: var(--magenta);
}

.metric-value.purple {
  color: var(--purple);
}

.metric-hint {
  color: var(--text-soft);
  font-size: 12px;
  margin-top: 2px;
}

.icon-warn {
  color: var(--warning);
  font-size: 16px;
}

.icon-up {
  color: var(--danger);
  font-size: 14px;
}

/* Compliance */
.compliance-list {
  list-style: none;
  margin: 0;
  padding: 8px 4px;
}

.compliance-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

.compliance-list li:last-child {
  border-bottom: 0;
}

.compliance-name {
  font-weight: 600;
}

.compliance-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.dot-ok,
.dot-warn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.dot-ok {
  background: var(--success);
}

.dot-warn {
  background: var(--warning);
}

/* Reviews */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
}

.review-field {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fafafa;
  min-height: 64px;
}

.review-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.review-field .value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  font-weight: 600;
}

.placeholder-note {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e1;
  color: #7a5b00;
  font-size: 12px;
  border: 1px solid #ffe082;
}

@media (max-width: 980px) {
  .grid-2,
  .grid-3,
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .detail-status {
    text-align: left;
  }

  .score-line {
    align-items: flex-start;
  }

  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .list-toolbar__title {
    margin-right: 0;
  }

  .search {
    width: 100%;
  }
}
