/* Bootstrap 3 compatibility layer for the Bootstrap 5 migration.
   Loaded after Bootstrap 5 and before main.css so existing templates keep
   their current appearance while the framework underneath moves to v5. */

/* Panels -> card-like containers */
.panel {
  margin-bottom: 20px;
  background-color: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(20, 24, 28, .03);
}
.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid #e2e6ea;
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  background: #f9fbfd;
}
.panel-body { padding: 15px; }
.panel-footer {
  padding: 10px 15px;
  border-top: 1px solid #e2e6ea;
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
  background: #f9fbfd;
}
.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  color: #20252b;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.panel-default > .panel-heading {
  color: #20252b;
  background: #f9fbfd;
  border-color: #e2e6ea;
}

/* Buttons */
.btn-default {
  color: #20252b;
  background-color: #fff;
  border-color: #d5dae0;
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active {
  color: #20252b;
  background-color: #eef0f3;
  border-color: #c2c8d0;
}
.btn-default:focus { box-shadow: 0 0 0 3px rgba(63, 70, 80, .12); }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-horizontal .form-group {
  display: flex;
  align-items: flex-start;
  margin-right: -15px;
  margin-left: -15px;
}
.form-horizontal .control-label {
  float: left;
  width: 16.66666667%;
  padding-top: 7px;
  text-align: right;
}
.form-horizontal .controls,
.form-horizontal .form-control-static { margin-left: 16.66666667%; }
.control-label { margin-bottom: 5px; font-weight: 600; }
.control-group { margin-bottom: 15px; }
.help-block { display: block; margin-top: 5px; color: #6b7280; }
.input-group-addon {
  padding: 6px 12px;
  color: #20252b;
  background-color: #f5f6f8;
  border: 1px solid #d5dae0;
  border-radius: 6px 0 0 6px;
}
.input-group-addon:last-child { border-radius: 0 6px 6px 0; }

/* Media objects */
.media { display: flex; gap: 10px; }
.media-left { margin-right: 10px; }
.media-body { flex: 1 1 auto; min-width: 0; }
.media-heading { margin: 0 0 5px; color: #20252b; font-size: 15px; }
.media-object { max-width: 100%; height: auto; }

/* Labels and badges */
.label {
  display: inline;
  padding: .2em .6em .3em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: .25em;
}
.label-default { background-color: #6b7280; }
.label-primary { background-color: #3f4650; }
.label-success { background-color: #3f8f66; }
.label-warning { background-color: #b9822b; }
.label-danger { background-color: #b46f6f; }
.label-info { background-color: #4b5563; }
.badge-danger { background-color: #b46f6f; }
.badge-sup { display: inline; padding: 1px 5px; font-size: 5px; font-weight: normal; }

/* Close button and caret */
.close {
  float: right;
  padding: 0;
  color: #6b7280;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: .8;
}
.close:hover, .close:focus { color: #20252b; opacity: 1; }
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* Utility helpers removed in v5 */
.center-block { display: block; margin-left: auto; margin-right: auto; }
.hide, .hidden { display: none !important; }
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.img-responsive { display: block; max-width: 100%; height: auto; }
.img-rounded { border-radius: 6px; }
.thumbnail {
  display: block;
  padding: 4px;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Responsive visibility helpers (BS3 breakpoints) */
.hidden-xs { display: none !important; }
@media (min-width: 768px) { .hidden-xs { display: block !important; } }
.visible-xs { display: none !important; }
@media (max-width: 767px) { .visible-xs { display: block !important; } }

.hidden-sm { display: none !important; }
@media (min-width: 992px) { .hidden-sm { display: block !important; } }
.visible-sm { display: none !important; }
@media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } }

.hidden-md { display: none !important; }
@media (min-width: 1200px) { .hidden-md { display: block !important; } }
.visible-md { display: none !important; }
@media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } }

/* Navbar pieces still referenced by a few legacy templates */
.navbar-header { display: flex; align-items: center; }
.navbar-form { margin: 8px 0; }
.navbar-left { margin-right: auto; }
.navbar-right { margin-left: auto; }
.navbar-toggle, .navbar-toggler {
  border-color: #d5dae0;
}
.navbar-default .navbar-nav > li > a { color: #20252b; }
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus { color: #3f4650; }
