:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #d6dde5;
  --group-bg: #ebeff3;
  --tab-bg: #eef2f7;
  --tab-active: #1f6feb;
  --tab-active-text: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: 1.3rem;
}

.date {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.tab {
  border: 1px solid var(--border);
  background: var(--tab-bg);
  color: #334155;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: var(--tab-active);
  border-color: var(--tab-active);
  color: var(--tab-active-text);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: auto;
  max-height: calc(100vh - 150px);
}

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

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
  font-size: 0.88rem;
}

th:nth-child(1),
th:nth-child(2),
td:nth-child(1),
td:nth-child(2) {
  text-align: left;
}

tbody tr:hover td {
  background-image: linear-gradient(rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.04));
}

tr.group-row td {
  font-weight: 900;
  background: #eef2ff;
  color: #111827;
  text-align: left;
  border-top: 3px solid #94a3b8;
  border-bottom: 1px solid #cfd8e3;
  letter-spacing: 0.6px;
}

.num-empty {
  color: #9ca3af;
  background: #f8fafc;
}

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

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