/* Bookify layout; financial table spacing, borders, selection and budget summary
   adapted from the MIT source table.tsx / EnvelopeBudgetComponents.tsx. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  color: var(--color-pageText, #172235);
  font:
    15px/1.5 system-ui,
    sans-serif;
}
main {
  max-width: 1220px;
  margin: auto;
  padding: 24px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.8px;
  margin: 4px 0;
}
h2 {
  font-size: 23px;
  margin: 0 0 15px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 17px;
  margin: 0 0 10px;
}
p {
  margin: 8px 0 15px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 1.7px;
  color: #6552a3;
  margin: 0;
}
.privacy {
  font-size: 13px;
  color: #536177;
  padding-bottom: 20px;
  border-bottom: 1px solid #d9e2ec;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.file {
  border: 1px solid #c8cddd;
  background: #fff;
  color: #273149;
  border-radius: 6px;
  padding: 9px 13px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
button:hover,
.file:hover {
  background: #f5f2fc;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.file:focus-within {
  outline: 3px solid #ad98ef;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button.primary {
  background: #6552a3;
  color: white;
  border-color: #6552a3;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.file {
  position: relative;
  display: inline-flex;
}
.file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 20px 0 26px;
}
nav button {
  border: 0;
  background: #f2f4f8;
}
nav button[aria-current="page"] {
  background: #6552a3;
  color: white;
}
.panel {
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  padding: 20px;
  margin: 18px 0;
  min-width: 0;
}
.panel.purple {
  background: #f7f5fc;
  border-color: #d7cdec;
}
.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.value {
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #6552a3;
}
.negative {
  color: #a22b40;
}
.muted {
  color: #536177;
  font-size: 13px;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #bec7d2;
  border-radius: 5px;
  background: white;
  color: #172235;
}
textarea {
  min-height: 75px;
}
label.check {
  flex-direction: row;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
input[type="month"],
input[type="date"] {
  min-height: 41px;
}
fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #d9e2ec;
  text-align: left;
  vertical-align: middle;
}
th {
  font-size: 12px;
  color: #536177;
  background: #f6f8fa;
  white-space: nowrap;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td button {
  font-size: 12px;
  padding: 5px 8px;
}
tr:has(input:checked) {
  background: #f0ebfb;
}
td input[type="checkbox"] {
  vertical-align: middle;
}
.scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 16px 0;
}
.scroll table {
  min-width: 580px;
}
.badge {
  display: inline-block;
  border-radius: 4px;
  padding: 3px 7px;
  background: #e8ecf0;
  font-size: 12px;
}
.notice {
  padding: 12px;
  border-radius: 6px;
  background: #eef6f0;
  margin: 14px 0;
  overflow-wrap: anywhere;
}
.notice.error {
  background: #fff0f2;
  color: #8e2236;
}
.compact {
  max-width: 820px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
details {
  margin: 16px 0;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
.progress {
  height: 8px;
  background: #e8ecf0;
  border-radius: 4px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: #6552a3;
}
.day {
  padding: 12px 0;
  border-bottom: 1px solid #d9e2ec;
}
.day h3 {
  font-size: 15px;
}
.day p {
  margin: 3px 0;
}
.empty {
  padding: 36px 20px;
  background: #f8f9fc;
  text-align: center;
  border-radius: 10px;
}
.report {
  overflow-wrap: anywhere;
}
.report table {
  min-width: 620px;
}
a {
  color: #594390;
}
small {
  display: block;
}
#restore-preview:empty,
#notice:empty {
  display: none;
}
@media (max-width: 650px) {
  main {
    padding: 16px;
  }
  header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  h1 {
    font-size: 26px;
  }
  .fields,
  .two {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 15px;
  }
  header .actions {
    width: 100%;
  }
  header button,
  header .file {
    flex: 1 1 125px;
    text-align: center;
    justify-content: center;
  }
  nav {
    gap: 7px;
  }
  nav button {
    font-size: 12px;
    padding: 8px 10px;
  }
  td,
  th {
    padding: 9px;
  }
  .value {
    font-size: 25px;
  }
}
progress {
  width: 100%;
  height: 9px;
  accent-color: #6552a3;
}
