:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #20252a;
  --muted: #67727d;
  --line: #d9dfd7;
  --panel: #ffffff;
  --brand: #176c72;
  --brand-dark: #0d4f55;
  --accent: #b64e32;
  --soft: #e8f2ee;
  --archived: #eef0f3;
  --shadow: 0 18px 45px rgba(32, 37, 42, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1.04;
}

h2 {
  font-size: 20px;
}

.today-pill {
  min-width: 164px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.summary-band {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.summary-item {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-item span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.summary-item strong {
  display: block;
  color: var(--brand-dark);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.entry-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entry-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 108, 114, 0.14);
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--accent);
  font-size: 14px;
}

.primary-button,
.day-button,
.icon-button,
.tab {
  border: 0;
  cursor: pointer;
}

.primary-button {
  min-height: 46px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

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

.list-panel {
  min-width: 0;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.tab {
  min-width: 92px;
  min-height: 38px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.is-active {
  background: var(--soft);
  color: var(--brand-dark);
}

.table-wrap {
  position: relative;
  min-height: 320px;
  overflow-x: auto;
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

td {
  font-size: 15px;
}

.name-cell {
  font-weight: 800;
}

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

.cost-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 800;
  white-space: nowrap;
}

.archived-row .cost-chip {
  background: var(--archived);
  color: var(--muted);
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 156px;
}

.day-button {
  min-width: 50px;
  height: 34px;
  border-radius: 7px;
  padding: 0 8px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.day-button:hover {
  background: #d8ebe4;
}

.day-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  background: #f4e7e2;
  color: var(--accent);
}

.empty-state {
  display: none;
  padding: 84px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 24px, 620px);
    padding-top: 20px;
  }

  .topbar,
  .workspace,
  .summary-band {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .today-pill {
    width: fit-content;
  }
}

@media (max-width: 520px) {
  .date-grid {
    grid-template-columns: 1fr;
  }

  .summary-item {
    min-height: 88px;
  }
}
