* {
  box-sizing: border-box;
}

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

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

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.auth-card {
  width: min(100%, 520px);
  padding: 32px;
}

.hero-card {
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  background: linear-gradient(135deg, #0f3d5e, #206c8c);
  color: #fff;
}

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

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

.hero-text {
  margin: 12px 0 0;
  line-height: 1.7;
  opacity: 0.92;
}

.auth-head h1 {
  margin: 0;
  font-size: 34px;
  color: #163247;
}

.auth-text {
  margin: 12px 0 0;
  color: #5b7487;
  line-height: 1.7;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.auth-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 144px;
  gap: 12px;
  align-items: end;
}

.auth-code-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-hint {
  min-height: 56px;
}

.content-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.panel-card {
  padding: 24px;
}

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

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

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

.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label 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: 96px;
  resize: vertical;
}

.filter-actions {
  display: flex;
  gap: 12px;
  align-items: end;
}

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

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

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

.hero-actions-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.hero-button-row {
  display: flex;
  gap: 10px;
}

.user-badge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  min-width: 240px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
}

.user-badge span {
  font-size: 12px;
  opacity: 0.84;
}

.user-badge strong {
  font-size: 15px;
  font-weight: 600;
}

.status-panel {
  padding: 16px 18px;
  border-radius: 16px;
  background: #eef5fb;
  color: #0f3d5e;
  line-height: 1.7;
}

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

.stat-card {
  padding: 18px 20px;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.stats-grid .stat-card {
  cursor: pointer;
}

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

.stats-grid .stat-card.active {
  border-color: #0f5f97;
  box-shadow: 0 12px 24px rgba(15, 61, 94, 0.12);
}

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

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

.stats-grid .stat-card.approved {
  background: #e8f6ea;
}

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

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

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

.stats-grid .stat-card.current {
  background: #eef5fb;
}

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

.stat-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
}

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

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

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

.review-title {
  margin: 0;
  font-size: 22px;
}

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

.review-highlight-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #eef5fb;
}

.review-highlight-label {
  color: #587287;
  font-size: 13px;
}

.review-highlight-value {
  font-size: 18px;
  font-weight: 700;
  color: #0f3d5e;
}

.review-highlight-supplier {
  color: #35576f;
  font-size: 14px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef5fb;
  color: #0f3d5e;
  font-size: 13px;
}

.pill-warn {
  background: #fff1db;
  color: #9d5b00;
}

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

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.review-stat {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f4f8fc;
}

.review-stat-label {
  color: #587287;
  font-size: 13px;
}

.review-stat-value {
  margin-top: 6px;
  font-weight: 700;
}

.review-comment {
  margin-top: 16px;
}

.review-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.review-details {
  margin-top: 18px;
  border: 1px solid #dce8f1;
  border-radius: 18px;
  background: #f8fbfe;
  padding: 14px 16px 16px;
}

.review-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f3d5e;
  list-style: none;
}

.review-details summary::-webkit-details-marker {
  display: none;
}

.review-detail-section {
  margin-top: 16px;
}

.review-detail-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #587287;
}

.review-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.attachment-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attachment-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #436074;
}

.attachment-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.attachment-image-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: #f8fbfe;
  border: 1px solid #dce8f1;
  color: #163247;
  text-decoration: none;
}

.attachment-image-card:hover {
  background: #eef5fb;
}

.attachment-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: #e8f1f8;
}

.attachment-image-name {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.model-preview-list {
  display: grid;
  gap: 14px;
}

.model-preview-card {
  padding: 14px;
  border-radius: 18px;
  background: #f8fbfe;
  border: 1px solid #dce8f1;
}

.model-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.model-preview-link {
  color: #0f5f97;
  text-decoration: none;
  font-size: 13px;
}

.model-preview-link:hover {
  text-decoration: underline;
}

.model-preview-name {
  margin-top: 10px;
  color: #436074;
  font-size: 13px;
  word-break: break-all;
}

.model-viewer {
  width: 100%;
  height: 360px;
  margin-top: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #edf4fa 0%, #dfeaf4 100%);
}

.model-preview-placeholder {
  margin-top: 12px;
  padding: 18px;
  border-radius: 14px;
  background: #eef5fb;
  color: #436074;
}

.model-preview-placeholder-title {
  font-weight: 600;
  color: #163247;
}

.model-preview-placeholder-text {
  margin-top: 8px;
  line-height: 1.6;
}

.attachment-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef5fb;
  color: #163247;
  text-decoration: none;
}

.attachment-item:hover {
  background: #e2eef8;
}

.attachment-type {
  display: inline-flex;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #d9e8f4;
  color: #0f3d5e;
  font-size: 12px;
}

.attachment-name {
  word-break: break-all;
}

.empty-state {
  padding: 20px;
  border-radius: 16px;
  background: #f4f8fc;
  color: #688193;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 220px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(19, 33, 27, 0.92);
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 61, 94, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .auth-inline,
  .filter-grid,
  .stats-grid,
  .review-grid,
  .review-detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .review-card-head,
  .section-head,
  .filter-actions,
  .review-actions,
  .hero-button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions-stack {
    align-items: stretch;
  }
}
