:root {
  color-scheme: dark;
}

html {
  background-color: #06131d;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: #06131d;
}

* {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background-color: #38bdf8;
  color: #06131d;
}

:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.75);
  cursor: pointer;
}

select option {
  background-color: #081724;
  color: #ffffff;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  border: 1px solid #15394d;
  background-color: #06121b;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid #081724;
  background-color: #f5a623;
  cursor: grab;
}

input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #081724;
  border-radius: 9999px;
  background-color: #f5a623;
  cursor: grab;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 9999px;
  background-color: #06121b;
}

.table-scroll {
  scrollbar-color: #194e6d #06131d;
  scrollbar-width: thin;
}

/* Critical row: FRONTWALL BENDING < 50% AND FLOOR FINISH FORECAST < today - 4 */
tr.row-critical,
tr.row-critical:hover,
tr.row-critical td {
  background-color: #a50021;
}

tr.row-critical td,
tr.row-critical td * {
  color: #ffffff;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  background-color: transparent;
}

.resize-handle:hover,
.resize-handle:active {
  background-color: #38bdf8;
}

/* Vertical (rotated) column headers */
thead th {
  vertical-align: bottom;
}
.th-vertical {
  vertical-align: bottom;
}
.th-vertical .th-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
}
.th-vertical .th-text {
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
  transform: rotate(-90deg);
  transform-origin: center center;
}
.th-vertical .th-sort {
  display: block;
  margin: 4px auto 2px;
  width: 100%;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  color: #7e9bb0;
}

.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
  background-color: #06131d;
}

.table-scroll::-webkit-scrollbar-thumb {
  background-color: #194e6d;
  border-radius: 4px;
  border: 2px solid #06131d;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #38bdf8;
}

.skeleton {
  background-image: linear-gradient(90deg, #081724 25%, #143547 37%, #081724 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.toast-enter-active,
.toast-leave-active {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-enter-from,
.toast-leave-to {
  opacity: 0;
  transform: translateY(12px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
