
/******************************************************************************/
/* Global Styles */
/******************************************************************************/

:root {
  --blue1: #cbdbec;
  --blue3: #cbdbec;
  --blue4: #435c8e;
  --blue5: #435c8e;
  --blue8: #435c8e;
  --blue9: #435c8e;

  --orange3: #ecac22;

  --green4: rgb(32, 111, 68);

  --red4: rgb(158, 12, 44);

  --gradBlue3: linear-gradient(to bottom, var(--orange3) 0%, var(--orange3) 100%);
  --gradBlue8: linear-gradient(to right, var(--orange3) 0%, var(--orange3) 100%);

  --grey1: #eee;
  --grey3: #ccc;
  --grey5: #999;
  --grey7: #6a6a6a;

  --shadow1: rgba(72, 89, 102, 0.1);
  --shadow2: rgba(255, 255, 255, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-weight: 300;
  scrollbar-width: thin;
}

html {
  width: 100%;
  height: 100vh;

  color: var(--grey7);
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
  line-height: 1.5;
  /* Some weird feature where browsers adjust the size of h1, p, etc. when
  on a mobile browser. Setting this to none fixes the issue... */
  text-size-adjust: none;
  -webkit-text-size-adjust: none;

  background-color: var(--blue1);
}
body {
  width: 100%;
  height: 100vh;
  margin: 0;
}

/* html, body {
  overflow: hidden;
} */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 72px auto 72px;
  grid-template-areas: 
    "nav header"
    "nav main"
    "nav footer";

  width: 100%;
  height: 100vh;

  transition: all .2s;
}

@media only screen and (max-width: 720px) {
  .app {
    grid-template-columns: 0px 1fr;
  }
}

/******************************************************************************/
/* nav */
/******************************************************************************/
nav {
  grid-area: nav;

  position: relative;
  left: 0px;
  display: flex;
  flex-direction: column;

  width: 240px;

  color: #fff;
  background-color: var(--blue9);

  transition: all .2s;
}
  .logo {
    flex: none;
    display: flex;
    align-items: center;

    color: #fff;
    height: 96px;
    padding: 0 24px;
  }
    .logoImage {
    }
    .logoText {
      font-size: 20px;
      letter-spacing: 2px;
    }

  .nav-link {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    
    height: 48px;
    padding: 0 24px;

    color: #fff;
    border-left: 0px solid transparent;
    white-space: nowrap;

    transition: all .2s;

    &.active {
      border-left: 4px solid var(--blue5);
      box-shadow: 0 6px 24px var(--shadow2);
    }

    &:hover {
      background-color: var(--shadow2);
    }
  }

  .signout {
    flex: auto;
    flex-direction: column;
    display: flex;
    place-content: end;
  }

@media only screen and (max-width: 720px) {
  nav {
    left: -240px;
  }
}

/******************************************************************************/
/* header */
/******************************************************************************/
header {
  grid-area: header;

  display: flex;
  align-items: center;
  justify-content: end;
  padding: 24px;

  background-color: #fff;
  box-shadow: 0 6px 24px var(--shadow1);
}
  header .logo {
    flex: none;
    width: 0px;
    padding: 0;
    overflow: hidden;

    color: var(--grey7);

    transition: width .2s;
  }

  .hamburger {
    display: none;
    flex: none;
  
    border: none;
    background: none;
    color: #474747;
    font-size: 36px;
    font-weight: bold;
  }

header .profile {
  display: flex;
  justify-content: end;
  
  img {
    height: 36px;
    width: 36px;
    border-radius: 36px;
    cursor: pointer;
  }
}

@media only screen and (max-width: 720px) {
  header .logo {
    flex: auto;
    width: auto;
  }
  header .profile {
    display: none;
  }
  header button.hamburger {
    display: block;
  }
}

@media only screen and (max-width: 320px) {
  header {
    padding: 12px;
  }
  header .logoText {
    display: none;
  }
}


/******************************************************************************/
/* main */
/******************************************************************************/
main {
  grid-area: main;

  width: 100%;
  padding: 36px;
  overflow: auto;

  transition: height .2s, padding .2s;
}
@media only screen and (max-width: 320px) {
  main {
    padding: 18px;
  }
}

/******************************************************************************/
/* footer */
/******************************************************************************/
footer {
  grid-area: footer;

  display: flex;
  align-items: center;
  justify-content: end;

  padding: 12px;

  font-size: 12px;
  background-color: #fff;
  box-shadow: 0 0px 24px var(--shadow1);
}
  footer section {
    flex: none;
  }
    footer .nav-link {
      display: block;
      padding: 8px 0;
    }

/******************************************************************************/
/* Menu */
/******************************************************************************/
.menu {
  position: fixed;
  height: calc(100% - 72px);
  width: 100%;
  margin-top: 72px;
  padding: 24px 0;
  z-index: 50;
  overflow: auto;

  background-color: var(--blue9);

  transition: opacity .2s ease-out, margin-top .2s;
}
  .menu .nav-link {
    width: 100%;

    transition: background-color .2s, padding .2s;
  }

/******************************************************************************/
/* Other */
/******************************************************************************/
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

pre {
  font-size: inherit;
  font-family: inherit;
  white-space: pre-wrap;
  white-space: break-spaces;
}

code {
  font-size: 12px;
  font-family: monaco, 'Courier New', monospace;
}

.mono {
  font-family: monaco, 'Courier New', monospace;
}

.no-color,
.no-color:active, .no-color:hover, .no-color:visited {
  color: transparent;
}

.text-align-right {
  text-align: right;
}

/******************************************************************************/
/* Images */
/******************************************************************************/
img:hover {
  filter: none !important;
}

/******************************************************************************/
/* Links */
/******************************************************************************/
a {
  text-decoration: none;
  transition: all .2s;
}
a:visited {
  color: inherit;
}
a:hover {
  color: var(--blue4);
}

/******************************************************************************/
/* Buttons */
/******************************************************************************/
button {
  cursor: pointer;
  font-family: inherit;
  font-weight: inherit;
}

a.primary,
button.primary {
  display: inline-block;
  padding: 6px 18px;
  min-height: 36px;

  border-radius: 2px;
  border: 0px solid transparent;
  background: var(--gradBlue8);
  color: #fff;

  font-size: inherit;
  text-decoration: none;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;

  transition: color .2s, opacity .2s;

  > * {
    vertical-align: middle;
  }
}
a.primary:hover,
button.primary:hover {
  opacity: .5;
}
a.primary:disabled,
button.primary:disabled {
  opacity: .5;
  background: var(--grey5);
}

a.secondary,
button.secondary {
  position: relative;
  display: inline-block;
  padding: 6px 18px;
  min-height: 36px;

  border-radius: 2px;
  border: 0px solid transparent;
  background: var(--gradBlue8);
  background-clip: text;
  color: transparent;

  font-size: inherit;
  text-decoration: none;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;

  transition: color .2s, opacity .2s;

  > * {
    vertical-align: middle;
  }

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 2px;
    border: 2px solid transparent;
    background: var(--gradBlue8);
    mask: 
      linear-gradient(#000 0 0) content-box, 
      linear-gradient(#000 0 0);
    mask-composite: exclude; 
  }
}
a.secondary:hover,
button.secondary:hover {
  opacity: .5;
}
a.secondary:disabled,
button.secondary:disabled {
  opacity: .5;
  background: var(--grey5);
}

a.delete,
button.delete {
  position: relative;
  display: inline-block;
  padding: 6px 18px;
  min-height: 36px;

  border-radius: 2px;
  border: 0px solid transparent;
  background: var(--red4);
  background-clip: text;
  color: transparent;

  font-size: inherit;
  text-decoration: none;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;

  transition: color .2s, opacity .2s;

  > * {
    vertical-align: middle;
  }

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 2px;
    border: 2px solid transparent;
    background: var(--red4);
    mask: 
      linear-gradient(#000 0 0) content-box, 
      linear-gradient(#000 0 0);
    mask-composite: exclude; 
  }
}
a.delete:hover,
button.delete:hover {
  opacity: .5;
}

button:disabled {
  cursor: not-allowed;
}

/******************************************************************************/
/* Inputs */
/******************************************************************************/
input, 
select {
  padding: 0;
  margin: 0;
  border-radius: 0;

  border: 0px solid transparent;
  /* border: 1px solid var(--grey3); */
  background-color: transparent;
  color: var(--grey7);
  accent-color: var(--blue4);
  outline-color: var(--blue4);
  font-size: 16px;
  font-family: inherit;
  /* -webkit-appearance: none; */
}

input[type="checkbox"],
input[type="radio"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
}
input,
input[type="number"],
input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  padding: 6px;
}

input::placeholder {
  color: var(--grey3);
}

input:invalid,
textarea:invalid,
select:invalid,
.invalid {
  /* border: 1px solid #8f0000; */
  /* background: #8f0000; */
  /* text-decoration: dashed underline #bd2e2e; */
  text-decoration: dashed underline 2px var(--red4);
  text-underline-offset: 2px; 
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 1;
  color: #aaa;
  -webkit-text-fill-color: #aaa;
}

.inputCurrency {
  position: relative;

  & .inputCurrency-sign {
    position: absolute;
    top: 6px;
    padding-left: 10px;
    color: var(--grey3);
    pointer-events: none;
  }
  & .inputCurrency-input {
    padding-left: 24px;
  }
}

.input-radio-container {
  white-space: nowrap;
}

/******************************************************************************/
/* View */
/******************************************************************************/
.view {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/******************************************************************************/
/* Button Group */
/******************************************************************************/
.group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;

  > * {
    flex: none;
  }
  > .grow {
    flex: auto;
  }
}

/******************************************************************************/
/* Lists */
/******************************************************************************/
ul {
  padding-inline-start: 12px;
}

/******************************************************************************/
/* inputSelect */
/******************************************************************************/
.inputSelect {
  /* display: contents; */
  position: relative;
  height: 40px;
  min-width: 200px;
}
.inputSelect-select {
  position: absolute;
  height: 40px;
  width: 100%;
  padding: 6px;

  /* Hide the select */
  outline: none;
  border: none;
  color: transparent;
}
.inputSelect-label {
  position: absolute;
  display: flex;
  align-items: center;
  height: 40px;
  width: 100%;
  padding: 6px;
  background-color: inherit;

  /* So events pass through to the select behind it */
  pointer-events: none;
}
.inputSelect-label-text {
  flex: auto;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.inputSelect-label-arrow {
  flex: none;
}

/******************************************************************************/
/* inputSwitch */
/******************************************************************************/
.inputSwitch {
  display: contents;
}
.inputSwitch-checkbox {
  display : none;
}
.inputSwitch-label {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
}
.inputSwitch-label::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
}
.inputSwitch-checkbox:checked + .inputSwitch-label {
  background-color: var(--blue5);
}
.inputSwitch-checkbox:checked + .inputSwitch-label::after {
  left : 24px;
}
/* This must come after so it takes precendence */
.inputSwitch-checkbox:disabled + .inputSwitch-label {
  cursor: not-allowed;
  background: #888;
}


/******************************************************************************/
/* Tables */
/******************************************************************************/
.table-pagination {
  display: flex;
  align-items: center;
}
  .table-pagination-back {
    flex: none;
  }
  .table-pagination-info {
    flex: auto;
    text-align: center;
    overflow: auto;
    white-space: nowrap;
  }
    .table-pagination-info-total,
    .table-pagination-info-filtered,
    .table-pagination-info-shown,
    .table-pagination-info-pageSize {
      margin: 0 12px;
    }
  .table-pagination-forward {
    flex: none;
  }

.table-resize {}

.table-header {
  position: sitcky;
  top: 0;

  & th {
    border-right: 1px solid var(--grey1);
  }
  & th:last-of-type {
    border-right: none;
  }
}

.table-filter {
  position: sitcky;
  top: 0;
}

.table > table,
table.table {
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  min-width: 1000px;

  background: #fff;
  border-left: 1px solid var(--blue9);
  border-right: 1px solid var(--blue9);
  box-shadow: 0 6px 24px var(--shadow1);
}

.hover {
  opacity: .5;
  transition: all .2s;
}
.hover:hover {
  background: var(--blue4)
}

.table.no-header {
  border-top: 1px solid var(--blue9);
}
.table tr {
  border-bottom: 1px solid var(--blue9);

  transition: all .2s;
}
.table tr:hover {
  background-color: var(--grey1);
}

.table :is(th, td) {
  padding: 8px;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  text-align: left;
}
.table :is(th, td).clickable {
  cursor: pointer;
  transition: all .2s;
}
.table :is(th, td).clickable:hover {
  opacity: .5;
}
.table th {
  height: 36px;
  /* background: var(--gradBlue3); */
  background: var(--blue9);
  color: #fff;
}

.table input {
  border: none;
}

/******************************************************************************/
/* Tabs */
/******************************************************************************/
.tabs {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
}

  .tabs-nav {
    flex: none;
    display: flex;
    align-items: center;
    overflow: auto;
    gap: 24px;
    padding-bottom: 24px;
  }
    .tabs-nav-tab {
      flex: none;
      font-weight: 600;
      white-space: nowrap;
      border-bottom: 3px solid transparent;
      cursor: pointer;

      transition: all .2s;
    }
    .tabs-nav-tab.active {
      border-bottom: 3px solid var(--blue5);
    }
    .tabs-nav-spacer {
      flex: auto;
    }

  .tabs-screen-container {
    flex: auto;
  }
    .tabs-screen {
      height: 100%;
      overflow: auto;
    }
  
  .tabs-button-group {
    display: flex;
    align-items: center;
    place-content: center;
    flex-wrap: wrap;
    gap: 18px;

    & * {
      flex: none;
    }
  }

/******************************************************************************/
/* Overlay */
/******************************************************************************/
.overlay {
  pointer-events: none;
}
.spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  height: 64px;
  width: 64px;
  margin-top: -32px;
  margin-left: -32px;
  border-top: 3px solid #fff;
  border-right: 3px solid transparent;
  border-radius: 50%;
  animation: spin 500ms linear infinite;
}

/******************************************************************************/
/* Dialog */
/******************************************************************************/
dialog {
  margin: auto;
  border: none !important;
  box-shadow: 0 0 #0000, 0 0 #0000, 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition:
    opacity .2s ease-out,
    overlay .2s ease-out allow-discrete,
    display .2s ease-out allow-discrete;
}
dialog[open] {
  opacity: 1;
}
@starting-style {
  dialog[open] {
    opacity: 0;
  }
}
body:has(dialog[open]) {
  overflow: hidden;
}

dialog::backdrop {
  background-color: rgb(0 0 0 / 0%);
  transition:
    display .2s allow-discrete,
    overlay .2s allow-discrete,
    background-color .2s;
}
dialog[open]::backdrop {
  background-color: rgb(0 0 0 / 25%);
}
@starting-style {
  dialog[open]::backdrop {
    background-color: rgb(0 0 0 / 0%);
  }
}

/******************************************************************************/
/* Profile */
/******************************************************************************/
.dialog-profile {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  gap: 10px;
  padding: 18px;
}
  .dialog-profile-image {
    text-align: center;

    & img {
      height: 100px;
      width: 100px;
      border-radius: 100px;
    }
  }
  .dialog-profile-name,
  .dialog-profile-username,
  .dialog-profile-links {
    text-align: center;
  }
  .dialog-profile-links {
    padding: 18px;
    & a {
      display: inline-block;
      width: 100%;
      padding: 10px;
    }
  }
  .dialog-profile-actions {
    display: flex;
    align-items: end;
    align-content: end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
  }

/******************************************************************************/
/* Entry */
/******************************************************************************/
.dialog-entry {
  padding: 24px;
  background-color: var(--blue1);
}

/******************************************************************************/
/* Form */
/******************************************************************************/
.form {
  display: flex;
  flex-direction: column;
  gap: 24px;

  transition: all .2s;
}

.form-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
  .form-divider {
    width: 100%;
    padding: 12px;

    font-size: 20px;
    text-align: center;
    color: #fff;
    background: var(--blue9);
    box-shadow: 0 6px 24px var(--shadow1);
  }

  .form-section {
    width: 100%;
    padding: 18px;

    background: #fff;
    box-shadow: 0 6px 24px var(--shadow1);
  }
    .form-section-title {
      font-size: 18px;
      font-weight: 600;
      text-align: center;
    }
    .form-paragraph {
      margin: 18px 0;
    }
    .form-input-group {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      column-gap: 12px;
      max-width: 100%;
      margin: 18px 0;

      & * > {
        flex: none;
      }
    }
    .form-input-container {
      flex: auto;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      column-gap: 8px;
      max-width: 100%;

      & label {
        flex: none;
        display: inline-block;
        max-width: 100%;
      }
      & input[type="text"],
      & input[type="number"],
      & input[type="date"],
      & input[type="email"],
      & input[type="tel"] {
        flex: auto;
        width: 72px; /* make sure it can shrink at least this low */

        outline: none;
        border-bottom: 2px solid var(--blue4);

        transition: all .2s;

        &.form-input-long {
          width: 120px;
        }
        &.form-input-extralong {
          width: 200px;
        }
        &:focus {
          /* border-left: 4px solid var(--blue4); */
          background-color: var(--blue1);
        }
      }

      & input[type="number"],
      &:has(input[type="date"]),
      &:has(.value-display) {
        flex: none;
      }
      & input[type="date"] {
        flex: none;
        width: initial;
      }
      & textarea {
        flex: auto;
        height: 96px;
        
        border: 2px solid var(--blue4);
        background: #fff;
        font-family: inherit;
        font-size: 16px;

        transition: all .2s;

        &:focus {
          /* border-left: 4px solid var(--blue4); */
          background-color: var(--blue1);
        }
      }
    }
    .form-inputSelect {
      flex: auto;
      width: 200px;

      outline: none;
      border: 2px solid var(--blue4);

      transition: all .2s;

      &:focus {
        /* border-left: 4px solid var(--blue4); */
        background-color: var(--blue1);
      }
    }
    .form-table-container {
      width: 100%;
      overflow: auto;
    }
    .form-table {
      padding: 18px 0; 
      border-spacing: 18px 0;

      & th {
        font-weight: 600;
      }

    }
    .form-table-button-row {
      
      & td {
        padding: 12px 0;
      }
    }

    .form-checkbox-container {
      flex: none;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      column-gap: 8px;
      max-width: 100%;
      
      & label {
        flex: none;
        display: inline-block;
        max-width: 100%;
      }
      & input[type="date"] {
        outline: none;
        border-bottom: 2px solid var(--blue4);
      }
      /* & input[type="checkbox"],
      & input[type="radio"] {
        flex: none;
      }
      &:has(input[type="checkbox"]),
      &:has(input[type="radio"]) {
        flex: none;
      } */
    }
    .value-display {
      display: inline-block;
      flex: none;
      width: 120px;

      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    .form-input-auto {
      flex-wrap: nowrap;

      & input[type="text"],
      & input[type="number"],
      & input[type="date"],
      & input[type="email"],
      & input[type="tel"],
      & textarea {
        flex: auto;
        min-width: 36px;
      }
    }
    
.form-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media only screen and (max-width: 600px) {
  .form {
    font-size: 12px;

    input {
      font-size: 12px;
    }
    input[type="checkbox"],
    input[type="radio"] {
      width: 18px;
      height: 18px;
    }
  }
}