/* ============================================================
   AdminLTE + Bootstrap 3 Compatibility Layer for CoreUI 5.4.3
   Purpose: Bridge AdminLTE/Material AdminLTE and Bootstrap 3
   classes that are still used across ASPX pages in KPS.
   ============================================================ */

/* --- Bootstrap 3/4 Backward-Compatible Classes --- */

.form-group {
    margin-bottom: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.input-group-append,
.input-group-prepend {
    display: flex;
}

/* BS3 pull-left/pull-right (removed in BS4+) */
.pull-left { float: left !important; }
.pull-right { float: right !important; }

/* BS4 directional utilities (replaced by logical in BS5) */
.float-left { float: left !important; }
.float-right { float: right !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* BS3 col-xs-* → Bootstrap 5 col-* equivalent */
.col-xs-1 { flex: 0 0 auto; width: 8.333333%; }
.col-xs-2 { flex: 0 0 auto; width: 16.666667%; }
.col-xs-3 { flex: 0 0 auto; width: 25%; }
.col-xs-4 { flex: 0 0 auto; width: 33.333333%; }
.col-xs-5 { flex: 0 0 auto; width: 41.666667%; }
.col-xs-6 { flex: 0 0 auto; width: 50%; }
.col-xs-7 { flex: 0 0 auto; width: 58.333333%; }
.col-xs-8 { flex: 0 0 auto; width: 66.666667%; }
.col-xs-9 { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

/* BS3 .hidden-xs, .visible-xs responsive utilities */
@media (max-width: 767.98px) {
    .hidden-xs { display: none !important; }
    .visible-xs { display: block !important; }
}
@media (min-width: 768px) {
    .visible-xs { display: none !important; }
}
.hidden { display: none !important; }

/* BS3 .img-circle → BS5 .rounded-circle */
.img-circle { border-radius: 50% !important; }

/* BS3 .img-responsive → BS5 .img-fluid */
.img-responsive {
    display: block;
    max-width: 100%;
    height: auto;
}

/* BS3 btn-xs (removed in BS4+) */
.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

/* BS3 label variants → badge */
.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: #777; }
.label-primary { background-color: var(--cui-primary, #321fdb); }
.label-success { background-color: var(--cui-success, #2eb85c); }
.label-info { background-color: var(--cui-info, #39f); }
.label-warning { background-color: var(--cui-warning, #f9b115); color: #212529; }
.label-danger { background-color: var(--cui-danger, #e55353); }

/* BS4 margin-left/right (replaced by ms-/me- in BS5) */
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }
.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }

/* BS4 padding-left/right (replaced by ps-/pe- in BS5) */
.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }
.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

/* BS3/4 close button (replaced by .btn-close in BS5) */
.close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.close:hover,
.close:focus {
    opacity: .75;
    text-decoration: none;
}

/* BS3 glyphicon fallback (basic icons for login form) */
.glyphicon {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: 'Font Awesome 5 Free';
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}
.glyphicon-user:before { content: "\f007"; }
.glyphicon-lock:before { content: "\f023"; }
.glyphicon-search:before { content: "\f002"; }
.glyphicon-plus:before { content: "\f067"; }
.glyphicon-remove:before { content: "\f00d"; }
.glyphicon-ok:before { content: "\f00c"; }
.glyphicon-chevron-right:before { content: "\f054"; }
.glyphicon-chevron-left:before { content: "\f053"; }

/* BS3 has-feedback input icon positioning */
.has-feedback {
    position: relative;
}
.has-feedback .form-control {
    padding-right: 42.5px;
}
.form-control-feedback {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: block;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    pointer-events: none;
}

/* BS4 badge variants */
.badge-primary { background-color: var(--cui-primary, #321fdb) !important; color: #fff !important; }
.badge-secondary { background-color: var(--cui-secondary, #9da5b1) !important; color: #fff !important; }
.badge-success { background-color: var(--cui-success, #2eb85c) !important; color: #fff !important; }
.badge-danger { background-color: var(--cui-danger, #e55353) !important; color: #fff !important; }
.badge-warning { background-color: var(--cui-warning, #f9b115) !important; color: #212529 !important; }
.badge-info { background-color: var(--cui-info, #39f) !important; color: #fff !important; }

/* --- AdminLTE .box → CoreUI .card Mapping --- */

.box {
    position: relative;
    border-radius: 0.25rem;
    background: #ffffff;
    border: 1px solid #d8dbe0;
    margin-bottom: 1rem;
    width: 100%;
    box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
}

.box-header {
    color: #444;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #d8dbe0;
    position: relative;
}

.box-header.with-border {
    border-bottom: 1px solid #d8dbe0;
}

.box-title {
    display: inline-block;
    font-size: 1rem;
    margin: 0;
    line-height: 1;
    font-weight: 600;
}

.box-body {
    padding: 1rem;
}

.box-body.no-padding {
    padding: 0;
}

.box-footer {
    border-top: 1px solid #d8dbe0;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
}

.box-tools {
    float: right;
    margin-right: -0.625rem;
}

.btn-box-tool {
    background: transparent;
    color: #adb5bd;
    font-size: 0.875rem;
    border: 0;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.btn-box-tool:hover {
    color: #495057;
}

/* .box overlay for loading spinner */
.box > .overlay,
.overlay-wrapper > .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, .7);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

/* --- AdminLTE Background Color Classes --- */

.bg-blue { background-color: #0073b7 !important; color: #fff !important; }
.bg-aqua { background-color: #00c0ef !important; color: #fff !important; }
.bg-green { background-color: #00a65a !important; color: #fff !important; }
.bg-yellow { background-color: #f39c12 !important; color: #fff !important; }
.bg-red { background-color: #dd4b39 !important; color: #fff !important; }
.bg-olive { background-color: #3d9970 !important; color: #fff !important; }
.bg-gray { background-color: #d2d6de !important; }
.bg-navy { background-color: #001f3f !important; color: #fff !important; }
.bg-teal { background-color: #39cccc !important; color: #fff !important; }
.bg-purple { background-color: #605ca8 !important; color: #fff !important; }
.bg-maroon { background-color: #d81b60 !important; color: #fff !important; }
.bg-black { background-color: #111 !important; color: #fff !important; }

/* AdminLTE active/hover color variants */
.bg-orange-active { background-color: #ff851b !important; color: #fff !important; }
.bg-red-active { background-color: #dd4b39 !important; color: #fff !important; }
.bg-green-active { background-color: #00a65a !important; color: #fff !important; }
.bg-aqua-active { background-color: #00c0ef !important; color: #fff !important; }

/* AdminLTE gradient backgrounds */
.bg-blue-gradient { background: linear-gradient(#0073b7, #005a8e) !important; color: #fff !important; }
.bg-green-gradient { background: linear-gradient(#00a65a, #008548) !important; color: #fff !important; }
.bg-aqua-gradient { background: linear-gradient(#00c0ef, #0098c0) !important; color: #fff !important; }
.bg-yellow-gradient { background: linear-gradient(#f39c12, #c87e0a) !important; color: #fff !important; }
.bg-red-gradient { background: linear-gradient(#dd4b39, #b33020) !important; color: #fff !important; }

/* AdminLTE text color classes */
.text-red { color: #dd4b39 !important; }
.text-orange { color: #f38a33 !important; }
.text-green { color: #00a65a !important; }
.text-blue { color: #0073b7 !important; }
.text-aqua { color: #00c0ef !important; }
.text-yellow { color: #f39c12 !important; }
.text-navy { color: #001f3f !important; }
.text-teal { color: #39cccc !important; }
.text-purple { color: #605ca8 !important; }

/* --- AdminLTE Elevation Classes --- */

.elevation-1 {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24) !important;
}

.elevation-2 {
    box-shadow: 0 3px 6px rgba(0, 0, 0, .16), 0 3px 6px rgba(0, 0, 0, .23) !important;
}

.elevation-3 {
    box-shadow: 0 10px 20px rgba(0, 0, 0, .19), 0 6px 6px rgba(0, 0, 0, .23) !important;
}

.elevation-4 {
    box-shadow: 0 14px 28px rgba(0, 0, 0, .25), 0 10px 10px rgba(0, 0, 0, .22) !important;
}

/* --- AdminLTE Login Page --- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #e9ecef;
}

.login-box {
    width: 360px;
}

.login-logo {
    text-align: center;
    margin-bottom: 0.75rem;
}

.login-card-body,
.login-box-body {
    padding: 1.25rem;
    background: #fff;
    border-radius: 0.25rem;
}

.login-box-msg {
    text-align: center;
    padding: 0 1.25rem 1.25rem;
    margin-bottom: 0;
}

/* --- AdminLTE Info Box Component --- */

.info-box {
    box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
    border-radius: 0.25rem;
    background: #fff;
    display: flex;
    padding: 0.5rem;
    min-height: 80px;
    position: relative;
    width: 100%;
}

.info-box-icon {
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.875rem;
    padding: 0.5rem;
    text-align: center;
    width: 70px;
    color: #fff;
}

.info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10px;
    flex: 1;
    line-height: 1.8;
}

.info-box-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-box-number {
    display: block;
    font-weight: 700;
}

/* --- AdminLTE Small Box Component --- */

.small-box {
    border-radius: 0.25rem;
    box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
    position: relative;
    display: block;
    margin-bottom: 20px;
    color: #fff;
}

.small-box .inner {
    padding: 10px;
}

.small-box .icon {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 70px;
    color: rgba(0, 0, 0, .15);
    z-index: 0;
}

.small-box-footer {
    display: block;
    padding: 3px 0;
    background: rgba(0, 0, 0, .1);
    color: rgba(255, 255, 255, .8);
    text-align: center;
    text-decoration: none;
    z-index: 10;
    position: relative;
}

.small-box-footer:hover {
    background: rgba(0, 0, 0, .15);
    color: #fff;
}

/* --- AdminLTE Card Tools & Buttons --- */

.card-tools {
    float: right;
    margin-right: -0.625rem;
}

.btn-tool {
    background: transparent;
    color: #adb5bd;
    font-size: 0.875rem;
    margin: -0.75rem 0;
    padding: 0.25rem 0.5rem;
    border: 0;
    cursor: pointer;
}

.btn-tool:hover {
    color: #495057;
}

.btn-flat {
    border-radius: 0;
    border: 1px solid transparent;
}

/* --- AdminLTE Sidebar Extras --- */

.btn-sidebar {
    background: transparent;
    border: 0;
    color: #adb5bd;
}

.form-control-sidebar {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
}

/* --- AdminLTE Content Header --- */

.content-header {
    padding: 15px 0.5rem;
}

/* --- AdminLTE Navbar Compat --- */

.navbar-white {
    background-color: #fff;
}

.navbar-light .navbar-nav .nav-link {
    color: rgba(0, 0, 0, .5);
}

.navbar-light .navbar-nav .nav-link:hover {
    color: rgba(0, 0, 0, .7);
}

/* --- AdminLTE Nav Tabs Custom --- */

.nav-tabs-custom {
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
    border-radius: 3px;
}

.nav-tabs-custom > .nav-tabs {
    margin: 0;
    border-bottom: 1px solid #ddd;
    border-radius: 3px 3px 0 0;
}

.nav-tabs-custom > .nav-tabs > li {
    border-top: 3px solid transparent;
    margin-bottom: -2px;
    margin-right: 5px;
}

.nav-tabs-custom > .nav-tabs > li > a {
    color: #444;
    border-radius: 0;
}

.nav-tabs-custom > .nav-tabs > li.active {
    border-top-color: #009da5;
}

.nav-tabs-custom > .nav-tabs > li.active > a {
    background-color: #fff;
    color: #444;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.nav-tabs-custom > .tab-content {
    padding: 10px 15px;
    border-radius: 0 0 3px 3px;
}

/* --- AdminLTE BS3 Breadcrumb --- */

.breadcrumb {
    padding: 8px 15px;
    margin-bottom: 0;
    list-style: none;
    background-color: transparent;
    border-radius: 4px;
}

.breadcrumb > li {
    display: inline-block;
}

.breadcrumb > li + li:before {
    padding: 0 5px;
    color: #ccc;
    content: "/\00a0";
}

.breadcrumb > .active {
    color: #777;
}

/* --- Margin/No-margin helpers (AdminLTE) --- */
.margin { margin: 5px; }
.margin-r { margin-right: 5px; }
.no-margin { margin: 0 !important; }
.no-padding { padding: 0 !important; }

/* --- BS3 .btn-outline (used in KPS modals) --- */
.btn-outline {
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
}
.btn-outline:hover {
    color: rgba(255, 255, 255, .7);
    border-color: rgba(255, 255, 255, .7);
}

/* --- AdminLTE Modal Color Variants --- */
.modal-primary .modal-header,
.modal-primary .modal-footer { background-color: var(--cui-primary, #321fdb); color: #fff; border: 0; }
.modal-success .modal-header,
.modal-success .modal-footer { background-color: var(--cui-success, #2eb85c); color: #fff; border: 0; }
.modal-warning .modal-header,
.modal-warning .modal-footer { background-color: var(--cui-warning, #f9b115); color: #212529; border: 0; }
.modal-danger .modal-header,
.modal-danger .modal-footer { background-color: var(--cui-danger, #e55353); color: #fff; border: 0; }
.modal-info .modal-header,
.modal-info .modal-footer { background-color: var(--cui-info, #39f); color: #fff; border: 0; }

/* --- BS3 panel → card fallback --- */
.panel { border-radius: 0.25rem; border: 1px solid #ddd; margin-bottom: 1rem; background: #fff; }
.panel-heading { padding: 10px 15px; border-bottom: 1px solid #ddd; border-radius: 0.25rem 0.25rem 0 0; }
.panel-body { padding: 15px; }
.panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #ddd; border-radius: 0 0 0.25rem 0.25rem; }
.panel-default > .panel-heading { color: #333; background-color: #f5f5f5; }
.panel-primary > .panel-heading { color: #fff; background-color: var(--cui-primary, #321fdb); }

/* --- AdminLTE Description Block (used in Default.aspx menu) --- */

.description-block {
    display: block;
    text-align: center;
    margin: 10px 0;
}

.description-block.margin-bottom {
    margin-bottom: 25px;
}

.description-text {
    display: block;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
}

.sparkbar {
    text-align: center;
}

.sparkbar.pad {
    padding: 10px;
}

/* AdminLTE .center helper (img centering) */
.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* AdminLTE .margin-bottom utility */
.margin-bottom {
    margin-bottom: 15px;
}

/* --- BS3 well → card-like container --- */
.well {
    min-height: 20px;
    padding: 19px;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
}
