.status-tabs {
  display: flex;
  gap: 28px;
  margin-top: 14px;
  border-bottom: 1px solid #dbe4ee;
}

.status-tabs button {
  position: relative;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 750;
  overflow: visible;
}

.status-tabs button.active {
  color: var(--theme-primary-active);
}

.status-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--theme-primary);
}

.scope-tab-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.2;
}

.scope-tab-badge {
  position: static;
  flex: 0 0 auto;
  min-width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -5px;
  padding: 0 3px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 850;
  line-height: 1;
  box-shadow:
    0 0 0 2px rgba(239, 68, 68, 0.1),
    0 6px 14px rgba(239, 68, 68, 0.22);
}

.document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.filter-set,
.document-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.list-search {
  position: relative;
  width: 280px;
}

.list-search .mdi {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 15px;
}

.list-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.list-search input::placeholder {
  color: #8da0b4;
}

.list-search input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(58, 124, 165, 0.14);
  outline: none;
}

.filter-btn {
  min-width: 120px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: rgba(58, 124, 165, .32);
  color: var(--theme-primary-active);
}

.document-filter,
.date-range-filter {
  position: relative;
}

.document-filter-menu,
.date-range-popover {
  position: absolute;
  z-index: 40;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.document-filter-menu {
  top: calc(100% + 8px);
  left: 0;
  min-width: 150px;
  max-height: 280px;
  padding: 6px;
  overflow-y: auto;
}

.document-filter-menu button {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

.document-filter-menu button:hover,
.document-filter-menu button.active {
  background: rgba(58, 124, 165, 0.1);
  color: var(--theme-primary-active);
}

.date-range-trigger {
  min-width: 150px;
}

.date-range-label {
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range-popover {
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.date-range-popover header,
.date-range-popover footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.date-range-popover header strong {
  color: #0f172a;
  font-size: 15px;
}

.date-range-popover header button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
}

.date-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.date-range-fields label {
  display: grid;
  gap: 6px;
}

.date-range-fields span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.date-range-fields input {
  width: 100%;
  height: 38px;
  padding: 0 9px;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  color: #0f172a;
  font-size: 13px;
}

.ghost-btn,
.apply-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 750;
}

.ghost-btn {
  border: 1px solid #d7e0ea;
  background: #fff;
  color: #334155;
}

.apply-btn {
  border: 0;
  background: var(--theme-primary);
  color: #fff;
}

.apply-btn:disabled {
  cursor: not-allowed;
  background: #cbd5e1;
}

.document-status-filter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
}

.status-dropdown-filter,
.status-filter-trigger,
.status-filter-menu {
  min-width: 154px;
}

.status-filter-trigger > .mdi:first-child {
  color: var(--theme-primary);
}

.clear-filter-btn {
  justify-content: center;
}

.create-request-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-active));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 24px var(--theme-primary-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.create-request-btn.secondary {
  border: 1px solid #d7e0ea;
  background: #fff;
  color: #334155;
  box-shadow: none;
}

.create-request-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px var(--theme-primary-shadow);
  filter: saturate(1.02);
}

.create-request-btn.secondary:hover {
  border-color: rgba(58, 124, 165, .32);
  color: var(--theme-primary-active);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.create-request-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.mark-read-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fff;
  color: #dc2626;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.mark-read-btn .mdi {
  font-size: 16px;
}

.mark-read-btn:hover {
  border-color: #fca5a5;
  background: #fff5f5;
  color: #b91c1c;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.1);
}

.table-wrap {
  min-height: 400px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: linear-gradient(180deg, #fcfefd 0%, #f4f8f6 100%);
  display: flex;
  flex-direction: column;
}

.table-wrap.is-empty {
  align-items: center;
  justify-content: center;
}

.table-wrap table {
  width: 100%;
  align-self: flex-start;
}

.table-state {
  width: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
  color: #64748b;
  background: linear-gradient(180deg, #fcfffd 0%, #f5f9f7 100%);
}

.table-state .mdi {
  font-size: 28px;
  color: var(--theme-primary);
}

.table-state strong {
  color: #0f172a;
  font-size: 15px;
}

.table-state p {
  max-width: 420px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.table-state.error {
  background: linear-gradient(180deg, #fffdfd 0%, #fff6f6 100%);
}

.table-state.error .mdi {
  color: #ef4444;
}

.retry-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #f1c5c5;
  border-radius: 8px;
  background: #fff;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 750;
}

table {
  width: 100%;
  min-width: 1420px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf2f7;
  color: #24324a;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: linear-gradient(90deg, rgba(58, 124, 165, .08), rgba(58, 124, 165, .03));
}

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

td small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #7d8da1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-id {
  color: var(--theme-primary-active);
  font-weight: 800;
}

.doc-kind-tag,
.type-tag,
.status-tag,
.risk-level-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.doc-kind-tag {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.doc-kind-tag.reimbursement {
  background: var(--theme-primary-light-9);
  color: var(--theme-primary-active);
}

.doc-kind-tag.application {
  background: #eff6ff;
  color: #2563eb;
}

.type-tag {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.type-tag.travel,
.type-tag.hotel,
.type-tag.transport {
  background: var(--theme-primary-light-9);
  color: var(--theme-primary-active);
}

.type-tag.entertainment,
.type-tag.meal {
  background: #fff7ed;
  color: #ea580c;
}

.type-tag.office {
  background: #eff6ff;
  color: #2563eb;
}

.type-tag.meeting,
.type-tag.training {
  background: #eef2ff;
  color: #4f46e5;
}

.type-tag.other,
.type-tag.neutral {
  background: #f8fafc;
  color: #475569;
}

.status-tag {
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
}

.status-tag.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.status-tag.success,
.status-tag.archived,
.status-tag.completed {
  border-color: var(--success-line);
  background: var(--success-soft);
  color: var(--success-active);
}

.status-tag.warning,
.status-tag.draft {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #f97316;
}

.status-tag.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.status-tag.neutral {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.risk-level-tags {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.risk-level-tag {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.risk-level-tag.high {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.risk-level-tag.medium {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.risk-level-tag.low {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.risk-level-tag.none {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.list-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.page-summary {
  color: #64748b;
  font-size: 14px;
  font-weight: 650;
}

.pager {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.pager button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.pager button:hover:not(.active) {
  background: #fff;
  color: var(--theme-primary-active);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.pager button.active {
  background: var(--theme-primary-active);
  color: #fff;
  box-shadow: 0 8px 16px var(--theme-primary-shadow);
}

.pager button:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.page-size-select {
  width: 118px;
  justify-self: end;
}

@media (max-width: 1200px) {
  .document-toolbar,
  .list-foot {
    grid-template-columns: 1fr;
  }

  .document-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .document-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .status-tabs {
    gap: 18px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .status-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .status-tabs button span {
    white-space: nowrap;
  }

  .filter-set,
  .document-actions,
  .list-search,
  .filter-btn,
  .mark-read-btn,
  .page-size-select {
    width: 100%;
  }

  .list-foot {
    display: grid;
    justify-items: stretch;
  }

  .pager {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .pager button {
    flex: 0 0 auto;
  }

  .documents-list .table-wrap {
    min-height: 0;
    max-height: none;
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .documents-list .table-wrap table,
  .documents-list .table-wrap thead,
  .documents-list .table-wrap tbody,
  .documents-list .table-wrap tr,
  .documents-list .table-wrap th,
  .documents-list .table-wrap td {
    display: block;
  }

  .documents-list .table-wrap table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
  }

  .documents-list .table-wrap thead,
  .documents-list .table-wrap colgroup {
    display: none;
  }

  .documents-list .table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .documents-list .table-wrap tr {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  }

  .documents-list .table-wrap tr:hover {
    background: #f8fbff;
  }

  .documents-list .table-wrap td {
    position: relative;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-height: 30px;
    padding: 7px 0;
    border-bottom: 1px dashed #edf2f7;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .documents-list .table-wrap td:last-child {
    border-bottom: 0;
  }

  .documents-list .table-wrap td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.7;
  }

  .documents-list .table-wrap td > * {
    min-width: 0;
  }

  .documents-list .table-wrap td:first-child {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .documents-list .table-wrap td:first-child::before {
    display: none;
  }

  .documents-list .table-wrap td[data-label="事项"] {
    grid-template-columns: 1fr;
  }

  .documents-list .table-wrap td[data-label="事项"]::before {
    margin-bottom: 2px;
  }
}
