:root {
  color: #202820;
  background: #eef1ed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  background: #26391f;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
}

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

.secondaryButton {
  background: #e8ece6;
  color: #26391f;
}

.authGate {
  align-items: center;
  background: #eef1ed;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.authPanel {
  background: #fff;
  border: 1px solid #d4dbd2;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgb(31 44 33 / 12%);
  margin: 0 auto;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.authPanel p {
  color: #687465;
  line-height: 1.5;
}

.appleButton {
  background: #111;
  margin-top: 10px;
  width: 100%;
}

.authMessage {
  min-height: 22px;
}

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px;
}

.topbar,
.panelHeader,
.sectionHeader {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

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

.signedInUser {
  color: #687465;
  font-size: 12px;
  font-weight: 800;
}

.eyebrow {
  color: #687465;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 18px;
}

.summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0 16px;
}

.summary article,
.chartPanel,
.listPanel,
.detailPanel {
  background: #fff;
  border: 1px solid #d4dbd2;
  border-radius: 8px;
}

.summary article {
  padding: 16px;
}

.summary span,
.muted {
  color: #687465;
  font-size: 13px;
  font-weight: 800;
}

.summary strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

.analytics {
  margin-bottom: 16px;
}

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

.chartPanel {
  min-height: 250px;
  padding: 16px;
}

.chartPanel.wide {
  grid-column: span 2;
}

.barChart,
.driverList,
.timelineChart {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.barRow {
  display: grid;
  gap: 8px;
}

.barLabel {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.barLabel strong,
.driverRow span {
  color: #202820;
  font-size: 13px;
}

.barLabel span,
.monthColumn span {
  color: #687465;
  font-size: 12px;
  font-weight: 800;
}

.stackBar {
  background: #e8ece6;
  border-radius: 999px;
  display: flex;
  height: 12px;
  overflow: hidden;
}

.expenseBar {
  background: #b84c4c;
}

.saleBar {
  background: #2f7d59;
}

.donutPanel {
  align-items: center;
  display: grid;
  gap: 18px;
  justify-items: center;
  margin-top: 18px;
}

.donut {
  align-items: center;
  background: conic-gradient(#2f7d59 0 var(--business-share), #4078a6 var(--business-share) 100%);
  border-radius: 50%;
  display: grid;
  height: 150px;
  justify-items: center;
  position: relative;
  width: 150px;
}

.donut::after {
  background: #fff;
  border-radius: 50%;
  content: "";
  height: 98px;
  position: absolute;
  width: 98px;
}

.donut strong,
.donut span {
  position: relative;
  z-index: 1;
}

.donut strong {
  align-self: end;
  font-size: 28px;
}

.donut span {
  align-self: start;
  color: #687465;
  font-size: 12px;
  font-weight: 900;
}

.splitLegend {
  display: grid;
  gap: 8px;
  width: 100%;
}

.splitLegend span {
  align-items: center;
  color: #44503e;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  justify-content: space-between;
}

.legendDot {
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.businessDot {
  background: #2f7d59;
}

.personalDot {
  background: #4078a6;
}

.timelineChart {
  align-items: end;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 170px;
}

.monthColumn {
  align-items: center;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.netTrack {
  align-items: end;
  background: #e8ece6;
  border-radius: 999px;
  display: flex;
  height: 110px;
  overflow: hidden;
  width: 18px;
}

.netTrack span {
  border-radius: 999px;
  display: block;
  width: 100%;
}

.positiveNet {
  background: #2f7d59;
}

.negativeNet {
  background: #b84c4c;
}

.driverRow {
  align-items: center;
  border-bottom: 1px solid #e8ece6;
  display: flex;
  justify-content: space-between;
  min-height: 34px;
}

.positiveText {
  color: #2f7d59;
}

.negativeText {
  color: #b84c4c;
}

.workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: 380px minmax(0, 1fr);
}

.listPanel,
.detailPanel {
  min-height: 520px;
  padding: 16px;
}

.entryList {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.entryButton {
  background: #f8faf7;
  border: 1px solid #d4dbd2;
  border-radius: 8px;
  color: #202820;
  padding: 12px;
  text-align: left;
}

.entryButton.active {
  border-color: #2f7d59;
  box-shadow: inset 4px 0 0 #2f7d59;
}

.entryButton strong,
.entryButton span {
  display: block;
}

.entryButton span {
  color: #687465;
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
}

.entryForm {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.fieldGrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: #44503e;
  display: grid;
  font-size: 13px;
  font-weight: 900;
  gap: 6px;
}

input,
select,
textarea {
  background: #f8faf7;
  border: 1px solid #d4dbd2;
  border-radius: 8px;
  color: #202820;
  min-height: 42px;
  padding: 9px 10px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.lineItems {
  display: grid;
  gap: 10px;
}

.lineItem {
  background: #f8faf7;
  border: 1px solid #d4dbd2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

@media (max-width: 860px) {
  .summary,
  .analyticsGrid,
  .workspace,
  .fieldGrid {
    grid-template-columns: 1fr;
  }

  .chartPanel.wide {
    grid-column: auto;
  }

  .timelineChart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
