/* Main layout */

html {
  --top-bar-height: 54px;
  /*height: -webkit-fill-available;*/
}

html {
  --menu-normal-width: 240px;
  --menu-collapsed-width: 80px;
  --menu-float-threshold: 640px;
  --tw-ring-color: var(--color-accent);
}

body {
  overflow: hidden;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
}

/*
  Main containers of the application
*/

#mainContainer {
  background-color: var(--color-window-background);
  height: 100dvh;
  width: 100%;
  max-height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: var(--top-bar-height) calc(100dvh - var(--top-bar-height)) !important;
  grid-gap: 0px;
}

#loginContainer {
  background-color: var(--color-window-background);
  height: 100dvh;
  width: 100%;
  display: grid;
}

/*
  Top bar containers
*/

#topBar {
  font-weight: bold;
  color: #ffffff;
  margin: 0px;
  padding: 0px;
  border-width: 0px;
  overflow: hidden;
  height: var(--top-bar-height);
  width: 100%;
  overflow: visible;
  z-index: 2;
  border-bottom: 1px solid var(--color-topbar-separator);
}

.topBarThemed {
  background-color: var(--color-topbar-background);
  color: var(--color-topbar-text);
}

#top-bar-container {
  width: 100%;
  background: transparent;
  padding: 0px;
  margin: 0px;
  height: var(--top-bar-height);
  overflow: visible;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: var(--top-bar-height);
  display: grid;
}

#top-bar-container-left {
  width: auto;
  padding-left: 20px;
  padding-right: 20px;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  height: 100%;
  display: flex;
}

#top-bar-container-center {
  padding-left: 0px;
  padding-right: 0px;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  height: 100%;
  display: flex;
}

#top-bar-container-right {
  padding-left: 20px;
  padding-right: 20px;
  align-items: center;
  overflow: visible;
  height: 100%;
  display: flex;
}

/*
  Body container
*/

#bodyContainer {
  background-color: var(--color-window-background);
  display: flex;
  flex-direction: row;
  z-index: 1;
  overflow: hidden;
  width: max-content;
}

/*
  Menu container
*/

#sidebarMenu {
  background-color: var(--color-menu-background);
  scrollbar-width: none;
  /*height: calc(100dvh - var(--top-bar-height)) !important;*/
  height: 100%;
  max-height: 100%;
  grid-template-columns: auto;
  grid-template-rows: auto 1fr auto;
  grid-gap: 0px;
  display: grid;
}

/* Fixes menu */

#leftBarMenu {
  /*height: calc(100dvh - var(--top-bar-height)) !important;*/
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

#leftBarMenu::-webkit-scrollbar {
  display: none;
}

/* Floating menu */

#leftBarOpened {
  float: left;
  position: fixed;
  width: 100%;
  /*height: 100dvh;*/
  height: -webkit-fill-available;
  /*background-color: #424242b0;*/
  scrollbar-width: none;
  display: block;
  z-index: 10;
}

#leftBarOpenedInner {
  background-color: var(--color-menu-background);
  scrollbar-width: none;
  height: 100%;
  grid-template-columns: auto;
  grid-template-rows: auto 1fr auto;
  grid-gap: 0px;
  display: grid;
  box-shadow: 0px 12px 24px rgba(0, 0, 0, 0.4);
}

#leftBarOpenedInnerMenu {
  background-color: var(--color-menu-background);
  scrollbar-width: none;
  overflow-y: scroll;
}

#leftBarClosed {
  float: left;
  z-index: 2;
  position: absolute;
  /*height: 100%;*/
  height: -webkit-fill-available;
  width: 0;
  scrollbar-width: none;
  flex-direction: column;
}

/*
  Center container
*/

#centerContainer {
  background-color: var(--color-window-background);
  color: var(--color-window-text);
  width: 100%;
  /*height: calc(100% - var(--top-bar-height)) !important;*/
  height: 100%;
}

@media only screen and (max-width: 640px) {
  #centerContainer {
    margin-left: 0px;
  }

  #bodyContainer {
    display: unset;
  }
}

#childrenContainer {
  background-color: var(--color-window-background);
  color: var(--color-window-text);
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 10px;
  padding-top: 10px;
  /*height: calc(100%) !important;*/
  height: 100%;
  overflow-y: scroll;
  scrollbar-width: none;
  scroll-behavior: auto;
}

.shadowbox {
  width: 15em;
  border: 1px solid #333;
  box-shadow: 8px 8px 5px #444;
  padding: 8px 12px;
  background-image: linear-gradient(180deg, #fff, #ddd 40%, #ccc);
}

/* Main menu */

/* 
  Grid screens / templates
*/

.grid-screen-caption {
  font-size: 1.125rem;
  font-weight: bold;
  color: var(--color-primary);
}

.grid-screen-subcaption {
  font-size: 0.875rem;
  color: var(--color-secondary);
  line-height: 120%;
}

/*
  Card screens / templates
*/

.card-screen-caption {
  font-size: 1.125rem;
  font-weight: bold;
  color: var(--color-primary);
}

.card-screen-subcaption {
  font-size: 0.875rem;
  color: var(--color-secondary);
  line-height: 120%;
}

/*
  Other functions
*/

.new-line {
  white-space: pre-line;
}

hr.dotted {
  border-top: 2px dotted var(--color-separator);
}

#route-body {
  background-color: var(--color-window-background);
  color: var(--color-window-text);
}

#scrollbar-customized {
  scrollbar-width: auto;
  scrollbar-color: var(--color-edit-border) transparent;
}

#scrollbar-customized::-webkit-scrollbar-track {
  background: transparent;
}

#scrollbar-customized::-webkit-scrollbar-thumb {
  background-color: var(--color-edit-border);
  border-radius: 6px;
  border: 3px solid transparent;
}

#scrollbar-customized::-webkit-scrollbar {
  width: 11px;
}

.ql-toolbar.ql-snow {
  border: 1px solid var(--color-edit-border);
  box-sizing: border-box;
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  padding: 8px;
  background-color: #ffffff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.ql-container.ql-snow {
  border: 1px solid var(--color-edit-border);
  box-sizing: border-box;
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  padding: 8px;
  background-color: var(--color-edit-background);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

input[type='search']::-webkit-search-cancel-button {
  filter: invert(100%) saturate(0%);
  color: grey;
}

/*
  Tree component
*/

.icon-tree-items {
  padding-right: 10px;
  font-weight: bold !important;
}

.splitter > .rst__rowContents {
  border: 2px dotted #c6c6c6 !important;
  border-radius: 0px 5px 5px 0px !important;
}
