/*:root {
  color-scheme: light dark;
  --success-bg: #e7f7ef;
  --success-ink: #14532d;
  --warning-bg: #fff1cf;
  --warning-ink: #8a5609;
  --danger-bg: #fde8e8;
  --danger-ink: #991b1b;
  --info-bg: #e8f2fb;
  --info-ink: #1d4f7a;
}
*/
.rx {text-align: right;}

.fx { display: flex; }
.jcc { justify-content: center; }
.jcsb { justify-content: space-between; }
.jcse { justify-content: space-evenly; }
.jcsa { justify-content: space-around; }
.jcfs { justify-content: flex-start; }
.jcfe { justify-content: flex-end; }
.aic { align-items: center; }
.aifs { align-items: flex-start; }
.aife { align-items: flex-end; }
.ais { align-items: stretch; }
.aib { align-items: baseline; }
.fxdc { flex-direction: column; }
.fx-sb { display: flex; justify-content: space-between; }
.g1 { gap: 1px; }
.g3 { gap: 3px; }
.g5 { gap: 5px; }
.g10 { gap: 10px; }
.g20 { gap: 20px; }

.g1e { gap: 1em; }
.g2e { gap: 2em; }

.lh1 { line-height: 1; }
.m0 { margin: 0; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.p0 { padding: 0; }
.plain { background: none; border: none; outline: none; cursor: pointer; }
.plain:hover { color: gray; }

rub {font-family: monospace;}
th.num, td.num, td.actions { text-align: right; }
.puntini { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lower { text-transform: lowercase; }

kbd.warn, code.warn { color: black; background: #fed700; }
kbd.warn.no-iva { color: white; background: #f14668; }
.stats { max-width:40ch; }

.year-history {
  width: 100%;
  max-width: 80ch;
  margin: 0 auto;
  box-sizing: border-box;

  .year-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-bottom: 0.25rem;

    input[type="radio"] { display: none; }

    .year-tab {
      order: 1;
      cursor: pointer;
      padding: 0;
      margin: 0;
      color: var(--text-bright);
      background: var(--background);
      border-radius: 6px;
      padding: 5px;
      font-family: monospace;

      &:hover,
      &:focus-visible {
        background: #fed700;
      }
    }

    input[type="radio"]:checked + .year-tab { background: #fed700; color: black; }

    .stats {
      display: none;
      width: 100%;
      max-width: none;
      min-width: 0;
      margin: 0.75rem auto 0;
      text-align: left;
      order: 2;
      flex: 0 0 100%;

      section { min-width: 0; }

      .year-summary {
        display: grid;
        grid-template-columns: max-content max-content minmax(14rem, 1fr);
        gap: 1rem;
        align-items: start;

        @media (max-width: 48rem) {
          grid-template-columns: 1fr;
        }
      }

      .year-donut {
        width: 100%;
        min-width: 0;

        &.resizing { visibility: hidden; }
      }

      table { width: 100%; }
    }

    input[type="radio"]:checked + .year-tab + .stats { display: block; }
  }
}

body {
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

header {
  padding: 10px;
  background: #00d1b2;
  a {
    color: whitesmoke;
    &.current {
      color:black;
      text-decoration: underline;
    }
  }
}
main {
  margin: 10px auto;
  max-width: 98ch;
  table { margin:10px auto; }
}

.auto-invoice-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;

  fieldset { min-width: 0; }

  @media (max-width: 60rem) {
    grid-template-columns: 1fr;
  }
}

.auto-invoice-show {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;

  fieldset { min-width: 0; }

  dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .35rem .75rem;
  }

  dt { font-weight: 600; }
  dd { margin: 0; min-width: 0; }

  @media (max-width: 60rem) {
    grid-template-columns: 1fr;
  }
}


h1, h2, h3, h4, h5 { font-family: "Avenir Next"; }
div.brand {
  font-family: "Avenir Next";
  background:cadetblue;
  a {color:white;font-weight:bold; text-decoration: none;}
  &:hover {background-color: darkgreen;}
  padding:2px 6px;
  border-radius:4px;
}

input, button, textarea { padding:5px 10px; }

select { padding: 5px 35px 5px 10px; }

select[multiple] { padding-right: 10px; }

.box {
  background: var(--background-alt);
  border-radius: 5px;
  padding:10px;
}

th.xs { width: 2ch; }
th.sm { width: 5ch; }
th.md { width: 8ch; }
th.lg{ width: 14ch; }
th.xxl { width: 21ch; }

div#auto-invoices {
  details{
    &[open] { padding: 5px; }
    table {
      th, td {padding: 1px 4px; }
      .lh1 { line-height: 12px; }
    }
  }
}

.no-results {
  display: none;
  &:only-child {display:block;}
}

tr.no-results {
  display:none;
  &:only-child { display:table-row; }
}
.notice { background: var(--background-alt); }

body > footer { background: var(--background-alt); }

#suppliers {
  td { padding: 1px; font-size: 12px; }
  .money, .cap, .naz { text-align: center; }
}

.nexi-ref { color:blue; cursor:help;}
