:root {
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-2-5: 10px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-8: 32px;
  --ui-radius-sm: 3px;
  --ui-radius-md: 4px;
  --ui-radius-lg: 6px;
  --ui-border: #e5e7eb;
  --ui-border-soft: #edf0f4;
  --ui-bg-soft: #f7f8fa;
  --ui-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --ui-shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body {
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.sidebar,
.btn,
input,
select,
textarea,
.table,
.dataTable {
}

.content-wrapper {
  background: var(--ui-bg-soft);
}

.content {
  padding: var(--ui-space-6);
}

.content-header {
  padding: var(--ui-space-5) var(--ui-space-6) 0;
}

.content-header > h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.content-header > .breadcrumb {
  position: absolute;
  top: 15px;
  right: 10px;
  float: right;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 12px;
  padding: 7px 5px;
  border-radius: 2px;
  background: transparent;
}

.main-header .navbar,
.main-header .logo {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.main-header .navbar.navbar-static-top {
  height: 50px;
  min-height: 50px;
}

.main-header .sidebar-toggle {
  height: 50px;
  line-height: 20px;
  padding-top: 15px;
  padding-bottom: 15px;
}

.main-header .navbar-nav > li > a {
  line-height: 20px;
  padding-top: 15px;
  padding-bottom: 15px;
}

.main-footer {
  border-top: 1px solid var(--ui-border);
}

.box {
  border-top-width: 1px;
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
  margin-bottom: var(--ui-space-6);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.box:hover {
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-1px);
}

.box-header {
  border-bottom: 1px solid var(--ui-border-soft);
  padding: 14px 16px;
}

.box-header > .box-tools {
  top: 8px;
}

.box-header > .box-title {
  font-size: clamp(18px, 1.5vw, 20px);
  font-weight: 600;
}

.box-body {
  padding: var(--ui-space-2-5);
  padding-top: 20px;
}

.box-footer {
  border-top: 1px solid var(--ui-border-soft);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
}

.small-box {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
}

.info-box {
  min-height: 92px;
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-sm);
  background: #fff;
  margin-bottom: var(--ui-space-4);
  overflow: hidden;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.info-box:hover {
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-1px);
}

.info-box .info-box-icon {
  width: 92px;
  min-height: 92px;
  line-height: 92px;
  font-size: 30px;
}

.info-box .info-box-content {
  margin-left: 92px;
  padding: 12px 14px;
}

.info-box .info-box-text {
  margin-top: 2px;
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: #374151;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.info-box .info-box-number {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}

.info-box .info-box-number.folder-date {
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
}

.panel,
.nav-tabs-custom {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
}

.dropdown-menu,
.modal-content,
.select2-dropdown {
  border-radius: var(--ui-radius-sm);
}

.btn {
  border-radius: var(--ui-radius-md);
  font-weight: 600;
  padding: 8px 14px;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus,
.btn:active:focus,
.btn.active:focus {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.box-tools .btn.btn-box-tool:focus,
.box-tools .btn.btn-box-tool:active:focus,
.box-tools .btn.btn-box-tool.active:focus {
  outline: none;
}

.btn.btn-sm {
  padding: 6px 12px;
}

.btn.btn-xs {
  padding: 4px 10px;
}

.btn-flat {
  border-radius: var(--ui-radius-md);
}

.form-group {
  margin-bottom: var(--ui-space-4);
}

label {
  font-weight: 600;
}

.form-control {
  min-height: 40px;
  border-radius: var(--ui-radius-md);
  border-color: #d6dbe3;
  box-shadow: none;
  padding: 8px 12px;
  transition: box-shadow 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.form-control:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* Keep Bootstrap/AdminLTE small-input sizing when .input-sm is explicitly used */
.form-control.input-sm,
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn,
.input-sm {
  min-height: 30px !important;
  height: 30px !important;
  padding: 5px 10px !important;
  line-height: 1.5 !important;
}

textarea.form-control {
  min-height: 90px;
}

.input-group-addon {
  border-color: #d6dbe3;
  background: #f4f6f9;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.chosen-container-single .chosen-single,
.chosen-container-multi .chosen-choices {
  min-height: 40px;
  border-radius: var(--ui-radius-md) !important;
  border-color: #d6dbe3 !important;
  box-shadow: none !important;
}

/* Select2 single: vertical centering (text, placeholder, arrow, clear) */
.select2-container .select2-selection--single {
  min-height: 40px;
  height: 40px;
  padding: 0 28px 0 12px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 38px;
  margin-top: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  line-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px;
  top: 1px;
  right: 6px;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
  margin-top: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  padding: 0 5px 0 5px !important;
}

.select2-container .select2-search--inline .select2-search__field {
  padding: 3px 5px 0 5px !important;
}

/* DataTables header filters: keep Select2 aligned with other 32px inputs */
table.dataTable thead .select2-container .select2-selection--single {
  min-height: 32px !important;
  height: 32px !important;
}

table.dataTable thead .select2-container .select2-selection--single .select2-selection__rendered,
table.dataTable thead .select2-container--default .select2-selection--single .select2-selection__placeholder {
  line-height: 30px !important;
}

table.dataTable thead .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 30px !important;
}

.table > thead > tr > th {
  border-top: 0;
  border-bottom: 0;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-top: 12px;
  padding-bottom: 12px;
}

.table > tbody > tr > td {
  border-top: 0;
  vertical-align: top;
  padding-top: 10px;
  padding-bottom: 10px;
}

.table > thead > tr > th,
.dataTable th,
.dataTable td {
  vertical-align: top;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background: rgba(0, 0, 0, 0.015);
}

.table-hover > tbody > tr:hover,
.table > tbody > tr:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
  border-color: #e6ebf2;
}

/* Default DataTables: horizontal separators only (exclude WO2 table) */
table.dataTable:not(.wo2-table) > thead > tr > th,
table.dataTable:not(.wo2-table) > tbody > tr > td {
  border-left: none !important;
  border-right: none !important;
}

table.dataTable:not(.wo2-table) > thead > tr > th {
  border-bottom: 1px solid #e9eff5 !important;
}

table.dataTable:not(.wo2-table) > tbody > tr > td {
  border-bottom: 1px solid #edf3f8 !important;
}

.pagination > li > a,
.pagination > li > span {
  border-radius: var(--ui-radius-sm) !important;
  margin: 0 2px;
}

.badge,
.label {
  border-radius: var(--ui-radius-sm);
}

.main-sidebar,
.left-side {
  border-right: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.content-wrapper,
.right-side {
  border-left: 0 !important;
  box-shadow: none !important;
}

body[class*="skin-"] .content-wrapper,
body[class*="skin-"] .right-side,
body[class*="skin-"] .main-footer,
body[class*="skin-"] .main-header .logo {
  border-left: 0 !important;
  border-right: 0 !important;
}

body[class*="skin-"] .main-header .navbar,
body[class*="skin-"] .main-header .logo {
  border-left: 0 !important;
  border-right: 0 !important;
}

.main-sidebar .sidebar {
  border: 0 !important;
}

.sidebar-menu li.header {
  margin: 0 8px 4px;
  padding: 8px 10px;
  border-radius: var(--ui-radius-sm);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
}

body.skin-black-light .sidebar-menu li.header,
body.skin-blue-light .sidebar-menu li.header,
body.skin-green-light .sidebar-menu li.header,
body.skin-purple-light .sidebar-menu li.header,
body.skin-red-light .sidebar-menu li.header,
body.skin-yellow-light .sidebar-menu li.header {
  background-color: #6d6f71;
  color: #fff;
}

.main-header .navbar .nav > li.user-menu > .dropdown-menu {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-menu > li > a,
.treeview-menu > li > a {
  border-radius: 0;
}

.sidebar-menu > li > a {
  margin: 2px 8px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-weight: 500;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

body.sidebar-collapse .sidebar-menu > li > a,
.sidebar-mini.sidebar-collapse .sidebar-menu > li > a {
  margin: 2px 0;
}

.sidebar-menu > li:hover > a {
  background: rgba(255, 255, 255, 0.03);
}

/* Keep sidebar stable: no hover translate/flicker in nav area */
.main-sidebar .sidebar .btn:hover,
.main-sidebar .sidebar .btn:focus,
.main-sidebar .sidebar .btn:active,
.main-sidebar .sidebar-menu > li > a:hover,
.main-sidebar .sidebar-menu > li > a:focus,
.main-sidebar .treeview-menu > li > a:hover,
.main-sidebar .treeview-menu > li > a:focus {
  transform: none !important;
}

.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.55);
}

body[class*="skin-"] .sidebar-menu > li.active > a {
  border-left-color: transparent !important;
  box-shadow: none !important;
}

/* Keep treeview-open-immediate visually aligned with active/open state on light skins */
body.skin-black-light .sidebar-menu > li.treeview-open-immediate > a,
body.skin-blue-light .sidebar-menu > li.treeview-open-immediate > a,
body.skin-green-light .sidebar-menu > li.treeview-open-immediate > a,
body.skin-purple-light .sidebar-menu > li.treeview-open-immediate > a,
body.skin-red-light .sidebar-menu > li.treeview-open-immediate > a,
body.skin-yellow-light .sidebar-menu > li.treeview-open-immediate > a {
  color: #000;
  background: #ececec;
}

body.skin-black-light .sidebar-menu > li.treeview-open-immediate > .treeview-menu,
body.skin-blue-light .sidebar-menu > li.treeview-open-immediate > .treeview-menu,
body.skin-green-light .sidebar-menu > li.treeview-open-immediate > .treeview-menu,
body.skin-purple-light .sidebar-menu > li.treeview-open-immediate > .treeview-menu,
body.skin-red-light .sidebar-menu > li.treeview-open-immediate > .treeview-menu,
body.skin-yellow-light .sidebar-menu > li.treeview-open-immediate > .treeview-menu {
  background: #ececec;
}

.sidebar-menu > li.active {
  border-left-width: 4px;
  border-left-style: solid;
}

body.skin-black .sidebar-menu > li.active {
  border-left-color: #fff;
}

body.skin-blue .sidebar-menu > li.active {
  border-left-color: #3c8dbc;
}

body.skin-green .sidebar-menu > li.active {
  border-left-color: #00a65a;
}

body.skin-purple .sidebar-menu > li.active {
  border-left-color: #605ca8;
}

body.skin-red .sidebar-menu > li.active {
  border-left-color: #dd4b39;
}

body.skin-yellow .sidebar-menu > li.active {
  border-left-color: #f39c12;
}

body.skin-black-light .sidebar-menu > li.treeview-open-immediate {
  border-left-color: #000;
}

body.skin-blue-light .sidebar-menu > li.treeview-open-immediate {
  border-left-color: #3c8dbc;
}

body.skin-green-light .sidebar-menu > li.treeview-open-immediate {
  border-left-color: #00b26b;
}

body.skin-purple-light .sidebar-menu > li.treeview-open-immediate {
  border-left-color: #605ca8;
}

body.skin-red-light .sidebar-menu > li.treeview-open-immediate {
  border-left-color: #dd4b39;
}

body.skin-yellow-light .sidebar-menu > li.treeview-open-immediate {
  border-left-color: #f39c12;
}

.sidebar-menu li > a > .fa-angle-left,
.sidebar-menu li > a > i.pull-right.fa-angle-left,
.sidebar-menu li > a > .pull-right-container > .fa-angle-left {
  -webkit-transition: -webkit-transform 120ms ease !important;
  transition: transform 120ms ease !important;
  transition-delay: 0s !important;
  transform: rotate(0deg);
  transform-origin: center;
  will-change: transform;
}

.sidebar-menu li.menu-open > a > .fa-angle-left,
.sidebar-menu li.active > a > .fa-angle-left,
.sidebar-menu li.treeview-open-immediate > a > .fa-angle-left,
.sidebar-menu li.menu-open > a > i.pull-right.fa-angle-left,
.sidebar-menu li.active > a > i.pull-right.fa-angle-left,
.sidebar-menu li.treeview-open-immediate > a > i.pull-right.fa-angle-left,
.sidebar-menu li > a[aria-expanded="true"] > .fa-angle-left,
.sidebar-menu li > a[aria-expanded="true"] > i.pull-right.fa-angle-left,
.sidebar-menu li.menu-open > a > .pull-right-container > .fa-angle-left,
.sidebar-menu li.active > a > .pull-right-container > .fa-angle-left,
.sidebar-menu li.treeview-open-immediate > a > .pull-right-container > .fa-angle-left,
.sidebar-menu li > a[aria-expanded="true"] > .pull-right-container > .fa-angle-left {
  -webkit-transform: rotate(-90deg);
  transform: rotate(-90deg);
}

.treeview-menu > li > a {
  margin: 0;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 22px;
  padding-right: 10px;
}

.treeview-menu > li:hover > a {
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-menu > li > .treeview-menu {
  display: none;
  width: calc(100% - 16px);
  margin: 0 8px 2px 8px;
  padding: 0;
}

.sidebar-menu > li.menu-open > .treeview-menu,
.sidebar-menu > li > .treeview-menu.menu-open {
  display: block;
}

/* btn-app: center icon + text */
.btn.btn-app {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: auto;
}

.btn.btn-app > .fa,
.btn.btn-app > .glyphicon,
.btn.btn-app > .ion {
  margin-bottom: 4px;
  line-height: 1;
}

/* Work order 2 sticky header stability */
.wo2-datatable-box {
  overflow: visible;
}

.wo2-datatable-box:hover {
  transform: none;
}

body.wo2-sticky .wo2-datatable-box .dataTables_scrollHead.dt-head-fixed,
body.wo2-sticky .wo2-datatable-box .dataTables_scrollHead.dt-head-abs-bottom {
  z-index: 1030 !important;
  pointer-events: auto;
}

/* WO2 only: thead alignment + sorting icon offset */
table.dataTable.wo2-table thead th,
table.dataTable.wo2-table thead td {
  vertical-align: bottom !important;
}

table.dataTable.wo2-table thead .sorting_desc::after {
  top: 13px !important;
}

/* Light modal: keep table look close to AdminLTE/Bootstrap default */
.light-modal .table > thead > tr > th {
  border-bottom: 0 !important;
  border-top: 0 !important;
  font-size: 14px !important;
  letter-spacing: normal;
  text-transform: none;
  padding: 8px !important;
  background: transparent !important;
}

.light-modal .table > tbody > tr > td {
  border-top: 0 !important;
  border-bottom: 0 !important;
  padding: 8px !important;
  background: transparent;
  vertical-align: top !important;
}

.light-modal .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f9f9f9 !important;
}

.light-modal .table-hover > tbody > tr:hover,
.light-modal .table > tbody > tr:hover {
  background-color: #f5f5f5 !important;
}

/* Strong override: DataTables THEAD Select2 must be 32px (also for scroll/fixed header clones) */
.dataTables_wrapper table thead .select2-container .select2-selection--single,
.dataTables_wrapper .dataTables_scrollHead table thead .select2-container .select2-selection--single {
  min-height: 32px !important;
  height: 32px !important;
}

.dataTables_wrapper table thead .select2-container .select2-selection--multiple,
.dataTables_wrapper .dataTables_scrollHead table thead .select2-container .select2-selection--multiple {
  min-height: 32px !important;
  height: 32px !important;
}

.dataTables_wrapper table thead .select2-container .select2-selection--single .select2-selection__rendered,
.dataTables_wrapper .dataTables_scrollHead table thead .select2-container .select2-selection--single .select2-selection__rendered,
.dataTables_wrapper table thead .select2-container--default .select2-selection--single .select2-selection__placeholder,
.dataTables_wrapper .dataTables_scrollHead table thead .select2-container--default .select2-selection--single .select2-selection__placeholder {
  line-height: 30px !important;
}

.dataTables_wrapper table thead .select2-container--default .select2-selection--single .select2-selection__arrow,
.dataTables_wrapper .dataTables_scrollHead table thead .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 30px !important;
}

/* Work orders module: header alignment and missing top borders on cols 8-10 */
table.dataTable.work-orders-table thead th,
table.dataTable.work-orders-table thead td {
  vertical-align: bottom !important;
}

.table-bordered > tbody > tr > td {
  border-color: #eee !important;
}

/* Work order 2: certification upload input height aligned with action buttons */
.wo2-cert-input {
  min-height: 38px !important;
  height: 38px !important;
}

/* Keep legacy compact datepicker sizing inside DataTables filters */
table.dataTable thead .datepicker.form-control,
.dataTables_wrapper .dataTables_filter .datepicker.form-control,
.dataTables_wrapper .datepicker.form-control.input-sm {
  padding: 4px !important;
}

table.dataTable thead .datepicker.form-control.input-sm,
.dataTables_wrapper .dataTables_filter .datepicker.form-control.input-sm,
.dataTables_wrapper .datepicker.input-sm {
  padding: 4px !important;
}

@media (max-width: 991px) {
  .content-header > .breadcrumb {
    position: relative;
    margin-top: 5px;
    top: 0;
    right: 0;
    float: none;
    background: #d2d6de;
    padding-left: 10px;
  }

  .content-header > .breadcrumb li:before {
    color: #97a0b3;
  }

  .content {
    padding: var(--ui-space-4);
  }

  .content-header {
    padding: var(--ui-space-4) var(--ui-space-4) 0;
  }

  .box-body {
    padding: var(--ui-space-4);
  }
}
