html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
.dt-navbar {
  background-color: #0d3b66;
  padding-top: env(safe-area-inset-top);
}

/* Top menu: white links instead of Bootstrap's grey, and a navy dropdown with white items. */
.dt-navbar .navbar-brand,
.dt-navbar .nav-link,
.dt-navbar .navbar-text {
  color: #fff;
}
.dt-navbar .nav-link:hover,
.dt-navbar .nav-link:focus,
.dt-navbar .nav-link.show {
  color: rgba(255, 255, 255, .8);
}
.dt-navbar .dropdown-menu {
  --bs-dropdown-bg: #0d3b66;
  --bs-dropdown-border-color: rgba(255, 255, 255, .15);
  --bs-dropdown-divider-bg: rgba(255, 255, 255, .2);
  --bs-dropdown-link-color: #fff;
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: #1a5490;
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: #1b6ec2;
  --bs-dropdown-header-color: rgba(255, 255, 255, .6);
}

/* Searchable select: a search box joined to the select list below it (see js/searchable-select.js). */
.dt-search-select-input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.dt-search-select-input + select {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: -1px;
}

/* Reports: keep long notes readable without stretching the table. */
.dt-report-notes {
  min-width: 12rem;
  white-space: pre-line;
}

/* AI assistant (admins): round button in the lower right corner and the chat window it opens. */
.dt-chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1040;
}
.dt-chat {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  width: 26rem;
  height: min(40rem, calc(100vh - 6rem));
  z-index: 1045;
  display: flex;
  flex-direction: column;
}
.dt-chat[hidden] {
  display: none;
}
.dt-chat-header {
  background-color: #0d3b66;
  color: #fff;
}
.dt-chat-header .form-select {
  min-width: 0;
}
.dt-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.dt-chat-msg {
  max-width: 90%;
  padding: .5rem .75rem;
  border-radius: .75rem;
  overflow-wrap: anywhere;
}
.dt-chat-user {
  align-self: flex-end;
  background-color: var(--bs-primary-bg-subtle);
  white-space: pre-wrap;
}
.dt-chat-assistant {
  align-self: flex-start;
  background-color: var(--bs-tertiary-bg);
}
.dt-chat-assistant .dt-chat-body > :last-child {
  margin-bottom: 0;
}
.dt-chat-assistant table {
  font-size: .85rem;
  background-color: var(--bs-body-bg);
}
.dt-chat textarea {
  resize: none;
}
@media (max-width: 575.98px) {
  .dt-chat {
    right: .5rem;
    left: .5rem;
    width: auto;
    bottom: calc(.5rem + env(safe-area-inset-bottom));
    height: calc(100vh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    height: calc(100dvh - 1rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}
@media print {
  .dt-chat, .dt-chat-fab {
    display: none !important;
  }
}

/* AI assistant full screen (the button next to Close in the chat header). */
.dt-chat.dt-chat-max {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1050;
}
.dt-chat.dt-chat-max .dt-chat-msg {
  max-width: min(90%, 60rem);
}
body:has(.dt-chat.dt-chat-max:not([hidden])) {
  overflow: hidden;
}
.dt-chat .dt-chat-icon-restore,
.dt-chat.dt-chat-max .dt-chat-icon-max {
  display: none;
}
.dt-chat.dt-chat-max .dt-chat-icon-restore {
  display: inline;
}

/* Time picker for start / stop times (see js/time-picker.js). */
.dt-time {
  position: relative;
}
.dt-time > input[data-time-for] {
  cursor: pointer;
  background-color: var(--bs-body-bg);
}
.dt-time-panel {
  top: 100%;
  margin-top: .25rem;
  min-width: 16rem;
  user-select: none;
}
.dt-time-value {
  min-width: 2.75rem;
  text-align: center;
  line-height: 1.2;
}
.dt-time-step {
  width: 3rem;
  touch-action: manipulation;
}

/* Test site only: a bright strip above the menu so nobody mistakes it for the live system. */
.dt-test-banner {
  background: repeating-linear-gradient(-45deg, #facc15 0 14px, #fde047 14px 28px);
  color: #1f2937;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .05em;
  text-align: center;
  padding: calc(.25rem + env(safe-area-inset-top)) .75rem .25rem;
}
.dt-test-banner + .dt-navbar {
  padding-top: 0;
}
