:root {
  --bg-1: #f1efe8;
  --bg-2: #dce7df;
  --ink: #1f2d2f;
  --ink-soft: #526466;
  --surface: #ffffff;
  --surface-alt: #f7f8f5;
  --stroke: #d4d8d1;
  --accent: #b64f2e;
  --accent-soft: #f3e0d8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.55), transparent 35%),
    radial-gradient(circle at 90% 15%, rgba(182, 79, 46, 0.16), transparent 40%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
  min-height: 100%;
}

.page {
  width: min(98vw, 2200px);
  margin: 0 auto;
  padding: 24px 16px 20px;
}

.hero {
  padding: 18px 2px 14px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1;
  color: #1e3436;
}

.subtitle {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.panel {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.83);
  backdrop-filter: blur(3px);
  overflow: hidden;
  box-shadow: 0 14px 38px rgba(25, 36, 36, 0.1);
}

.panel + .panel {
  margin-top: 14px;
}

.panel-top {
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(241, 238, 230, 0.88));
}

.panel-title {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: #223739;
}

.summary {
  font-size: 13px;
  color: #2e4244;
}

.summary.error {
  color: #8f241f;
  font-weight: 600;
}

.legend {
  margin-top: 6px;
  font-size: 12px;
  color: #415558;
}

.panel-actions {
  margin-top: 8px;
}

.date-filter {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.date-filter label {
  font-size: 12px;
  font-weight: 600;
  color: #2f4143;
}

.date-filter input[type='date'] {
  border: 1px solid #b9c2b8;
  border-radius: 8px;
  background: #ffffff;
  color: #233537;
  padding: 5px 8px;
  font-size: 12px;
}

.filter-status {
  margin-top: 6px;
  font-size: 12px;
  color: #3b5154;
}

.filter-status.error {
  color: #8f241f;
  font-weight: 600;
}

.panel-actions .action-btn + .action-btn {
  margin-left: 8px;
}

.action-btn {
  border: 1px solid #b8c2b5;
  background: #f8f7f1;
  color: #25383a;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.action-btn:hover:not(:disabled) {
  background: #efeade;
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.multiplier-controls {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.multiplier-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #d0d6cd;
  border-radius: 8px;
  background: #f8f7f1;
  font-size: 12px;
}

.multiplier-item label {
  font-weight: 600;
  color: #2d3f41;
}

.multiplier-item input {
  width: 88px;
  border: 1px solid #c0c8bc;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  color: #243537;
  background: #ffffff;
}

.table-wrap {
  overflow: auto;
  max-height: 78vh;
}

.table-wrap.compact {
  max-height: 58vh;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

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

th,
td {
  border-right: 1px solid #e2e5df;
  border-bottom: 1px solid #ecefe9;
  font-size: 12px;
  line-height: 1.2;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

th.meta-col,
td.meta-col {
  background: var(--surface-alt);
}

th.sortable-col {
  cursor: pointer;
  user-select: none;
}

th.sortable-col:hover {
  background: #ece6d8;
}

td.meta-col {
  font-weight: 600;
  color: #2c3d3f;
}

th.date-col,
td.date-col {
  min-width: 78px;
}

th.count-col,
td.count-col {
  min-width: 64px;
  text-align: center;
}

th.calc-col,
td.calc-col {
  min-width: 86px;
  text-align: right;
}

th.tot-col,
td.tot-col {
  font-weight: 700;
  background: #f5e5dc;
}

.total-row td {
  font-weight: 700;
  background: #ece8dc;
}

tbody tr:nth-child(even) td {
  background: rgba(246, 248, 244, 0.78);
}

tbody tr:hover td {
  background: var(--accent-soft);
}

@media (max-width: 900px) {
  .page {
    width: 100vw;
    padding: 12px 8px 10px;
  }

  th,
  td {
    font-size: 11px;
    padding: 6px 8px;
  }

  .table-wrap {
    max-height: 74vh;
  }

  .date-filter {
    gap: 6px;
  }

  .date-filter input[type='date'] {
    width: 100%;
    max-width: 180px;
  }
}
