/**********************
 * EXTERNAL COMPONENTS
 **********************/

@import "https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css";
/* @import "/css/bootstrap.min.css"; */
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");
/* @import "/css/bootstrap-icons.min.css"; */


/**********************
 * FRAMEWORK SETUP
 **********************/

/**********************
 * Some setup for the framework used
 * Everything goes into panels that handles scrolling
 * Scale the body to the full screen size and disable its scrolling
 **********************/
html {
  height: 100%;
}

body {
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: row;
}

#main {
  flex-grow: 1;
  /* Flex items won't shrink below their content's width otherwise: a wide table would make the whole page wider
     than the screen, cut off by the body. Now wide content scrolls inside its own box (e.g. ResponsiveTable). */
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/**********************
 * Some setup for PWA Standalone mode
 * (When it is an Installed app / Added to Home screen)
 **********************/
@media all and (display-mode: standalone) {
  /**
  * Need extra padding at the bottom.
  * This is to avoid going into the rounded corners on some phones
  * (Inside a browser a navigation bar keeps the content away from the corners)
  */
  #main-modal > div > div {
    padding-bottom: 35px;
  }

  nav.fixed-bottom > div {
    padding-bottom: 25px;
  }
}

body.ios-app {
  #main-modal > div > div {
    padding-bottom: 35px;
  }

  nav.fixed-bottom > div {
    padding-bottom: 25px;
  }
}

/**********************
 * CUSTOM COMPONENTS
 **********************/


.menu-target {
  overflow-x: hidden;
  min-height: 100%;
}

/**********************
 * Vertical inputs
 * This is to group inputs together vertically
 * It makes them merge over each other to share a border between them.
 * Only the top input has rounded corners at the top and
 * only the bottom input has rounded corners at the bottom.
 **********************/
div.vertical-inputs div.input {

  /*  Bring highlight to the front so that is isn't hidden under the input below*/

  &:focus-within {
    z-index: 2;
  }

  /*  Inputs except for the first one*/

  &:not(:first-child) div.input-group {
    /*  Remove rounded corners at the bottom*/

    input, span.input-group-text {
      border-top-left-radius: 0;
      border-top-right-radius: 0;
    }
  }

  /*  Inputs except for the last one*/

  &:not(:last-child) div.input-group {
    /*  Remove rounded corners at the top*/

    input, span.input-group-text {
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
      margin-bottom: -1px;
    }
  }
}

/**********************
 * CUSTOM STYLES
 * Some variations on the standard Bootstrap Styling
 **********************/

/*  Make navbars look a but more like app menus, give a bit darker background and a gradient by default*/
.navbar {
  background-color: var(--bs-tertiary-bg);
  background-image: var(--bs-gradient);

  ul li {
    &.nav-item {
      /*  Give a little softer feel*/
      border-radius: 4px;
    }

    &.nav-item, &.dropdown-item {
      /*  Make a little darker when the mouse is over a menu item*/

      &:hover {
        background: #0002;
      }
    }

    /*  Make dropdown look a bit more like the menu*/

    ul.dropdown-menu {
      background-color: var(--bs-tertiary-bg);
      border-radius: 4px;
      padding: 4px 0;

      li.dropdown-item {
        padding: 2px 0;
      }
    }

  }

  /*  Add option for a compact menu*/

  &.small-menu {
    --bs-navbar-padding-y: 0;
    font-size: 80%;

    .navbar-brand {
      font-size: 1em;
    }

    /* A toggle button that fits the compact bar, rather than making it taller */
    .navbar-toggler {
      --bs-navbar-toggler-padding-y: 0;
      --bs-navbar-toggler-padding-x: 0.4rem;
      --bs-navbar-toggler-font-size: 1rem;
    }
  }

  &.medium-menu {
    --bs-navbar-padding-y: 4px;
  }
}

/*  Short screens (Typically a phone in landscape mode)*/
@media (max-height: 500px) {

  /*  Make inputs a bit smaller*/
  .form-floating > {

    .form-control, .form-control-plaintext, .form-select {
      height: calc(2.5rem + calc(var(--bs-border-width) * 2));
      min-height: calc(2.5rem + calc(var(--bs-border-width) * 2));

      ~ label {
        /* Center vertically in smaller input padding: 0.5 rem .75 rem;*/
      }

      /* When focused or has content (Small label) &: focus, &: not(: placeholder-shown) {*/

      ~ label {
        font-size: 90%;

        &::after {
          height: 0;
        }
      }
    }
  }
}

/* A table's body cells are one line, cut off with an ellipsis at --sc-cell-max-width (Table::CellWidth()), the full
   text in a popover when cut off (app.js cutCells()). Wrap() asks for lines instead: a cell, a heading cell's column (its
   cells get .cell-wrap from app.js), the whole table. Cells with controls in them stay as they were: cutting them off
   would clip their menus and focus rings. */
.table:not(.table-wrap) > tbody > tr > :is(td, th):not(.cell-wrap):not(:has(.dropdown, .btn-group, .progress, form, input, select, textarea, button, .btn, .form-check)) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: var(--sc-cell-max-width, 20rem);
}

/* A cut-off cell shows its full text when hovered, tapped or focused */
.table > tbody > tr > .cell-cut {
  cursor: help;
}

.popover.cell-popover {
  --bs-popover-max-width: min(40rem, 90vw);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

table > tbody > tr > td > input {
  margin-top: -6px;
  margin-bottom: -6px;
}

.flex-row > * {
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
  margin-top: var(--bs-gutter-y);
}

/* A heading that sorts the table when clicked (TableHeadingCell::Sort) */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;

  &:hover {
    color: var(--bs-link-hover-color);
  }
}

/* A popup's refresh button turns while its page loads again (app.js refreshModal()), so a click always shows */
.modal-refresh.busy i {
  display: inline-block;
  animation: modal-refresh-spin .8s linear infinite;
}

@keyframes modal-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Nav overflow (js/app.js navOverflow()): the wrapper takes the room there is, not what its items would like, so
   moving items into More doesn't change what it measures; the nav stays one line. Without Overflow() the wrapper
   (BS\Tabs, BS\Menu) takes no part in the layout. */
.nav-wrap:not(.nav-overflow) {
  display: contents;
}

/* Its container may shrink below the nav's full width too (a flex item, such as a navbar's item bar, won't by itself) */
:has(> .nav-overflow) {
  min-width: 0;
}

.nav-overflow {
  flex: 1 1 0;
  min-width: 0;

  > .nav, > .navbar-nav {
    flex-wrap: nowrap;
  }

  .nav-overflow-hidden {
    display: none !important;
  }
}

/* The calendar of date fields (BS\DatePicker, Vanilla Calendar Pro) in Bootstrap's colours, light and dark */
.vc {
  --vc-bg: var(--bs-body-bg);
  --vc-color: var(--bs-body-color);
  --vc-header-color: var(--bs-body-color);
  --vc-title-color: var(--bs-body-color);
  --vc-date-color: var(--bs-body-color);
  --vc-date-outside-color: var(--bs-secondary-color);
  --vc-date-disabled-color: var(--bs-tertiary-color);
  --vc-date-bg-hover: var(--bs-secondary-bg);
  --vc-date-hover-bg: var(--bs-secondary-bg);
  --vc-date-today-color: var(--bs-primary);
  --vc-date-selected-bg: var(--bs-primary);
  --vc-date-selected-color: #fff;
  --vc-date-weekend-selected-bg: var(--bs-primary);
  --vc-date-weekend-selected-color: #fff;
  --vc-date-range-middle-bg: var(--bs-primary-bg-subtle);
  --vc-date-range-middle-color: var(--bs-primary-text-emphasis);
  --vc-date-hover-edge-bg: var(--bs-primary-border-subtle);
  --vc-months-years-bg-selected: var(--bs-primary);
  --vc-months-years-color-selected: #fff;
  --vc-focus-outline-color: var(--bs-primary);
  font-family: var(--bs-body-font-family);
  border: var(--bs-border-width) solid var(--bs-border-color-translucent);
  box-shadow: var(--bs-box-shadow);
  /* Above popups and side panels, which a date field may be in */
  z-index: 1090;
}

/* Multi-selects (BS\MultiSelect, js/app.js multiSelect()): a field like a floating-label input, with chips and the
   search inside, its label always up; the list under it */
.multi-select-field {
  position: relative;

  > .multi-select {
    display: flex;
    align-items: flex-start;
    gap: .25rem;
    height: auto;
    min-height: calc(3.5rem + calc(var(--bs-border-width) * 2));
    padding-top: 1.625rem;
    padding-bottom: .375rem;
    cursor: text;

    &.focus {
      color: var(--bs-body-color);
      background-color: var(--bs-body-bg);
      border-color: #86b7fe;
      outline: 0;
      box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
    }

    &.is-invalid {
      border-color: var(--bs-form-invalid-border-color);
    }

    &.disabled {
      background-color: var(--bs-secondary-bg);
      cursor: default;
    }
  }

  > .multi-select ~ label {
    color: rgba(var(--bs-body-color-rgb), .65);
    transform: scale(.85) translateY(-.5rem) translateX(.15rem);
    pointer-events: auto;
  }

  .multi-select-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    flex: 1 1 auto;
    min-width: 0;
  }

  .multi-select-chip {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    font-size: .875em;

    .btn-close {
      --bs-btn-close-opacity: .75;
      width: .5em;
      height: .5em;
      background-size: .5em;
    }
  }

  .multi-select-search {
    flex: 1 1 4rem;
    min-width: 4rem;
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    color: inherit;
  }

  .multi-select-clear {
    flex: none;
    margin-top: .25rem;
    width: .6em;
    height: .6em;
    background-size: .6em;
  }

  .multi-select-menu {
    /* Above sticky headers and columns (1020), below fixed bars (1030) */
    z-index: 1025;
    width: 100%;
    max-height: 18rem;
    overflow-y: auto;
    top: 100%;
    left: 0;
    margin-top: .125rem;
  }

  .multi-select-tools {
    display: flex;
    justify-content: space-between;
    padding: 0 .5rem .25rem;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color-translucent);
    margin-bottom: .25rem;
  }

  .multi-select-option {
    display: flex;
    align-items: center;

    &.focus {
      background-color: var(--bs-tertiary-bg);
    }

    &:disabled {
      opacity: .5;
    }
  }
}


/* The icon demo (demos/icons.php): tiles that fit the width, the icon at the chosen size */
.icon-grid {
  --icon-size: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: .5rem;

  .icon-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .75rem .25rem .5rem;
    border: var(--bs-border-width) solid var(--bs-border-color-translucent);
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    min-width: 0;

    &:hover, &:focus-visible {
      background: var(--bs-tertiary-bg);
    }

    &.copied {
      border-color: var(--bs-success);
      background: var(--bs-success-bg-subtle);
    }

    &[hidden] {
      display: none;
    }

    i {
      font-size: var(--icon-size);
      line-height: 1;
      height: 32px;
      display: flex;
      align-items: center;
    }

    .icon-case, .icon-class {
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .icon-case {
      font-size: .8rem;
    }

    .icon-class {
      font-size: .7rem;
      color: var(--bs-secondary-color);
    }
  }
}

/* Time fields (BS\TimePicker, js/app.js timePicker()): columns of hours, minutes (seconds, AM/PM) under the field */
.time-picker-field {
  position: relative;

  .time-picker-menu {
    /* Above sticky headers and columns (1020), below fixed bars (1030) */
    z-index: 1025;
    top: 100%;
    left: 0;
    margin-top: .125rem;
    padding: .25rem;
  }

  .time-picker-columns {
    display: flex;
    gap: .25rem;
  }

  .time-picker-column {
    height: 13rem;
    overflow-y: auto;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 .125rem;
  }

  .time-picker-cell {
    border: 0;
    border-radius: var(--bs-border-radius-sm);
    background: transparent;
    color: var(--bs-body-color);
    padding: .25rem .75rem;
    font-variant-numeric: tabular-nums;

    &:hover:not(:disabled) {
      background: var(--bs-tertiary-bg);
    }

    &.active {
      background: var(--bs-primary);
      color: #fff;
    }

    &:disabled {
      color: var(--bs-tertiary-color);
    }
  }

  .time-picker-footer {
    display: flex;
    align-items: center;
    gap: .25rem;
    border-top: var(--bs-border-width) solid var(--bs-border-color-translucent);
    margin-top: .25rem;
    padding-top: .25rem;
  }
}


/* MultiSelect's "Add ..." entry (data-bs-creatable) */
.multi-select-create {
  font-style: italic;
}

/* File fields (BS\FileInput, js/app.js fileInput()): the file input lies over its drop zone, invisible, so a click
   anywhere on the zone chooses files; without the script it shows as an ordinary file field */
.file-drop {
  position: relative;
  border: var(--bs-border-width) dashed var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg);
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--bs-secondary-color);
  transition: border-color .15s, background-color .15s;

  > input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }

  .file-drop-text .bi {
    display: block;
    font-size: 1.75rem;
    margin-bottom: .25rem;
  }

  &.dragging, &:hover, &:focus-within {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
  }

  &:focus-within {
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
  }

  > .invalid-feedback {
    text-align: start;
  }
}

.was-validated .file-drop:has(:invalid) {
  border-color: var(--bs-form-invalid-border-color);

  > .invalid-feedback {
    display: block;
  }
}

.file-list {
  margin: .5rem 0 0;

  .file-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem 0;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color-translucent);
  }

  .file-thumb {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: var(--bs-border-radius-sm);
  }

  .file-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .file-remove {
    flex: none;
  }
}

/* Groups of choices (BS\Choices): a fieldset like the other fields, its message under the choices once the form is
   checked; toggle buttons (Buttons()) side by side */
.choices {
  > legend {
    margin-bottom: .25rem;
  }

  .choices-button {
    display: inline-block;
    margin: 0 .25rem .25rem 0;
  }
}

.was-validated .choices:has(:invalid) {
  > .invalid-feedback {
    display: block;
  }

  .form-check-label {
    color: var(--bs-form-invalid-color);
  }
}

/* Password fields (BS\PasswordInput): the show/hide button joins the field; the strength meter under it, as Bootstrap
   6's Strength (four segments coloured up to the level in data-bs-strength) */
.password-field .password-toggle {
  border-color: var(--bs-border-color);
}

.strength {
  --strength-height: .25rem;
  --strength-gap: .25rem;
  --strength-margin-top: .375rem;
  --strength-border-radius: 50rem;
  --strength-bg: var(--bs-secondary-bg);
  --strength-color: var(--bs-secondary-bg);
  --strength-weak-color: var(--bs-danger);
  --strength-fair-color: var(--bs-warning);
  --strength-good-color: var(--bs-info);
  --strength-strong-color: var(--bs-success);
  display: flex;
  gap: var(--strength-gap);
  margin-top: var(--strength-margin-top);

  &[data-bs-strength="weak"] { --strength-color: var(--strength-weak-color); }
  &[data-bs-strength="fair"] { --strength-color: var(--strength-fair-color); }
  &[data-bs-strength="good"] { --strength-color: var(--strength-good-color); }
  &[data-bs-strength="strong"] { --strength-color: var(--strength-strong-color); }

  .strength-segment {
    flex: 1 1 0;
    height: var(--strength-height);
    border-radius: var(--strength-border-radius);
    background: var(--strength-bg);
    transition: background-color .15s;

    &.active {
      background: var(--strength-color);
    }
  }
}

.strength-text {
  display: block;
  min-height: 1.25em;
}

/* A date and a time in one (BS\DateTimePicker): the two fields side by side, the time narrower */
.date-time-picker-fields {
  display: flex;
  gap: .5rem;

  > .date-time-picker-date {
    flex: 3 1 0;
    min-width: 0;
  }

  > .date-time-picker-time {
    flex: 2 1 0;
    min-width: 0;
  }
}

/* Number fields (BS\NumberInput): the number at the end, as numbers line up */
.number-field {
  input[data-bs-toggle="number"] {
    text-align: end;
  }

  .number-step {
    border-color: var(--bs-border-color);
  }
}

/* One-time codes (BS\OtpInput, js/app.js otpInput()), as Bootstrap 6's OTP input: the real input lies over a box for
   each character, invisible; without the script it is an ordinary field */
.otp {
  position: relative;
  display: inline-flex;
  max-width: 100%;

  &:not(.otp-ready) .otp-input {
    display: block;
    width: 12rem;
    padding: .375rem .75rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 1.25rem;
    letter-spacing: .5em;
  }

  &.otp-ready .otp-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 1;
    font-size: 16px; /* no zoom on phones */
    caret-color: transparent;
    cursor: text;
  }

  .otp-slots {
    display: flex;
    align-items: center;
    gap: .5rem;
  }

  .otp-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 3.25rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s, box-shadow .15s;

    &.active {
      border-color: var(--bs-primary);
      box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
    }
  }

  .otp-separator {
    color: var(--bs-secondary-color);
    font-size: 1.25rem;
  }

  &.otp-connected .otp-slots {
    gap: 0;

    .otp-slot:not(:first-child) {
      margin-left: calc(-1 * var(--bs-border-width));
    }

    .otp-slot {
      border-radius: 0;
    }

    .otp-slot:first-child {
      border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius);
    }

    .otp-slot:last-child {
      border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
    }
  }

  &.is-invalid .otp-slot {
    border-color: var(--bs-form-invalid-border-color);
  }
}

.was-validated .otp:has(.otp-input:invalid) .otp-slot {
  border-color: var(--bs-form-invalid-border-color);
}

.otp-field > .form-label {
  display: block;
}

.was-validated .otp-field:has(:invalid) > .invalid-feedback {
  display: block;
}

/* BS\Stepper: numbered steps over a thin progress bar; on a phone "Step 2 of 4: ..." instead of the names */
.stepper {
  width: 100%;
}

.stepper-steps {
  gap: 0.5rem;
  padding: 0;
}

.stepper-step {
  flex: 1 1 0;
  min-width: 0;
}

.stepper-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.stepper-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper-marker {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  font-weight: 600;
}

.stepper-current .stepper-content {
  color: var(--bs-body-color);
  font-weight: 600;
}

.stepper-current .stepper-marker {
  border-color: var(--bs-primary);
  background: var(--bs-primary);
  color: #fff;
}

.stepper-done .stepper-marker {
  border-color: var(--bs-success);
  color: var(--bs-success);
}

a.stepper-content:hover .stepper-label {
  text-decoration: underline;
}

/* Charts (php/Chart): drawn as SVG with colours of their own (for emails and PDFs), which these adapt to the theme */
.sc-chart {
  margin: 0;
}

.sc-chart-title {
  font-weight: 600;
  margin-bottom: .5rem;
}

.sc-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.sc-chart .sc-axis text {
  fill: var(--bs-secondary-color);
}

.sc-chart .sc-grid line {
  stroke: var(--bs-border-color);
  stroke-opacity: 1;
}

.sc-chart .sc-pie-total {
  fill: var(--bs-body-color);
}

.sc-chart .sc-slice {
  stroke: var(--bs-body-bg);
}

.sc-chart [data-href] {
  cursor: pointer;
}

.sc-chart [data-href]:focus-visible {
  outline: 2px solid var(--bs-primary);
}

.sc-chart .sc-band:hover {
  fill-opacity: .08;
}

.sc-chart .sc-bar:hover,
.sc-chart .sc-slice:hover {
  opacity: .8;
}

.sc-chart .sc-series-link:hover,
.sc-chart .sc-series-link:focus-visible {
  stroke-opacity: .25;
  outline: none;
}

.sc-chart svg .sc-off {
  display: none;
}

.sc-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
  margin-top: .5rem;
  font-size: .875rem;
}

.sc-legend-item {
  cursor: pointer;
  user-select: none;
}

.sc-legend-item i {
  display: inline-block;
  width: .75rem;
  height: .75rem;
  margin-right: .35rem;
  border-radius: 2px;
  vertical-align: -.05rem;
}

.sc-legend-item.sc-off {
  opacity: .4;
  text-decoration: line-through;
}

.sc-pie-legend .sc-legend-item:not([data-href]) {
  cursor: default;
}

.sc-chart-tip {
  position: fixed;
  z-index: 1090;
  display: none;
  max-width: 20rem;
  padding: .25rem .5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  box-shadow: var(--bs-box-shadow-sm);
  font-size: .8125rem;
  white-space: pre-line;
  pointer-events: none;
}

/* The hover box with rows (a line chart's time, a bar, a slice): header, then colour, name and value per row */
.sc-chart-tip.sc-chart-tip-rows {
  max-width: none;
  padding: .5rem .75rem;
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow);
  white-space: nowrap;
}

.sc-chart-tip-head {
  margin: -.125rem 0 .375rem;
  padding-bottom: .375rem;
  border-bottom: 1px solid var(--bs-border-color);
  font-weight: 600;
}

.sc-chart-tip table td {
  padding: .125rem 0;
}

.sc-chart-tip table td:nth-child(2) {
  padding: .125rem 1.25rem .125rem .5rem;
  color: var(--bs-secondary-color);
}

.sc-chart-tip table i {
  display: inline-block;
  width: 1rem;
  height: .25rem;
  border-radius: .125rem;
  vertical-align: middle;
}

.sc-chart-tip-value {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sc-chart .sc-crosshair {
  stroke: var(--bs-secondary-color);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.sc-chart .sc-hover-dot {
  stroke: var(--bs-body-bg);
  stroke-width: 2;
}

/* With the crosshair, the strip itself stays see-through */
.sc-chart .sc-band[data-x]:hover {
  fill-opacity: 0;
}

.sc-stat {
  padding: .75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  background: var(--bs-body-bg);
}

.sc-stat[data-href] {
  cursor: pointer;
}

.sc-bargauge[data-href] {
  cursor: pointer;
}

.sc-bargauge[data-href]:hover {
  border-color: var(--bs-primary) !important;
}

.sc-stat[data-href]:hover {
  border-color: var(--bs-primary);
}

.sc-stat-caption {
  color: var(--bs-secondary-color);
  font-size: .875rem;
}

.sc-stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.sc-stat-change {
  font-size: .875rem;
}

.sc-stat-trend {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: .25rem;
}

/* A doughnut stays doughnut-sized in a wide panel */
.sc-chart.sc-pie svg {
  max-width: 320px;
  margin: 0 auto;
}

/* Dashboards (php/Chart/Dashboard.php) */
.sc-dashboard .sc-panel .sc-chart-title {
  font-size: .9375rem;
}

.sc-dashboard .sc-stat {
  height: 100%;
}

.sc-dashboard-bar .spin,
.sc-dashboard-bar i.spin {
  display: inline-block;
  animation: sc-spin 1s linear infinite;
}

@keyframes sc-spin {
  to {
    transform: rotate(360deg);
  }
}
