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%;
  scroll-padding-top: 76px;
}

body {
  margin-bottom: 0;
  scroll-padding-top: 76px;
  padding-top: 72px;
}

html, body {
  overflow-x: hidden;
}

/* Navbar – fixed top for guaranteed visibility */
header {
  position: static;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

.navbar.navbar-light {
  background: linear-gradient(90deg, #6aa4ff 0%, #3a6fe0 35%, #1e3a8a 100%) !important;
}

.navbar.fixed-top {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1030 !important;
  background: linear-gradient(90deg, #6aa4ff 0%, #3a6fe0 35%, #1e3a8a 100%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-text {
  color: #fff !important;
}

.navbar .nav-link:hover,
.navbar .navbar-brand:hover {
  color: #e6f0ff !important;
}

.navbar .nav-link,
.navbar .btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 0.35rem 0.85rem;
  transition: background .2s ease, transform .15s ease;
}

.navbar .nav-link:hover,
.navbar .btn:hover {
  background: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

.navbar .navbar-toggler {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}
.navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* Content offset for fixed navbar */
body:not(.body-fill) > div.container,
body:not(.body-fill) > div.container-fluid {
  padding-top: 0;
}

.main-fill {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 0.75rem;
  padding-bottom: 1rem;
}

body.body-fill {
  min-height: 100vh;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

body.body-fill > header {
  flex: 0 0 auto;
}

body.body-fill > .container-fluid {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dsr-page {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 120px;
}

.dsr-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dsr-form .dsr-filters,
.dsr-form .dsr-totals,
.dsr-form .dsr-actions {
  flex: 0 0 auto;
}

.dsr-form .dsr-grid {
  flex: 1 1 auto;
  min-height: 0;
}

.dsr-form .dsr-grid table {
  margin-bottom: 0;
  table-layout: auto;
}

#dsrGrid {
  table-layout: auto;
  width: 100%;
}

#dsrGrid th,
#dsrGrid td {
  vertical-align: middle;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
}

#dsrGrid th {
  font-weight: 600;
  text-align: center;
}

#dsrGrid th:nth-child(2),
#dsrGrid td:nth-child(2) {
  white-space: normal;
  min-width: 260px;
}

#dsrGrid th:nth-child(3),
#dsrGrid td:nth-child(3) {
  min-width: 140px;
}

#dsrGrid th:nth-child(4),
#dsrGrid td:nth-child(4) {
  min-width: 130px;
}

#dsrGrid th:nth-child(6),
#dsrGrid td:nth-child(6) {
  min-width: 150px;
}

#dsrGrid th:nth-child(7),
#dsrGrid td:nth-child(7) {
  min-width: 170px;
}

#dsrGrid input.form-control {
  width: 100%;
  box-sizing: border-box;
}

#dsrGrid input.form-control-sm {
  padding: 0.15rem 0.4rem;
  height: calc(1.5em + 0.3rem);
}

#dsrGrid .form-check-input {
  margin: 0 auto;
  transform: scale(1.1);
}

#dsrGrid td.text-center {
  text-align: center;
}

#dsrGrid td.text-end {
  text-align: right;
}

/* Fixed bottom control bar on DSR page */
.dsr-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1rem;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background-color: #fff;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.15);
  margin: 0 1rem;
}

.dsr-bottom-bar .dsr-totals {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
}

.dsr-bottom-bar .dsr-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.dsr-form {
  padding-bottom: 140px;
}

.dsr-page {
  padding-bottom: 140px;
}

@media (max-width: 1200px) {
  .dsr-totals {
    left: 1rem;
    right: auto;
    max-width: calc(100vw - 2rem - 340px);
  }
}

@media (max-width: 992px) {
  .dsr-totals {
    left: 1rem;
    right: 1rem;
    bottom: 5.5rem;
    max-width: calc(100vw - 2rem);
  }
  .dsr-form {
    padding-bottom: 180px;
  }
  .dsr-page {
    padding-bottom: 180px;
  }
}

/* Subtle 3D styling for DSR form controls */
.dsr-form .form-control,
.dsr-form .form-control-sm {
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.6);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.dsr-form .form-control:focus,
.dsr-form .form-control-sm:focus {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06), 0 0 0 0.2rem rgba(37,140,251,.25);
}
.dsr-form .btn,
.dsr-form .input-group-text {
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}
.dsr-form .btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.dsr-form .form-check-input {
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.06);
}
.dsr-form .form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.dsr-form .card {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
#dsrGrid td .form-control,
#dsrGrid td .form-control-sm {
  border-radius: 6px;
}
#dsrGrid .btn-outline-danger {
  border-radius: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
}

