
body {
    display: grid;
    grid-template:
        "menu bar" 52px
        "menu content" calc(100vh - 52px) /
        auto 1fr;
}

main {
    grid-area: content;
    padding: 16px;
    box-sizing: border-box;
    overflow: auto;
    position: relative;
    height: calc(100vh - 54px);
    max-width: 1600px;
    width: 100%;
    justify-self: center;
    display: flex;
    flex-direction: column;
    transition: opacity ease .4s !important;
}

body.loading > main {
    pointer-events: none;
    opacity: 0.45;
}

@keyframes spin-sync {
    to { transform: rotate(-360deg); }
}

#sync-indicator {
    font-size: 14px;
    font-weight: 400;
    text-shadow: 0 0 10px white;
    cursor: pointer;
}

#sync-indicator::before {
   animation: spin-sync 2s linear infinite;
   text-shadow: 0 0 10px white;
   margin-right: 8px;
}

body > header {
    grid-area: bar;
    background-color: #333;
    text-align: right;
    position: relative;
    color: white;
    display: flex;
    justify-content: flex-end;
    box-sizing: border-box;
    box-shadow: 0 0 6px #000b;
    z-index: 8;
}

body > header > a {
    position: absolute;
    left: 24px;
    align-self: center;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 2px white;
}

body > header > h1 {
    color: #ff9800;
    margin: 0;
    display: inline-flex;
    position: absolute;
    left: 16px;
    font-size: 20px;
    align-items: center;
    align-self: center;
}

body > header > h1 > span {
  place-items: flex-start;
  width: 500px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align:left;
}

body > header > h1 > span > info{
    margin-top: 4px;
    color: #888;
    display:block;
    font-size: 11px;
    align-items: center;
    align-self: center;
    user-select: all
}

body > header > a + h1 {
    left: 72px;
}

body > header > h1::before {
    line-height: 52px;
    margin-right: 18px !important;
}

body > header > section {
    box-sizing: border-box;
    display: flex;
    background-color: #393933;
    height: 100%;
    min-width: 52px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #554;
    position: relative;
}

section > button[data-icon] {
    margin-right: 0;
}

section.impersonation {
    display: grid;
    grid-gap: 4px;
}

section.impersonation.managing::before {
    color: #ff9800;
}

section.impersonation::before {
    grid-row: span 2;
    margin-right: 8px;
}

section.impersonation > small {
    grid-column: 2;
    font-size: 11px;
    justify-self: left;
    align-self: end;
    color: #eee9;
}

section.impersonation > span {
    justify-self: left;
    align-self: start;
    grid-column: 2;
}

section.impersonation > button {
    grid-row: 1 / 3;
    grid-column: 3;
    margin-left: 16px;
    margin-right: -4px;
    border-radius: 50%;
    height: 32px;
    width: 32px;
    dispay: flex;
    justify-content: center;

}

section.impersonation > button:hover {
    color: #ff9800;
    background: #fff1;
}

section.impersonation.managing {
    cursor: pointer;
    transition: background .3s ease;
}

section.impersonation.managing:hover {
    background: #46463E;
}

#actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: sticky;
    padding: 16px 0;
    text-align: right;
    top: -18px;
    z-index: 5;
    background-color: white;
}

#actions > label {
    display: inline-flex;
    margin-right: 4px;
    margin-bottom: 0 !important;
    width: 220px;
}

#actions > button {
    margin-left: 6px;
}

b.online {
    color: #8bc34a;
}

b.offline {
    color: #f44336;
}

menu {
    position: absolute;
    flex-wrap: wrap;
    box-shadow: 0 0 10px #0004;
    z-index: 7;
    background-color: white;
    padding: 8px 0;
    border-radius: 4px;
    transform-origin: top;
    transition: transform .2s ease .3s,
                opacity .2s ease .3s;
}

menuitem, menu > button {
    display: flex;
    cursor: pointer;
    align-items: center;
    color: #333;
    min-height: 32px;
    padding: 6px 16px;
    box-sizing: border-box;
    min-width: 100px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    border-radius: 0;
    width: 100%;
    transition: background-color .4s ease;
    letter-spacing: normal;
    text-transform: none;
    justify-content: left;
    text-align: left;
}

menu > button::after {
    display: none !important;
}

menuitem:hover, menu > button:hover {
    background-color: #efefef;
}

menu.closed {
    opacity: 0;
    transform: scale(.6);
    pointer-events: none;
}

section.stats {
    padding: 12px;
    display: grid;
    grid-auto-columns: minmax(100px, 260px);
    grid-auto-rows: min-content min-content;
    grid-auto-flow: column dense;
    grid-gap: 16px;
    margin-bottom: 24px;
}

article.warning {
    position: absolute;
    margin: auto;
    top: 0; left: 0; right: 0; bottom: 0;
    font-size: 20px;
    height: fit-content;
    width: fit-content;
    overflow: hidden;
    letter-spacing: 4px;
    transform: translateY(-32px);
}

article.warning::before {
    display: block;
    font-size: 32px;
    margin-bottom: 24px;
}

main > div.tabulator {
    flex: 1;
}

div.chart-container {
    height: 100%;
    width: 100%;
}

dialog {
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    transition: opacity .6s ease;
    position: fixed;
    z-index: 20;
    background: #000a;
    display: grid;
    border: none;
    color: #ccc;
    font-size: 13px;
    pointer-events: none;
}


dialog.image  > :first-child {
  padding: 5px;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap:10px;
  z-index:20;
}

dialog.image  > :first-child > a {
  color:#fb8500;
  text-decoration: none;
  position:absolute;
  top:10;
  left:10;
}

dialog > :first-child {
    background-color: var(--bg-color, #333);
    border-radius: 6px;
    padding: 16px;
    align-self: center;
    position: relative;
    justify-self: center;
    box-shadow: 0 16px 24px 2px rgba(0,0,0,0.14), 0 6px 30px 5px rgba(0,0,0,0.12), 0 8px 10px -5px rgba(0,0,0,0.20);
}

dialog.white > :first-child {
    background-color: white;
    color: black;
}

dialog > :first-child > h2 {
    margin: 0;
    margin-top: -8px;
    padding-bottom: 8px;
    font-size: 18px;
    font-weight: normal;
    letter-spacing: .6;
    font-family: Saira;
    color: #f4f4f4;
    border-bottom: 1px solid #fff3;
}

dialog > :first-child > p {
    line-height: 1.6;
    font-size: 14px;
}

dialog > :first-child > footer {
    text-align: right;
    margin-bottom: -8px;
    border-top: 1px solid #fff3;
    padding-top: 8px;
    margin-top: 5px;
}

dialog > :first-child > .loader {
    position: absolute;
    bottom: 10px;
    --width: 3px;
    --size: 26px;
}

dialog > :first-child > .loader::before {
    border-color: #0003;
    border-top-color: #2196f3 !important;
    opacity: 1 !important;
}

dialog > :first-child > footer > button {
    margin-left: 16px;
}

dialog.open {
    opacity: 1;
    pointer-events: all;
}

dialog > h3 {
    font-weight: 500;
    font-size: 20px;
    margin: 26px 0 4px 26px;
}

dialog > p {
    margin: 8px 0 0 26px;
    color: #aaa;
    font-size: 13px;
}

dialog > form {
    margin-top: 10px;
    margin-bottom: 0;
}

dialog .quick-search {
    border-color: #fff3;
    margin: 8px 0;
}

dialog .quick-search > input {
    color: #ddd;
}

#notices {
    position: fixed;
    max-height: 468px;
    top: 52px;
    z-index: 1;
    text-align: left;
    color: #333;
    overflow-y: auto;
    box-shadow: 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12), 0 5px 5px -3px rgba(0,0,0,0.20);
    border-radius: 4px;
    background-color: white;
    opacity: 0;
    pointer-events: none;
}

section.notices:focus-within #notices,
:focus-within > #notices,
#notices:hover {
    opacity: 1;
    pointer-events: auto;
}

section.notices.unread::after {
    position: absolute;
    content: "NEW";
    color: white;
    font-size: 10px;
    padding: 0 2px;
    background-color: red;
    border-radius: 8px;
    top: 18px;
    left: 29px;
}

#notices > h3 {
    line-height: 48px;
    padding: 0 14px;
    margin: 0;
}

#notices > button {
    position: absolute;
    right: 6px;
    top: 5px;
}

#notices > button:last-child {
    display: none;
}

#notices > h3:nth-last-child(2)::after {
    content: "You have no unread notices";
    font-size: 12px;
    display: block;
    font-weight: normal;
    line-height: 1;
    color: #666;
    margin-bottom: 16px;
}

#notices > div {
    background: white;
    margin: 0;
    padding: 110x 16px;
}

section.health > span {
  padding: 4px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 0.5;
}

section.health > span::before {
  content: 'ALERT:';
  margin-right:8px;
  color: #333;
  font-weight:700;
}


section.health > span {
  color: #f44336;
  background-color: #f8d7da;
  border-color: #f5c6cb;
  display: flex;
}

section.socket::before{
  color: #81c3ff;
}

section > ul {
    margin: 0;
}

ul > li {
    font-size: 15px;
    text-align: left;
    margin-bottom: 8px;
}

code {
    white-space: pre-wrap;
}

.clipboard-enable {
  cursor: copy;
}

.fade-out {
    opacity: 0;
}

.animated {
    transition: opacity .4s ease;
}

#switch-company > div {
    max-height: 600px;
    overflow-y: auto;
}

#switch-company p {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto auto;
    grid-gap: 8px;
    line-height: 32px;
    margin: 0 8px 4px 0;
}

#switch-company p.highlight {
    background-color: #444;
    margin: 8px 8px 8px 0;
    padding: 8px;
    border-radius: 8px;
}

#switch-company p.highlight > button {
    font-size: 13px;
    color: white;
}

#switch-company button {
    border: none;
    border-radius: 24px;
    text-transform: none;
    margin: 0;
    color: #ddd;
}

#switch-company button:first-child {
    justify-content: left;
    padding-right: 8px;
}

#switch-company button + button {
    width: 40px;
    height: 40px;
}

#switch-company button:hover {
    background-color: #222;
}

#switch-company button:first-child::after {
    margin-left: 8px;
    font-size: 20px;
}

#switch-company .loader {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #0004;
    --size: 42px;
    --width: 4px;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
}

.leaflet-map-pane, .leaflet-control-attribution,
.leaflet-control-container > div {
    z-index: 6 !important;
}

/* Quick search component */

.quick-search {
    border: 2px solid #0002;
    display: flex;
    border-radius: 32px;
    padding: 4px 8px;
    margin: 8px;
}

.quick-search::before {
    opacity: .3;
}

.quick-search > input {
    background-color: transparent;
    width: calc(100% - 32px);
    border: none;
}

/* sync monitor */

#sync-monitor {
    min-width: 340px;
    max-width: 420px;
    height: 400px;
    position: fixed;
    background-color: #333;
    bottom: 16px;
    right: 16px;
    z-index: 7;
    box-shadow: 0 12px 17px 2px rgba(0,0,0,0.14), 0 5px 22px 4px rgba(0,0,0,0.12), 0 7px 8px -4px rgba(0,0,0,0.20);
    border-radius: 5px;
    padding: 12px;
    box-sizing: border-box;
    border-right: 36px solid #444;
    transition: transform ease 1s;
}

#sync-monitor[hidden] {
    display: block;
    transform: translateY(500px);
}

#sync-monitor > header {
    right: -30px;
    position: absolute;
    display: flex;
    flex-direction: column;
}

#sync-monitor > header > button {
    margin-right: 0;
    color: #999;
    margin-bottom: 16px;
}

#sync-monitor > header > button:hover {
    color: white;
}

#sync-monitor > label {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-bottom: 4px;
    margin-left: 10px;
}

#sync-monitor > label[hidden] {
    display: none;
}

#sync-monitor > label > b {
    margin-right: 6px;
    margin-left: 5px;
    font-size: 16px;
}

#sync-monitor > label::before {
    margin-right: 8px;
    font-size: 20px;
}

#sync-monitor > label.done {
    color: #8bc34a;
}

#sync-monitor > label.pending {
    color: #42a5f5;
}

#sync-monitor > label.pending::before {
    animation: spin-sync 1s linear infinite;
    animation-direction: reverse;
}

#sync-monitor > label.failed {
    color: #ef5350;
}

/*#sync-monitor > label.done {
    color: #666;
}*/

#sync-monitor > header + label,
#sync-monitor > [hidden] + label {
    font-weight: 500;
    font-size: 15px;
    margin: 0 0 12px 0;
    background-color: #444;
    height: 42px;
    padding: 0 16px 0 10px;
    border-radius: 32px;

}

#sync-monitor > header + label > b,
#sync-monitor > [hidden] + label > b {
    font-size: 20px;
}

#sync-monitor > header + label::before,
#sync-monitor > [hidden] + label::before {
    font-size: 28px;
    margin-right: 10px;
}

#sync-monitor > time {
    color: #ccc;
    margin-left: 12px;
    margin-top: 16px;
    display: block;
}

#sync-monitor > time[hidden] {
    display: none;
}

#sync-monitor > time > b {
    font-size: 13px;
    margin-left: 6px;
}

#sync-monitor > h4 {
    color: #eee;
    margin: 32px 0 8px 12px;
    font-size: 15px;
}

#sync-monitor > section > p {
    margin: 0 0 0 12px;
    color: #ccc;
    line-height: 24px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow-x: hidden;
}

#sync-monitor > section time {
    color: white;
}

#sync-monitor > section b {
    margin-right: 6px;
    margin-left: 6px;
}

#sync-monitor > section .you {
    background-color: #ff9800;
    color: black;
    padding: 0 6px;
    border-radius: 5px;
    margin-left: 6px;
    line-height: 20px;
}

@media (min-height: 800px) {

    header > section {
        min-width: 64px;
    }

    body {
        grid-template-rows: 64px calc(100vh - 64px);
    }

    body > main {
        height: calc(100vh - 64px);
    }

}

/** override text font in charts **/
.c3 svg {
  /* font: unset !important; */
  font-family: 'Roboto' !important;
  letter-spacing: 1.0;
  font-size: 14px !important;
}

header label.field {
    width: 260px;
    margin: 0 !important;
}

header .field::before {
    height: 12px;
    margin-top: 32px;
}

header .field > span {
    color: #bbb !important;
    font-size: 11px !important;
}

header label.field > input {
    background-color: transparent !important;
    color: white !important;
    border: none !important;
}

/* GLOBAL SEARCH */

#global-search {
    padding-left: 8px;
    padding-right: 8px;
}

#global-search > label {
    width: 192px;
}

#search-dialog {
    padding: 0 !important;
    width: 900px;
    height: calc(100vh - 64px);
    max-height: 600px;
    background: #fafafa;
    overflow: hidden;
}

#search-dialog > .loader {
    left: 0;
    right: 0;
    top: 0;
    --size: 48px;
}

#search-dialog > :first-child {
    width: 916px;
    margin: 0 !important;
    height: auto !important;
}

#search-dialog > :first-child > input {
    padding-top: 42px;
    padding-bottom: 28px !important;
}

#search-dialog > ul > p {
    padding-left: 16px;
    color: #333;
    font-size: 16px !important;
}

#search-dialog > ul {
    list-style: none;
    padding: 0;
    color: #777;
    max-height: 508px;
    overflow-y: auto;
}

#search-dialog > ul > li {
    display: grid;
    grid-template:
        'i t a' 26px
        'i d a' auto / min-content 1fr auto auto;
    padding: 12px 8px;
    cursor: pointer;
    margin: 0;
    transition: all ease .5s;
}

#search-dialog > ul > li:hover {
    background: #eee;
    color: #333;
}

#search-dialog > ul > li::before {
    grid-area: i;
    font-size: 26px;
    align-self: center;
    margin-right: 18px;
    margin-left: 12px;
}

#search-dialog > ul label {
    font-weight: bold;
    align-self: center;
    pointer-events: none;
}

#search-dialog > ul label > .tag {
    border-radius: 16px;
    margin-right: 6px;
    font-size: 14px;
    padding: 0px 8px;
    line-height: 1.4;
    font-weight: normal;
}

#search-dialog > ul label > .tag.online {
    background-color: #8bc34a;
    color: white;
}

#search-dialog > ul label > .tag.intoday {
    background-color: #42AF35;
    color: white;
}

#search-dialog > ul label > .tag.offline {
    background-color: #d32f2f;
    color: white;
}

#search-dialog > ul p {
    grid-area: d;
    margin: 0;
    font-size: 12px;
    align-self: start;
}

#search-dialog > ul section {
    justify-self: right;
    align-self: center;
    grid-row: span 2;
    margin-left: 16px;
}

#search-dialog > ul .last-access {
    display: grid;
    grid-template-columns: auto 1fr;
}

#search-dialog > ul .last-access > span {
    font-size: 12px;
    grid-row: 1;
    grid-column: span 2;
    margin-bottom: 4px;
}

#search-dialog > ul .last-access > .avatar {
    grid-row: span 2;
    width: 32px;
    height: 32px;
    margin-right: 8px;
}

#search-dialog > ul .last-access > label {
    font-size: 14px;
}

#search-dialog > ul .last-access > time {
    font-size: 12px;
}

#search-dialog > ul section button {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-left: 8px;
}

#search-dialog > ul section button:hover {
    background: #bbb;
    color: black;
    margin-right: 6px;
}

#search-dialog > ul > .loader {
    position: absolute;
    top: 18px;
    right: 16px;
}

/* User Tools */

#user-tools {

}

#user-tools > menu {
    top: 42px;
    right: 16px;
    z-index: 100;
    width: 200px;
}

#user-tools > menu > .logout {
    color: #f44336;
}

/* Site Focus */

#site-focus {
    padding: 4px !important;
}

#site-focus label {
    width: 250px;
}

#site-focus button:last-child {
    margin-left: -12px !important;
}

#ad-sync-status {
    font-size: 15px;
    font-weight: 500;
    color: #999;
}

#ad-sync-status[data-status=bad] {
    color: #f44336;
}

#ad-sync-status[data-status=bad]::after {
    content: "!";
    position: absolute;
    right: 10px;
    top: 20px;
}


/* General */

div b.ad {
    background-color: #ddd;
    border-radius: 50%;
    width: 24px;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: initial;
    display: inline-block;
    margin-left: 8px;
}