:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --good-bg: #e8f5f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.topbar p,
.section-title span,
.status {
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 8px;
  min-width: 420px;
}

.stat {
  background: var(--good-bg);
  border: 1px solid #b8ddd6;
  padding: 8px 10px;
  border-radius: 6px;
}

.stat strong {
  display: block;
  font-size: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.app-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.nav-btn {
  width: auto;
  min-width: max-content;
  min-height: 36px;
  padding: 7px 12px;
  background: #f8fafc;
  border-color: var(--line);
  color: var(--ink);
}

.nav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.page-shell {
  padding: 18px;
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.controls,
.entry {
  display: grid;
  gap: 14px;
  align-content: start;
}

.entry,
.quote-detail,
.master-data,
.rate-grid,
.dashboard,
.history-panel,
.reports,
.supplier-notes {
  grid-column: 1 / -1;
}

.dashboard-alert-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-alert-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #b8ddd6;
  border-radius: 8px;
  background: #ecfdf5;
}

.dashboard-alert-card strong {
  color: var(--accent-dark);
  font-size: 24px;
}

.dashboard-alert-card span {
  font-weight: 800;
}

.dashboard-alert-card small,
.supplier-info {
  color: var(--muted);
  font-size: 12px;
}

.approval-list {
  margin-top: 14px;
  max-height: 180px;
}

.approval-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.approval-actions button {
  width: auto;
  min-width: 92px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

select,
input,
textarea,
button {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

button.danger {
  background: #b42318;
  border-color: #b42318;
}

button.danger:hover {
  background: #7a271a;
  border-color: #7a271a;
}

.master-row-actions .danger {
  background: #c2410c;
  border-color: #c2410c;
}

.master-row-actions .danger:hover {
  background: #9a3412;
  border-color: #9a3412;
}

.purchase-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 16px 18px;
  background: #ecfdf5;
  border: 2px solid #0f766e;
  border-left-width: 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.12);
}

.purchase-summary strong {
  color: var(--ink);
  font-size: 17px;
}

.purchase-summary .better {
  color: var(--accent-dark);
  font-weight: 700;
}

.purchase-summary .worse {
  color: #b42318;
  font-weight: 700;
}

.history-selector-panel {
  border: 2px solid #b8ddd6;
  background: #f0fdfa;
}

.history-selector-panel h2 {
  font-size: 24px;
}

.history-picker {
  display: grid;
  grid-template-columns: 280px minmax(360px, 1fr) 180px;
  gap: 14px;
  align-items: end;
}

.history-picker label {
  font-size: 15px;
}

.history-picker select,
.history-picker button {
  min-height: 52px;
  font-size: 16px;
  font-weight: 700;
}

.master-selector-panel {
  border: 1px solid #b8ddd6;
  border-left: 8px solid var(--accent);
  background: linear-gradient(180deg, #ecfdf5 0%, #f8fafc 100%);
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.08);
}

.master-picker {
  grid-template-columns: 320px minmax(420px, 1fr) 220px;
  padding-top: 4px;
}

@media (max-width: 1280px) {
  .master-picker {
    grid-template-columns: 220px minmax(260px, 1fr) 180px;
  }
}

.master-settings-card,
.master-console {
  padding: 20px;
}

.master-settings-card .section-title,
.master-console .section-title {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.master-settings-card .table-wrap {
  margin-top: 14px;
  max-height: 320px;
  background: #ffffff;
}

.master-settings-card table {
  min-width: 760px;
}

.master-status-pill {
  min-width: 220px;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid #b8ddd6;
  border-radius: 6px;
  background: #ecfdf5;
  color: var(--accent-dark);
  font-weight: 700;
  text-align: center;
}

.master-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.master-quality-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: #f8fafc;
}

.master-quality-card div { display: grid; gap: 2px; }
.master-quality-card span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.master-quality-card strong { font-size: 16px; }
.master-quality-card small { color: var(--muted); font-size: 11px; }
.master-quality-card.needs-data { border-left-color: #d89b18; background: #fffbeb; }
.master-quality-card.complete { border-left-color: #159570; background: #ecfdf5; }

@media (max-width: 1100px) {
  .master-quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rate-entry-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid #b8ddd6;
  border-left: 8px solid var(--accent);
  border-radius: 8px;
  background: #ecfdf5;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.1);
}

.rate-entry-hero h2 {
  font-size: 28px;
}

.rate-entry-hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.hero-badge {
  min-width: max-content;
  padding: 10px 14px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #b8ddd6;
  color: var(--accent-dark);
  font-weight: 700;
}

.rate-entry-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.6fr);
  gap: 18px;
}

.rate-context,
.single-rate-card,
.bulk-rate-card {
  align-content: start;
}

.rate-context {
  grid-column: 1 / -1;
}

.context-grid {
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr);
  gap: 14px;
}

.single-rate-card {
  display: grid;
  gap: 14px;
}

.single-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.bulk-rate-card {
  display: grid;
  gap: 12px;
}

.link-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px 160px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.bulk-meta {
  display: grid;
  grid-template-columns: 180px 200px minmax(220px, 1fr);
  gap: 12px;
}

.rate-grid-wrap {
  max-height: 420px;
}

.rate-grid-table {
  min-width: 0;
}

.rate-grid-table th:first-child,
.rate-grid-table td:first-child {
  width: 38%;
}

.table-wrap {
  overflow: auto;
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.table-wrap.compact {
  max-height: 34vh;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: #eef2f6;
  z-index: 1;
}

.sort-header {
  display: inline-flex;
  width: auto;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.sort-header:hover,
.sort-header.active {
  background: #e8f5f2;
  border-color: #9bd2ca;
  color: var(--accent-dark);
}

.sort-header span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
}

td.rate {
  font-weight: 700;
  color: var(--accent-dark);
}

.score-badge {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-weight: 800;
}

.good-score {
  background: #dcfce7;
  color: #166534;
}

.mid-score {
  background: #fef9c3;
  color: #854d0e;
}

.low-score {
  background: #fee2e2;
  color: #991b1b;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.master-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.master-box {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
}

.master-box h3 {
  margin: 0;
  font-size: 18px;
}

.master-box-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.master-box-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.master-create-area {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: #f8fafc;
}

.master-search {
  min-height: 42px;
  padding-left: 36px;
  background:
    linear-gradient(transparent, transparent),
    #ffffff;
  border-color: #cbd5e1;
  font-weight: 700;
}

.master-search::placeholder {
  color: #7a8797;
  font-weight: 600;
}

.mini-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.mini-item {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.mini-item:last-child {
  border-bottom: 0;
}

.mini-item strong {
  color: var(--ink);
}

.master-list {
  max-height: 260px;
}

.master-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.master-list-row:last-child {
  border-bottom: 0;
}

.master-list-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.master-row-actions {
  display: flex;
  gap: 8px;
}

.master-row-actions button {
  width: auto;
  min-width: 64px;
  min-height: 34px;
}

.missing-rate-item {
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: center;
  gap: 10px;
}

.missing-rate-item span {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.report-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid #b8ddd6;
  border-left: 8px solid var(--accent);
  border-radius: 8px;
  background: #ecfdf5;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.1);
}

.report-hero h2 {
  font-size: 28px;
}

.report-hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.report-hero > button {
  width: auto;
  min-width: 160px;
}

.admin-hero {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-color: #cbd5e1;
  border-left-color: #0f766e;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.hero-kicker,
.card-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.report-grid {
  display: grid;
  gap: 18px;
}

.report-grid.two-col {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
}

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

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-card {
  display: grid;
  gap: 14px;
  min-height: 300px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.admin-card-wide {
  grid-column: 1 / -1;
  min-height: auto;
}

.admin-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-card h3 {
  margin: 0;
  font-size: 22px;
}

.admin-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

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

.secondary-action {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-action:hover {
  background: #e8f5f2;
  border-color: #9bd2ca;
  color: var(--accent-dark);
}

.admin-status {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #b8ddd6;
  border-radius: 6px;
  background: #ecfdf5;
}

.admin-list {
  min-height: 92px;
  max-height: 190px;
}

.audit-list {
  max-height: 260px;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px;
  gap: 10px;
}

.report-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.report-filter-panel {
  background: #ffffff;
  border: 1px solid #b8ddd6;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: 260px minmax(340px, 1fr) 240px 160px;
  gap: 12px;
  align-items: end;
}

.report-filter-grid select,
.report-filter-grid button {
  min-height: 46px;
  font-weight: 700;
}

.report-summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.report-metric {
  padding: 16px 18px;
  border: 1px solid #b8ddd6;
  border-radius: 8px;
  background: #ecfdf5;
}

.report-metric strong {
  display: block;
  font-size: 28px;
  color: var(--accent-dark);
}

.report-metric span {
  color: var(--muted);
}

.report-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.report-card h3 {
  margin: 0;
  font-size: 18px;
}

.report-card.primary-card {
  min-height: 420px;
}

.report-card .mini-list {
  max-height: 300px;
}

.rfq-context-panel {
  border-color: #b8ddd6;
  background: #ffffff;
}

.rfq-context-grid {
  display: grid;
  grid-template-columns: 280px minmax(360px, 1fr);
  gap: 14px;
}

.rfq-context-grid select {
  min-height: 50px;
  font-weight: 700;
}

.rfq-summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.rfq-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
}

.rfq-action-card {
  min-height: 330px;
}

.rfq-record-card {
  min-height: 360px;
}

.rfq-record-card .mini-list {
  max-height: 250px;
}

.rfq-link-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px;
  gap: 10px;
  align-items: end;
}

.rfq-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.rfq-tracker-item span {
  color: var(--muted);
}

.rfq-workflow-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 150px;
  gap: 8px;
  margin-top: 8px;
}

.rfq-workflow-row input,
.rfq-workflow-row select,
.rfq-workflow-row button {
  min-height: 34px;
}

.report-export-panel {
  background: #ffffff;
}

.report-export-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.attachment-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.attachment-link:hover {
  text-decoration: underline;
}

.trend-chart {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 14px;
  overflow: auto;
}

.trend-chart svg {
  width: 100%;
  min-width: 760px;
  height: 360px;
}

.trend-empty {
  padding: 24px;
  color: var(--muted);
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.trend-summary div {
  padding: 12px 14px;
  border: 1px solid #b8ddd6;
  border-radius: 8px;
  background: #ecfdf5;
}

.trend-summary span,
.trend-summary small {
  display: block;
  color: var(--muted);
}

.trend-summary strong {
  display: block;
  margin: 4px 0;
  color: var(--accent-dark);
  font-size: 24px;
}

.trend-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.trend-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 32px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.trend-show-all {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.trend-legend.active {
  border-color: var(--accent);
  background: #ecfdf5;
}

.trend-legend span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.trend-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 6px;
}

.trend-plot-bg {
  fill: #ffffff;
  stroke: #edf1f5;
}

.trend-axis {
  stroke: #98a2b3;
  stroke-width: 1.4;
}

.trend-grid-line {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.trend-week-line {
  stroke: #f0f2f5;
  stroke-width: 1;
}

.trend-axis-label,
.trend-axis-title {
  fill: #667085;
  font-size: 12px;
}

.trend-axis-title {
  font-weight: 700;
}

.trend-line {
  transition: opacity 0.15s ease;
  opacity: 0.88;
}

.trend-point {
  cursor: pointer;
  transition: r 0.15s ease, filter 0.15s ease, stroke-width 0.15s ease;
}

.trend-point.best {
  stroke: #f59e0b;
  stroke-width: 4;
}

.trend-point.selected {
  stroke: #0f172a;
  stroke-width: 4;
}

.trend-point:hover,
.trend-point:focus {
  r: 9;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.25));
  outline: none;
}

.trend-tooltip {
  position: absolute;
  display: none;
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  pointer-events: none;
}

.trend-tooltip.visible {
  display: block;
}

.trend-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #b8ddd6;
  border-radius: 6px;
  background: #ecfdf5;
  color: var(--muted);
}

.trend-detail strong {
  color: var(--accent-dark);
}

.wide {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .topbar,
  .layout {
    display: block;
  }

  .stats {
    min-width: 0;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 14px;
  }

  .dashboard-alert-grid,
  .report-export-actions {
    grid-template-columns: 1fr;
  }

  .panel {
    margin-bottom: 14px;
  }

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

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

  .master-picker {
    grid-template-columns: 1fr;
  }

  .master-console .section-title,
  .master-settings-card .section-title {
    display: grid;
    grid-template-columns: 1fr;
  }

  .master-status-pill {
    min-width: 0;
    text-align: left;
  }

  .report-grid.two-col,
  .admin-grid,
  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-card-wide {
    grid-column: auto;
  }

  .admin-card-header,
  .admin-actions,
  .admin-actions.split,
  .admin-user-grid {
    grid-template-columns: 1fr;
  }

  .report-filter-grid,
  .report-card-header {
    grid-template-columns: 1fr;
  }

  .report-summary-row {
    grid-template-columns: 1fr;
  }

  .trend-summary {
    grid-template-columns: 1fr;
  }

  .rfq-context-grid,
  .rfq-summary-row,
  .rfq-layout,
  .rfq-link-row,
  .rfq-meta-grid,
  .rfq-workflow-row {
    grid-template-columns: 1fr;
  }

  .history-picker {
    grid-template-columns: 1fr;
  }

  .rate-entry-hero,
  .rate-entry-layout {
    display: block;
  }

  .rate-entry-hero,
  .rate-context,
  .single-rate-card,
  .bulk-rate-card {
    margin-bottom: 14px;
  }

  .context-grid,
  .single-rate-grid,
  .link-strip,
  .bulk-meta {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}

/* Executive procurement command center theme */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --ink: #172033;
  --muted: #667085;
  --line: #dce2ea;
  --line-strong: #c9d2df;
  --accent: #087f73;
  --accent-dark: #05655d;
  --accent-soft: #e8f7f3;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --gold: #c88800;
  --gold-soft: #fff6d8;
  --danger: #c3352b;
  --danger-soft: #fff0ee;
  --sidebar: #161d2b;
  --sidebar-soft: #222b3d;
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 14px 32px rgba(16, 24, 40, 0.1);
  --sidebar-width: 252px;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button,
.panel,
.stat,
.master-box,
.report-card,
.admin-card,
.rfq-card {
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.app-frame {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
  color: #f8fafc;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.08);
}

.brand-block {
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 12px;
  padding: 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(8, 127, 115, 0.28);
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0;
}

.brand-copy span {
  overflow: hidden;
  color: #9ba8bb;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-label {
  padding: 18px 20px 8px;
  color: #77859a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding: 0 12px 14px;
  background: transparent;
  border: 0;
}

.app-nav .nav-label {
  padding: 8px 8px 4px;
}

.nav-divider {
  height: 1px;
  margin: 8px 6px 2px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #b6c0cf;
  font-size: 13px;
  text-align: left;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 1.9;
}

.nav-btn:hover {
  background: var(--sidebar-soft);
  color: #ffffff;
  transform: translateX(2px);
}

.nav-btn.active {
  border-color: rgba(70, 224, 200, 0.18);
  background: #0b5f59;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.nav-btn.active::before {
  position: absolute;
  inset: 9px auto 9px -12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #4de0c7;
  content: "";
}

.sidebar-foot {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-status > span,
.live-pill > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #35d399;
  box-shadow: 0 0 0 4px rgba(53, 211, 153, 0.12);
  animation: statusPulse 2.2s ease-in-out infinite;
}

.system-status div {
  display: grid;
  gap: 2px;
}

.system-status strong {
  font-size: 12px;
}

.system-status small,
.sidebar-version {
  color: #7f8da2;
  font-size: 10px;
}

.app-content {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(280px, 640px) auto;
  min-height: 74px;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.04);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions,
.hero-actions,
.live-pill {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 10px;
}

.page-heading {
  display: grid;
  gap: 1px;
}

.topbar-eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.page-heading h1 {
  font-size: 20px;
  line-height: 1.2;
}

.global-search-wrap {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

.global-search-wrap > svg {
  position: absolute;
  left: 14px;
  z-index: 1;
  width: 17px;
  color: #7c8799;
}

.global-search-wrap input {
  min-height: 44px;
  padding: 10px 70px 10px 42px;
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.global-search-wrap input:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(8, 127, 115, 0.12);
  outline: none;
}

kbd {
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}

.global-search-wrap kbd {
  position: absolute;
  right: 10px;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 8px;
}

.icon-btn,
.quick-rate-btn {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.icon-btn:hover {
  border-color: #a7ddd4;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.icon-btn svg,
.quick-rate-btn svg,
.hero-actions svg {
  width: 17px;
  height: 17px;
}

.quick-rate-btn {
  min-height: 40px;
  gap: 7px;
  padding: 8px 14px;
}

.notification-btn {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--panel);
  border-radius: 9px;
  background: var(--danger);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 3px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: #795500;
  font-size: 11px;
  font-weight: 900;
}

.user-chip div {
  display: grid;
  gap: 1px;
}

.user-chip strong {
  font-size: 11px;
}

.user-chip small {
  color: var(--muted);
  font-size: 9px;
}

.mobile-menu-btn,
.sidebar-close {
  display: none;
}

.stats-bar {
  padding: 12px 24px 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  min-width: 0;
}

.stat {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.stat::before {
  display: grid;
  width: 34px;
  height: 34px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  content: attr(data-icon);
  font-size: 12px;
  font-weight: 900;
}

.stat:nth-child(2)::before { background: var(--blue-soft); color: var(--blue); }
.stat:nth-child(3)::before { background: var(--gold-soft); color: #8a6200; }
.stat:nth-child(4)::before { background: #f0ecff; color: #6941c6; }

.stat strong {
  font-size: 20px;
  line-height: 1;
}

.stat span {
  font-size: 10px;
}

.page-shell {
  width: min(100%, 1700px);
  margin: 0 auto;
  padding: 18px 24px 32px;
}

.page.active {
  animation: pageIn 260ms ease both;
}

.page.active > * {
  animation: riseIn 380ms ease both;
}

.page.active > *:nth-child(2) { animation-delay: 45ms; }
.page.active > *:nth-child(3) { animation-delay: 90ms; }
.page.active > *:nth-child(4) { animation-delay: 135ms; }

.panel {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.panel:hover {
  border-color: #ccd6e2;
}

.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid #2d3a50;
  border-radius: 8px;
  background: #1c2637;
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.dashboard-hero::after {
  position: absolute;
  right: 300px;
  bottom: -40px;
  width: 180px;
  height: 180px;
  border: 24px solid rgba(74, 224, 198, 0.08);
  border-radius: 50%;
  content: "";
}

.dashboard-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 30px 34px;
}

.dashboard-hero .hero-kicker {
  color: #6ee7d0;
}

.dashboard-hero h2 {
  margin-top: 2px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
}

.dashboard-hero p {
  max-width: 720px;
  margin-top: 10px;
  color: #b6c1d1;
  font-size: 14px;
  line-height: 1.55;
}

.hero-actions {
  gap: 10px;
  margin-top: 20px;
}

.hero-actions button {
  display: inline-flex;
  width: auto;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
}

.hero-actions .secondary-action {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.hero-actions .secondary-action:hover {
  background: rgba(255, 255, 255, 0.15);
}

.savings-spotlight {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: #172131;
}

.savings-spotlight span {
  color: #a9b5c6;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.savings-spotlight strong {
  margin: 10px 0 6px;
  color: #62e3c9;
  font-size: 40px;
  line-height: 1;
}

.savings-spotlight small {
  color: #8492a7;
  font-size: 11px;
  line-height: 1.4;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr) 24px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.workflow-strip > button {
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.workflow-strip > button:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.workflow-strip > button > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.workflow-strip > button div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workflow-strip strong {
  font-size: 12px;
}

.workflow-strip small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-strip > svg {
  width: 16px;
  color: #a6b0bf;
}

.dashboard-section-title {
  margin-bottom: 14px;
}

.dashboard-alert-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  margin: 0;
}

.dashboard-alert-card {
  position: relative;
  min-height: 126px;
  align-content: space-between;
  overflow: hidden;
  padding: 16px;
  border-color: var(--line);
  background: var(--panel-soft);
}

.dashboard-alert-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  content: "";
}

.dashboard-alert-card:nth-child(2)::after { background: var(--gold); }
.dashboard-alert-card:nth-child(3)::after { background: var(--danger); }
.dashboard-alert-card:nth-child(4)::after { background: var(--blue); }
.dashboard-alert-card:nth-child(5)::after { background: #6941c6; }

.dashboard-alert-card:hover {
  border-color: #b8c5d4;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.dashboard-alert-card strong {
  color: var(--ink);
  font-size: 28px;
}

.dashboard-alert-card span {
  font-size: 12px;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.7fr);
  gap: 18px;
}

.dashboard-comparison-panel,
.dashboard-activity-panel {
  min-width: 0;
}

.live-pill {
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #b8ead9;
  border-radius: 12px;
  background: #effcf6;
  color: #08734f;
  font-size: 10px;
  font-weight: 800;
}

.approval-list {
  max-height: 250px;
  margin-top: 0;
  border: 0;
  background: transparent;
}

.approval-list .mini-item {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.activity-timeline {
  display: grid;
  gap: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.activity-item {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 4px 4px 14px 24px;
  color: var(--muted);
  font-size: 11px;
}

.activity-item::before {
  position: absolute;
  top: 7px;
  left: 5px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px #bcd0ff;
  content: "";
}

.activity-item:not(:last-child)::after {
  position: absolute;
  top: 15px;
  bottom: -1px;
  left: 8px;
  width: 1px;
  background: var(--line);
  content: "";
}

.activity-item strong {
  color: var(--ink);
  font-size: 11px;
}

.section-title h2 {
  font-size: 17px;
}

select,
input {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--ink);
}

select:hover,
input:hover {
  border-color: #aebccc;
}

select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 127, 115, 0.1);
  outline: none;
}

button:hover {
  box-shadow: 0 7px 16px rgba(8, 127, 115, 0.17);
  transform: translateY(-1px);
}

button:active {
  box-shadow: none;
  transform: translateY(0);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.table-wrap {
  border-color: var(--line);
  background: var(--panel);
}

th {
  background: #edf1f6;
  color: #344054;
  font-size: 11px;
  text-transform: uppercase;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: #f3fbf9;
}

td.rate {
  position: relative;
  color: var(--accent-dark);
}

td.rate::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--gold);
  content: "";
  vertical-align: middle;
}

.best-quote-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  margin-right: 7px;
  padding: 2px 7px;
  border: 1px solid #ead48c;
  border-radius: 10px;
  background: var(--gold-soft);
  color: #755300;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.rate-entry-hero,
.report-hero,
.master-selector-panel,
.history-selector-panel {
  border-color: #b8ddd6;
  border-left-width: 5px;
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.rate-entry-hero h2,
.report-hero h2,
.history-selector-panel h2 {
  font-size: 24px;
}

.master-box:hover,
.report-card:hover,
.admin-card:hover {
  border-color: #b9c6d5;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.score-badge {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.trend-stage {
  background: var(--panel-soft);
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.02);
}

.trend-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawTrend 1.1s ease forwards;
}

.trend-point {
  transform-box: fill-box;
  transform-origin: center;
  animation: pointIn 350ms ease both;
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: 11vh 20px 20px;
  background: rgba(8, 15, 27, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(5px);
}

.command-palette.open {
  opacity: 1;
  pointer-events: auto;
}

.command-dialog {
  width: min(680px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(8, 15, 27, 0.32);
  transform: translateY(-16px) scale(0.98);
  transition: transform 220ms ease;
}

.command-palette.open .command-dialog {
  transform: translateY(0) scale(1);
}

.command-search-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.command-search-row > svg {
  width: 20px;
  color: var(--accent);
}

.command-search-row input {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  box-shadow: none;
}

.command-caption {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.command-results {
  display: grid;
  max-height: 52vh;
  gap: 3px;
  overflow-y: auto;
  padding: 6px 8px 10px;
}

.command-result {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.command-result:hover,
.command-result.selected {
  border-color: #bfe4dd;
  background: var(--accent-soft);
}

.command-result-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.command-result div:nth-child(2) {
  display: grid;
  gap: 2px;
}

.command-result strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-result small {
  color: var(--muted);
  font-size: 10px;
}

.command-result > span {
  color: var(--muted);
  font-size: 10px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 10px;
}

.toast {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  animation: toastIn 250ms ease both;
}

.toast::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.toast.error::before { background: var(--danger); }
.toast.warning::before { background: var(--gold); }

.toast button {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: #e9edf2 !important;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.72), transparent);
  content: "";
  transform: translateX(-100%);
  animation: skeletonSweep 1.2s ease-in-out infinite;
}

body.dark-mode {
  --bg: #111722;
  --panel: #192130;
  --panel-soft: #202a3a;
  --ink: #edf2f7;
  --muted: #9aa7b9;
  --line: #303b4d;
  --line-strong: #415069;
  --accent: #20a895;
  --accent-dark: #5ed8c5;
  --accent-soft: #173b3a;
  --blue-soft: #1e3158;
  --gold-soft: #433715;
  --danger-soft: #492421;
  color-scheme: dark;
}

body.dark-mode .topbar {
  background: rgba(25, 33, 48, 0.96);
}

body.dark-mode th { background: #222d3d; color: #c7d0dc; }
body.dark-mode tbody tr:hover { background: #1b3837; }
body.dark-mode .dashboard-hero { border-color: #36455d; }
body.dark-mode .trend-plot-bg { fill: #192130; stroke: #303b4d; }
body.dark-mode .trend-grid-line,
body.dark-mode .trend-week-line { stroke: #344055; }
body.dark-mode .trend-axis-label,
body.dark-mode .trend-axis-title { fill: #9aa7b9; }
body.dark-mode .master-selector-panel,
body.dark-mode .admin-hero { background: var(--panel-soft); }

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

@keyframes drawTrend {
  to { stroke-dashoffset: 0; }
}

@keyframes pointIn {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes skeletonSweep {
  to { transform: translateX(100%); }
}

@media (max-width: 1240px) {
  :root { --sidebar-width: 218px; }
  .topbar { grid-template-columns: minmax(180px, auto) minmax(220px, 1fr) auto; padding-inline: 18px; }
  .user-chip div { display: none; }
  .quick-rate-btn span { display: none; }
  .quick-rate-btn { width: 40px; padding: 0; }
  .dashboard-alert-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .dashboard-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 252px; }
  .app-sidebar {
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(8, 15, 27, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .app-content { margin-left: 0; }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 64px;
    padding: 10px 14px;
  }
  .mobile-menu-btn,
  .sidebar-close { display: inline-flex; }
  .sidebar-close { margin-left: auto; border-color: rgba(255,255,255,0.12); background: transparent; color: #ffffff; }
  .global-search-wrap { grid-column: 1 / -1; grid-row: 2; }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .topbar { position: relative; }
  .user-chip { display: none; }
  .stats-bar { padding: 10px 14px 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
  .page-shell { padding: 14px; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .savings-spotlight { border-top: 1px solid rgba(255,255,255,0.12); border-left: 0; }
  .workflow-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-strip > svg { display: none; }
  .dashboard-alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .page-heading h1 { font-size: 17px; }
  .topbar-eyebrow { display: none; }
  .topbar-actions .notification-btn { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { grid-template-columns: 30px 1fr; padding: 8px; gap: 7px; }
  .stat::before { width: 28px; height: 28px; }
  .stat strong { font-size: 16px; }
  .dashboard-hero-copy { padding: 24px 20px; }
  .dashboard-hero h2 { font-size: 26px; }
  .savings-spotlight { padding: 22px 20px; }
  .workflow-strip { grid-template-columns: 1fr; }
  .dashboard-alert-grid { grid-template-columns: 1fr; }
  .hero-actions { display: grid; width: 100%; }
  .hero-actions button { width: 100%; }
  .command-palette { padding: 7vh 10px 10px; }
}

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

/* Enterprise workflow modules */
body:not(.authenticated) .app-frame {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 520px);
  min-height: 100vh;
  background: #eef2f6;
}

.login-screen.visible {
  display: grid;
  animation: pageIn 240ms ease both;
}

.login-brand-panel {
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(36px, 8vw, 110px);
  background: #182233;
  color: #ffffff;
}

.login-brand-mark {
  margin-bottom: 26px;
}

.login-brand-panel h1 {
  margin-top: 4px;
  font-size: clamp(36px, 5vw, 58px);
}

.login-brand-panel > p {
  max-width: 650px;
  margin-top: 16px;
  color: #b6c1d1;
  font-size: 17px;
  line-height: 1.6;
}

.login-feature-list {
  display: grid;
  gap: 12px;
  margin-top: 34px;
}

.login-feature-list span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d7dee8;
  font-size: 13px;
  font-weight: 700;
}

.login-feature-list svg {
  width: 18px;
  color: #51d8c1;
}

.login-card {
  display: grid;
  width: min(440px, calc(100% - 40px));
  align-content: center;
  justify-self: center;
  gap: 18px;
  padding: 34px;
}

.login-card h2 {
  font-size: 30px;
}

.login-card > p {
  margin-top: -10px;
  color: var(--muted);
  line-height: 1.5;
}

.login-card input {
  min-height: 48px;
}

.login-card button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.login-status {
  min-height: 20px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.topbar-actions {
  position: relative;
}

.notification-panel {
  position: absolute;
  top: 52px;
  right: 54px;
  z-index: 90;
  display: none;
  width: min(420px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(8, 15, 27, 0.24);
}

.notification-panel.open {
  display: block;
  animation: riseIn 180ms ease both;
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.notification-panel-head > div {
  display: grid;
  gap: 2px;
}

.notification-panel-head small {
  color: var(--muted);
  font-size: 10px;
}

.notification-list {
  max-height: 430px;
  overflow-y: auto;
  padding: 6px;
}

.notification-item {
  display: grid;
  width: 100%;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.notification-item:hover {
  border-color: #bfe4dd;
  background: var(--accent-soft);
  box-shadow: none;
  transform: none;
}

.notification-item.read {
  opacity: 0.68;
}

.notification-type-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.notification-item > div {
  display: grid;
  gap: 3px;
}

.notification-item strong {
  font-size: 12px;
}

.notification-item span,
.notification-item small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.landed-rate {
  color: var(--blue);
  font-weight: 900;
}

.rfq-batch-panel {
  border-left: 5px solid var(--blue);
}

.rfq-batch-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 0.8fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.rfq-batch-grid select[multiple] {
  min-height: 230px;
  padding: 6px;
}

.rfq-batch-grid select[multiple] option {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.rfq-batch-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rfq-batch-meta button,
.rfq-batch-meta label:last-of-type {
  grid-column: 1 / -1;
}

.po-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.po-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.po-item > div,
.po-order-item,
.po-order-head {
  display: grid;
  gap: 4px;
}

.po-order-list,
.po-eligible-list {
  max-height: 520px;
}

.po-order-item {
  padding: 12px;
}

.po-order-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.po-status {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-approved,
.status-received { background: #e9f8ef; color: #16714a; border-color: #b9e3cb; }
.status-issued { background: var(--blue-soft); color: var(--blue); border-color: #bfd0fa; }
.status-cancelled { background: var(--danger-soft); color: var(--danger); border-color: #f0c2bd; }

.po-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
  margin-top: 8px;
}

.po-commercial-editor {
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.po-commercial-editor summary {
  color: var(--teal-700);
  cursor: pointer;
  font-weight: 700;
}

.po-commercial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
  align-items: end;
}

.po-commercial-grid .save-po-commercial-btn {
  min-height: 42px;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.supplier-scorecard {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.supplier-scorecard:hover {
  border-color: #a7d9d1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.scorecard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
}

.scorecard-head > div:first-child {
  display: grid;
  gap: 4px;
}

.scorecard-head > div:first-child span,
.supplier-scorecard p {
  color: var(--muted);
  font-size: 11px;
}

.score-ring {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--line) 0);
}

.score-ring::after {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--panel-soft);
  content: "";
}

.score-ring span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 900;
}

.scorecard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.scorecard-metrics > span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 9px;
}

.scorecard-metrics strong {
  color: var(--ink);
  font-size: 16px;
}

.conversion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) 180px;
  gap: 10px;
  align-items: end;
}

.conversion-list {
  margin-top: 12px;
}

.user-admin-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.user-admin-item > div:first-child {
  display: grid;
  gap: 3px;
}

.user-admin-actions {
  display: grid;
  grid-template-columns: 120px 90px;
  gap: 7px;
}

.approval-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.approval-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 220px));
  gap: 12px;
}

.approval-toolbar > label { width: min(260px, 100%); }
.approval-inbox-list { display: grid; gap: 10px; }
.approval-inbox-list .empty-state { display: grid; gap: 4px; padding: 12px 0; }
.approval-inbox-list .empty-state span { color: var(--muted); }

.approval-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #d59b16;
  border-radius: 8px;
  background: var(--surface);
}

.approval-record.approved { border-left-color: var(--teal); }
.approval-record.rejected { border-left-color: var(--danger); }
.approval-record-main,
.approval-record-title,
.approval-record-actions,
.approval-facts,
.rfq-message-actions,
.data-quality-row,
.data-quality-row span { display: flex; align-items: center; }
.approval-record-main { align-items: flex-start; flex-direction: column; gap: 7px; min-width: 0; }
.approval-record-title { gap: 10px; }
.approval-record-title strong { font-size: 16px; }
.approval-record-main > span,
.approval-record-main > p,
.approval-record-main > small { color: var(--muted); margin: 0; }
.approval-facts { flex-wrap: wrap; gap: 8px; }
.approval-facts span { padding: 6px 9px; background: var(--surface-soft); border-radius: 6px; color: var(--muted); }
.approval-record-actions { gap: 8px; }
.status-badge { padding: 5px 8px; border-radius: 6px; font-size: 12px; font-weight: 800; background: #fff5d8; color: #8a5d00; }
.status-badge.approved { background: #dcf8ef; color: #08745f; }
.status-badge.rejected { background: #fee7e5; color: #a82a23; }
.rfq-message-actions { flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.rfq-message-actions button { width: auto; }
.data-quality-summary { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 12px; }
.data-quality-summary strong { font-size: 30px; color: var(--ink); }
.data-quality-summary span { color: var(--muted); }
.data-quality-row { justify-content: space-between; gap: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-quality-row span { gap: 9px; }
.data-quality-row svg { width: 17px; height: 17px; }
.data-quality-row.clear svg { color: var(--teal); }
.data-quality-row.has-issue svg,
.data-quality-row.has-issue strong { color: #b76e00; }

.po-builder {
  margin-bottom: 16px;
  border-left: 4px solid var(--accent);
}

.po-builder-grid,
.ops-form-grid,
.settings-form-grid,
.approval-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.po-builder-grid .wide,
.ops-form-grid .wide,
.settings-form-grid .wide { grid-column: span 2; }
.po-builder > button { width: auto; min-width: 240px; }

.ops-tabbar {
  display: inline-flex;
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ops-tab {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.ops-tab:hover { background: var(--surface-soft); color: var(--ink); }
.ops-tab.active { background: var(--accent); color: #fff; }
.ops-tab svg { width: 17px; }
.ops-view { display: none; }
.ops-view.active { display: block; animation: page-enter 240ms ease both; }
.ops-split { display: grid; grid-template-columns: minmax(420px, 0.9fr) minmax(480px, 1.1fr); gap: 16px; }
.ops-form-panel,
.ops-register-panel { min-height: 520px; }
.ops-register-panel .section-title { align-items: end; }
.ops-register-panel .section-title label { min-width: 170px; }
.ops-list { max-height: 430px; overflow: auto; }
.ops-record { display: grid; gap: 5px; }
.ops-record-head,
.ops-record-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ops-record-actions { justify-content: flex-start; margin-top: 5px; }
.ops-record-actions button { width: auto; }
.ops-record small { color: var(--muted); }

.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.settings-panel-wide { grid-column: 1 / -1; }
.supplier-master-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.supplier-master-fields .wide { grid-column: 1 / -1; }
.master-profile-fields { display: grid; gap: 10px; }
.master-profile-fields.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.master-profile-fields .wide { grid-column: 1 / -1; }
.supplier-master-actions,
.master-form-actions { display: flex; gap: 8px; }
.supplier-master-actions button,
.master-form-actions button { flex: 1; }
.master-create-area textarea { resize: vertical; min-height: 64px; }
.master-record-copy { display: grid; min-width: 0; gap: 3px; }
.master-record-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.company-logo-uploader {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.company-logo-preview {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  background: #fff;
  color: var(--muted);
}

@media (max-width: 760px) {
  .master-quality-grid {
    grid-template-columns: 1fr;
  }

  .supplier-master-fields,
  .master-profile-fields.two-column {
    grid-template-columns: 1fr;
  }

  .supplier-master-fields .wide,
  .master-profile-fields .wide {
    grid-column: auto;
  }
}
.company-logo-preview img { max-width: 250px; max-height: 105px; object-fit: contain; }
.company-logo-uploader > div:last-child { display: grid; gap: 8px; }
.company-logo-uploader button { width: auto; justify-self: start; min-width: 150px; }
.company-logo-uploader small { color: var(--muted); }
.terms-specific-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.terms-specific-grid .wide { grid-column: span 2; }
.terms-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.terms-actions button { width: auto; min-width: 210px; }
.terms-legal-note { margin-top: 12px; color: #8a5a00; }
.settings-list { margin-top: 14px; max-height: 260px; overflow: auto; }
.settings-record { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-record > div { display: grid; gap: 4px; }
.settings-record .settings-record-actions { display: flex; grid-auto-flow: column; align-items: center; gap: 8px; }
.settings-record-actions button { width: auto; }
.approval-rule-grid { grid-template-columns: repeat(6, minmax(120px, 1fr)); align-items: end; }
.approval-rule-grid button { min-height: 40px; }

body[data-role="Buyer"] .approval-rule-grid,
body[data-role="Viewer"] .approval-rule-grid { display: none; }

.supplier-portal-body {
  min-height: 100vh;
  background: #f2f6f8;
}

.supplier-portal-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.supplier-portal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid #d7e0e7;
}

.supplier-portal-header > div:last-child { display: grid; gap: 2px; }
.supplier-portal-header strong { font-size: 18px; }
.supplier-portal-header span { color: #667085; font-size: 13px; }
.supplier-portal-intro { padding: 34px 0 20px; }
.supplier-portal-intro h1 { margin: 8px 0; font-size: 32px; letter-spacing: 0; }
.supplier-portal-intro p { color: #667085; }
.supplier-request-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-bottom: 18px; border: 1px solid #d7e0e7; border-radius: 8px; background: #d7e0e7; }
.supplier-request-summary div { display: grid; gap: 4px; min-height: 84px; padding: 14px; background: #fff; }
.supplier-request-summary span { color: #667085; font-size: 12px; }
.supplier-request-summary strong { overflow-wrap: anywhere; }
.supplier-quote-form { padding: 22px; border: 1px solid #d7e0e7; border-radius: 8px; background: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08); }
.supplier-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.supplier-form-grid .wide { grid-column: span 2; }
.portal-status { margin: 12px 0 0; color: #a82a23; }
.supplier-portal-message { display: grid; gap: 8px; padding: 24px; border: 1px solid #9bd2ca; border-left: 5px solid var(--accent); border-radius: 8px; background: #ecfdf5; }
.supplier-portal-message strong { font-size: 20px; }
.supplier-portal-message span { color: #52606f; }

@media (max-width: 1100px) {
  .rfq-batch-grid { grid-template-columns: 1fr 1fr; }
  .rfq-batch-meta { grid-column: 1 / -1; }
  .scorecard-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .ops-split,
  .settings-layout { grid-template-columns: 1fr; }
  .settings-panel-wide { grid-column: auto; }
  .approval-rule-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .login-screen.visible { grid-template-columns: 1fr; overflow-y: auto; }
  .login-brand-panel { padding: 34px 24px; }
  .login-brand-panel h1 { font-size: 34px; }
  .login-brand-panel > p { font-size: 14px; }
  .login-feature-list { display: none; }
  .login-card { padding: 30px 20px; }
  .notification-panel { position: fixed; top: 66px; right: 14px; left: 14px; width: auto; }
  .rfq-batch-grid,
  .rfq-batch-meta,
  .po-summary-row,
  .scorecard-grid,
  .conversion-grid { grid-template-columns: 1fr; }
  .rfq-batch-meta,
  .rfq-batch-meta button,
  .rfq-batch-meta label:last-of-type { grid-column: auto; }
  .user-admin-item,
  .user-admin-actions { grid-template-columns: 1fr; }
  .approval-toolbar,
  .approval-record { grid-template-columns: 1fr; display: grid; }
  .approval-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approval-toolbar > label { width: 100%; }
  .approval-record-actions button { flex: 1; }
  .report-hero > button { width: 100%; }
  .po-builder-grid,
  .po-commercial-grid,
  .ops-form-grid,
  .settings-form-grid,
  .terms-specific-grid,
  .approval-rule-grid { grid-template-columns: 1fr; }
  .po-builder-grid .wide,
  .ops-form-grid .wide,
  .settings-form-grid .wide { grid-column: auto; }
  .company-logo-uploader { grid-template-columns: 1fr; }
  .supplier-master-fields { grid-template-columns: 1fr; }
  .supplier-master-fields .wide { grid-column: auto; }
  .terms-specific-grid .wide { grid-column: auto; }
  .terms-actions { display: grid; }
  .terms-actions button { width: 100%; min-width: 0; }
  .po-builder > button { width: 100%; min-width: 0; }
  .ops-tabbar { display: grid; grid-template-columns: 1fr; width: 100%; }
  .ops-tab { width: 100%; justify-content: flex-start; }
  .ops-form-panel,
  .ops-register-panel { min-height: 0; }
  .settings-record { align-items: flex-start; }
  .supplier-request-summary,
  .supplier-form-grid { grid-template-columns: 1fr; }
  .supplier-form-grid .wide { grid-column: auto; }
  .supplier-portal-intro h1 { font-size: 26px; }
}
.dashboard-alert-card.is-actionable {
  cursor: pointer;
  outline: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-alert-card.is-actionable:hover,
.dashboard-alert-card.is-actionable:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(8, 127, 115, 0.14);
}

.data-quality-row > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-quality-details {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.data-quality-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.data-quality-detail-header h4,
.data-quality-detail-header p {
  margin: 3px 0 0;
}

.data-quality-detail-header > strong {
  white-space: nowrap;
  color: var(--primary);
}

.data-quality-table-wrap {
  max-height: 440px;
}

.data-quality-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.data-quality-package {
  min-width: 190px;
}

@media (max-width: 760px) {
  .data-quality-detail-header {
    flex-direction: column;
  }

  .data-quality-package {
    min-width: 150px;
  }
}
.current-user-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(8, 127, 115, 0.12);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-admin-actions button:disabled,
.user-admin-actions select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
