* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #e8f1f8 0%, #f4f7fb 100%);
  color: #163247;
}

button,
input,
textarea,
select {
  font: inherit;
}

.supplier-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.supplier-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, #0f3d5e, #206c8c);
  color: #fff;
  box-shadow: 0 18px 42px rgba(15, 61, 94, 0.18);
}

.supplier-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.supplier-hero h1 {
  margin: 0;
  font-size: 36px;
}

.supplier-subtitle {
  max-width: 760px;
  margin: 12px 0 0;
  line-height: 1.7;
  opacity: 0.92;
}

.supplier-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.supplier-sidebar,
.supplier-content {
  min-width: 0;
}

.panel-card {
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(15, 61, 94, 0.08);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 26px;
}

.panel-head p {
  margin: 0;
  color: #5b7487;
  line-height: 1.6;
}

.nav-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-tab {
  padding: 14px 18px;
  border: 1px solid #d7e6f0;
  border-radius: 16px;
  background: #eef5fb;
  color: #0f3d5e;
  text-align: left;
  cursor: pointer;
}

.nav-tab.active {
  background: #0f5f97;
  color: #fff;
  border-color: #0f5f97;
}

.nav-tab.materials-has-pending {
  background: #fff3df;
  color: #b26b13;
  border-color: #f0cf8b;
}

.nav-tab.materials-has-pending.active {
  background: #df8a1e;
  color: #fff;
  border-color: #df8a1e;
}

.nav-tab.materials-has-rejected {
  background: #fdeceb;
  color: #b33d2d;
  border-color: #f0b9b2;
}

.nav-tab.materials-has-rejected.active {
  background: #c65041;
  color: #fff;
  border-color: #c65041;
}

.status-chip {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e6f4ea;
  color: #2a6b37;
}

.hint-text,
.muted-text {
  color: #688193;
  line-height: 1.6;
}

.empty-note {
  color: #688193;
  line-height: 1.7;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

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

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

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

.form-grid label,
.upload-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-grid span,
.upload-field span {
  color: #587287;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #d8e5ef;
  border-radius: 16px;
  background: #f8fbfe;
  color: #163247;
}

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

input[readonly] {
  background: #f1f6fa;
  color: #496276;
}

.full-width {
  grid-column: 1 / -1;
}

.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.material-name-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.material-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.prefix-toggle {
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.prefix-toggle:hover {
  transform: translateY(-1px);
}

.prefix-enabled {
  background: linear-gradient(135deg, #38a957, #1f8644);
  box-shadow: 0 8px 18px rgba(42, 107, 55, 0.18);
}

.prefix-disabled {
  background: linear-gradient(135deg, #f2ab47, #df7a20);
  box-shadow: 0 8px 18px rgba(223, 124, 36, 0.18);
}

.field-status {
  min-height: 22px;
  font-size: 13px;
  line-height: 1.6;
  color: #688193;
}

.field-status.success {
  color: #2a6b37;
}

.field-status.error {
  color: #8a2825;
}

.field-status.pending {
  color: #8a6a24;
}

.primary-btn,
.ghost-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  cursor: pointer;
  border: none;
}

.primary-btn {
  background: #0f5f97;
  color: #fff;
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-btn {
  background: #eef5fb;
  color: #0f3d5e;
}

.inline-profile-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border-radius: 18px;
  background: #eef5fb;
}

.number-preview {
  margin: 22px 0;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #eef9ee, #d8f0d8);
}

.number-label {
  color: #5f7b67;
  font-size: 14px;
}

.number-value {
  margin-top: 10px;
  font-size: 38px;
  font-weight: 700;
  color: #29653c;
  word-break: break-all;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: #eef5fb;
  border: 1px solid transparent;
}

.stat-filter-card {
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.stat-filter-card:hover {
  transform: translateY(-2px);
}

.stat-filter-card.active {
  box-shadow: 0 10px 24px rgba(15, 61, 94, 0.12);
}

.stat-filter-card.total {
  background: #eef5fb;
}

.stat-filter-card.total.active {
  border-color: #0f5f97;
}

.stat-filter-card.pending {
  background: #fff3df;
}

.stat-filter-card.pending.active {
  border-color: #df8a1e;
}

.stat-filter-card.approved {
  background: #e6f4ea;
}

.stat-filter-card.approved.active {
  border-color: #2d8c48;
}

.stat-filter-card.rejected {
  background: #fdeceb;
}

.stat-filter-card.rejected.active {
  border-color: #c65041;
}

.stat-label {
  color: #5b7487;
  font-size: 14px;
}

.stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-card {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid #dce8f1;
  background: #fbfdff;
}

.list-card-editable {
  cursor: pointer;
  border-color: #f1d0ca;
  box-shadow: 0 8px 22px rgba(179, 61, 45, 0.06);
}

.list-card-editable:hover {
  background: #fff9f8;
}

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

.list-card-title {
  margin: 0;
  font-size: 20px;
}

.list-card-subtitle,
.list-card-meta {
  margin-top: 8px;
  color: #688193;
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef5fb;
  color: #0f3d5e;
  white-space: nowrap;
}

.status-pill.rejected {
  background: #fdeceb;
  color: #b33d2d;
}

.status-pill.pending {
  background: #fff3df;
  color: #b26b13;
}

.status-pill.approved {
  background: #e6f4ea;
  color: #2a6b37;
}

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

.upload-field {
  padding: 16px;
  border: 1px dashed #c9dce9;
  border-radius: 18px;
  background: #f8fbfe;
}

.submit-result {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: #eef5fb;
  color: #0f3d5e;
  line-height: 1.7;
  display: none;
}

.submit-result.show {
  display: block;
}

.submit-result.error {
  background: #fdeceb;
  color: #8a2825;
}

@media (max-width: 1120px) {
  .supplier-grid {
    grid-template-columns: 1fr;
  }

  .two-col,
  .three-col,
  .four-col,
  .upload-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .material-name-row {
    grid-template-columns: 1fr;
  }
}
