:root {
  --tr-hover: #C4D2E6;
  --primary: #D81921;
  --primary-80: #C31618;
  --secondary: #dee2e6;
  --secondary-80: #ced4da;
}

html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 3em;
}

footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 3em;
}

#footer-text::after {
  content: 'Shamirlens (Thailand) Co., Ltd.';
}

section {
  margin: 0 auto 1em;
  padding: 1em;
  border: 0.05em solid var(--bs-gray-300);
  border-radius: 0.5em;
  box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-black-rgb), 0.05);
}

.navbar {
  padding: 1em 0;
  background: linear-gradient(45deg, var(--secondary), var(--secondary-80) 35%, var(--secondary) 35%, var(--secondary-80));
}

.navbar-brand {
  padding: 0 1em;
}

.navbar-brand img {
  height: 4em;
  content: url(/images/logo.svg);
}

.navbar-nav {
  align-items: center;
}

.navbar-nav .nav-link {
  color: var(--bs-body-color);
}

.banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-80) 65%, var(--primary) 65%, var(--primary-80));
}

.box-shadow {
  box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-black-rgb), 0.05);
}

.align-text-left {
  text-align: left !important;
}
.align-text-right {
  text-align: right !important;
}
.align-text-center {
  text-align: center !important;
}

.ws-prewrap {
  white-space: preserve-breaks;
}

.ws-nowrap {
  white-space: nowrap;
}

/* >>> adjust bootstrap styles */
.row {
  align-self: self-start;
  --bs-gutter-x: 0.5rem;
  margin: 0 0 0.5rem;
}

section > .row:last-child {
  margin-bottom: 0;
}

@media (max-width: 992px) {
  .container, .container-md, .container-sm {
    max-width: unset;
  }
}

/* xs */
@media (max-width: 575px) {
  .form-select {
    background-image: none;
    padding: 0.1875em 0.375em;
  }
  .form-control {
    padding: 0.1875em 0.375em;
  }
  .form-control-plaintext {
    padding: 0.1875em 0;
  }

  .text-abbr {
    visibility: hidden;
  }
  .text-abbr::first-letter {
    visibility: visible;
  }
}

/* sm */
@media (min-width: 576px) and (max-width: 767px) {
  .form-select.sm-control {
    background-image: none;
    padding: 0.375em 0.75em;
  }
}

/* md */
@media (min-width: 768px) and (max-width: 991px) {
  .form-select.md-control {
    background-image: none;
    padding: 0.375em 0.75em;
  }
}

/* lg */
@media (min-width: 992px) and (max-width: 1199px) {
  .form-select.lg-control {
    background-image: none;
    padding: 0.375em 0.75em;
  }
}

/* xl */
@media (min-width: 1200px) and (max-width: 1399px) {
  .form-select.xl-control {
    background-image: none;
    padding: 0.375em 0.75em;
  }
}

/* <<< */

hr {
  margin: 0.5rem 0;
}

div[role=dialog] {
  display: none;
  /* higher than sticky-top */
  z-index: 2000;
}

span[role=button] {
  font-weight: bold;
}
span[role=button]:hover {
  text-decoration: underline;
}

#shape-dialog img {
  border-radius: 0.5em;
}

#shape-dialog img:hover {
  background-color: var(--tr-hover);
}

.table-header {
  font-weight: bold;
  background-color: var(--bs-gray-200);
  outline: 1px solid var(--bs-body-color);
  padding: 0.5em;
  align-content: center;
}
.table-item {
  background-color: white;
  outline: 1px solid var(--bs-body-color);
  padding: 0.5em;
  align-content: center;
}

.dt-scroll-head {
  position: sticky !important;
  top: 0;
  z-index: 1;
}

.dt-scroll-headInner {
  margin: 0 auto;
  background-color: white;
}

.dt-container .dt-processing {
  top: initial;
  margin-top: -51px;
}

.ui-autocomplete {
  max-height: 15em;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.25em;
}

.ui-framebrand {
  margin: 0.25em 0;
  font-weight: bold;
}

.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
  border: 1px solid var(--primary-80);
  background: var(--primary);
  color: var(--bs-light);
  font-weight: 400;
}

.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover,
.ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus,
.ui-button:hover,
.ui-button:focus {
  border: 1px solid var(--primary-80);
  background: var(--primary);
  color: var(--bs-light);
  font-weight: 400;
}

.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited,
.ui-state-focus a,
.ui-state-focus a:hover,
.ui-state-focus a:link,
.ui-state-focus a:visited,
a.ui-button:hover,
a.ui-button:focus {
  color: var(--bs-light);
}

.ui-state-hover .ui-icon, .ui-state-focus .ui-icon, .ui-button:hover .ui-icon, .ui-button:focus .ui-icon {
    background-image: url(/lib/jquery-ui/images/ui-icons_FFFFFF_256x240.png);
}

.ui-widget-header {
  background: var(--bs-gray-300);
}

.ui-widget.ui-widget-content {
  border: 0.05em solid var(--bs-gray-300);
}

.ui-autocomplete-input.ui-autocomplete-loading {
  background-image: url(/images/refresh.svg);
  background-size: 24px;
  background-repeat: no-repeat;
  background-position: right center;
}

.ui-dialog .ui-dialog-buttonpane {
  display: flex;
  flex-direction: column;
  padding: 0 0.4em;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
  float: unset;
  text-align: right;
}

.ui-dialog table {
  width: 100%;
}

.ui-dialog table thead th,
.ui-dialog table thead td {
  text-transform: capitalize;
  border-bottom: 1px solid #111;
}

.ui-dialog table th.head,
.ui-dialog table td.head {
  text-transform: capitalize;
  border-right: 1px solid #111;
}

.ui-dialog table th,
.ui-dialog table td {
  padding: 0.25em 0.5em;
}

.ui-dialog table tbody tr.odd {
  background-color: var(--bs-gray-200);
}

.ui-dialog table tbody tr:hover {
  background-color: var(--tr-hover);
}

.ui-dialog .countdown {
  height: 0.5em;
  width: 100%;
  background-color: var(--primary);
  margin-top: auto;
}

.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
  border-bottom-right-radius: 0.5em;
}

.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
  border-bottom-left-radius: 0.5em;
}

.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
  border-top-right-radius: 0.5em;
}

.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
  border-top-left-radius: 0.5em;
}

.btn {
  margin: 0.25em;
  padding: 0.375em;
  align-content: center;
}

.btn-primary {
  font-weight: 600;
  color: var(--bs-light);
  background: linear-gradient(to bottom, var(--primary), var(--primary) 50%, var(--primary-80) 50%, var(--primary-80));
  border-color: var(--primary);
  min-width: 6em;
}

button:hover,
.btn:hover {
  filter: brightness(1.25);
  border-color: var(--primary);
}

section.quick-links {
  position: sticky;
  top: 1em;
}

section.quick-links .btn {
  overflow: hidden;
  word-break: break-word;
  max-height: 3.75em;
  min-width: initial;
}

.input-validation-error {
  border-color: var(--bs-danger);
}

.field-validation-error,
.validation-summary-errors {
  color: var(--bs-danger);
}

.input-validation-error:focus {
  border-color: var(--bs-danger);
  box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), .25);
}

.form-control-plaintext {

}

.form-group-header {
  font-weight: 600;
  color: var(--bs-light);
  background: linear-gradient(135deg, var(--primary), var(--primary-80) 65%, var(--primary) 65%, var(--primary-80));
  padding: 0.375rem 0;
}

@media (min-width: 992px) {
  .form-group-header.lg-cont {
    background: linear-gradient(135deg, var(--primary-80), var(--primary-80) 65%, var(--primary) 65%, var(--primary-80));
  }
}

.extended {
  color: #9c0006;
  background-color: #ffc7ce;
}

#shapeDialog img,
#tracerShape svg,
#jobCard svg,
#frameShapePreview svg {
  max-width: 100%;
  height: auto;
}

#jobCard svg {
  aspect-ratio: 7 / 3;
}

#jobCard {
  display: grid;
  grid-template-columns: repeat(10, calc(10% - 0.9px));
  grid-gap: 1px;
  max-width: 1074px;
  margin: 0.5em auto;
}

#jobCard .sub-header {
  display: grid;
  grid-template-columns: repeat(10, calc(10% - 2.7px));
  grid-gap: 3px;
}

#jobCard .sub-header * {
  white-space: nowrap;
  min-height: 1.5em;
}

#jobCard .grid-item {
  background-color: white;
  outline: 1px solid var(--bs-body-color);
  padding: 0.25em;
  align-content: center;
  text-align: center;
  min-height: 2em;
}

#jobCard .grid-item.header {
  font-weight: bold;
  background-color: var(--bs-gray-200);
}

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-7 { grid-column: span 7; }
.col-span-8 { grid-column: span 8; }
.col-span-9 { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }

.row-span-2 { grid-row: span 2; }
.row-span-3 { grid-row: span 3; }
.row-span-4 { grid-row: span 4; }
.row-span-5 { grid-row: span 5; }
.row-span-6 { grid-row: span 6; }
.row-span-7 { grid-row: span 7; }
.row-span-8 { grid-row: span 8; }
.row-span-9 { grid-row: span 9; }
.row-span-10 { grid-row: span 10; }
