:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #20242a;
  background: #f4f5f6;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.app-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  color: #fff;
  background: #20242a;
  border-bottom: 4px solid #f0b323;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.brand p,
.section-heading p {
  margin-top: 4px;
  color: #b9c0c8;
  font-size: 13px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: #343a41;
  border: 1px solid #50575f;
  border-radius: 6px;
}

.icon-button:hover {
  background: #4a525b;
}

.icon-button.danger:hover {
  color: #fff;
  background: #b93a32;
  border-color: #b93a32;
}

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

main {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 18px 24px 32px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  background: #fff;
  border: 1px solid #d8dce0;
  border-radius: 6px;
}

.summary-item {
  min-height: 72px;
  padding: 14px 18px;
  border-right: 1px solid #e1e4e7;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item span {
  display: block;
  color: #666e77;
  font-size: 13px;
}

.summary-item strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.assignee-load {
  margin-top: 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid #d8dce0;
}

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

.section-heading h2 {
  font-size: 17px;
}

.section-heading p {
  color: #737b84;
}

.section-heading.compact {
  margin-bottom: 0;
}

.save-state {
  color: #2d6b4f;
  font-size: 12px;
}

.load-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.load-item {
  min-width: 0;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid #d8dce0;
  border-left: 4px solid var(--person-color);
  border-radius: 6px;
}

.load-item-head,
.load-item-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.load-item-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.load-item-head span {
  color: #59616a;
  font-size: 12px;
}

.load-item-metrics {
  margin-top: 9px;
  color: #636b74;
  font-size: 12px;
}

.load-bar {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  background: #e8eaed;
  border-radius: 3px;
}

.load-bar > span {
  display: block;
  width: var(--bar-width);
  height: 100%;
  background: var(--person-color);
}

.task-panel {
  margin-top: 18px;
  background: #fff;
  border: 1px solid #d8dce0;
  border-radius: 6px;
}

.task-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid #d8dce0;
}

.filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.search-box {
  width: min(300px, 36vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #bfc5cb;
  border-radius: 6px;
}

.search-box:focus-within {
  border-color: #357c61;
  box-shadow: 0 0 0 2px rgb(53 124 97 / 14%);
}

.search-box svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #707880;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
}

select {
  height: 38px;
  padding: 0 30px 0 10px;
  color: #20242a;
  background: #fff;
  border: 1px solid #bfc5cb;
  border-radius: 6px;
}

select:focus {
  border-color: #357c61;
  outline: 2px solid rgb(53 124 97 / 14%);
}

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

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

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid #e1e4e7;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #4c545d;
  background: #f0f2f3;
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 13px;
}

tbody tr:hover {
  background: #f8faf9;
}

tbody tr[data-assigned="true"] {
  background: #fbfcfb;
}

.rank-column {
  width: 54px;
  text-align: center;
}

.description-column {
  width: 240px;
}

.date-column {
  width: 100px;
}

.time-column {
  width: 78px;
}

.number-column {
  width: 70px;
  text-align: right;
}

.assignee-column {
  width: 150px;
}

.event-id {
  color: #155f8a;
  font-weight: 700;
}

.event-description {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-meta {
  display: none;
}

.metric-number {
  display: block;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.deadline-date,
.deadline-time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.deadline-date.today,
.deadline-time.today {
  color: #9a3e24;
  font-weight: 700;
}

.deadline-date.later,
.deadline-time.later {
  color: #2f6fa5;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.super {
  color: #8f1f19;
  background: #f8d6d3;
}

.badge.high {
  color: #875614;
  background: #fae9bd;
}

.badge.medium {
  color: #185b73;
  background: #d8edf3;
}

.badge.normal {
  color: #3d6251;
  background: #dfece5;
}

.recommendation {
  color: #5c646d;
  font-size: 12px;
}

.recommendation strong {
  color: #252a30;
  font-weight: 700;
}

.assignee-select {
  width: 100%;
  min-width: 132px;
}

.assignee-select.assigned {
  color: #1f5f45;
  border-color: #7eb29d;
  background: #f2f8f5;
  font-weight: 700;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #6a727b;
}

.empty-state svg {
  width: 28px;
  height: 28px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  color: #fff;
  background: #20242a;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .summary-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-item:nth-child(3) {
    border-right: 0;
  }

  .summary-item:nth-child(-n + 3) {
    border-bottom: 1px solid #e1e4e7;
  }

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

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

  .filters {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-box {
    width: min(100%, 380px);
  }
}

@media (max-width: 620px) {
  .app-header {
    padding: 10px 12px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  h1 {
    font-size: 17px;
  }

  .brand p {
    font-size: 11px;
  }

  .header-actions {
    gap: 5px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  main {
    padding: 12px 10px 24px;
  }

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

  .summary-item,
  .summary-item:nth-child(3) {
    border-right: 1px solid #e1e4e7;
    border-bottom: 1px solid #e1e4e7;
  }

  .summary-item:nth-child(even) {
    border-right: 0;
  }

  .summary-item:last-child {
    border-bottom: 0;
  }

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

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }

  .filters select {
    width: 100%;
  }

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

  table {
    min-width: 0;
    table-layout: auto;
  }

  thead {
    display: none;
  }

  tbody {
    display: block;
  }

  tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    grid-template-areas:
      "event assignee"
      "description assignee";
    gap: 4px 10px;
    min-height: 84px;
    padding: 11px 10px;
    border-bottom: 1px solid #d8dce0;
  }

  tbody tr:hover {
    background: #f8faf9;
  }

  tbody td {
    padding: 0;
    border-bottom: 0;
  }

  tbody .rank-column,
  tbody .desktop-detail {
    display: none;
  }

  .event-cell {
    grid-area: event;
    align-self: end;
  }

  .description-cell-body {
    grid-area: description;
    min-width: 0;
  }

  .event-description {
    overflow: visible;
    color: #262b31;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
  }

  .mobile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 5px;
    color: #65707a;
    font-size: 11px;
    line-height: 1.3;
  }

  .mobile-meta .urgent {
    color: #9a3e24;
    font-weight: 700;
  }

  .mobile-meta .later {
    color: #2f6fa5;
    font-weight: 700;
  }

  .assignee-cell {
    grid-area: assignee;
    align-self: center;
  }

  .assignee-select {
    min-width: 0;
    height: 40px;
    padding-right: 24px;
    font-size: 13px;
  }
}
