:root {
  color-scheme: light;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #eef3ef;
  color: #17231d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f7faf7 0%, #e8f0eb 100%);
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: #4c6658;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

.tax-pill {
  border: 1px solid #b7d4c0;
  background: #f8fff9;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  color: #244b34;
  white-space: nowrap;
}

.page-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #cde0d3;
  border-radius: 999px;
  background: #ffffff;
  padding: 5px;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #244b34;
  font-weight: 800;
  text-decoration: none;
}

.page-nav a.active {
  background: #17643a;
  color: #ffffff;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 35, 29, 0.08);
  padding: 18px;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  font-size: 13px;
  font-weight: 700;
  color: #43564b;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid #cbd8d0;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 16px;
  background: #fffbea;
  color: #17231d;
}

input:focus,
select:focus {
  outline: 3px solid #c7ead2;
  border-color: #4e9c67;
}

button {
  height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 22px;
  background: #17643a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  background: #7b9084;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.summary-grid div {
  background: #ffffff;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  padding: 16px;
}

.summary-grid span {
  display: block;
  color: #5e7166;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.summary-grid strong {
  font-size: 24px;
}

.status {
  min-height: 24px;
  margin: 14px 0 0;
  font-weight: 700;
  color: #43564b;
}

.status.success {
  color: #17643a;
}

.status.error {
  color: #a43c26;
}

.dashboard {
  margin-top: 24px;
}

.standalone-dashboard {
  margin-top: 0;
}

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

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

h2 {
  font-size: 28px;
}

.secondary-button {
  height: 40px;
  border: 1px solid #b7d4c0;
  background: #f8fff9;
  color: #17643a;
  padding: 0 16px;
}

.dashboard-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.compact-select {
  min-width: 140px;
}

.compact-select select {
  height: 40px;
  background: #ffffff;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-cards div,
.table-card {
  background: #ffffff;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 35, 29, 0.06);
}

.dashboard-cards div {
  padding: 16px;
}

.dashboard-cards span {
  display: block;
  color: #5e7166;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.dashboard-cards strong {
  font-size: 24px;
}

.table-card {
  overflow: hidden;
}

.table-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #e5eee8;
}

.table-title span {
  color: #5e7166;
  font-size: 13px;
  font-weight: 700;
}

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

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

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #edf3ef;
  white-space: nowrap;
}

th {
  background: #f3f8f4;
  color: #43564b;
  font-size: 13px;
}

td {
  font-size: 14px;
}

@media (max-width: 980px) {
  .entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  button {
    grid-column: 1 / -1;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 520px);
    margin: 18px auto;
  }

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

  .page-nav {
    width: 100%;
  }

  .page-nav a {
    flex: 1;
  }

  .entry-form,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-heading,
  .table-title {
    align-items: start;
    flex-direction: column;
  }

  .dashboard-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .secondary-button {
    width: 100%;
  }
}
