/*
 * Bootstrap 3 (todc-bootstrap) compatibility layer for Bootstrap 5.3.8
 * Preserves the original visual appearance after BS3 → BS5 migration.
 *
 * The original app used todc-bootstrap.css which inverted the standard
 * Bootstrap 3 color conventions:
 *   - navbar-default = dark background (#2d2d2d)
 *   - navbar-inverse = light background (#fafafa)
 * This file reproduces those styles using BS5-compatible selectors.
 */

/* ================================================================
   Body / Typography (todc-bootstrap base)
   Original: font 13px/1.4 Arial, color #333
   ================================================================ */
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
}

/* ================================================================
   Container widths (BS3 responsive breakpoints)
   BS3: 750px@768 / 970px@992 / 1170px@1200 / no xxl
   BS5 added 540px@576 and 1320px@1400 — override both.
   ================================================================ */
.container {
  padding-left: 15px;
  padding-right: 15px;
}

@media (min-width: 576px) {
  .container {
    max-width: none;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 750px;
  }
}
@media (min-width: 992px) {
  .container {
    max-width: 970px;
  }
}
@media (min-width: 1200px) {
  .container {
    max-width: 1170px;
  }
}
@media (min-width: 1400px) {
  .container {
    max-width: 1170px;
  }
}

/* ================================================================
   Form labels (BS3 style)
   BS3: label { font-weight: 700 }  BS5 removed this default.
   ================================================================ */
label {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 5px;
  font-weight: 700;
}

/* ================================================================
   Form controls (todc style)
   Original: 30px height, 1px border-radius, #d9d9d9 border
   ================================================================ */
.form-control {
  height: 30px;
  padding: 5px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #555;
  background-color: #fff;
  border: 1px solid #d9d9d9;
  border-top-color: #c0c0c0;
  border-radius: 1px;
  box-shadow: none;
  transition: none;
}

.form-control:focus {
  border-color: #4d90fe;
  outline: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
  background-color: #f1f1f1;
  border: 1px solid #e5e5e5;
}

textarea.form-control {
  height: auto;
}

.form-select {
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid #d9d9d9;
  border-top-color: #c0c0c0;
  border-radius: 1px;
}

/* ================================================================
   Input groups (todc style)
   ================================================================ */
.input-group .form-control {
  border-radius: 0;
}

.input-group-text {
  padding: 5px 8px;
  font-size: 13px;
  color: #555;
  background-color: #f5f5f5;
  border: 1px solid #d9d9d9;
  border-top-color: #c0c0c0;
  border-radius: 2px;
}

/* ================================================================
   Alert overrides (todc style)
   BS3 used light backgrounds with dark text.
   BS5 uses saturated colors — override for readability.
   ================================================================ */
.alert {
  padding: 8px;
  margin-bottom: 18px;
  border-radius: 2px;
}

.alert-danger {
  color: #a94442;
  background-color: #f2dede;
  border-color: #d59595;
}

.alert-success {
  color: #3c763d;
  background-color: #dff0d8;
  border-color: #a3d48e;
}

.alert-warning {
  color: #333;
  background-color: #f9edbe;
  border-color: #f0c36d;
}

.alert-info {
  color: #31708f;
  background-color: #d9edf7;
  border-color: #85c5e5;
}

/* ================================================================
   Text color utilities (BS3 values)
   BS5 redefines these with !important — must use !important to win.
   ================================================================ */
.text-danger {
  color: #a94442 !important;
}

.text-success {
  color: #3c763d !important;
}

.text-warning {
  color: #333 !important;
}

.text-info {
  color: #31708f !important;
}

/* ================================================================
   Background color utilities (BS3 values)
   BS5 redefines these with !important — must use !important to win.
   ================================================================ */
.bg-danger {
  background-color: #f2dede !important;
}

.bg-success {
  background-color: #dff0d8 !important;
}

.bg-warning {
  background-color: #f9edbe !important;
}

.bg-info {
  background-color: #d9edf7 !important;
}

/* ================================================================
   HR (BS3 style)
   BS3: solid #eee, 20px margin. BS5: color inherit + opacity.
   ================================================================ */
hr {
  margin-top: 20px;
  margin-bottom: 20px;
  border: 0;
  border-top: 1px solid #eee;
  opacity: 1;
  color: inherit;
}

/* ================================================================
   Table compat (BS3 class names)
   BS3 .table-condensed → BS5 .table-sm equivalent
   ================================================================ */
.table {
  margin-bottom: 18px;
}

.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
  line-height: 1.4;
  border-top: 1px solid #ddd;
  border-bottom: 0;
}

.table > thead > tr > th {
  border-bottom: 2px solid #ddd;
}

.table > tbody > tr:last-child > td,
.table > tbody > tr:last-child > th {
  border-bottom: 0;
}

.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
  padding: 5px;
}

/* ================================================================
   Labels / Badges (BS3 .label → BS5 .badge)
   ================================================================ */
.label {
  display: inline;
  padding: .2em .6em .3em;
  font-size: 75%;
  font-weight: bold;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: .25em;
}

.label-danger {
  background-color: #d9534f;
}

.label-success {
  background-color: #5cb85c;
}

.label-warning {
  background-color: #f0ad4e;
  color: #333;
}

.label-info {
  background-color: #5bc0de;
}

/* ================================================================
   General button base (todc style)
   Original: padding 5px 12px, font-size 13px, line-height 18px
   ================================================================ */
.btn {
  padding: 5px 12px;
  font-size: 13px;
  line-height: 18px;
  font-weight: bold;
  cursor: default;
  border-radius: 2px;
}

.btn:hover {
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}

.btn:active,
.btn.active {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
}

/* ================================================================
   btn-default (todc style)
   BS3 btn-default as styled by todc-bootstrap: light grey gradient
   with subtle border — NOT the solid grey of BS5 btn-secondary.
   ================================================================ */
.btn-default {
  color: #333;
  background-color: #f3f3f3;
  background-image: linear-gradient(to bottom, #f5f5f5 0%, #f1f1f1 100%);
  background-repeat: repeat-x;
  border: 1px solid #dcdcdc;
}

.btn-default:hover {
  color: #333;
  background-color: #f3f3f3;
  background-image: linear-gradient(to bottom, #f8f8f8 0%, #f1f1f1 100%);
  border-color: #c6c6c6;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
  transition: none;
}

.btn-default:active,
.btn-default.active {
  color: #333;
  background-color: #e8e8e8;
  background-image: linear-gradient(to bottom, #f6f6f6 0%, #f1f1f1 100%);
  border: 1px solid #dcdcdc;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
}

.btn-default:focus,
.btn-default.focus {
  color: #333;
  background-color: #f3f3f3;
  border-color: #4d90fe;
  outline: none;
  box-shadow: none;
}

.btn-default:disabled,
.btn-default.disabled {
  color: #333;
  background-color: #f5f5f5;
  background-image: linear-gradient(to bottom, #f5f5f5 0%, #f1f1f1 100%);
  border: 1px solid #dcdcdc;
  box-shadow: none;
}

.btn-default .badge {
  color: #f3f3f3;
  background-color: #333;
}

/* ================================================================
   btn-success (todc style)
   ================================================================ */
.btn-success {
  color: #fff;
  background-image: linear-gradient(to bottom, #35aa35 0%, #2d8f2d 100%);
  background-repeat: repeat-x;
  border: 1px solid transparent;
  border-radius: 2px;
}

.btn-success:hover {
  color: #fff;
  background-image: linear-gradient(to bottom, #35aa35 0%, #2d8f2d 100%);
  border-color: transparent;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}

.btn-success:active,
.btn-success.active {
  background-image: linear-gradient(to bottom, #35aa35 0%, #288428 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}

/* ================================================================
   btn-danger (todc style)
   ================================================================ */
.btn-danger {
  color: #fff;
  background-image: linear-gradient(to bottom, #dd4b39 0%, #d14836 100%);
  background-repeat: repeat-x;
  border: 1px solid transparent;
  border-radius: 2px;
}

.btn-danger:hover {
  color: #fff;
  border-color: #b0281a;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}

/* ================================================================
   btn-info (todc style)
   BS5 uses color:#000 for btn-info — BS3/todc used white text.
   ================================================================ */
.btn-info {
  color: #fff;
  background-color: #5bc0de;
  background-image: linear-gradient(to bottom, #5bc0de 0%, #46b8da 100%);
  background-repeat: repeat-x;
  border: 1px solid transparent;
  border-radius: 2px;
}

.btn-info:hover {
  color: #fff;
  background-color: #39b3d7;
  background-image: linear-gradient(to bottom, #5bc0de 0%, #39b3d7 100%);
  border-color: transparent;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}

.btn-info:active,
.btn-info.active {
  color: #fff;
  background-image: linear-gradient(to bottom, #5bc0de 0%, #2fa4c7 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}

/* ================================================================
   btn-lg size (todc compatible)
   Original: padding 9px 14px, font-size 14px, line-height 1.3
   ================================================================ */
.btn-lg,
.btn-group-lg > .btn {
  padding: 9px 14px;
  font-size: 14px;
  line-height: 1.3;
  border-radius: 2px;
}

/* ================================================================
   Navbar base overrides (todc style)
   todc-bootstrap used smaller/compact navbar sizing.
   ================================================================ */
.navbar {
  min-height: 28px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  padding-top: 0;
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .navbar {
    border-radius: 2px;
  }
}

.navbar-brand {
  height: 28px;
  padding: 5px 15px;
  font-size: 14px;
  line-height: 18px;
}

.navbar-nav .nav-link {
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 18px;
}

/* ================================================================
   Dark navbar (todc "navbar-default" = dark #2d2d2d)
   Used by loginLayout and baseLayout.
   ================================================================ */
.navbar-dark {
  background-color: #2d2d2d;
  border-color: #000;
}

.navbar-dark .navbar-brand {
  color: #999;
}

.navbar-dark .navbar-brand:hover,
.navbar-dark .navbar-brand:focus {
  color: #fff;
  background-color: transparent;
}

.navbar-dark .navbar-nav .nav-link {
  color: #999;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #fff;
  background-color: transparent;
}

.navbar-dark .navbar-nav .nav-item.active .nav-link {
  color: #fff;
  background-color: #141414;
}

.navbar-dark .navbar-toggler {
  border-color: #222;
  color: #fff;
}

.navbar-dark .navbar-toggler:hover,
.navbar-dark .navbar-toggler:focus {
  background-color: #333;
}

.navbar-dark .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-dark .navbar-collapse {
  border-color: #000;
}

.navbar-dark .dropdown-menu {
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, .15);
}

.navbar-dark .dropdown-item {
  color: #333;
}

.navbar-dark .dropdown-item:hover,
.navbar-dark .dropdown-item:focus {
  color: #333;
  background-color: #e8e8e8;
}

.navbar-dark .dropdown-toggle::after {
  border-top-color: #999;
}

/* ================================================================
   Light navbar (todc "navbar-inverse" = light #fafafa)
   Used by guestLayout.
   ================================================================ */
.navbar-light {
  background-color: #fafafa;
  border-color: #dbdbdb;
  display: block;
}

.navbar-light .navbar-brand {
  color: #999;
}

.navbar-light .navbar-brand:hover,
.navbar-light .navbar-brand:focus {
  color: #808080;
  background-color: transparent;
}

.navbar-light .navbar-nav .nav-link {
  color: #999;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
  color: #333;
  background-color: transparent;
}

.navbar-light .navbar-toggler {
  border-color: #ddd;
}

.navbar-light .navbar-toggler:hover,
.navbar-light .navbar-toggler:focus {
  background-color: #ddd;
}

.navbar-light .navbar-collapse {
  border-color: #e8e8e8;
}
