:root {
  --ink: #1e232b;
  --muted: #6f7783;
  --line: #e4e7eb;
  --paper: #ffffff;
  --canvas: #f6f7f9;
  --dark: #20252d;
  --dark-soft: #303640;
  --indigo: #4356a4;
  --indigo-soft: #eef1ff;
  --green: #237b61;
  --green-soft: #eaf7f1;
  --amber: #b36a11;
  --amber-soft: #fff4df;
  --red: #b14343;
  --red-soft: #fff0f0;
  --shadow: 0 16px 40px rgba(28, 35, 43, 0.08);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.topbar,
.summary-band,
.control-band,
.notice-band,
.table-section,
.footer {
  background: var(--paper);
}

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

.brand-lockup,
.topbar-meta,
.notice-band,
.section-heading,
.detail-status-line,
.attachment-list {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--dark);
  border-radius: 10px;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.topbar-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 999px;
}

.button,
.icon-button,
.filter-button,
.text-button {
  border: 0;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:active,
.icon-button:active,
.filter-button:active,
.text-button:active {
  transform: translateY(1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-dark {
  color: #fff;
  background: var(--dark);
}

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

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
}

.icon-button:hover {
  color: var(--ink);
  background: #f0f2f4;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 142px;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric-dark {
  color: #fff;
  background: var(--dark);
}

.metric-label,
.metric-note {
  display: block;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-dark .metric-label,
.metric-dark .metric-note {
  color: #bbc3cf;
}

.metric strong {
  display: block;
  margin: 16px 0 7px;
  font-size: 34px;
  line-height: 1;
}

.metric-note {
  color: #89919d;
  font-size: 12px;
}

.control-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border: 1px solid var(--line);
  border-top: 0;
}

.search-field {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  min-width: 220px;
  height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: #f8f9fa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.search-field:focus-within {
  border-color: #a8b2d5;
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

.search-field svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0 0 0 9px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-button:hover {
  color: var(--ink);
  background: #f0f2f4;
}

.filter-button.is-active {
  color: var(--indigo);
  background: var(--indigo-soft);
}

.sort-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sort-field select {
  min-height: 38px;
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  appearance: none;
  outline: 0;
  font-size: 12px;
}

.sort-field svg {
  position: absolute;
  right: 9px;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.notice-band {
  gap: 12px;
  padding: 14px 24px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #f0d5a1;
  border-top: 0;
}

.notice-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--amber);
  background: #ffe7b8;
  border-radius: 7px;
}

.notice-icon svg {
  width: 18px;
  height: 18px;
}

.notice-band strong {
  display: block;
  color: #6f460c;
  font-size: 13px;
}

.notice-band p {
  margin: 3px 0 0;
  color: #8d672c;
  font-size: 12px;
}

.text-button {
  margin-left: auto;
  padding: 5px 0;
  color: #76501a;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  color: #4e3308;
}

.table-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.section-heading {
  justify-content: space-between;
  gap: 20px;
  padding: 21px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.result-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 14px 16px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #edf0f2;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #fbfcfd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #fafbfe;
}

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

.col-name {
  min-width: 240px;
}

.col-action {
  width: 82px;
  text-align: center;
}

.asset-name {
  display: block;
  margin: 0 auto;
  max-width: 330px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
}

.asset-subline {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.muted-value {
  color: var(--muted);
}

.date-value {
  font-variant-numeric: tabular-nums;
}

.amount-value {
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.status-pill.expired {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.due {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.active {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.nodate,
.status-pill.unknown {
  color: #616b78;
  background: #eef0f2;
}

.company-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 240px;
  min-height: 24px;
  padding: 0 9px;
  overflow: hidden;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-tone-0 {
  color: #2b5d88;
  background: #eaf3fb;
}

.company-tone-1 {
  color: #2d745e;
  background: #eaf7f1;
}

.company-tone-2 {
  color: #6653a0;
  background: #f0edff;
}

.company-tone-3 {
  color: #a04b6c;
  background: #fff0f5;
}

.company-tone-4 {
  color: #a8611a;
  background: #fff3e3;
}

.company-tone-5 {
  color: #26717a;
  background: #e8f6f7;
}

.company-tone-6 {
  color: #4a5a9f;
  background: #eef1ff;
}

.company-tone-7 {
  color: #7a5d32;
  background: #f8f0e4;
}

.company-tone-8 {
  color: #8b4f29;
  background: #fff0e8;
}

.company-tone-9 {
  color: #536879;
  background: #edf2f5;
}

.company-tone-muted {
  color: #616b78;
  background: #eef0f2;
}

.asset-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.asset-tone-scrapped {
  color: var(--red);
  background: var(--red-soft);
}

.asset-tone-electronic {
  color: #596875;
  background: #edf1f4;
}

.asset-tone-fixed {
  color: #3d6fa8;
  background: #eaf3ff;
}

.asset-tone-loaned {
  color: var(--amber);
  background: var(--amber-soft);
}

.asset-tone-default {
  color: #6653a0;
  background: #f0edff;
}

.asset-tone-muted {
  color: #616b78;
  background: #eef0f2;
}

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 0;
  color: var(--indigo);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.row-action svg {
  width: 15px;
  height: 15px;
}

.row-action:hover {
  color: #2d3d86;
}

.loading-row td {
  height: 190px;
  color: var(--muted);
  text-align: center;
}

.loading-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid #dfe4e9;
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.empty-state svg {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  color: #a0a8b2;
}

.empty-state strong,
.empty-state p {
  display: block;
}

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-state p {
  margin: 6px 0 0;
  font-size: 12px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 24px;
  color: #8a929d;
  border: 1px solid var(--line);
  border-top: 0;
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(30, 35, 43, 0.42);
}

.detail-modal {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(14, 20, 28, 0.22);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  max-width: 620px;
  line-height: 1.3;
}

.detail-status-line {
  gap: 10px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.detail-status-copy {
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  padding: 10px 0;
}

.detail-item {
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid #edf0f2;
}

.detail-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-value {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.attachment-section {
  padding-top: 14px;
}

.attachment-list {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}

.attachment-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 10px;
  color: var(--indigo);
  background: var(--indigo-soft);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.attachment-link:hover {
  background: #e1e6ff;
}

.attachment-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .control-band {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search-field {
    flex-basis: 100%;
  }

  .sort-field {
    margin-left: auto;
  }

  .col-name {
    min-width: 220px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 1480px);
    padding-top: 12px;
  }

  .topbar,
  .control-band,
  .section-heading,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .topbar-meta {
    width: 100%;
    justify-content: flex-start;
  }

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

  .metric {
    min-height: 118px;
    padding: 18px 16px;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .metric strong {
    margin-top: 12px;
    font-size: 28px;
  }

  .control-band {
    gap: 10px;
  }

  .filter-group {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .filter-button {
    flex: 0 0 auto;
  }

  .sort-field {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .sort-field select {
    flex: 1;
  }

  .notice-band {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .footer {
    flex-direction: column;
    gap: 5px;
  }

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

@media (max-width: 540px) {
  .button-dark span {
    display: none;
  }

  .button-dark {
    width: 38px;
    padding: 0;
  }

  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(3),
  td:nth-child(3),
  th:nth-child(5),
  td:nth-child(5),
  th:nth-child(7),
  td:nth-child(7) {
    display: none;
  }

  th,
  td {
    padding: 13px 12px;
  }

  .col-name {
    min-width: 205px;
  }

  .detail-modal {
    padding: 18px;
  }
}
