:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #18191f;
  background: #f8f9fc;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: #15161c;
  color: white;
  padding: 12px 17px;
  border-radius: 9px;
  min-height: 44px;
}
button.secondary {
  color: #6e3ef4;
  background: #f1edff;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dedee8;
  padding: 11px;
  border-radius: 8px;
  background: white;
  color: #17181c;
  min-height: 44px;
}
textarea {
  min-height: 90px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #626575;
}
aside {
  width: 215px;
  background: #101116;
  color: white;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 28px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
aside h2 {
  margin: 0 10px 26px;
}
aside button {
  text-align: left;
  background: transparent;
  color: #b9bbc8;
}
aside button.active {
  background: #292b35;
  color: white;
}
aside footer {
  margin-top: auto;
  padding: 15px;
  color: #b9bbc8;
}
.logo {
  color: #9460ff;
  font-size: 30px;
  margin-right: 8px;
}
main {
  margin-left: 215px;
  padding: 34px;
  max-width: 1600px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}
header h1 {
  font-size: 30px;
  margin: 0 0 5px;
}
small,
.muted {
  color: #747887;
  font-size: 13px;
}
.hero {
  padding: 28px;
  color: white;
  background: #12141b;
  border-radius: 16px;
  margin-bottom: 22px;
}
.hero h2 {
  font-size: 38px;
  margin: 12px 0;
}
.hero small {
  color: #bcc0d0;
}
.progress {
  height: 9px;
  background: #323441;
  border-radius: 9px;
  margin-top: 20px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: #8250ff;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.two {
  grid-template-columns: 1.2fr 1fr;
}
.card {
  background: white;
  border: 1px solid #e8e9f0;
  border-radius: 14px;
  padding: 22px;
  min-width: 0;
}
.card h2 {
  font-size: 18px;
  margin: 0 0 15px;
}
.stat {
  font-weight: 700;
  font-size: 26px;
  margin: 12px 0;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar input,
.toolbar select {
  width: auto;
  max-width: 100%;
}
.empty {
  padding: 26px;
  color: #747887;
}
.list {
  display: grid;
  gap: 12px;
}
.item {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid #eeeef4;
  padding: 13px 0;
}
.item p {
  margin: 6px 0;
}
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 6px;
  background: #f0eaff;
  color: #7042cc;
}
.danger {
  color: #b33932;
}
.bar {
  height: 11px;
  background: #7847ff;
  border-radius: 8px;
  margin: 6px 0 14px;
}
.chart {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  min-height: 180px;
  padding-top: 16px;
}
.chart > div {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.chart .column {
  background: #8050f6;
  border-radius: 6px 6px 0 0;
  min-height: 3px;
  margin: 7px auto;
  width: 70%;
}
.chart small {
  font-size: 11px;
}
dialog {
  width: min(760px, 94vw);
  max-height: 90vh;
  border: 0;
  border-radius: 18px;
  padding: 25px;
  box-shadow: 0 15px 80px #0005;
}
dialog::backdrop {
  background: #13172488;
}
form.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
form.fields h2,
form.fields .full {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.login {
  max-width: 430px;
  margin: 13vh auto;
  padding: 30px;
}
.login label {
  margin: 20px 0;
}
.note {
  background: #f3f0ff;
  padding: 16px;
  border-radius: 10px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid #e8e9f0;
  white-space: nowrap;
}
th {
  color: #747887;
  background: #f8f9fc;
}
td button {
  padding: 6px 9px;
  background: #f1edff;
  color: #7042cc;
}
#toast {
  position: fixed;
  bottom: 85px;
  right: 24px;
  max-width: 450px;
  background: #29252e;
  color: white;
  padding: 0;
  border-radius: 10px;
  z-index: 10;
}
#toast:not(:empty) {
  padding: 15px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.day {
  border: 1px solid #e9eaf0;
  padding: 7px;
  min-height: 75px;
  font-size: 12px;
  border-radius: 7px;
}
.day button {
  font-size: 11px;
  min-height: 25px;
  padding: 3px;
  background: #eee8ff;
  color: #6041bd;
  width: 100%;
  margin-top: 3px;
}
a {
  color: #7140db;
}
button:focus-visible {
  outline: 3px solid #b7a1ff;
}
@media (max-width: 800px) {
  aside {
    inset: auto 0 0;
    width: auto;
    height: 70px;
    z-index: 5;
    flex-direction: row;
    overflow: auto;
    padding: 6px;
    background: #101116;
  }
  aside h2,
  aside footer {
    display: none;
  }
  aside button {
    font-size: 12px;
    padding: 8px;
    white-space: nowrap;
  }
  main {
    margin: 0;
    padding: 20px 14px 95px;
  }
  header h1 {
    font-size: 25px;
  }
  .grid,
  .two {
    grid-template-columns: 1fr;
  }
  .hero h2 {
    font-size: 32px;
  }
  .grid.stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .card {
    padding: 17px;
  }
  .stat {
    font-size: 22px;
  }
  form.fields {
    grid-template-columns: 1fr;
  }
  header {
    flex-wrap: wrap;
  }
  .day {
    padding: 3px;
    min-height: 60px;
  }
  .calendar {
    gap: 2px;
  }
}
.mobile-nav {
  display: none;
}
@media (max-width: 800px) {
  aside {
    display: none;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #101116;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 5;
    justify-content: space-around;
  }
  .mobile-nav button {
    font-size: 12px;
    padding: 9px 6px;
    min-height: 48px;
    background: transparent;
  }
}

.calendar-toolbar,
.calendar-month,
.calendar-filters,
.day-panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.calendar-toolbar {
  justify-content: space-between;
  margin-bottom: 20px;
}
.calendar-month h2 {
  font-size: 20px;
  margin: 0;
  text-transform: capitalize;
}
.calendar-month button {
  min-width: 44px;
}
.calendar-filters label {
  font-size: 12px;
  min-width: 110px;
}
.calendar-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.calendar-totals article {
  display: grid;
  gap: 8px;
  background: white;
  border: 1px solid #e8e9f0;
  border-radius: 13px;
  padding: 20px;
}
.calendar-totals strong {
  font-size: 25px;
}
.cal-income {
  color: #16865b;
}
.cal-expense {
  color: #c04d48;
}
.month-card {
  padding: 16px;
  overflow-x: auto;
}
.money-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 830px;
  gap: 5px;
}
.calendar-weekday {
  padding: 10px;
  color: #898c9a;
  font-size: 12px;
}
.money-day {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 148px;
  text-align: left;
  padding: 10px 8px;
  background: white;
  color: #272936;
  border: 1px solid #eeeff5;
  border-radius: 8px;
  overflow: hidden;
}
.money-day:hover {
  background: #f8f6ff;
}
.money-day.selected {
  border: 2px solid #8250ed;
  padding: 9px 7px;
  background: #faf8ff;
}
.money-day.today .money-day-top b {
  background: #191a23;
  color: white;
  border-radius: 6px;
  padding: 2px 6px;
}
.money-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.day-count {
  font-size: 11px;
  color: #8a6ac1;
}
.daily-totals {
  display: grid;
  gap: 2px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.3px;
}
.day-label {
  font-size: 10px;
  font-weight: 400;
}
.daily-events {
  display: grid;
  gap: 4px;
  margin-top: auto;
  min-width: 0;
}
.cal-event {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  background: #f5f5f9;
  padding: 4px;
  border-radius: 4px;
  font-size: 10px;
}
.cal-event > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event em {
  font-style: normal;
  color: #777;
  flex-shrink: 0;
}
.cal-event.income {
  border-left: 2px solid #46ad80;
}
.cal-event.expense {
  border-left: 2px solid #dc8077;
}
.calendar-hint {
  margin-top: 12px;
}
.calendar-day-panel {
  margin-top: 20px;
  margin-bottom: 20px;
}
.day-panel-heading {
  justify-content: space-between;
  border-bottom: 1px solid #eeeef5;
  padding-bottom: 16px;
}
.day-panel-heading h2 {
  text-transform: capitalize;
  margin: 0 0 5px;
}
.day-panel-heading .toolbar {
  margin-bottom: 0;
}
.income-add {
  background: #e8f5ef;
  color: #137049;
}
.expense-add {
  background: #ffefed;
  color: #a13e3b;
}
.calendar-entry {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #eeeef4;
  padding: 18px 0;
}
.calendar-entry-main {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.calendar-entry h3 {
  font-size: 15px;
  margin: 7px 0;
}
.calendar-entry > strong {
  white-space: nowrap;
  font-size: 17px;
}
.entry-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.entry-actions button {
  font-size: 12px;
  padding: 9px;
}
.delete-operation {
  background: #fff1ef;
  color: #a33c35;
}
.day-transfer {
  font-size: 11px;
  color: #777587;
}
@media (max-width: 800px) {
  .calendar-totals {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .calendar-totals article {
    padding: 14px;
  }
  .calendar-totals article:last-child {
    grid-column: 1/-1;
  }
  .calendar-totals strong {
    font-size: 20px;
  }
  .calendar-entry {
    flex-wrap: wrap;
    gap: 12px;
  }
  .calendar-entry-main {
    flex-basis: 60%;
  }
  .entry-actions {
    flex-basis: 100%;
  }
  .calendar-filters {
    width: 100%;
    gap: 8px;
  }
  .calendar-filters label {
    flex: 1;
    min-width: 80px;
  }
  .calendar-month {
    gap: 8px;
  }
  .calendar-month h2 {
    font-size: 18px;
  }
  .month-card {
    padding: 8px;
  }
}
