:root {
  --home-icon: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWhvdXNlLWljb24gbHVjaWRlLWhvdXNlIj48cGF0aCBkPSJNMTUgMjF2LThhMSAxIDAgMCAwLTEtMWgtNGExIDEgMCAwIDAtMSAxdjgiLz48cGF0aCBkPSJNMyAxMGEyIDIgMCAwIDEgLjcwOS0xLjUyOGw3LTZhMiAyIDAgMCAxIDIuNTgyIDBsNyA2QTIgMiAwIDAgMSAyMSAxMHY5YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0yeiIvPjwvc3ZnPg==");
  --logout-icon: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWxvZy1vdXQtaWNvbiBsdWNpZGUtbG9nLW91dCI+PHBhdGggZD0ibTE2IDE3IDUtNS01LTUiLz48cGF0aCBkPSJNMjEgMTJIOSIvPjxwYXRoIGQ9Ik05IDIxSDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJoNCIvPjwvc3ZnPg==");
}

#mobile-navmenu {
  display: none;
}

@media (max-width: 928px) {
    :root {
      --ui-component-height: 32px;
      --ui-component-width: 32px;
  }
}

@media (min-width: 768px) and (max-width: 928px) {
  #nav_buttons li.selected a {
    box-shadow: inset 1px 1px 8px 0px #fff;
  }
}

@media (max-width: 768px) {
  #mobile-navmenu {
    display: block;
  }
  #footer,
  #header,
  #nav_buttons li a:hover,
  #navigation,
  #view {
    box-sizing: revert;
    color: revert;
  }

  #header form [name],
  #sidePanel textarea {
    background: revert;
    border: revert;
    box-sizing: revert;
    color: revert;
  }

  #sidePanelViewContent select {
    background-color: revert;
    border: revert;
    border-radius: revert;
    box-sizing: revert;
    color: revert;
    font: revert;
    font-feature-settings: revert;
    font-variation-settings: revert;
    letter-spacing: revert;
    margin: revert;
    opacity: revert;
    padding: revert;
  }

  div#sidePanelContent input {
    margin: 1px;
  }

  #nav_buttons li.selected {
    z-index: 50 !important;
  }

  #header,
  #sidebar,
  .hide-on-mobile {
    display: none !important;
  }

  #container {
    height: 100vh !important;
    width: 100vw !important;
  }

  #container,
  #view {
    padding: 0 !important;
  }

  #view {
    width: 100%;
  }

  .detailsContainer.shift-management-wrapper {
    height: 100%;
    min-width: 100%;
    padding: 2px 0 0;
    width: 100%;
  }

  #shift-management-container,
  .shift-management-standalone > div {
    height: 100%;
    min-height: 100% !important;
  }

  #sidePanel {
    top: 0;
    z-index: 50;
  }

  #sidePanel[state="closed"] {
    height: 40px;
  }

  #nav_buttons a {
    float: unset;
  }

  #moduletabnavi {
    margin: 1px 42px;
  }

  #container #navigation {
    background: revert;
    background: #000 !important;
    border: revert;
    border-bottom: unset !important;
    border-radius: revert;
    border-bottom-right-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow: revert;
    box-shadow: unset;
    height: revert;
    height: 0 !important;
    margin: revert;
    margin: 0 !important;
    padding: unset;
    position: revert;
    position: absolute !important;
    z-index: 5;
    flex-direction: column;
  }

  #container #navigation ul {
    display: none;
    min-width: 15vw;
  }

  #container #navigation[data-state="open"] {
    box-shadow: 0 0 10px #4d4d4d !important;
    height: auto !important;
    padding: 0 15px;
  }

  #container #navigation[data-state="open"] ul {
    display: revert;
  }

  #container #navigation[data-state="open"] li a:hover {
    padding: 9px 15px;
  }

  #container #navigation[data-state="open"] #mobile-navmenu {
    background: #000;
    border: unset;
  }

  #container #navigation[data-state="open"] #mobile-navmenu:hover {
    box-shadow: unset;
  }

  #container #navigation li {
    border-radius: 6px;
    display: revert;
    float: unset;
    font-family: Inter, Arial, sans-serif;
    height: auto !important;
    letter-spacing: revert !important;
    line-height: 1rem;
    margin: 0 0 6px;
    padding: 8px 0;
    position: relative;
    width: 100% !important;
  }

  #container #navigation li a:hover,
  #container #navigation li.selected {
    background: #ddd;
    background-image: unset;
    background-position: unset;
    background-repeat: unset;
    height: unset;
    padding: 8px 0;
    z-index: unset;
  }

  #container #navigation li.selected a span {
    color: #206080;
    font-weight: 900;
  }

  #container #navigation li.selected {
    background: unset;
  }

  #container #navigation li a:not(:visited):hover,
  #container #navigation li a:visited:hover {
    color: #000;
  }

  #mobile-navmenu {
    background: linear-gradient(130deg, #fff, #aaa);
    border: 1px solid #7b7b7b;
    border-radius: 5px;
    width: 41px;
    height: 41px;
  }

  #mobile-navmenu:hover {
    box-shadow: 0 0 12px 1px #3b00adb3;
  }

  #mobile-navmenu-logo {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDMyIiBoZWlnaHQ9IjIwMzIiIHZlcnNpb249IjEuMCIgdmlld0JveD0iMCAwIDE1MjQgMTUyNCI+PGcgZmlsbD0iIzNiMDBhZCIgc3Ryb2tlPSIjM2IwMGFkIj48cGF0aCBzdHJva2Utd2lkdGg9Ii4xIiBkPSJNNzY0LjUgMzcxLjZDNDY4LjEgNTc1LjMgMjI0LjQgNzQyLjggMjIzLjEgNzQzLjhsLTIuNSAxLjggMTYuMyAxMi43YzkgNyAxNi43IDEyLjcgMTcuMiAxMi43czIyOS4zLTE1Ny4xIDUwOC40LTM0OWMyNzkuMS0xOTIgNTA3LjctMzQ5IDUwOC0zNDlzLjUgMzEyLjkuNSA2OTUuMmwuMSA2OTUuMyAxNi45IDExLjMgMTcgMTEuMlY3NDMuNWMwLTQwOC40LS4zLTc0Mi41LS43LTc0Mi40LS41IDAtMjQzLjMgMTY2LjctNTM5LjggMzcwLjV6Ii8+PHBhdGggc3Ryb2tlLXdpZHRoPSIuMSIgZD0iTTcxNC4zIDUzMy4zYy0yNjQuMSAxODIuMS00ODAuMSAzMzEuNS00ODAgMzMxLjkuMS41IDIxNi4yIDE0OC42IDQ4MC4yIDMyOS4zbDQ4MCAzMjguNi43LTM5LjhjLjktNTEgLjgtMTEwMC42IDAtMTIwMy41bC0uNy03Ny44ek0yMzggODkyLjd2NGw0NDcuNyAzMDcuOWMyNDYuMiAxNjkuMyA0NDggMzA4LjEgNDQ4LjUgMzA4LjMuNS4xLjgtMS42LjYtNGwtLjMtNC4zLTI0NC0xNjcuOGMtMTM0LjItOTIuMy0zMzUuNC0yMzAuNy00NDcuMi0zMDcuNS0xMTEuNy03Ni45LTIwMy42LTEzOS45LTIwNC4yLTE0MC4xLS43LS4yLTEuMSAxLjItMS4xIDMuNXptNDQ5LjcgMzA1LjhjNDQwLjMgMzAyLjcgNDQ2LjMgMzA2LjkgNDQ2LjMgMzEwLjFzLTIuMSAxLjgtMjI3LjgtMTUzLjRjLTEyNS4zLTg2LjItMzI2LjctMjI0LjctNDQ3LjUtMzA3LjctMjE4LjQtMTUwLjEtMjE5LjYtMTUxLTIxOS43LTE1NC40IDAtMi41LjMtMy4xIDEuMy0yLjQuNi41IDIwMiAxMzkgNDQ3LjQgMzA3Ljh6Ii8+PC9nPjwvc3ZnPg==");
    background-position: -5px 0;
    background-repeat: no-repeat;
    background-size: contain;
    display: inline-block;
    height: 40px;
    width: 40px;
  }

  .mobile-navmenu-icon {
    background-repeat: no-repeat;
    background-size: contain;
    display: inline-block;
    height: calc(var(--ui-component-height) - 8px);
    width: calc(var(--ui-component-width) - 8px);
  }

  .icon-home {
    background-image: var(--home-icon);
  }

  .icon-logout {
    background-image: var(--logout-icon);
  }

  /** Huoltolomake mobile scaling **/
  .floatLeft,
  .floatRight {
    float: unset !important;
    display: flex;
    width: 100%;
    flex-direction: column;
  }

  div#huoltolomakecontainer {
    width: 100%;
  }

  div#infowrapper {
    width: 100% !important;
  }

  p.instruction {
    box-sizing: border-box;
    width: 100% !important;
    margin: 0 auto;
    overflow-x: hidden;
  }

  .clearfix {
    zoom: unset;
  }

  fieldset.doubleFieldset-2 {
    width: 100% !important;
    overflow: visible;
  }

  .largeContainer-2,
  .largeContainer {
    max-width: 100%;
  }

  fieldset {
    box-sizing: border-box !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    overflow-x: auto;
    margin-right: 0 !important;
    min-width: 0 !important;
  }

  form#lomake {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow: visible;
  }

  html {
    width: 100vw !important;
    min-width: 0;
    max-width: 100vw !important;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    height: auto;
    overflow: visible;
  }

  body {
    height: auto;
    overflow: auto;
  }

  #container {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    overflow-x: hidden;
    overflow: visible;
  }

  #nav_buttons li.selected::before {
    background-color: #ddd;
    background-image: url(../img/viewup4.png);
    background-position: center up;
    background-repeat: repeat-x;
    position: absolute;
    content: " ";
    border-radius: 8px;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0px;
    background-size: cover;
  }

  #header-messagebox {
    position: absolute;
    left: calc((100vw - 90vw) / 2);
    top: 33px;
  }

  #header-messagebox #messagetag {
    width: 80vw;
  }

  a.mobile-as-button {
    min-width: calc(var(--ui-component-width) * 2);
    height: var(--ui-component-height);
    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
    line-height: 2;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    background-color: rgb(240, 240, 240);
    border: 2px outset #000;
    box-sizing: border-box;
    color: #000;
    cursor: default;
    display: block;
    margin: 0;
    padding: 1px 6px;
    overflow: clip;
    user-select: none;
  }
}

@media (max-width: 928px) {
  .largeContainer,
  .largeContainer-2 {
    width: 100%;
  }

  #nav_buttons a {
    float: unset !important;
    min-height: 10px;
    height: 10px;
    display: block;
    padding: 6px 24px;
  }

  .leftmenu,
  .rightmenu,
  .leftup,
  .leftbottom,
  .rightup,
  .rightbottom {
    display: none;
  }

  #nav_buttons li {
    float: unset !important;
  }

  #nav_buttons li.selected {
    height: 20px;
    z-index: unset;
  }

  #nav_buttons li.selected a {
    color: #fff;
  }

  ul#nav_buttons {
    display: flex;
    float: left;
    position: relative;
    flex-wrap: wrap;
    gap: 1.2rem;
  }

  div#navigation {
    min-height: 25px;
    padding: 16px 0 16px 0;
    height: 100% !important;
    display: flex;
    background-repeat: unset;
    background-image: unset;
    background: linear-gradient(
      to bottom,
      /* TOP: 11px, 1px bands (exactly as the PNG) */ #d4d4d4 0px 1px,
      #bbbbbb 1px 2px,
      #a1a1a1 2px 3px,
      #888888 3px 4px,
      #717171 4px 5px,
      #616161 5px 6px,
      #515151 6px 7px,
      #454545 7px 8px,
      #3c3c3c 8px 9px,
      #373737 9px 10px,
      #343434 10px 11px,

      /* MIDDLE: stretches */ #333333 11px calc(100% - 10px),
      /* BOTTOM: 10px, 1px bands (exactly as the PNG) */ #323232
        calc(100% - 10px) calc(100% - 9px),
      #313131 calc(100% - 9px) calc(100% - 8px),
      #2e2e2e calc(100% - 8px) calc(100% - 7px),
      #2b2b2b calc(100% - 7px) calc(100% - 6px),
      #262626 calc(100% - 6px) calc(100% - 5px),
      #212121 calc(100% - 5px) calc(100% - 4px),
      #232323 calc(100% - 4px) calc(100% - 3px),
      #2a2a2a calc(100% - 3px) calc(100% - 2px),
      #353535 calc(100% - 2px) calc(100% - 1px),
      #464646 calc(100% - 1px) 100%
    );
  }

  #nav_buttons li.selected {
    background-color: unset;
    background-image: unset;
    background-position: unset;
    background-repeat: unset;
    position: unset;
    height: unset;
    z-index: unset;
  }

  /** Huoltolomake mobile scaling **/
  .floatLeft,
  .floatRight {
    display: flex;
    flex-direction: column;
  }

  /** Temporary fix for mobile view **/
  #header-infoarea {
    display: none;
  }

  #container {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    overflow-x: hidden;
  }

  img.icon {
    width: var(--ui-component-width);
    height: var(--ui-component-width);
  }

  input[type="text"],
  input[type="number"],
  input[type="button"],
  input[type="submit"],
  input[type="date"],
  input[type="checkbox"],
  input[type="radio"],
  input[type="file"],
  input[type="password"],
  input.timefield,
  input.datefield {
    height: var(--ui-component-height);
  }
  select,
  input[type="text"],
  input[type="number"],
  input[type="button"],
  input[type="submit"],
  input[type="date"],
  input[type="file"],
  input[type="password"],
  input.timefield,
  input.datefield {
    min-width: calc(var(--ui-component-width) * 2);
  }
  select {
    padding-block-end: 1px;
    padding-block-start: 1px;
    padding-bottom: 2px;
    padding-inline-end: 2px;
    padding-inline-start: 2px;
    padding-left: 2px;
    padding-right: 2px;
    padding-top: 2px;
    border-bottom-style: inset;
    border-bottom-width: 1px;
    border-image-width: 1;
    border-left-color: rgb(118, 118, 118);
    border-left-style: inset;
    border-left-width: 1px;
    border-right-color: rgb(118, 118, 118);
    border-right-style: inset;
    border-right-width: 1px;
    border-top-color: rgb(118, 118, 118);
    border-top-style: inset;
    border-top-width: 1px;
    box-sizing: content-box;
    max-height: calc(var(--ui-component-height) - 4px);
    height: calc(var(--ui-component-height) - 4px);
  }
  select:not([multiple]):disabled {
    opacity: 0.7;
    color: #aaa;
    color: color-mix(in srgb, currentColor 50%, transparent);
    border-color: rgba(118, 118, 118, 0.3);
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: var(--ui-component-width);
    min-width: var(--ui-component-width);
  }
  td.input > input[type="checkbox"] {
    margin-left: 0;
  }
  .ui-autocomplete-input,
  .search-input {
    background-origin: content-box;
  }

  .ui-datepicker .ui-datepicker-prev,
  .ui-datepicker .ui-datepicker-next {
    width: var(--ui-component-height);
    height: var(--ui-component-height);
    top: 9px;
  }
  .ui-datepicker .ui-datepicker-prev {
    left: 0px;
  }

  .ui-datepicker .ui-datepicker-next {
    right: 0;
  }
  .ui-datepicker .ui-datepicker-title {
    display: flex;
  }
  #ui-datepicker-div {
    width: auto;
  }
  .ui-datepicker table tbody tr td:nth-child(n + 2) {
    width: var(--ui-component-height);
    height: var(--ui-component-height);
  }
  .ui-datepicker table tbody tr td:nth-child(n + 2) a {
    height: 80%;
  }

  table ~ p.pagination * {
    height: var(--ui-component-height);
    width: var(--ui-component-height);
    min-width: var(--ui-component-height);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  table ~ p.pagination .prev,
  table ~ p.pagination .next {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    color: transparent;
    text-indent: 200%;
    font-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  table ~ p.pagination .divider {
    margin-left: 0;
    margin-right: 0;
  }

  table ~ p.pagination {
    margin: 13px 0;
  }

  table ~ p.pagination .prev::before {
    content: "";
    width: 24px;
    height: 24px;

    background-color: #206080;

    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m15 18-6-6 6-6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m15 18-6-6 6-6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / contain no-repeat;
  }

  table ~ p.pagination .next::before {
    content: "";
    width: 24px;
    height: 24px;

    background-color: #206080;

    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / contain no-repeat;
  }

  .mobile-flex {
    display: flex;
  }

  a[onclick]:has(img),
  a[href]:has(img) {
    width: var(--ui-component-width);
    height: var(--ui-component-height);
    display: inline-block;
  }

  table.form th {
    font-size: 10px;
  }

  #footer {
    position: relative !important;
    bottom: unset !important;
    margin: 0 !important;
    left: 0 !important;
    right: unset !important;
  }

  td[colspan="2"] {
    display: flex;
    align-items: center;
    gap: 4px;
    width: unset;
  }

  table.form .label {
    vertical-align: middle;
  }

  table.form .input input[type="file"] {
    width: 100%;
  }

  select {
    text-shadow: none;
    text-align: start;
    text-indent: 0px;
    color: #000;
    background-color: #fff;
    min-inline-size: calc-size(auto, max(size, 24px));
    min-block-size: calc-size(auto, max(size, 24px, 1lh));
    overflow: visible !important;
    font-family: Arial;
    border: 1px solid #767676;
    padding-block: 0.25em;
    padding-inline: 0.5em;
    gap: 0.5em;
    border-radius: 0.5em;
  }

  .ui-accordion-header.ui-helper-reset.ui-state-default.ui-corner-all {
    min-height: var(--ui-component-height);
    display: flex;
    align-items: center;
  }

  #mobile-navmenu-extra {
    display: none;
  }

  #navigation[data-state="open"] #mobile-navmenu-extra {
    display: flex;
    justify-content: flex-end;
    position: absolute;
    right: 14px;
    top: 6px;
    gap: 4px;
  }
  #container #navigation[data-state="open"] #mobile-navmenu {
    height: unset;
    width: auto;
    background: #000;
    border: unset;
    padding-bottom: 10px;
    border-radius: unset;
    border-bottom: 1px solid #206080;
    margin-bottom: 6px;
  }

  #mobile-navmenu-extra button {
    padding: 0px;
    background: linear-gradient(190deg, #88e6fd, #0890e4);
    border: 1px solid #206080;
    border-radius: 8px;
    width: calc(var(--ui-component-width) + 2px);
    height: calc(var(--ui-component-height) + 2px);
  }
}
