:root {
  color: #1f2933;
  background: #f5f7f8;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f5f7f8;
}

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

.login-panel {
  background: #ffffff;
  border: 1px solid #dbe2e7;
  border-radius: 8px;
  margin: 0 auto;
  max-width: 440px;
  padding: 28px;
  width: 100%;
}

.login-helper {
  color: #60707c;
  margin: 12px 0 20px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  color: #60707c;
  font-size: 0.875rem;
}

.login-form input {
  border: 1px solid #cbd6dd;
  border-radius: 6px;
  color: #1f2933;
  font: inherit;
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: #60707c;
  font-size: 0.875rem;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 1.875rem;
  font-weight: 700;
}

h2 {
  font-size: 1.125rem;
}

.user-panel {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe2e7;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  padding: 10px 12px;
}

.user-panel span,
.user-panel strong {
  display: block;
}

.user-panel span {
  color: #14212b;
  font-weight: 700;
}

.user-panel strong {
  color: #60707c;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 2px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-button {
  background: #ffffff;
  border: 1px solid #cbd6dd;
  border-radius: 6px;
  color: #4c5d68;
  cursor: pointer;
  font: inherit;
  min-height: 40px;
  padding: 0 16px;
}

.tab-button.active {
  background: #21495a;
  border-color: #21495a;
  color: #ffffff;
}

.toolbar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.refresh-button {
  border: 1px solid #b8c4cc;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2933;
  cursor: pointer;
  font: inherit;
  min-height: 40px;
  padding: 0 16px;
}

.refresh-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.status {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.status-loading {
  background: #e8f2f7;
  border: 1px solid #b9d8e5;
  color: #21495a;
}

.status-error {
  background: #fff0ef;
  border: 1px solid #f1bbb8;
  color: #8a2b25;
}

.status-success {
  background: #eef8f2;
  border: 1px solid #b9dfc8;
  color: #23643a;
}

.overview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.metric {
  background: #ffffff;
  border: 1px solid #dbe2e7;
  border-radius: 8px;
  min-height: 108px;
  padding: 18px;
}

.metric span {
  color: #60707c;
  display: block;
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.metric strong {
  color: #14212b;
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.table-section,
.detail-section,
.form-section {
  background: #ffffff;
  border: 1px solid #dbe2e7;
  border-radius: 8px;
  overflow: hidden;
}

.detail-section,
.form-section {
  margin-top: 18px;
}

.form-section {
  margin-bottom: 18px;
}

.section-header {
  align-items: center;
  border-bottom: 1px solid #dbe2e7;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.section-header span {
  color: #60707c;
  font-size: 0.875rem;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid #edf1f3;
  padding: 14px 18px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8fafb;
  color: #60707c;
  font-size: 0.8125rem;
  font-weight: 600;
}

td {
  color: #26333d;
  font-size: 0.9375rem;
}

tr:last-child td {
  border-bottom: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover,
.clickable-row:focus,
.selected-row {
  background: #eef6f4;
  outline: none;
}

.empty-cell {
  color: #60707c;
  text-align: center;
}

.detail-placeholder {
  color: #60707c;
  padding: 18px;
}

.detail-section .status {
  margin: 18px;
}

.detail-actions {
  align-items: center;
  border-top: 1px solid #edf1f3;
  display: flex;
  gap: 12px;
  padding: 18px;
}

.detail-actions label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.detail-actions input,
.detail-actions select {
  border: 1px solid #cbd6dd;
  border-radius: 6px;
  color: #1f2933;
  font: inherit;
  min-height: 40px;
  padding: 9px 10px;
  width: 150px;
}

.detail-actions span {
  color: #60707c;
  font-size: 0.875rem;
}

.form-section .status {
  margin: 0 18px 18px;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
}

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

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

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

.form-grid label span {
  color: #60707c;
  font-size: 0.8125rem;
  font-weight: 600;
}

.filter-grid label span {
  color: #60707c;
  font-size: 0.8125rem;
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  border: 1px solid #cbd6dd;
  border-radius: 6px;
  color: #1f2933;
  font: inherit;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

.filter-grid input,
.filter-grid select {
  border: 1px solid #cbd6dd;
  border-radius: 6px;
  color: #1f2933;
  font: inherit;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

.form-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.form-wide {
  grid-column: 1 / -1;
}

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

.filter-actions {
  align-self: end;
}

.text-button {
  background: transparent;
  border: 0;
  color: #21495a;
  cursor: pointer;
  font: inherit;
  min-height: 40px;
  padding: 0 8px;
}

.compact-action {
  min-height: 32px;
  padding: 0 4px;
  white-space: nowrap;
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.detail-item {
  border: 1px solid #edf1f3;
  border-radius: 6px;
  min-height: 84px;
  padding: 14px;
}

.detail-item span {
  color: #60707c;
  display: block;
  font-size: 0.8125rem;
  margin-bottom: 8px;
}

.detail-item strong {
  color: #14212b;
  display: block;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-button {
    width: 100%;
  }

  .tabs,
  .toolbar {
    flex-direction: column;
  }

  .tab-button {
    width: 100%;
  }

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

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

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

  .form-actions {
    flex-direction: column;
  }

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

@media (min-width: 761px) and (max-width: 1080px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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