:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  --rose-quartz: #f7cac9;
  --serenity: #92a8d1;
  --serenity-strong: #526fa6;
  --ink: #172033;
  --muted: #5f6b7a;
  --panel: #fffefe;
  --line: #d8dfeb;
  background: linear-gradient(135deg, #eef4ff 0%, #dfe9fb 46%, #f7cac9 78%, #92a8d1 100%);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
}

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

.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tabButton {
  background: rgb(255 254 254 / 0.72);
  border: 1px solid var(--line);
  color: #314d81;
}

.tabButton.active {
  background: var(--serenity-strong);
  color: #fff;
}

.tabPanel[hidden] {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
}

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

h3 {
  font-size: 14px;
  margin: 18px 0 10px;
  color: var(--muted);
}

p {
  color: var(--muted);
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
  margin: 0 0 16px;
}

.accountsGrid {
  grid-template-columns: 1fr 1fr;
  margin-top: 0;
}

.singleGrid {
  grid-template-columns: 0.95fr 1.05fr;
}

.panel {
  background: rgb(255 254 254 / 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 28px rgb(82 111 166 / 0.08);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  width: 100%;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--serenity-strong);
  color: white;
  font: inherit;
  font-weight: 700;
  padding: 11px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.ghost {
  background: #eef4ff;
  color: #314d81;
}

.danger {
  background: #b42318;
}

.ok {
  background: #15803d;
}

form button {
  margin-top: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(135deg, rgb(146 168 209 / 0.24), rgb(247 202 201 / 0.12));
}

.stats span {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.reportStats {
  margin-top: 10px;
}

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

.bars {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.notice {
  margin-top: 12px;
  color: #5d4774;
  background: #fff5fb;
  border: 1px solid #efc7dc;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.notice:empty {
  display: none;
}

.miniForm,
.compactList {
  display: grid;
  gap: 10px;
}

.miniForm {
  margin-top: 14px;
}

.compactRow {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #edf1f7;
  padding-top: 10px;
}

.compactRow strong,
.compactRow small {
  display: block;
}

.sectionGap {
  margin-top: 22px;
}

.bar {
  display: grid;
  grid-template-columns: 88px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.bar i {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--serenity), var(--rose-quartz));
}

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

.transaction {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid #edf1f7;
  padding: 10px 0 0;
  text-align: left;
  width: 100%;
  background: transparent;
  color: inherit;
  font-weight: 400;
}

.transaction strong {
  display: block;
}

.pill {
  border-radius: 999px;
  background: #eef4ff;
  color: #314d81;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.pill.warn {
  background: #fff2cc;
  color: #7a4b00;
}

.amount {
  font-weight: 800;
}

.iconButton {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
}

.listActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

dialog {
  width: min(680px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgb(23 32 51 / 0.35);
}

.editorForm {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .shell { padding: 16px; }
  .grid,
  .accountsGrid,
  .singleGrid,
  .topbar,
  .row,
  .listHead {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .transaction {
    grid-template-columns: 1fr auto auto;
  }
  .transaction .amount {
    grid-column: 1 / -1;
  }
  .listActions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .listActions button {
    flex: 1;
  }
  .actions {
    flex-direction: column;
  }
  .actions button {
    width: 100%;
  }
}
