/* ==========================================================================
   Author's custom styles
   ========================================================================== */


body {

  font-family: var(--brand-font-body);
  font-weight: 400;

  line-height: 1.5;
  padding: 6em 0em;
  color: #555;

  font-size: 14px;

  /* background-color: #fafafa; */

}

p {
  color: var(--brand-text);
}

.hideable {
  display: none;
}

.table td {
  background-color: #ffffff;
}

.navbar {
  background-color: var(--brand-canvas);
  border-width: 0px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.navbar-fixed-top {
  min-height: 80px;
}

.navbar-brand {
  padding-top: 0px;
  padding-bottom: 0px;
  line-height: 80px;
  color: #555;
}

.navbar-nav>.wrapper {
  display: flex;
  justify-content: space-between;
}

.navbar-nav .nav-group-2 {
  display: flex;
}

.navbar-nav>.wrapper a {
  text-decoration: none;
  padding-top: 0px;
  padding-bottom: 0px;
  color: var(--brand-blue);
  padding: 0 15px;
  /* line-height: 80px; */
}

.navbar-nav .logo-text {
  width: 200px;
  font-size: 15px;
}

.navbar-nav .brand-logo {
  /* scale: 0.76; */
  width: 200px;
}

.navbar-nav .user-icon {
  mix-blend-mode: darken;
  width: 30px;
}

.navbar-nav .nav-item {
  display: flex;
  height: 80px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.navbar-nav .dropdown-menu {
  left: unset;
  right: -13px;
  padding: 0;
}

.navbar-nav .dropdown-menu li a {
  padding: 5px;
  width: 280px;
  color: black;
  border-top: 1px solid;
}

.navbar-nav .dropdown-menu li:first-of-type a {
  border: 0;
}

.form-control {
  border: solid 1px black;
  transition: border 1s;
}

.form-control:focus {
  box-shadow: none;
  border: solid 1px #428bca;
}


.select2-container--default .select2-selection--multiple {
  background-color: white;
  border: solid 1px black;
  transition: border 1s;
  border-radius: 4px;
}

/* ── Global: force all Select2 widgets to full column width ──────────── */
/* Fixes the size mismatch between Select2 multi-selects (Measure Parameters,
   Keywords, Workstation Parts, lab selects, etc.) and plain .form-control
   inputs. Applies to every form in the application. */
.select2-container {
  width: 100% !important;
}
.select2-container .select2-search--inline .select2-search__field {
  width: 100% !important;
}


/* ─── Mobile hamburger toggle button ─────────────────── */
.nav-mobile-toggle {
  display: none;
  /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  margin: auto 0;
  /* vertically centre in the 80px bar */
}

.nav-mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brand-blue);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animate to × when active */
.nav-mobile-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-mobile-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-mobile-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile navbar breakpoint ───────────────────────── */
@media (max-width: 768px) {

  /* Shrink the navbar height on mobile */
  .navbar-fixed-top {
    min-height: 56px;
  }

  /* Adjust body top padding to match smaller navbar */
  body {
    padding-top: 56px !important;
  }

  /* Wrapper: logo on left, toggle on right */
  .navbar-nav>.wrapper {
    align-items: center;
    padding: 0 12px;
    height: 56px;
  }

  /* Show the toggle */
  .nav-mobile-toggle {
    display: flex;
  }

  /* Logo area: smaller on mobile */
  .navbar-nav .brand-logo {
    width: 110px;
  }

  .navbar-nav .logo-text {
    font-size: 11px;
    width: auto;
  }

  .navbar-nav .nav-group-1 {
    padding: 0;
  }

  /* Collapse nav-group-2 */
  .navbar-nav .nav-group-2 {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--brand-canvas);
    border-top: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    z-index: 1000;
    padding: 8px 0;
  }

  .navbar-nav .nav-group-2.nav-open {
    display: flex;
  }

  /* Stack nav items vertically, full width */
  .navbar-nav .nav-item {
    height: auto;
    padding: 12px 20px;
    width: 100%;
    justify-content: flex-start;
    /* border-bottom: 1px solid #e8e8e8; */
    font-size: 13px;
  }

  .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }

  /* User dropdown — full width on mobile */
  .navbar-nav .dropdown {
    width: 100%;
  }

  .navbar-nav .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: #eaeaea;
    width: 100%;
    right: auto;
    left: auto;
  }

  .navbar-nav .dropdown-menu li a {
    width: 100%;
    padding: 10px 28px;
  }

  /* Admin sidebar: adjust for shorter navbar */
  .admin-sidebar {
    top: 56px !important;
  }

  .admin-hamburger-float {
    top: 68px !important;
  }

  footer.container {
    padding-left: 0 !important;
  }
}

h1 {
  text-align: center;
  font-weight: bold;
  color: #555;
}

h3 {
  text-align: center;
  font-weight: bold;
  color: #555;
}

h4 {
  font-weight: bold;
  letter-spacing: 1px;
  /* text-transform: uppercase; */
  font-size: 18px;
  color: black;
}

button {
  background: var(--brand-blue);
  /* color: wheat; */
  border: 0;
  padding: 9px 15px;
  border-radius: 6px;
}

input[type='checkbox'] {
  accent-color: #555555;
}

footer {
  margin: 30px 10px;
}

footer button {
  width: 150px;
}

footer .help-icon {
  width: 20px;
}

footer button a {
  text-decoration: none;
  color: white;
}

footer button a:hover {
  text-decoration: none;
  color: rgb(235, 235, 235);
}

footer .tutorial {
  color: var(--brand-blue);
  text-align: center;
  margin-bottom: 10px;
}

footer .tutorial-section {
  display: flex;
  align-items: center;
  gap: 28px;
  justify-content: center;
}

/* ─────────────────────────────────────────────────────
   UNIFIED BUTTON SYSTEM  — single source of truth
   ───────────────────────────────────────────────────── */

.btn {
  padding: 8px 18px;
  font-weight: 600;
  letter-spacing: .3px;
  /* Keep Bootstrap's default border-radius (4px) — do not override here */
  transition: background .15s, box-shadow .15s, border-color .15s, color .15s;
  cursor: pointer;
}

/* Equal-width flex layout for button rows (replaces per-page scoped styles) */
.row.form-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.row.form-group .btn {
  flex: 1;
  margin: 0 5px;
}

/* Modal close button alignment fix — Bootstrap float:right doesn't work in flex */
#equipmentModal .modal-header .close,
#editLendModal .modal-header .close {
  margin-left: auto !important;
  float: none !important;
}

/* ── PRIMARY / SAVE — Intuceo blue ──────────────────────── */
.btn-primary,
.btn-save {
  color: #fff !important;
  background-color: var(--brand-blue) !important;
  border: 1px solid var(--brand-blue) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-save:hover,
.btn-save:focus,
.btn-save:active,
.open>.dropdown-toggle.btn-primary {
  color: #fff !important;
  background-color: var(--brand-blue-dark) !important;
  border-color: var(--brand-blue-dark) !important;
  box-shadow: 0 3px 10px rgba(18, 118, 225, 0.25) !important;
}

/* ── SUCCESS — also Intuceo blue (e.g. "Verify" button) ── */
.btn-success {
  color: #fff !important;
  background-color: var(--brand-blue) !important;
  border: 1px solid var(--brand-blue) !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
  color: #fff !important;
  background-color: var(--brand-blue-dark) !important;
  border-color: var(--brand-blue-dark) !important;
}

/* ── CANCEL / SECONDARY / DEFAULT — Neutral grey ───── */
.btn-secondary,
.btn-default,
.btn-cancel {
  color: #4b5563 !important;
  background-color: transparent !important;
  border: 1px solid #d1d5db !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-default:hover,
.btn-default:focus,
.btn-cancel:hover,
.btn-cancel:focus {
  color: #1e293b !important;
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

/* ── DANGER / DELETE — Red ──────────────────────────── */
.btn-danger,
.btn-delete {
  color: #fff !important;
  background-color: #dc3545 !important;
  border: 1px solid #dc3545 !important;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-delete:hover,
.btn-delete:focus {
  color: #fff !important;
  background-color: #b91c1c !important;
  border-color: #b91c1c !important;
}

/* ── SHARED UTILITIES (use instead of per-page scoped) */
/* Save / Submit */
.brand-btn-save {
  color: #fff;
  background: var(--brand-blue);
  border: 1px solid var(--brand-blue);
  border-radius: 8px;
  padding: 9px 26px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, box-shadow .15s;
  font-family: inherit;
}

.brand-btn-save:hover {
  background: var(--brand-blue-dark);
  box-shadow: 0 3px 10px rgba(18, 118, 225, 0.25);
}

/* Cancel */
.brand-btn-cancel {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 13.5px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}

.brand-btn-cancel:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

/* Delete */
.brand-btn-delete {
  background: transparent;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}

.brand-btn-delete:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* ── LEND — the system's green: a feature action, not a form save ── */
.btn-lend {
  color: #fff !important;
  background-color: var(--brand-success) !important;
  border: 1px solid var(--brand-success) !important;
}

.btn-lend:hover,
.btn-lend:focus,
.btn-lend:active {
  color: #fff !important;
  background-color: var(--brand-success-dark) !important;
  border-color: var(--brand-success-dark) !important;
}

.btn-lend:disabled,
.btn-lend[disabled] {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}

/* ── CLONE / COPY — Dark charcoal (utility action) ── */
.btn-copy {
  color: #fff !important;
  background-color: #4E4E50 !important;
  border: 1px solid #4E4E50 !important;
}

.btn-copy:hover,
.btn-copy:focus,
.btn-copy:active {
  color: #fff !important;
  background-color: #3a3a3c !important;
  border-color: #3a3a3c !important;
}

.form-inline {
  padding: 100px;
}

.form-horizontal .control-label {
  text-align: left;
}

.just-padding {
  padding: 15px;
}

.list-group.list-group-root {
  padding: 0;
  overflow: hidden;
}

.list-group.list-group-root .list-group {
  margin-bottom: 0;
}

.list-group.list-group-root .list-group-item {
  border-radius: 0;
  border-width: 1px 0 0 0;
}

.list-group.list-group-root>.list-group-item:first-child {
  border-top-width: 0;
}

.list-group.list-group-root>.list-group>.list-group-item {
  padding-left: 30px;
}

.list-group.list-group-root>.list-group>.list-group>.list-group-item {
  padding-left: 45px;
}

.list-group-item .glyphicon {
  margin-right: 5px;
}

.list-group>a.disabled {
  color: #999999;
}

.list-group>a.disabled:hover,
.list-group>a.disabled:focus {
  color: #999999;
  text-decoration: none;
  background-color: transparent;
  cursor: not-allowed;
}

table.floatThead-table {
  border-top: none;
  border-bottom: none;
  background-color: #fff;
}

.deleteFileBtn {
  padding-top: 0px;
  padding-bottom: 0px;
  color: #ffffff;
  background-color: #d9534f;
}

.eqptImg {
  height: 300px;
  background-size: 100% 100%;
}

.export {
  display: inline-block;
  margin-bottom: 0;
  text-align: center;
  cursor: pointer;
  background-image: none;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  font-weight: 700;
  background-color: var(--brand-blue);
  color: #fff;
}

.btn-go {
  padding-top: 6px;
  padding-bottom: 6px;
}

.file_container {
  padding-top: 11px;
  padding-left: 20px;
  margin-bottom: 15px;
  border: 1px solid black;
  border-radius: 5px;
}

.file_container>.form-group {
  margin-bottom: 8px;
}

.file_item {
  display: flex;
  align-items: center;
  padding: 5px;
  background: #f9fafb;
  border-radius: 6px;
  margin-left: 10px;
  margin-top: 5px;
}

.selected-for-deletion {
  background: #dc3545;
  color: white;
}

.selected-for-deletion a {
  color: white;
}

.file_container .file_status_text {
  margin-bottom: 4px;
  padding-right: 15px;
  float: right;
  color: #363636;
  font-size: smaller;
}

.pointer {
  cursor: pointer;
}


.unverified {
  opacity: 0.5;
  text-decoration: none;
  color: #ffffff !important;
  background: #5395ce;
}

.unverified:hover,
.unverified:focus {
  background-color: #7a97b0 !important;
}

.notAllowed {
  cursor: not-allowed;
  /* pointer-events: none; */

}

/* Handle required fields */
.required_field_empty {
  border-color: #dc3545;
  background-color: #dc3545;
}

.required_field_empty::placeholder {
  /* for Chrome,Firefox,Opera,Safari 10.1+ */
  color: white;
}

.required_field_empty:-ms-input-placeholder {
  /* for IE 10-11 */
  color: white;
}

.required_field_empty::-ms-input-placeholder {
  /* for Edge */
  color: white;
}


.dropdown-container {
  position: relative;
}


/* Styling for the list of options */
.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  z-index: 10;
  display: none;
}

.dropdown-item {
  padding: 10px;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: #f0f0f0;
}

.dropdown-list.show {
  display: block;
}


/* Skeleton Loader Styles */
.skeleton-loader {
  display: block;
  padding: 10px 20px;
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.skeleton-item {
  background-color: #ddd;
  border-radius: 4px;
  background-color: #ddd;
  margin: 15px 0;
  height: 25px;
  animation: skeleton-animation 1.2s ease-in-out infinite;

}

/* Create staggered skeleton effect */
.skeleton-item:nth-child(odd) {
  width: 60%;
}

.skeleton-item:nth-child(even) {
  width: 50%;
}




/* Animation for the skeleton loader */
@keyframes skeleton-animation {
  0% {
    background-color: #ddd;
  }

  50% {
    background-color: #f4f4f4;
  }

  100% {
    background-color: #ddd;
  }
}

/* Hide mobile layout on desktop by default */
.mobile-stacked-layout {
  display: none;
}

/* Hide mobile alerts on desktop */
.mobile-alerts {
  display: none;
}

.sidebar {
  position: fixed;
  left: 0;
  display: flex;
  height: calc(100vh - 80px);
  padding-top: 10px;
  top: 80px;
}

.sidebar .first-part {
  position: relative;
  width: 250px;
  z-index: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.sidebar .last-part {
  position: relative;
  left: 0;
  width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  /* width: 269px; */
}

.sidebar .list-group-item,
.sidebar .list-group.list-group-root {
  border: 0;
}

.sidebar .list-group-item.active {
  background: var(--brand-blue) !important;
}

.content {
  flex-grow: 1;
  margin: 25px;

  margin-left: 275px;
  /* margin-left: 544px; */
  min-height: 57vh;
}

.show-form {
  max-width: 600px;
  float: right;
}

.custom-flex-column {
  display: flex;
  flex-direction: column;
}

.upload-button {
  background: white !important;
  border: 1px solid !important;
  padding: 5px 9px;
  border-radius: 4px;
  padding-right: 37px;
  width: 147px;
  margin: 0;
}

#uppicture_container,
#upfile_container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.custom_file_input {
  display: none !important;
}

#equipment_info .form-group {
  margin-bottom: 10px;
}

.checkbox-group {
  display: flex;
  flex-direction: row-reverse;
  justify-content: left;
  gap: 8px;
  width: 100%;
}

.custom-checkbox input[type='checkbox'] {
  display: block;
  accent-color: #555555;
}

/* .checkbox-group .custom-checkbox{
  padding-top: 2px;
} */

/* Style the dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Export menu: the same green, for the same reason. */
.dropbtn {
  background-color: var(--brand-success);
  color: white;
  padding: 7px 15px;
  /* Keep original padding */
  font-size: 12px;
  /* Keep original font size */
  border: none;
  cursor: pointer;
  padding-bottom: 5px;
}

.dropbtn:hover {
  background-color: var(--brand-success-dark);
}

/* Dropdown content (hidden by default) */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #ffffff;
  min-width: 92px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border: 1px solid #ddd;
  z-index: 1000;
  top: 100%;
  right: 0;
  margin-top: 0;
  /* Removed gap between button and dropdown */
}

/* Dropdown links follow the button. */
.dropdown-content a {
  color: var(--brand-success);
  padding: 10px 15px;
  text-decoration: none;
  display: block;
  font-size: 12px;
  /* Keep original font size */
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.dropdown-content a:last-child {
  border-bottom: none;
  border-radius: 0 0 4px 4px;
}

.dropdown-content a:first-child {
  border-radius: 4px 4px 0 0;
}

.dropdown-content a:hover {
  background-color: #f5f5f5;
  color: var(--brand-success-dark);
  /* Darker on hover. */
}

/* Show the dropdown content when hovering over the button */
.dropdown:hover .dropdown-content {
  display: block;
}

/* Keep dropdown open when hovering over it */
.dropdown-content:hover {
  display: block;
}


.last-panel-header {
  display: flex;
  justify-content: space-between;
  margin: 0 5px;
  margin-bottom: 7px;
  position: sticky;
  top: 0;
  background-color: #f8f9fa;
  z-index: 10;
  padding: 5px 0;
  border-bottom: 1px solid #dee2e6;
  flex-shrink: 0;
}

.second-panel-header {
  position: sticky;
  top: 0;
  background-color: #f8f9fa;
  z-index: 10;
  padding: 5px 0;
  padding-left: 9px;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}

.first-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 9px;
  margin-bottom: 7px;
  position: sticky;
  top: 0;
  background-color: #f8f9fa;
  z-index: 10;
  padding: 5px 0;
  border-bottom: 1px solid #dee2e6;
  flex-shrink: 0;
}

/* Well styling for sidebar - align with headers */
.sidebar .well {
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  padding: 12px;
  padding-left: 9px;
  margin: 0;
  margin-bottom: 7px;
  font-size: 14px;
  color: #6c757d;
}

/* Ensure h4 in second-panel-header has no margin */
.second-panel-header h4 {
  margin: 0;
  line-height: 1.2;
}

/* Ensure icon in second-panel-header is properly aligned */
.second-panel-header img {
  display: block;
  flex-shrink: 0;
}

.last-panel-header button span img {
  width: 15px;
  margin-left: 5px;
  margin-bottom: 4px;
}

/* ── "Lended" pill badge in the equipment list ──────────────────────── */
.lend-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  background: #e3f2fd;
  color: var(--brand-blue);
  border: 1.5px solid #90caf9;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  margin-left: 8px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-transform: uppercase;
}

.lend-badge-pill:hover {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(18, 118, 225, .30);
}

.lend-badge-pill i {
  font-size: 12px;
}

/* Professional Pagination Styling */
.modern-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
}

.modern-pagination .pagination {
  margin: 0;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modern-pagination .pagination>li>a,
.modern-pagination .pagination>li>span {
  position: relative;
  float: left;
  padding: 8px 12px;
  margin: 0;
  line-height: 1.42857143;
  color: var(--brand-blue);
  text-decoration: none;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-right: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  min-width: 40px;
  text-align: center;
}

.modern-pagination .pagination>li:first-child>a,
.modern-pagination .pagination>li:first-child>span {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.modern-pagination .pagination>li:last-child>a,
.modern-pagination .pagination>li:last-child>span {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  border-right: 1px solid #dee2e6;
}

.modern-pagination .pagination>li>a:hover,
.modern-pagination .pagination>li>span:hover,
.modern-pagination .pagination>li>a:focus,
.modern-pagination .pagination>li>span:focus {
  color: #0d4a7a;
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.modern-pagination .pagination>.active>a,
.modern-pagination .pagination>.active>span,
.modern-pagination .pagination>.active>a:hover,
.modern-pagination .pagination>.active>span:hover,
.modern-pagination .pagination>.active>a:focus,
.modern-pagination .pagination>.active>span:focus {
  z-index: 2;
  color: #fff;
  cursor: default;
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
}

.modern-pagination .pagination>.disabled>span,
.modern-pagination .pagination>.disabled>span:hover,
.modern-pagination .pagination>.disabled>span:focus,
.modern-pagination .pagination>.disabled>a,
.modern-pagination .pagination>.disabled>a:hover,
.modern-pagination .pagination>.disabled>a:focus {
  color: #6c757d;
  cursor: not-allowed;
  background-color: #fff;
  border-color: #dee2e6;
}

/* Professional Legend/Definitions Styling */
.modern-legend {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 20px;
  margin: 30px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modern-legend .legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.modern-legend .legend-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  border-left: 3px solid var(--brand-blue);
  transition: all 0.2s ease;
}

.modern-legend .legend-item:hover {
  background: #e9ecef;
  border-left-color: #0d4a7a;
}

.modern-legend .legend-item .legend-code {
  font-weight: 700;
  font-size: 14px;
  min-width: 32px;
  text-align: center;
  margin-right: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  color: var(--brand-blue);
  background: #ffffff;
  border: 1px solid var(--brand-blue);
  flex-shrink: 0;
}

.modern-legend .legend-item .legend-description {
  color: #495057;
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
  font-weight: 400;
}

/* Responsive design */
@media (max-width: 768px) {
  .modern-legend .legend-grid {
    grid-template-columns: 1fr;
  }

  .modern-pagination .pagination>li>a,
  .modern-pagination .pagination>li>span {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 36px;
  }

  .modern-legend {
    padding: 16px;
    margin: 20px 0;
  }

  .modern-legend .legend-item {
    padding: 10px 12px;
  }

  /* Mobile responsive layout - restructure sidebar for mobile */
  .sidebar {
    position: static !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 0 !important;
    margin-bottom: 20px;
    order: 1;
  }

  .content {
    margin-left: 0 !important;
    margin: 15px !important;
    width: calc(100% - 30px) !important;
    order: 2;
  }

  /* Adjust body padding for mobile */
  body {
    padding-top: 80px;
  }

  /* Hide only the desktop alert elements on mobile */
  .content .desktop-alert {
    display: none;
  }

  /* Show mobile alerts on mobile */
  .mobile-alerts {
    display: block;
  }

  .mobile-alerts .alert {
    margin: 15px;
    border-radius: 6px;
  }

  /* Hide panel control icons on mobile */
  #sidebar-open,
  #sidebar-close {
    display: none !important;
  }

  /* Improve export dropdown for mobile */
  .sidebar .dropdown {
    width: auto;
    /* Don't make it full width */
    margin-bottom: 10px;
  }

  .sidebar .dropbtn {
    width: auto;
    /* Don't make button full width */
    justify-content: center;
    padding: 7px 15px;
    /* Keep original smaller padding */
    font-size: 12px;
    /* Keep original smaller font size */
  }

  .sidebar .dropdown-content {
    width: 100%;
    min-width: auto;
    right: 0;
    left: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .sidebar .dropdown-content a {
    text-align: center;
    padding: 14px 16px;
    font-size: 14px;
  }

  /* Make the main container use flexbox column-reverse for mobile stacking */
  div[style*="display: flex"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Style the sidebar parts for mobile */
  .sidebar .first-part {
    width: 100% !important;
    position: static !important;
    max-height: none !important;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  .sidebar .last-part {
    width: 100% !important;
    position: static !important;
    max-height: none !important;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  /* Style section headers for mobile */
  .sidebar .first-panel-header,
  .sidebar .second-panel-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    padding: 12px 16px;
    margin: 0;
    position: static !important;
  }

  .sidebar .first-panel-header h4,
  .sidebar .second-panel-header h4 {
    margin: 0;
    color: var(--brand-blue);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Mobile list styling */
  .sidebar .list-group-item {
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid var(--brand-canvas);
  }

  .sidebar .list-group-item:last-child {
    border-bottom: none;
  }

  .sidebar .list-group-item:hover {
    background-color: #f8f9fa;
  }

  .sidebar .list-group-item.active {
    background: var(--brand-blue) !important;
    color: white !important;
  }

  /* Mobile form adjustments */
  .content .form-group {
    margin-bottom: 15px;
  }

  .content .form-control {
    width: 100%;
  }

  /* Mobile well styling */
  .sidebar .well {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    padding: 12px;
    margin: 12px 0;
    font-size: 14px;
    color: #6c757d;
  }
}

/* Ensure consistent sidebar icon sizes */
#sidebar-open,
#sidebar-close {
  width: 29px;
  height: 20px;
  max-width: 30px;
  max-height: 30px;
}

.summary-export {
  background-color: unset !important;
}

/* Welcome Logo Container - Shows when right panel is empty */
.welcome-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56vh;
  padding: 40px 20px;
  background: #ffffff;
}

.welcome-logo-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.welcome-title {
  font-size: 42px;
  font-weight: bold;
  color: var(--brand-blue);
  /* Intuceo navy */
  margin: 0;
  line-height: 1.2;
}

/* Logo on the welcome screen */
.welcome-logo {
  width: 300px;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
}

.welcome-footer {
  margin-top: 60px;
}

.welcome-link {
  color: #4285F4;
  /* Light blue */
  font-size: 16px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.welcome-link:hover {
  color: var(--brand-blue);
  /* Dark blue on hover */
  text-decoration: none;
}

/* Hide welcome logo when content is loaded (has other children besides welcome-logo) */
#equipment_info:not(:empty) #welcome-logo {
  display: none;
}

/* Show the landing panel when equipment_info is empty or holds only it.
   Block, not flex: this centred a logo, and now carries the dashboard, which
   lays itself out and needs the full width of the column. */
#equipment_info:empty #welcome-logo,
#equipment_info #welcome-logo:only-child {
  display: block;
  width: 100%;
}

/* Responsive styles for welcome logo */
@media (max-width: 768px) {
  .welcome-title {
    font-size: 36px;
  }

  .welcome-logo {
    width: 200px;
  }

  .welcome-logo-container {
    min-height: 50vh;
    padding: 20px 15px;
  }

  .welcome-footer {
    margin-top: 40px;
  }
}

/* CSS for the admin layout shell */
:root {
  --color-bg-base: #ffffff;
  --color-bg-surface: #ffffff;
  --color-text-main: #212529;
  --color-text-muted: #6c757d;
  --color-border: #dee2e6;
  --color-primary: var(--brand-blue);
  --color-danger-bg: #ffeef0;
  --color-danger-text: #dc3545;

  --sidebar-width: 220px;
}

/* Base structural flexbox under the navbar */
.admin-shell {
  display: flex;
  min-height: calc(100vh - 96px);
  /* account for global body padding */
  width: 100%;
}

/* Sidebar Styling */
.admin-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-surface);
  border-right: 0.5px solid var(--color-border);

  /* Fixed sidebar positioning */
  position: fixed;
  top: 86px;
  bottom: 0;
  /* Ensures it touches the bottom of the viewport */
  left: 0;
  z-index: 100;
}

/* Navigation inside sidebar */
.admin-nav {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar {
  display: none;
}

/* Accordion sections */
.admin-nav-section {
  margin-bottom: 4px;
}

.admin-nav-section-btn {
  width: 100%;
  background: none;
  border: none;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-main);
  cursor: pointer;
  font-family: inherit;
}

.admin-nav-section-btn .admin-arrow {
  width: 10px;
  height: 10px;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.admin-nav-section.open .admin-nav-section-btn .admin-arrow {
  transform: rotate(90deg);
}

.admin-nav-section-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease-out;
}

.admin-nav-section.open .admin-nav-section-content {
  grid-template-rows: 1fr;
}

.admin-nav-section-content-inner {
  overflow: hidden;
}

/* Nav items */
.admin-nav-item {
  display: flex;
  align-items: center;
  padding: 6px 20px 6px 24px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.admin-nav-item:hover,
.admin-nav-item:focus {
  color: var(--color-primary);
  text-decoration: none;
}

.admin-nav-item.active {
  color: var(--color-primary);
  font-weight: 500;
}

/* Dashboard home link — sits above the accordion groups */
.admin-nav-home {
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 6px;
}

.admin-nav-home:hover,
.admin-nav-home:focus {
  color: var(--color-primary);
}

.admin-nav-home.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* SVG tree mark */
.admin-tree-mark {
  width: 6px;
  height: 9px;
  margin-right: 12px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  opacity: 0.5;
  transition: color 0.15s ease, opacity 0.15s ease;
  position: relative;
  top: -1px;
}

.admin-nav-item:hover .admin-tree-mark {
  color: var(--color-primary);
  opacity: 0.8;
}

.admin-nav-item.active .admin-tree-mark {
  color: var(--color-primary);
  opacity: 1;
}

/* Pills */
.admin-badge {
  background-color: var(--color-danger-bg);
  color: var(--color-danger-text);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  line-height: 1;
}

/* Main Content Area */
.admin-main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px;
  background-color: #fafbfc;
}

.admin-breadcrumb {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  font-weight: 400;
}

.admin-page-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 24px 0;
  color: var(--color-text-main);
}

/* ─── Mobile hamburger float button ──────────────────── */
.admin-hamburger-float {
  display: none;
  /* hidden on desktop */
  position: fixed;
  top: 104px;
  /* just below the 80px navbar + some breathing room */
  left: 12px;
  z-index: 200;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 7px 14px 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-main);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  transition: box-shadow 0.15s, background 0.15s;
  font-family: inherit;
  line-height: 1;
}

.admin-hamburger-float:hover {
  background: #f8f9fa;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
}

/* ─── Overlay backdrop ────────────────────────────────── */
.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.admin-sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ─── Mobile breakpoint ───────────────────────────────── */
@media (max-width: 768px) {

  /* Show the floating hamburger button */
  .admin-hamburger-float {
    display: flex;
  }

  /* Sidebar becomes an off-canvas drawer */
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 160;
    top: 80px;
    /* sit below the 80px fixed navbar */
    bottom: 0;
  }

  /* When JS adds .open class: slide in */
  .admin-sidebar.open {
    transform: translateX(0);
  }

  /* Hide the hamburger button while sidebar is open */
  .admin-sidebar.open~.admin-main-content .admin-hamburger-float,
  .admin-hamburger-float.hidden {
    display: none !important;
  }

  /* Main content takes full width, with top padding so hamburger button doesn't overlap */
  .admin-main-content {
    margin-left: 0 !important;
    padding: 64px 16px 20px;
  }

  /* Admin shell doesn't need flex offset */
  .admin-shell {
    min-height: auto;
  }
}