:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --panel-soft: #fbfaf7;
  --line: #e6e1d8;
  --text: #22201d;
  --muted: #766f67;
  --blue: #3458db;
  --teal: #008575;
  --green: #1f7a4b;
  --gold: #b77900;
  --clay: #9b6f64;
  --red: #d61f3c;
  --shadow: 0 16px 42px rgba(54, 48, 38, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 18px 28px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logout-form {
  margin-left: auto;
}

.account-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.account-actions .logout-form {
  margin-left: 0;
}

.user-avatar {
  align-items: center;
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 36px;
  justify-content: center;
  letter-spacing: 0;
  min-width: 36px;
  padding: 0 9px;
}

.crumb {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0;
  margin: 0;
}

.app-version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin: 4px 0 0;
}

h2 {
  font-size: 17px;
  margin-bottom: 16px;
}

.filters label,
.bill-form label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  min-height: 36px;
  padding: 8px 10px;
}

button,
.form-actions a,
.detail-actions a,
.detail-header a,
.row-actions a,
.tabs a,
.filters a {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
}

button:hover,
a:hover {
  border-color: #c9beb1;
}

main {
  padding: 22px 28px 40px;
}

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

.summary-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 15px 16px;
}

.summary-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 8px;
}

.summary-grid strong {
  font-size: 25px;
  letter-spacing: 0;
}

.tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}

.tabs a {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: transparent;
  color: var(--muted);
  min-width: 86px;
}

.tabs a.active {
  background: var(--panel);
  border-color: var(--line);
  border-bottom-color: var(--panel);
  color: var(--text);
  margin-bottom: -1px;
}

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

.content-panel,
.detail-panel,
.settings-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bill-form {
  display: grid;
  gap: 12px;
}

.checkline {
  align-items: center;
  display: flex !important;
  flex-direction: row;
  font-size: 14px !important;
}

.checkline input {
  min-height: auto;
}

.form-actions {
  display: flex;
  gap: 8px;
}

.form-actions button {
  background: var(--text);
  color: #fff;
  flex: 1;
}

.detail-panel {
  margin: 0 auto;
  max-width: 840px;
  padding: 22px;
}

.detail-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.detail-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.detail-header h2 {
  font-size: 24px;
  margin: 0;
}

.detail-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.variable-toggle-line {
  margin-top: -2px;
}

.variable-bill-fields {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.variable-payment-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.variable-payment-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.small-add-button,
.remove-variable-button {
  font-size: 16px;
  height: 34px;
  min-height: 34px;
  min-width: 38px;
  padding: 4px 10px;
}

.small-add-button {
  background: var(--text);
  color: #fff;
}

.variable-payment-rows {
  display: grid;
  gap: 10px;
}

.variable-payment-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.45fr) auto;
}

.remove-variable-button {
  color: var(--red);
}

.span-2 {
  grid-column: 1 / -1;
}

.detail-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
}

.detail-actions button {
  background: var(--text);
  color: #fff;
  min-width: 150px;
}

.secondary-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
}

.secondary-actions form {
  margin: 0;
}

.archive-button {
  color: var(--gold);
}

.delete-button {
  color: var(--red);
}

.log-panel {
  max-width: 920px;
}

.log-form {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.log-list {
  display: grid;
  gap: 10px;
}

.log-entry {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.log-entry div {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.log-entry span,
.log-entry p,
.empty-state {
  color: var(--muted);
}

.log-entry p {
  margin: 0;
}

.settings-shell {
  padding: 22px;
}

.settings-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.settings-page-card {
  background: #fff;
  margin-top: 14px;
  max-width: 980px;
}

.settings-card h3 {
  font-size: 17px;
  margin-bottom: 14px;
}

.settings-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.settings-tabs a {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  font-weight: 750;
  min-height: 36px;
  padding: 8px 12px;
}

.settings-tabs a.active {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  margin-bottom: -1px;
}

.option-manager {
  display: grid;
  gap: 16px;
}

.settings-form,
.compact-form {
  display: grid;
  gap: 10px;
}

.settings-form label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
}

.settings-form textarea {
  min-height: 84px;
  resize: vertical;
}

.security-mini-panel {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

.security-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  margin: 0;
  padding: 10px 12px;
}

.security-status.is-enabled {
  background: #f1f7ee;
  border-color: #cfe6c8;
  color: #24552a;
}

.security-status.is-pending {
  background: #fff8e8;
  border-color: #ead59a;
  color: #705000;
}

.recovery-codes-box {
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  padding: 12px;
}

.recovery-code {
  background: #fff;
  border: 1px solid #d8d2c8;
  border-radius: 6px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
  padding: 8px;
  text-align: center;
}

.security-settings {
  display: grid;
  gap: 22px;
}

.security-grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 900px;
}

.security-grid-form .span-2,
.security-grid-form .security-switches {
  grid-column: 1 / -1;
}

.security-switches {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
}

.security-log-panel {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.security-event-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.security-event-row strong {
  text-transform: capitalize;
}

.security-event-row span,
.security-event-row p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.login-body {
  align-items: center;
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  padding: 20px;
}

.login-shell {
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
}

.login-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(34, 32, 29, 0.08);
  display: grid;
  gap: 14px;
  padding: 24px;
}

.login-panel h1 {
  font-size: 28px;
  margin: 0;
}

.login-copy,
.login-message {
  color: var(--muted);
  margin: 0;
}

.login-message {
  background: #f1f7ee;
  border: 1px solid #cfe6c8;
  border-radius: 8px;
  color: #24552a;
  padding: 10px 12px;
}

.security-honeypot {
  height: 0;
  left: -9999px;
  overflow: hidden;
  position: absolute;
}

.option-toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  max-width: 900px;
}

.inline-add {
  align-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 52px auto;
  max-width: 560px;
  padding: 8px;
}

.option-save-button {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  min-width: 136px;
}

.settings-list {
  display: grid;
  gap: 10px;
  max-width: 900px;
}

.option-order-form,
.option-save-form {
  display: none;
}

.sortable-list {
  user-select: none;
}

.settings-row {
  align-items: center;
  background: linear-gradient(180deg, #fff 0%, #fdfcf9 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding: 11px 12px;
}

.settings-row.dragging {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(52, 88, 219, 0.14);
  opacity: 0.62;
}

.user-marker {
  align-items: center;
  background: #ede8dd;
  border-radius: 999px;
  color: #4a443c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.drag-handle {
  align-items: center;
  align-self: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: grab;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  min-width: 32px;
  padding: 0;
}

.drag-handle::before {
  background:
    radial-gradient(circle, #a79f94 1.5px, transparent 2px) 0 0 / 7px 7px,
    radial-gradient(circle, #a79f94 1.5px, transparent 2px) 3.5px 0 / 7px 7px;
  content: "";
  height: 21px;
  opacity: 0.82;
  width: 16px;
}

.drag-handle:hover {
  background: #f4f1eb;
}

.drag-handle:active {
  cursor: grabbing;
}

.option-edit-form {
  align-items: center;
  display: grid;
  flex: 1;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) 220px;
}

.option-edit-form label {
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
}

.option-edit-form label:first-of-type span {
  align-items: center;
  color: var(--green);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  gap: 6px;
  text-transform: uppercase;
}

.option-edit-form label:first-of-type span::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 7px;
  width: 7px;
}

.option-edit-form input {
  border-color: #ded6ca;
  font-weight: 700;
}

.option-row-actions {
  display: flex;
  gap: 6px;
}

.settings-row .option-row-actions {
  display: flex;
}

.color-edit {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 44px minmax(0, 1fr);
}

input[type="color"] {
  cursor: pointer;
  height: 36px;
  min-height: 36px;
  padding: 2px;
  width: 44px;
}

.settings-row div {
  display: grid;
  gap: 2px;
}

.settings-row span {
  color: var(--muted);
  font-size: 12px;
}

.settings-row form {
  margin: 0;
}

.settings-row button,
.inline-add button,
.settings-form button {
  min-height: 32px;
  padding: 6px 10px;
}

.settings-row button {
  background: #fff;
}

.settings-row .delete-button {
  border-color: #f1c7cf;
  background: #fff8fa;
}

.icon-action-button,
.icon-delete-button {
  min-width: 36px;
  padding: 6px;
}

.ysp-svg-icon {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  display: inline-block;
  height: 18px;
  transition: transform 140ms ease;
  width: 18px;
}

.ysp-icon-edit {
  background-image: url("/assets/edit-icon.svg");
}

.ysp-icon-duplicate {
  background-image: url("/assets/duplicate-icon.svg");
}

.ysp-icon-delete {
  background-image: url("/assets/trash-icon.svg");
}

.icon-action-button:hover .ysp-svg-icon,
.icon-delete-button:hover .ysp-svg-icon {
  transform: scale(1.12);
}

.content-panel {
  overflow: hidden;
}

.filters {
  align-items: end;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
}

.filters label {
  min-width: 120px;
}

.filter-actions {
  align-items: end;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.filter-actions label {
  min-width: 280px;
}

.search-control {
  display: block;
  position: relative;
}

.filter-actions input {
  padding-right: 38px;
  width: 100%;
}

.search-clear-button {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  height: 26px;
  min-height: 26px;
  padding: 0;
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
}

.search-clear-button:hover {
  background: #eee9e2;
  color: var(--text);
}

.primary-action {
  background: var(--text) !important;
  border-color: var(--text) !important;
  color: #fff !important;
  min-width: 112px;
}

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

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

th,
td {
  border-bottom: 1px solid #eee9e2;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

td:first-child {
  min-width: 420px;
  width: 420px;
}

tr.is-late td:nth-child(2) {
  color: var(--red);
  font-weight: 750;
}

.dot {
  background: var(--blue);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px currentColor;
  color: var(--blue);
  display: inline-block;
  height: 10px;
  margin-right: 12px;
  width: 10px;
}

.dot.kingsbury,
.dot.freedom {
  background: var(--clay);
  color: var(--clay);
}

.pill {
  border-radius: 7px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 22px;
  padding: 3px 8px;
}

.inline-table-edit {
  margin: 0;
  position: relative;
}

.inline-date-edit {
  margin: 0;
}

.inline-amount-edit {
  margin: 0;
}

.inline-name-edit {
  display: inline-block;
  margin: 0;
  max-width: 100%;
  vertical-align: middle;
}

.inline-name-edit input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  min-height: 30px;
  min-width: 340px;
  padding: 4px 7px;
  width: 100%;
}

.inline-name-edit input:hover {
  background: #fff;
  border-color: #ded6ca;
}

.inline-name-edit input:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(52, 88, 219, 0.12);
  outline: none;
}

.inline-amount-wrap {
  align-items: center;
  background: #fff;
  border: 1px solid #ded6ca;
  border-radius: 7px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  padding: 0 8px;
  width: 104px;
}

.inline-amount-wrap span {
  color: var(--muted);
  line-height: 1;
}

.inline-amount-wrap input {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  padding: 0 0 0 3px;
  width: 100%;
}

.inline-amount-wrap input:focus {
  outline: none;
}

.inline-amount-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(52, 88, 219, 0.12);
}

.inline-date-input {
  background: #fff;
  border-color: #ded6ca;
  border-radius: 7px;
  color: var(--text);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  justify-content: space-between;
  min-height: 30px;
  min-width: 188px;
  padding: 5px 8px;
  text-align: left;
}

tr.is-late .inline-date-input {
  background: #fff5f5;
  border-color: #f0b6c0;
  color: var(--red);
}

.inline-date-text {
  line-height: 1.15;
}

.inline-date-past {
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  margin-top: 2px;
}

.budget-date-picker-calendar {
  background: #fff;
  border: 1px solid #d7cec2;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(34, 32, 29, 0.22);
  padding: 12px;
  position: fixed;
  width: min(320px, calc(100vw - 32px));
  z-index: 240;
}

.budget-date-picker-head {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  margin-bottom: 10px;
}

.budget-date-picker-head button,
.budget-date-picker-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-weight: 800;
  min-height: 34px;
}

.budget-date-picker-head input {
  min-height: 34px;
  width: 100%;
}

.budget-date-picker-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(7, 1fr);
}

.budget-date-picker-dow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.budget-date-picker-day {
  cursor: pointer;
  padding: 0;
}

.budget-date-picker-day.is-muted {
  opacity: 0.38;
}

.budget-date-picker-day:hover {
  border-color: #c9beb1;
}

.budget-date-picker-day.is-selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.inline-selector-button {
  justify-content: space-between;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  min-width: 128px;
  padding: 4px 28px 4px 9px;
  position: relative;
}

.inline-selector-button::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-40%);
}

.inline-selector-status {
  background: #eef3ff;
  border-color: #cdd8ff;
  color: #2445bf;
}

.inline-selector-method {
  background: #dff5ee;
  border-color: #bce8dc;
  color: #007465;
}

.inline-selector-managed {
  background: #e8f5ec;
  border-color: #cbe9d5;
  color: #235d3c;
}

.inline-selector-filter {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  min-height: 36px;
  min-width: 120px;
  width: var(--selector-width, 120px);
}

.filter-selector {
  display: inline-block;
  position: relative;
  width: var(--selector-width, 120px);
}

.detail-selector {
  display: block;
  position: relative;
  width: 100%;
}

.inline-selector-detail,
.detail-date-input {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  min-height: 36px;
  width: 100%;
}

.inline-selector-button.needs-value {
  background: #fff5f5;
  border-color: #f0b6c0;
  color: var(--red);
}

.inline-selector-menu {
  background: #fff;
  border: 1px solid #d7cec2;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(34, 32, 29, 0.18);
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  position: fixed;
  z-index: 200;
}

.inline-selector-menu.is-open {
  display: grid;
  gap: 2px;
}

.inline-selector-menu button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 750;
  justify-content: flex-start;
  min-height: 30px;
  padding: 6px 9px;
  text-align: left;
  width: 100%;
}

.inline-selector-menu button:hover,
.inline-selector-menu button.selected {
  background: #eef3ff;
  color: #2445bf;
}

.status-monthly {
  background: #d9e2ff;
  color: #2445bf;
}

.status-annually {
  background: #d8c5bd;
  color: #65443a;
}

.status-new,
.status-3-monthly,
.status-one-time {
  background: #ffe08a;
  color: #6f4700;
}

.method {
  background: #d9f2ea;
  color: #007465;
}

.managed-personal {
  background: #dff5e8;
  color: #235d3c;
}

.managed-yummy {
  background: #f7d8c2;
  color: #794d31;
}

.managed-freedom {
  background: #dbe4ff;
  color: #314a98;
}

.managed-kingsbury {
  background: #f7e6bd;
  color: #76520b;
}

.state-active {
  background: #e5f6df;
  color: var(--green);
}

.state-inactive {
  background: #eee9e2;
  color: var(--muted);
}

.funded {
  color: var(--muted);
  min-width: 72px;
}

.funded.yes {
  background: #e5f6df;
  border-color: #bddfb0;
  color: var(--green);
}

.row-actions {
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}

.row-actions form {
  display: inline-flex;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.row-actions > a {
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.row-actions > :last-child {
  margin-right: 0;
}

.row-actions button,
.row-actions a {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 9px;
}

.calendar-toolbar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(96px, 1fr) auto minmax(96px, 1fr);
  padding: 16px 16px 0;
}

.calendar-title {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.calendar-nav-link {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  text-decoration: none;
}

.calendar-nav-link:last-child {
  justify-self: end;
}

.calendar-nav-link:hover {
  background: #f5f2ed;
  border-color: #d4cbc0;
}

.calendar-nav-link.is-disabled {
  color: transparent;
  pointer-events: none;
}

.calendar-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  padding: 14px;
}

.weekday,
.day {
  background: #fff;
  border: 1px solid var(--line);
  min-height: 94px;
  padding: 9px;
}

.weekday {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
}

.day {
  display: grid;
  gap: 5px;
  align-content: start;
}

.day.today {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.day.muted {
  background: #f5f2ed;
}

.calendar-bill-link {
  background: #eef4ff;
  border-radius: 6px;
  color: #244078;
  display: block;
  font-size: 11px;
  padding: 4px 5px;
}

.calendar-bill-link:hover {
  background: #dde8ff;
  border-color: transparent;
}

.toast {
  animation: toast-in 180ms ease-out, toast-out 280ms ease-in 4.2s forwards;
  background: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  bottom: 22px;
  box-shadow: 0 18px 44px rgba(34, 32, 29, 0.22);
  color: #fff;
  font-weight: 750;
  max-width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  position: fixed;
  right: 22px;
  z-index: 100;
}

.confirm-open {
  overflow: hidden;
}

.confirm-overlay {
  align-items: center;
  background: rgba(34, 32, 29, 0.46);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 300;
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-dialog {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(34, 32, 29, 0.28);
  display: grid;
  gap: 12px;
  max-width: 420px;
  padding: 22px;
  width: min(100%, 420px);
}

.confirm-dialog h2 {
  font-size: 20px;
  margin: 0;
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.confirm-cancel {
  background: #fff;
}

.confirm-continue {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
    visibility: hidden;
  }
}

@media (max-width: 980px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

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

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

  .detail-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .filters {
    display: grid;
  }

  .filter-actions {
    display: grid;
    margin-left: 0;
  }

  .filter-actions label {
    min-width: 0;
  }

  .detail-header,
  .detail-actions,
  .secondary-actions {
    align-items: stretch;
    display: grid;
  }

  .inline-add,
  .option-toolbar,
  .option-edit-form,
  .option-row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-row {
    align-items: start;
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .settings-row .option-row-actions {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
