:root {
  --red: #ff9999;
  --green: #00dd88;
  --orange: #ffc466;
}

body {
  font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-left: 0;
}

h1 {
  margin-bottom: 0.25em;
}

main {
  & section {
    background-image: linear-gradient(165deg, transparent 10%, var(--blue2) 100%);
    margin-bottom: 1.5em;
    padding: 1em;
    border-radius: 1em;
    box-shadow: 2px 2px var(--blackTrans);
    overflow-x: scroll
  }
}

main h2,
aside h2 {
  margin-top: 0;
  padding-bottom: 0.5em;
  margin-bottom: 0.5em;
  border-bottom: 2px solid var(--blue1);
}

aside {
  margin-bottom: 2em;
  background-color: var(--white);
  background-image: linear-gradient(148deg, var(--white) 0%, #efefef 100%);
  color: var(--black);
  padding: 1em;
  border-radius: 1em;
  box-shadow: 2px 2px var(--blackTrans);

  & h2 {
    border-bottom: 2px solid var(--blackTrans);

    & svg {
      color: var(--gray);
    }
  }
}

#stats td {
  border-top: 1px solid var(--blue);
}

table {

  & th,
  td {
    padding: 0.5em;
  }

  &.equalCols {
    table-layout: fixed;
  }

  &.fullwidth {
    width: 100%;
  }
}

input,
button,
textarea,
select {
  width: 100%;
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue1);
}

button {
  min-height: 2em;
  margin-right: 0.25em;
  margin-bottom: 0.25em;
}

button {
  font-size: 1.75rem
}

.alert {
  text-shadow: none;
  font-size: 18px;
}

.red {
  color: var(--red);
}

.orange {
  color: var(--orange);
}

.green {
  color: var(--green);
}

.range {
  font-size: 0.8em;
  color: var(--white);
  float: right;
  margin-bottom: 0.5em;
}

.taxes {
  font-size: 0.8em;
  color: var(--red);
}

.income {
  font-size: 0.8em;
  color: var(--green);
}

.dash {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 1em;

  & h2 {
    margin-top: 0;
    border-bottom: 2px solid var(--blue2);
  }

  & button {
    margin-top: 0;
  }
}

.invoice {

  & form {
    margin-top: 0;
    margin-bottom: 0.5em;
  }

  & th:last-of-type,
  & td:last-of-type {
    text-align: right;
  }
}

.invoiceTotals {
  width: initial;
  margin-left: auto;
  margin-top: 1em;

  & th {
    max-width: 150px;
    position: relative;

    &:last-of-type {
      text-align: center;
    }
  }

  & img {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    max-width: 100%;
    max-height: 100%;
  }
}

.stationary {
  display: grid;
  grid-template-columns: 100px 2fr 1fr 1fr;
  grid-gap: 1em;
  align-content: end;

  & h2 {
    margin-top: 0;
    margin-bottom: 0;
  }

  & section {
    display: grid;
    justify-content: start;
    align-content: center;
  }

  & section:nth-of-type(3),
  section:nth-of-type(4) {
    grid-template-columns: 2em 1fr;
    align-items: center;

    & svg {
      justify-self: center;
    }
  }
}

.login {

  & h1,
  a {
    padding-right: 0.5rem;
  }
}

.printonly {
  display: none !important;
}

@media only screen and (min-width: 1200px) {

  main:not(.dash):not(.login):not(.invMain) {
    padding-right: 2em;
    float: left;
    width: 70%;
  }

  input,
  button,
  textarea,
  select {
    width: 100%;
    /* max-width: 250px; */
  }

  .dash button {
    max-width: 48.5%;
  }

  .invoice button {
    max-width: 32.5%;
  }

  aside {
    float: right;
    width: 30%;

    & h2 {
      margin-top: 0;
      text-shadow: none;
    }

    & label {
      text-shadow: none;
      font-size: 0.8em;
    }
  }
}

@media only screen and (max-width: 1000px) {
  .dash {
    grid-template-columns: 1fr;

    & table {
      width: 100%;
    }
  }
}

@media only screen and (min-width: 500px) {
  form {
    & fieldset {
      display: grid;
      grid-template-columns: 100px auto;
      align-items: center;

      & label {
        margin-top: 0.5em;
        padding-right: 0.25em;
      }
    }
  }

  .undoEdit {
    padding: 1em 0 0 1em;
  }

  fieldset .alert {
    /* max-width: 250px; */
    font-size: 0.75em;
    margin-bottom: 0;
  }
}

@media only screen and (max-width: 500px) {

  #splash {
    width: calc(100vw - 5em);
  }

  form {
    width: 100%;
  }

  h2 {
    font-size: 2.5em;
  }

  .undoEdit {
    display: none;
  }

  .invoiceTotals img {
    display: none;
  }
}

@media print {
  @page {
    size: 8.5in 11in;
  }

  .moreLinks,
  .noprint {
    display: none !important;
  }

  .stationary {
    margin-bottom: 1em;
  }

  .printonly {
    display: grid !important;
  }

  hr {
    border: 1px solid var(--gray);
  }

  main section {
    padding: 0;
  }
}