// --------
// -- FORMS
// --------
body {
  div {
    // Form content inner
    .tdb-s-fc-inner {
      position: relative;
      display: flex;
      flex-wrap: wrap;
      margin: 0 -13px;

      &:not(:last-child) {
        margin-bottom: 28px;

        &:after {
          content: '';
          display: block;
          margin: 28px 13px 0;
          width: 100%;
          height: 1px;
          background-color: #efefef;
        }
      }

      .tdb-s-notif {
        width: 100%;
        margin-left: 13px;
        margin-right: 13px;
      }
    }


    // Form content inner title
    .tdb-s-fc-inner-title {
      display: flex;
      width: 100%;
      margin: 0 0 20px;
      padding: 0 13px;
      font-size: .929em;
      font-weight: 500;
      line-height: 1.2;
      color: #1d2327;

      span {
        background-color: #f1f1f1;
        border-radius: 3px;
        padding: 4px 7px 6px;
      }
    }


    // Labels
    .tdb-s-form-label {
      position: relative;
      display: block;
      margin-bottom: 8px;
      font-size: .929em;
      line-height: 1;
      font-weight: 600;
      color: #666;
    }

    .tdb-s-form-label-required {
      color: #FF0000;
    }

    .tdb-s-form-label-descr {
      display: block;
      width: 100%;
      margin-top: 4px;
      margin-bottom: 10px;
      font-size: .923em;
      line-height: 1.2;
      font-weight: 400;
    }


    // Inputs general
    .tdb-s-form-input {
      margin: 0;
      padding: 0 15px 1px;
      width: 100%;
      height: 44px;
      min-height: 44px;
      font-size: 1em;
      line-height: 1.3;
      font-weight: 600;
      color: #444;
      border: 2px solid #D7D8DE;
      border-radius: 5px;
      outline: 3px solid transparent;
      box-shadow: none;
      transition: border-color .2s ease-in-out, color .2s ease-in-out, outline-color .2s ease-in-out;

      &:-webkit-autofill,
      &:-webkit-autofill:hover,
      &:-webkit-autofill:focus,
      &:-webkit-autofill:active {
        -webkit-text-fill-color: #444;
        -webkit-box-shadow: 0 0 0 1000px white inset !important;
      }

      &::placeholder {
        color: #888;
        transition: color .2s ease-in-out;
      }
      &::-webkit-input-placeholder {
        color: #888;
        transition: color .2s ease-in-out;
      }
      &::-moz-placeholder {
        color: #888;
        transition: color .2s ease-in-out;
      }
      &:-ms-input-placeholder {
        color: #888;
        transition: color .2s ease-in-out;
      }
      &:-moz-placeholder {
        color: #888;
        transition: color .2s ease-in-out;
      }

      &:hover {
        color: inherit;
      }
      &:focus {
        box-shadow: none;
      }
    }
    .tdb-s-form-group:not(.tdb-s-fg-error) {
      .tdb-s-form-input {
        // Focus state
        &:focus:not([readonly]) {
          border-color: #0489FC !important;
          outline-width: 3px;
          outline-style: solid;
          outline-color: rgba(4, 137, 252, .1);
        }

        // Read-only/disabled
        &[readonly]:not(.tdb-s-form-input-date):not(.tdb-s-form-datepicker),
        &:disabled {
          background-color: #fff;
          color: #BEBEBE;
          border-color: #E8E9EC;
          outline: none;

          &::placeholder {
            color: #BEBEBE;
          }
          &::-webkit-input-placeholder {
            color: #BEBEBE;
          }
          &::-moz-placeholder {
            color: #BEBEBE;
          }
          &:-ms-input-placeholder {
            color: #BEBEBE;
          }
          &:-moz-placeholder {
            color: #BEBEBE;
          }
        }
      }
    }


    // Textarea input
    textarea.tdb-s-form-input {
      display: block;
      width: 100%;
      min-width: 100%;
      max-width: 100%;
      min-height: 76px;
      padding-top: 8px;
      padding-bottom: 8px;
      line-height: 1.5;
    }


    // Select input
    .tdb-s-form-select-wrap {
      position: relative;

      .tdb-s-form-input {
        max-width: 100%;
        padding-right: 34px;
        background: #fff;
        -webkit-appearance: none;
        cursor: pointer;

        &::-webkit-calendar-picker-indicator {
          opacity: 0;
        }

        &[multiple] {
          padding-top: 8px;
          padding-bottom: 8px;
          padding-right: 15px;
          height: 100px;
          min-height: 100px;
          overflow-y: auto;

          & + .tdb-s-form-select-icon {
            display: none;
          }
        }
      }

      .tdb-s-form-select-icon {
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        pointer-events: none;
        fill: #444;
        transition: fill .2s ease-in-out;
      }
    }
    .tdb-s-form-group:not(.tdb-s-fg-error) {
      .tdb-s-form-select-wrap .tdb-s-form-input {
        &[readonly],
        &:disabled {
          + .tdb-s-form-select-icon {
            fill: #BEBEBE;
          }
        }
      }
    }


    // Select2 input
    .tdb-s-form-select-wrap {
      .select2-hidden-accessible {
        display: none;
      }

      .select2-selection {
        display: flex;
        align-items: center;
        padding: 5px 15px 6px;
        width: 100%;
        min-height: 44px;
        height: auto;
        font-size: 1em;
        line-height: 1.3;
        font-weight: 600;
        color: #444;
        border: 2px solid #D7D8DE;
        border-radius: 5px;
        outline: 3px solid transparent;
        cursor: pointer;
        transition: border-color .2s ease-in-out, color .2s ease-in-out, outline-color .2s ease-in-out;
      }
    }

    .tdb-s-form-group:not(.tdb-s-fg-error) .select2-container--open .select2-selection {
      border-color: #0489FC !important;
      outline-width: 3px;
      outline-style: solid;
      outline-color: rgba(4, 137, 252, .1);
    }

    .tdb-s-fg-error .tdb-s-form-select-wrap .select2-selection {
      border-color: #FF0000 !important;
      outline: 3px solid rgba(255, 0, 0, .1);
    }


    // Checkbox/radio inputs
    .tdb-s-form-check {
      input {
        display: none;
      }

      label {
        display: flex;
        align-items: flex-start;
        position: relative;
        top: 1px;
        cursor: pointer;
      }

      .tdb-s-fc-check {
        position: relative;
        margin-right: 10px;
        width: 19px;
        height: 19px;
        background-color: #fff;
        border: 2px solid #D7D8DE;
        outline: 3px solid transparent;
        transition: border-color .2s ease-in-out, outline-color .2s ease-in-out;
        cursor: pointer;

        &:after {
          content: '';
          position: absolute;
          top: 3px;
          left: 3px;
          width: 9px;
          height: 9px;
          background-color: #0489FC;
          opacity: 0;
          transition: opacity .2s ease-in-out;
        }
      }

      .tdb-s-fc-title {
        flex: 1;
        font-size: 1em;
        line-height: 1.3;
        font-weight: 600;
        word-break: break-all;
        color: #444;
        cursor: pointer;
      }

      input[type=checkbox] + .tdb-s-fc-check {
        border-radius: 5px;

        &:after {
          border-radius: 3px;
        }
      }
      input[type=radio] + .tdb-s-fc-check {
        &,
        &:after {
          border-radius: 100%;
        }
      }
      input:checked + .tdb-s-fc-check {
        border-color: #0489FC;
        outline-color: rgba(4, 137, 252, .1);

        &:after {
          opacity: 1;
        }
      }
      input[disabled] {
        & + .tdb-s-fc-check,
        & + .tdb-s-fc-check + .tdb-s-fc-title {
          pointer-events: none;
        }

        & + .tdb-s-fc-check {
          border-color: #E8E9EC;
        }

        & + .tdb-s-fc-check + .tdb-s-fc-title {
          color: #BEBEBE;
        }
      }
      input[disabled]:checked + .tdb-s-fc-check {
        outline-color: rgba(4, 137, 252, .08);

        &:after {
          background-color: #9ACFFD;
        }
      }
    }


    // Checkbox/radio groups
    .tdb-s-form-checkboxes-wrap {
      display: flex;
      flex-wrap: wrap;
      margin-left: -13px;
      margin-right: -13px;

      .tdb-s-form-check {
        margin-bottom: 7px;
        padding-left: 13px;
        padding-right: 13px;

        &:last-child {
          margin-bottom: 0;
        }
      }
    }


    // Button groups (radio) inputs
    .tdb-s-form-btn {
      input {
        display: none;
      }

      input:checked + .tdb-s-fb-btn {
        background-color: #0489FC;
        color: #fff;
        border-color: #0489FC;

        &:hover,
        &:active {
          background-color: #152BF7;
          border-color: #152BF7;
        }

        &:active:not(:disabled) {
          outline-color: rgba(21, 43, 247, .2);
        }
      }

      .tdb-s-fb-label {
        display: flex;
        cursor: pointer;
      }

      .tdb-s-fb-btn {
        pointer-events: none;
      }
    }

    .tdb-s-form-btns-wrap {
      display: flex;
      flex-wrap: wrap;
      flex-direction: column;

      .tdb-s-form-btn {
        margin-bottom: 7px;

        &:last-child {
          margin-bottom: 0;
        }
      }
    }


    // File uploads
    .tdb-s-form-file {
      display: block;
      position: relative;

      &[data-file-type="document"],
      &:not([data-file-type="document"]):not(.tdb-s-form-file-previewing) {
        width: 100%;
        padding-bottom: 142px;
      }

      // Remove button
      .tdb-s-btn {
        min-width: auto;
        padding: 8px 10px 12px;

        &:active:not(:disabled) {
          outline-color: transparent;
        }

        svg {
          margin-right: 0;
          width: 14px;
        }

        &:not(.tdb-s-ffp-remove) {
          svg {
            &,
            * {
              fill: #fff;
            }
          }
        }
      }
    }
    .tdb-s-form-file-box,
    .tdb-s-form-file-preview-image,
    .tdb-s-form-file-preview-video {
      .tdb-s-btn {
        position: absolute;
        right: 15px;
      }
    }
    .tdb-s-form-file-box,
    .tdb-s-form-file-preview-image {
      .tdb-s-btn {
        bottom: 15px;
      }
    }
    .tdb-s-form-file-preview-video {
      .tdb-s-btn {
        top: 15px;
      }
    }

    // File uploads boxes general
    .tdb-s-form-file-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      padding: 0 15px;
      font-size: 1em;
      line-height: 1.3;
      font-weight: 600;
      color: #444;
      border: 2px solid #D7D8DE;
      border-radius: 5px;
      outline: 3px solid transparent;
      transition: border-color .2s ease-in-out, color .2s ease-in-out, outline-color .2s ease-in-out;
    }

    .tdb-s-ffu-ico {
      width: 40px;
      margin-bottom: 10px;
      stroke: #bfbfbf;
      transition: stroke .2s ease-in-out;
    }

    .tdb-s-ffu-txt {
      text-align: center;
    }

    // File uploads previews
    // Image preview
    .tdb-s-form-file-preview-image {
      position: relative;

      .tdb-s-ffip-img {
        padding-bottom: 30%;
        background-color: #eee;
        border-radius: 5px;
        background-size: cover;
        background-position: center;
      }
    }

    // Audio preview
    .tdb-s-form-file-preview-audio {
      display: flex;
      align-items: center;
      min-height: 54px;

      audio {
        flex: 1;
        margin-right: 26px;
      }
    }

    // Video preview
    .tdb-s-form-file-preview-video {
      min-height: 54px;

      video {
        width: 100%;
        border-radius: 5px;
      }
    }

    // Upload box
    .tdb-s-form-file-upload {
      .tdb-s-ffu-ico {
        pointer-events: none;
      }
    }

    // Input
    .tdb-s-form-file-input {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }

    // Disabled state
    .tdb-s-form-file-disabled {
      pointer-events: none;
      opacity: .6;
    }

    // Hover/dragover state
    .tdb-s-form-file {
      &:hover,
      &.tdb-s-form-file-dragover {
        .tdb-s-form-file-upload {
          border-color: #0489FC;
          outline-color: rgba(4, 137, 252, .1);
          color: #0489FC;

          .tdb-s-ffu-ico {
            stroke: #0489FC;
          }
        }
      }
    }

    // Error state
    .tdb-s-fg-error .tdb-s-form-file .tdb-s-form-file-upload {
      border-color: #FF0000 !important;
      outline: 3px solid rgba(255, 0, 0, .1);
    }

    // File preview state
    .tdb-s-form-file-previewing {
      .tdb-s-form-file-upload {
        display: none;
      }
    }


    // WpEditor
    .tdb-s-form-wpeditor {
      border: 2px solid #D7D8DE;
      border-radius: 5px;
      outline: 3px solid transparent;
      transition: border-color .2s ease-in-out, color .2s ease-in-out, outline-color .2s ease-in-out;

      .mce-panel {
        background-color: transparent;
      }

      .mce-toolbar .mce-btn-group .mce-btn:not(.mce-listbox):focus,
      .mce-toolbar .mce-btn-group .mce-btn:not(.mce-listbox):hover,
      .mce-toolbar .mce-btn-group .mce-btn:not(.mce-listbox).mce-active,
      .mce-toolbar .mce-btn-group .mce-btn:not(.mce-listbox):active,
      .qt-dfw:focus,
      .qt-dfw:hover,
      .qt-dfw.active,
      .wp-core-ui .button,
      .wp-core-ui .button-secondary {
        background-color: #fff;
        box-shadow: none;
        border-color: #e7e6e6;
      }

      .wp-core-ui .button,
      .wp-core-ui .button-secondary {
        color: #50575e;
      }

      .mce-toolbar .mce-btn-group .mce-btn.mce-listbox {
        border-color: #e7e6e6;
        box-shadow: none;
      }

      .wp-editor-tools {
        display: flex;
        align-items: center;
        background-color: #f5f5f5;
        margin: 6px 6px 0;
        padding: 7px 9px 4px;
        border-radius: 4px 4px 0 0;
      }

      .wp-editor-tabs {
        display: flex;
        align-items: center;
        margin-left: auto;
      }

      .wp-switch-editor {
        margin: 0;
        padding: 1px 7px 2px;
        background-color: transparent;
        text-transform: uppercase;
        font-size: 11px;
        line-height: 1;
        font-weight: 500;
        border-width: 1px;
        border-color: transparent;
        border-radius: 4px;
      }

      .switch-tmce {
        margin-right: 3px;
      }

      .wp-switch-editor:hover,
      .html-active .switch-html,
      .tmce-active .switch-tmce {
        border-color: #e7e6e6;
      }

      .html-active .switch-html,
      .tmce-active .switch-tmce {
        background-color: #fff;
      }

      .wp-editor-container {
        border: 0;
      }

      .wp-editor-container {
        width: calc(~'100% - 12px') !important;
        margin: 0 6px 6px;
      }

      .mce-tinymce {
        border: 0 !important;
      }

      .mce-top-part {
        &:before {
          display: none;
        }
      }

      .quicktags-toolbar {
        padding: 5px 7px;
        border-bottom: 0;
      }

      .mce-toolbar-grp {
        background-color: #f5f5f5;
        border-bottom: 0;
        border-radius: 0 0 4px 4px;

        > div {
          padding: 5px 7px;
        }
      }

      .mce-statusbar {
        border-top: none;
      }
    }

    .tdb-s-form-wpeditor-disabled {
      pointer-events: none;
      opacity: .6;
    }

    .tdb-s-fg-error .tdb-s-form-wpeditor {
      border-color: #FF0000 !important;
      outline: 3px solid rgba(255, 0, 0, .1);
    }


    // Datepicker
    .tdb-s-form-datepicker {
      &:focus {
        border-color: #0489FC !important;
        outline-width: 3px;
        outline-style: solid;
        outline-color: rgba(4, 137, 252, .1);
      }
    }


    // Form groups
    .tdb-s-form-group {
      position: relative;
      width: 100%;
      padding: 0 13px;

      &:not(:last-child) {
        margin-bottom: 28px;
      }
    }


    // Form groups small
    .tdb-s-form-group-sm {
      // Labels
      .tdb-s-form-label {
        font-size: .857em;
        margin-bottom: 6px;
      }


      // Inputs general
      .tdb-s-form-input {
        padding: 0 10px 2px;
        height: 36px;
        min-height: 36px;
        font-size: .929em;
      }


      // Textarea input
      textarea.tdb-s-form-input {
        min-height: 76px;
        padding-top: 6px;
        padding-bottom: 6px;
        line-height: 1.5;
      }


      // Select2 input
      .tdb-s-form-select-wrap {
        .select2-selection {
          height: 36px;
          font-size: .929em;
        }
      }


      // Checkbox/radio inputs
      .tdb-s-form-check {
        .tdb-s-fc-check {
          width: 17px;
          height: 17px;

          &:after {
            top: 2px;
            left: 2px;
          }
        }

        .tdb-s-fc-title {
          font-size: 13px;
          line-height: 1.2;
        }
      }
    }


    // Form groups error state
    .tdb-s-fg-error {
      .tdb-s-form-input {
        &,
        &:focus:not([readonly]) {
          border-color: #FF0000 !important;
          outline: 3px solid rgba(255, 0, 0, .1);
        }
      }
    }
    .tdb-s-fg-error-msg {
      position: absolute;
      top: calc(~'100% + 3px');
      left: 0;
      width: 100%;
      padding: 0 13px;
      font-size: .786em;
      line-height: 1.3;
      color: #FF3838;
    }


    // Form content
    .tdb-s-form-content {
      .tdb-s-notif {
        margin-top: 32px;
      }
    }


    // Form footer
    .tdb-s-form-footer {
      display: flex;
      align-items: center;
      margin-top: 40px;

      .tdb-s-btn {
        margin-right: 26px;

        &:last-of-type {
          margin-right: 0;
        }
      }
    }
  }


  // Select2 dropdown
  & > .select2-container,
  .tdb-s-select2.select2-dropdown,
  .tdb-s-select2 .select2-search,
  .tdb-s-select2 .select2-results {
    display: block;
  }
  & > .select2-container {
    z-index: 10005;
  }
  &.admin-bar .tdb-s-select2.select2-dropdown {
    margin-top: 36px;
  }
  .tdb-s-select2.select2-dropdown {
    margin-top: 4px;
    background-color: #fff;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
    font-size: 14px;
    border: 2px solid #D7D8DE;
    border-radius: 5px;
    outline-width: 3px;
    outline-style: solid;
    outline-color: rgba(215, 216, 222, .18);
  }
  .tdb-s-select2 .select2-search {
    padding: 6px;
  }
  .tdb-s-select2 .select2-search__field {
    padding: 0 10px 2px;
    width: 100%;
    height: 36px;
    min-height: 36px;
    font-size: .929em;
    line-height: 1.3;
    font-weight: 600;
    color: #444;
    border: 2px solid #D7D8DE;
    border-radius: 5px;
    outline: 3px solid transparent;
    box-shadow: none;
    transition: border-color .2s ease-in-out, color .2s ease-in-out, outline-color .2s ease-in-out;
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box;
    box-sizing: border-box;
  }
  .tdb-s-select2 .select2-results__options {
    list-style-type: none;
    margin: 0;
    padding: 0 0 4px;
    max-height: 277px;
    font-size: .929em;
    font-weight: 600;
    color: #444;
    overflow-y: auto;
  }
  .tdb-s-select2 .select2-results__options li {
    margin: 0;
    padding: 2px 10px 4px;
    cursor: pointer;
  }
  .tdb-s-select2 .select2-results__options li:hover {
    background-color: #F8F8F8;
  }


  // Datepicker control
  .tdb-s-datepicker-control {
    padding: 14px;
    width: 279px;
    background-color: #fff;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
    font-size: 11px;
    color: #444;
    line-height: 1;
    font-weight: 600;
    border: 2px solid #D7D8DE;
    border-radius: 5px;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .12);

    &:before,
    &:after {
      display: none;
    }

    // Inputs
    select,
    input {
      padding: 0 17px 1px 8px !important;
      min-height: 29px;
      background-color: #fff;
      font-size: inherit !important;
      font-weight: inherit !important;
      color: inherit !important;
      border: 2px solid rgba(215, 216, 222, .5) !important;
      border-radius: 5px !important;
      outline: 3px solid transparent !important;
      transition: border-color .2s ease-in-out, outline .2s ease-in-out;
      -webkit-appearance: none !important;

      &:focus {
        box-shadow: none;
        border-color: #D7D8DE !important;
        outline-color: rgba(215, 216, 222, .2) !important;
      }
    }

    select {
      &,
      &:focus,
      &:hover {
        background: #fff url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6.794" height="9.822" viewBox="0 0 6.794 9.822"><g transform="translate(6.294 0.5) rotate(90)"><path d="M0,6.294a.5.5,0,0,1-.324-.12.5.5,0,0,1-.056-.7L1.816,2.9-.38.325a.5.5,0,0,1,.056-.7.5.5,0,0,1,.7.056l2.473,2.9a.5.5,0,0,1,0,.649L.38,6.118A.5.5,0,0,1,0,6.294Z" transform="translate(6.349 0)" fill="%23444"/><path d="M2.474,6.294a.5.5,0,0,1-.38-.175L-.38,3.221a.5.5,0,0,1,0-.649l2.473-2.9A.5.5,0,0,1,2.8-.38a.5.5,0,0,1,.056.7L.657,2.9l2.2,2.572a.5.5,0,0,1-.38.825Z" transform="translate(0 0)" fill="%23444"/></g></svg>') no-repeat right 8px center !important;
      }
    }

    .numInputWrapper {
      &:hover {
        background-color: transparent;
      }

      span {
        display: flex;
        justify-content: center;
        right: 8px;
        line-height: 1;
        font-size: 0;
        border: none;

        &:hover {
          background-color: transparent;
        }

        &:after {
          position: relative;
          top: 0;
          border: none;
        }
      }

      .arrowUp {
        align-items: flex-end;
        padding-bottom: 1px;

        &:after {
          content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6.799" height="3.477" viewBox="0 0 6.799 3.477"><path id="Path_4" data-name="Path 4" d="M2.474,6.294a.5.5,0,0,1-.38-.175L-.38,3.221a.5.5,0,0,1,0-.649l2.473-2.9A.5.5,0,0,1,2.436-.5.5.5,0,0,1,2.8-.38a.5.5,0,0,1,.056.7L.657,2.9l2.2,2.572a.5.5,0,0,1-.38.825Z" transform="translate(6.297 0.5) rotate(90)" fill="%23444"/></svg>');
        }
      }

      .arrowDown {
        align-items: flex-start;
        padding-top: 2px;

        &:after {
          content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6.786" height="3.466" viewBox="0 0 6.786 3.466"><path id="Path_3" data-name="Path 3" d="M0,6.294a.5.5,0,0,1-.324-.12.5.5,0,0,1-.056-.7L1.816,2.9-.38.325a.5.5,0,0,1,.056-.7.5.5,0,0,1,.7.056l2.473,2.9a.5.5,0,0,1,0,.649L.38,6.118A.5.5,0,0,1,0,6.294Z" transform="translate(6.294 0.497) rotate(90)" fill="%23444"/></svg>');
        }
      }
    }

    input {
      &,
      &:focus,
      &:hover {
        background-color: #fff !important;
      }
    }

    // Header controls
    .flatpickr-months,
    .flatpickr-month {
      color: inherit;
      overflow: visible;
    }

    .flatpickr-months {
      display: flex;
      align-items: stretch;
      margin: 0 -4px 10px;
    }

    .flatpickr-prev-month,
    .flatpickr-month,
    .flatpickr-next-month {
      height: auto;
      padding: 0 4px;
    }

    .flatpickr-prev-month,
    .flatpickr-next-month {
      display: flex;
      align-items: stretch;
      position: relative;
      width: 14.4%;

      &:before {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding-bottom: 1px;
        border-radius: 5px;
      }

      svg {
        display: none;
      }

      &:hover {
        &:before {
          background-color: rgba(4, 137, 252, .05);
        }
      }
    }

    .flatpickr-current-month {
      display: flex;
      position: relative;
      left: 0;
      padding: 0;
      width: 100%;
      height: auto;
      font-size: inherit;
      font-weight: inherit;

      select,
      .numInputWrapper {
        width: 50%;
      }

      select {
        margin: 0 4px 0 0;
      }

      .numInputWrapper {
        margin-left: 4px;

        &:hover {
          background-color: transparent;
        }
      }
    }

    .flatpickr-prev-month {
      &:before {
        content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10"><path d="M13,15a1,1,0,0,1-.707-.293l-4-4a1,1,0,0,1,0-1.414l4-4a1,1,0,0,1,1.414,1.414L10.414,10l3.293,3.293A1,1,0,0,1,13,15Z" transform="translate(-8 -5)" fill="%23878d93"/></svg>');
      }

      &:hover {
        &:before {
          content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10"><path d="M13,15a1,1,0,0,1-.707-.293l-4-4a1,1,0,0,1,0-1.414l4-4a1,1,0,0,1,1.414,1.414L10.414,10l3.293,3.293A1,1,0,0,1,13,15Z" transform="translate(-8 -5)" fill="%23152BF7"/></svg>');
        }
      }
    }

    .flatpickr-next-month {
      &:before {
        content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10"><path d="M13,15a1,1,0,0,1-.707-.293l-4-4a1,1,0,0,1,0-1.414l4-4a1,1,0,0,1,1.414,1.414L10.414,10l3.293,3.293A1,1,0,0,1,13,15Z" transform="translate(14 15) rotate(180)" fill="%23878d93"/></svg>');
      }

      &:hover {
        &:before {
          content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="6" height="10" viewBox="0 0 6 10"><path d="M13,15a1,1,0,0,1-.707-.293l-4-4a1,1,0,0,1,0-1.414l4-4a1,1,0,0,1,1.414,1.414L10.414,10l3.293,3.293A1,1,0,0,1,13,15Z" transform="translate(14 15) rotate(180)" fill="%23152BF7"/></svg>');
        }
      }
    }

    .flatpickr-innerContainer,
    .flatpickr-weekdays {
      overflow: visible;
    }

    .flatpickr-weekdays {
      position: relative;
      margin-bottom: 8px;
      padding-bottom: 1px;

      &:before {
        content: '';
        position: absolute;
        top: 0;
        left: -14px;
        width: calc(~'100% + 28px');
        height: 100%;
        background-color: rgba(4, 137, 252, .05);
        z-index: -1;
      }
    }

    .flatpickr-weekdaycontainer {
      margin-left: -4px;
      margin-right: -4px;
    }

    .flatpickr-weekday {
      padding: 0 4px;
      font-size: 0;
      font-weight: inherit;
      color: inherit;

      &:before {
        font-size: 11px;
      }

      &:nth-child(1):before { content: 'S'; }
      &:nth-child(2):before { content: 'M'; }
      &:nth-child(3):before { content: 'T'; }
      &:nth-child(4):before { content: 'W'; }
      &:nth-child(5):before { content: 'T'; }
      &:nth-child(6):before { content: 'F'; }
      &:nth-child(7):before { content: 'S'; }
    }

    .flatpickr-days,
    .dayContainer {
      width: 100%;
    }

    .dayContainer {
      row-gap: 8px;
      width: auto;
      max-width: none;
      min-width: 0;
      margin-left: -4px;
      margin-right: -4px;
    }

    .flatpickr-day {
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      height: 29px;
      padding: 0 4px 1px;
      background: transparent !important;
      font-size: inherit;
      line-height: 1;
      font-weight: inherit;
      color: inherit;
      border: none;
      border-radius: 5px;
      transition: color .2s ease-in-out;

      &:before {
        content: '';
        position: absolute;
        top: 0;
        left: 4px;
        width: calc(~'100% - 8px');
        height: 100%;
        background-color: transparent;
        border-radius: 5px;
        transition: background-color .2s ease-in-out;
        z-index: -1;
      }

      &.prevMonthDay,
      &.nextMonthDay {
        opacity: .45;
      }

      &:not(.selected):not(.today) {
        &:hover {
          color: #152BF7;

          &:before {
            background-color: rgba(4, 137, 252, .05);
          }
        }
      }

      &.today {
        color: #152BF7;

        &:before {
          background-color: rgba(4, 137, 252, .1);
        }
      }

      &.selected {
        color: #fff;

        &:before {
          background-color: #0489FC;
        }
      }
    }

    // Timepicker
    &.hasTime {
      .flatpickr-time,
      .numInputWrapper {
          height: auto;
      }

      .flatpickr-time {
        align-items: stretch;
        margin: 0 -4px 0;
        line-height: 1;
        overflow: visible;
        border-top-color: #D7D8DE;

        &:first-child {
          border-top: 0;
        }
      }

      .flatpickr-innerContainer + .flatpickr-time {
        margin-top: 8px;
        padding-top: 8px;
      }

      .numInputWrapper,
      .flatpickr-am-pm {
        padding: 0 4px;
      }

      .flatpickr-am-pm {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 29px;
        position: relative;
        background-color: transparent !important;
        color: inherit;

        &:before {
          content: '';
          position: absolute;
          top: 0;
          left: 4px;
          width: calc(~'100% - 8px');
          height: 100%;
          background-color: transparent;
          transition: background-color .2s ease-in-out;
          border-radius: 5px;
          z-index: -1;
        }

        &:hover {
          color: #152BF7;

          &:before {
            background-color: rgba(4, 137, 252, .05);
          }
        }
      }
    }
  }
}