:root {
  font-family: 'DM Sans', sans-serif;
  color: #20263b;
  background: #f4f6fb;
  --accent: #4867e8;
  --brand: #4867e8;
  --line: #e4e8f1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: grid;
  grid-template-columns: 13.75rem 1fr;
  min-height: 100vh;
}
button,
input {
  font: inherit;
}
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  background: #191d31;
  color: #cad1e6;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
  padding: 0 0.5rem 1.6875rem;
  color: white;
  font-weight: 700;
}
.logo b {
  display: grid;
  place-items: center;
  width: 1.8125rem;
  height: 1.8125rem;
  border-radius: 0.5rem;
  background: var(--brand);
  color: #ffffff;
  font: 400 1.125rem 'Instrument Serif';
}
nav {
  display: grid;
  gap: 0.3125rem;
}
aside button {
  border: 0;
  border-radius: 0.5rem;
  padding: 0.625rem;
  background: none;
  color: #cad1e6;
  text-align: left;
  font-size: 0.6875rem;
  cursor: pointer;
}
aside button.active,
aside button:hover {
  background: #2e385f;
  color: white;
}
aside button i {
  float: right;
  font-style: normal;
}
.aside-bottom {
  margin-top: auto;
}
.user {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
  padding: 1rem 0.5rem 0;
  border-top: 0.0625rem solid #2e385f;
}
.user > span {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #6683f0;
  color: #20263b;
  font-size: 0.75rem;
}
.user p,
.user b,
.user small {
  display: block;
  margin: 0;
}
.user b {
  font-size: 0.625rem;
  color: #fff;
}
.user small {
  font-size: 0.75rem;
  color: #cad1e6;
  margin-top: 0.125rem;
}
main {
  padding: 2.125rem 2.375rem 3.75rem;
  min-width: 0;
}
main > header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 1.6875rem;
}
small {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: #636e89;
}
h1 {
  margin: 0.3125rem 0 0;
  font: 400 2.25rem 'Instrument Serif';
}
.new,
.submit {
  border: 0;
  border-radius: 0.5rem;
  background: #4867e8;
  color: white;
  padding: 0.6875rem 0.9375rem;
  font-size: 0.625rem;
  font-weight: 600;
  cursor: pointer;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
}
.metrics article,
.panel {
  background: #ffffff;
  border: 0.0625rem solid var(--line);
  border-radius: 0.75rem;
}
.metrics article {
  padding: 1.125rem;
}
.metrics span,
.metrics strong,
.metrics small {
  display: block;
}
.metrics span {
  color: #636e89;
  font-size: 0.75rem;
}
.metrics strong {
  margin: 0.4375rem 0;
  font-size: 1.25rem;
}
.metrics small {
  font-size: 0.75rem;
  letter-spacing: 0;
}
.metrics .up {
  color: #4867e8;
}
.metrics .balance {
  background: #2e385f;
  color: white;
}
.metrics .balance span {
  color: #cad1e6;
}
.metrics .balance i {
  display: block;
  margin-top: 0.75rem;
  color: #cad1e6;
  font-size: 0.75rem;
  font-style: normal;
}
.content {
  display: grid;
  grid-template-columns: 2fr 0.7fr;
  gap: 0.625rem;
  margin: 0.625rem 0;
}
.panel {
  padding: 1.25rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel h2 {
  margin: 0.25rem 0 0;
  font: 400 1.25rem 'Instrument Serif';
}
.panel-head > button {
  border: 0.0625rem solid var(--line);
  background: white;
  border-radius: 0.4375rem;
  padding: 0.4375rem 0.5625rem;
  font-size: 0.75rem;
}
.chart {
  position: relative;
  height: 11.875rem;
  margin-top: 1.25rem;
  padding: 0 0.625rem 1.25rem 2.5rem;
  border-bottom: 0.0625rem solid var(--line);
  background: repeating-linear-gradient(#fff0 0 2.8125rem, #e4e8f1 2.875rem);
}
.y {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #77819a;
  font-size: 0.75rem;
}
.bars {
  display: flex;
  align-items: end;
  justify-content: space-around;
  height: 100%;
  gap: 0.9375rem;
}
.bars i {
  width: 1.625rem;
  height: var(--h);
  border-radius: 0.3125rem 0.3125rem 0 0;
  background: #6683f0;
}
.bars i.current {
  background: var(--accent);
}
.months {
  display: flex;
  justify-content: space-around;
  margin-top: 0.4375rem;
  color: #77819a;
  font-size: 0.75rem;
}
.goal {
  text-align: center;
}
.goal h2 {
  margin-top: 1rem;
  font-size: 1.6875rem;
}
.goal p {
  margin: 0.125rem;
  color: #636e89;
  font-size: 0.75rem;
}
.ring {
  display: grid;
  place-items: center;
  width: 6.5625rem;
  height: 6.5625rem;
  margin: 1.25rem auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 72%, #e4e8f1 0);
  position: relative;
}
.ring:after {
  content: '';
  position: absolute;
  inset: 0.625rem;
  border-radius: 50%;
  background: #ffffff;
}
.ring strong {
  position: relative;
  z-index: 1;
}
.goal > span {
  font-size: 0.75rem;
  color: #636e89;
}
.invoices {
  padding-bottom: 0.625rem;
}
.filters button {
  border: 0;
  background: none;
  padding: 0.375rem 0.5625rem;
  border-radius: 0.375rem;
  color: #636e89;
  font-size: 0.75rem;
  cursor: pointer;
}
.filters button.active {
  background: #e4e8f1;
  color: #20263b;
}
.table {
  margin-top: 0.9375rem;
}
.tr {
  display: grid;
  grid-template-columns: 1.7fr 0.7fr 0.7fr 0.7fr 1.5625rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6875rem 0.3125rem;
  border-top: 0.0625rem solid #e4e8f1;
  font-size: 0.75rem;
}
.th {
  color: #77819a;
  font-size: 0.75rem;
}
.client {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
}
.client i {
  display: grid;
  place-items: center;
  width: 1.8125rem;
  height: 1.8125rem;
  border-radius: 0.5rem;
  background: #e4e8f1;
  color: #2e385f;
  font-style: normal;
  font-weight: 700;
}
.client b,
.client small {
  display: block;
}
.client small {
  margin-top: 0.125rem;
  letter-spacing: 0;
}
.badge {
  width: max-content;
  padding: 0.25rem 0.4375rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
}
.badge-paid {
  background: #e9ecfc;
  color: #2e385f;
}
.badge-sent {
  background: #e4e8f1;
  color: #2e385f;
}
.badge-overdue {
  background: #f9e4d8;
  color: #914d30;
}
.badge-draft {
  background: #e4e8f1;
  color: #636e89;
}
.more {
  border: 0;
  background: none;
}
dialog {
  width: min(30rem, calc(100% - 1.875rem));
  border: 0;
  border-radius: 0.9375rem;
  padding: 0;
  background: #f4f6fb;
  box-shadow: 0 1.5625rem 5.625rem #191d3170;
}
dialog::backdrop {
  background: #191d3199;
  backdrop-filter: blur(0.25rem);
}
dialog form {
  position: relative;
  display: grid;
  gap: 0.8125rem;
  padding: 1.6875rem;
}
dialog h2 {
  margin: 0 0 0.625rem;
  font: 400 1.6875rem 'Instrument Serif';
}
dialog label {
  display: grid;
  gap: 0.3125rem;
  font-size: 0.75rem;
  font-weight: 600;
}
dialog input {
  border: 0.0625rem solid var(--line);
  border-radius: 0.4375rem;
  padding: 0.625rem;
  background: white;
  outline: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.close {
  position: absolute;
  right: 1.125rem;
  top: 0.9375rem;
  border: 0;
  background: none;
  font-size: 1.375rem;
}
.submit {
  margin-top: 0.5rem;
}
@media (max-width: 900px) {
  body {
    grid-template-columns: 4.25rem 1fr;
  }
  .logo {
    font-size: 0;
  }
  .logo b {
    font-size: 1.125rem;
  }
  aside nav button {
    font-size: 0;
    text-align: center;
  }
  aside nav button:first-letter {
    font-size: 0.875rem;
  }
  .aside-bottom {
    display: none;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .content {
    grid-template-columns: 1fr;
  }
  .goal {
    display: block;
  }
}
@media (max-width: 600px) {
  body {
    display: block;
  }
  aside {
    position: fixed;
    z-index: 4;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 3.625rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: row;
  }
  .logo,
  .aside-bottom {
    display: none;
  }
  aside nav {
    display: flex;
    width: 100%;
    justify-content: space-around;
  }
  aside nav button {
    width: 25%;
  }
  main {
    padding: 1.5625rem 0.875rem 5.3125rem;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metrics article {
    padding: 0.875rem;
  }
  .metrics strong {
    font-size: 1.0625rem;
  }
  .tr {
    grid-template-columns: 1fr 0.7fr 0.7fr;
  }
  .tr span:nth-child(3),
  .tr span:nth-child(5) {
    display: none;
  }
  .th span:nth-child(3),
  .th span:nth-child(5) {
    display: none;
  }
  .chart-panel {
    overflow: hidden;
  }
  .bars {
    gap: 0.4375rem;
  }
  .bars i {
    width: 1.125rem;
  }
  h1 {
    font-size: 1.9375rem;
  }
  .new {
    font-size: 0;
  }
  .new:first-letter {
    font-size: 0.9375rem;
  }
}

nav a {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 0.875rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
}
nav a:hover {
  background: #ffffff12;
}
button:focus-visible,
a:focus-visible {
  outline: 0.1875rem solid #4867e8;
  outline-offset: 0.1875rem;
}

.bar-month {
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  flex: 1;
}
.bars .bar-month i {
  width: 48%;
  height: var(--h);
  min-height: 0.0625rem;
}
.bars .bar-month .expense {
  background: #eba17d;
}
.cash-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.cash-toolbar button,
.cash-toolbar a,
#settings-form button {
  padding: 0.5625rem;
  border: 0.0625rem solid #e4e8f1;
  border-radius: 0.4375rem;
  background: #fff;
  color: #20263b;
  font: inherit;
  cursor: pointer;
}
.cash-operations {
  margin: 1.375rem 0;
}
.cash-row {
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  padding: 0.8125rem 0;
  border-bottom: 0.0625rem solid #e4e8f1;
  font-size: 0.8125rem;
}
.cash-row span {
  flex: 1;
}
.cash-row small {
  display: block;
  margin-top: 0.3125rem;
  white-space: pre-wrap;
  color: #636e89;
}
#settings-form {
  display: grid;
  gap: 0.5625rem;
  margin-top: 1.125rem;
  text-align: left;
  font-size: 0.75rem;
}
#settings-form label {
  display: grid;
  gap: 0.3125rem;
}
#settings-form input,
select {
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.5625rem;
  border: 0.0625rem solid #e4e8f1;
  border-radius: 0.375rem;
}
#csv-result {
  font-size: 0.8125rem;
}
@media (max-width: 600px) {
  .cash-row {
    flex-wrap: wrap;
  }
  .cash-row span {
    min-width: 100%;
  }
  .cash-toolbar {
    margin-top: 0.75rem;
  }
  .cash-operations .panel-head {
    display: block;
  }
}

input:focus-visible,
select:focus-visible {
  outline: 0.1875rem solid #4867e8;
  outline-offset: 0.1875rem;
}

.cash-row {
  flex-wrap: wrap;
}
.cash-actions {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cash-actions button {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 0.0625rem solid #e4e8f1;
  border-radius: 0.5rem;
  background: white;
  color: inherit;
  cursor: pointer;
}

/* Desktop readability at native browser scale. */
@media (min-width: 801px) {
  aside button {
    font-size: 0.875rem;
  }
  .user > span {
    font-size: 0.875rem;
  }
  .user b {
    font-size: 0.875rem;
  }
  .user small {
    font-size: 0.75rem;
  }
  small {
    font-size: 0.75rem;
  }
  .new,
  .submit {
    font-size: 0.875rem;
  }
  .metrics span {
    font-size: 0.875rem;
  }
  .metrics small {
    font-size: 0.75rem;
  }
  .metrics .balance i {
    font-size: 0.875rem;
  }
  .panel h2 {
    font-size: 1.5rem;
  }
  .panel-head > button {
    font-size: 0.875rem;
  }
  .y {
    font-size: 0.875rem;
  }
  .months {
    font-size: 0.875rem;
  }
  .goal p {
    font-size: 0.875rem;
  }
  .goal > span {
    font-size: 0.875rem;
  }
  .filters button {
    font-size: 0.875rem;
  }
  .tr {
    font-size: 0.875rem;
  }
  .th {
    font-size: 0.875rem;
  }
  .badge {
    font-size: 0.75rem;
  }
  dialog label {
    font-size: 0.875rem;
  }
  nav a {
    font-size: 1rem;
  }
  .cash-row {
    font-size: 1rem;
  }
  #settings-form {
    font-size: 1rem;
  }
  #csv-result {
    font-size: 1rem;
  }
}

/* Responsive desktop component scale. */
@media (min-width: 801px) {
  html {
    font-size: clamp(18px, 1.35vw, 20px);
  }
}

/* Component fit at intermediate desktop widths. */
@media (min-width: 801px) {
  .metrics > article,
  .metrics > div {
    min-width: 0;
  }
  .metrics small {
    overflow-wrap: anywhere;
  }
  .panel-head {
    flex-wrap: wrap;
    gap: 1rem;
  }
  button,
  input,
  select {
    min-height: 40px;
  }
  .chart {
    min-width: 0;
  }
}
