@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');
@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:700&display=swap');

* {
    font-family: 'Open Sans', sans-serif;
}

/* CSS for loader container */
.loader-container {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black background */
    z-index: 9999; /* Ensure it's above other content */
}

/* CSS for loader — pure CSS ring, no icon-font dependency */
.loader {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loader-spin 0.75s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    /* translate is baked into the keyframe start so the spin origin stays centred */
    transform: translate(-50%, -50%);
    z-index: 10000;
}
@keyframes loader-spin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

h1, h2, h3, h4, h5, h6,
h5 strong {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
}
.ck-editor__editable,
textarea {
    min-height: 150px;
}
.datatable {
    width: 100% !important;
}

.dataTables_length,
.dataTables_filter,
.dt-buttons {
    margin-bottom: 0.333em;
    margin-top: .2rem;
}

.dataTables_filter {
    margin-right: .2rem;
}

.dt-buttons .btn {
    margin-left: 0.333em;
    border-radius: 0;
}

.table.datatable {
    box-sizing: border-box;
    border-collapse: collapse !important;
}

table.dataTable thead th {
    border-bottom: 2px solid #c8ced3;
}

.dataTables_wrapper.no-footer .dataTables_scrollBody {
    border-bottom: 1px solid #c8ced3;
}

.select2 {
    max-width: 100%;
    width: 100% !important;
}

.select2-selection__rendered {
    padding-bottom: 5px !important;
}

.has-error .invalid-feedback {
    display: block !important;
}

.btn-info,
.badge-info {
    color: white;
}

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none;
}

.sidebar .nav-item {
    cursor: pointer;
}

.btn-default {
    color: #23282c;
    background-color: #f0f3f5;
    border-color: #f0f3f5;
}

.btn-default.focus,
.btn-default:focus {
    box-shadow: 0 0 0 .2rem rgba(209, 213, 215, .5);
}

.btn-default:hover {
    color: #23282c;
    background-color: #d9e1e6;
    border-color: #d1dbe1;
}

.btn-group-xs > .btn,
.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

#carton-row .delete-carton{
    display: none;
}

.carton-item #add-carton{
    display: none;
}

.carton-item .delete-carton{
    display: block;
}
.card-body .has-error input {
    border-color: #f86c6b;
}

/***********
    Login 
************/

.login-page {
    background-color: #2f6fa9;
}
.login-logo a {
    width: 300px;
    display: block;
    margin: 0 auto;
}
.login-logo {
    padding-bottom: 40px;
}
.btn-primary {
    background-color: #3276b1;
    border-color: #285e8e;
}
.btn-success {
    background-color: #47a447; 
    border-color: #398439;
}
.btn-danger {
    background-color: #d9534f; 
    border-color: #d43f3a;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus {
    background-color: #428bca; 
    border-color: #357ebd;
    box-shadow: none;
}
.btn-success:hover,
.btn-success:active,
.btn-success:focus {
    background-color: #5cb85c; 
    border-color: #4cae4c;
}
.btn-danger:hover,
.btn-danger:active,
.btn-danger:focus {
    background-color: #d2322d; 
    border color: #ac2925;
}
.form-control:focus {
    box-shadow: none;
    border-color: #428bca;
}
.btn.add-btn:hover {
    background-color: #ff8200;
    border-color: #ff8200;
}
/**************
    Dashboard
***************/
.sidebar-fixed .navbar-brand {
    padding-left: 15px;
}
.sidebar .nav-link.active {
    background: #2f6fa9;
}
.sidebar .sidebar-minimizer,
.sidebar-minimized .sidebar .sidebar-minimizer {
    background: #2f6fa9;
}
.sidebar .sidebar-minimizer:hover,
.sidebar .nav-link:hover {
    background: #ff8200;
}
.sidebar .sidebar-minimizer::before,
.sidebar .sidebar-minimizer:hover::before{
    background-image: url(../images/arrow.svg);
}
.sidebar .nav-link.active .nav-icon {
    color: #fff;
}
.page-link {
    color: #17a2b8;
}

/***********
    Roles
************/
.add-role-list .d-block {
    margin-bottom: 1px;
} 


/************
    Setting
*************/
#myTabContent .form-check {
    position: relative;
}
#myTabContent .form-check input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 14px;
    width: 14px;
    left: 20px;
    top: 0;
    z-index: 2;
}
.checkmark {
    position: absolute;
    top: 2px;
    left: 0px;
    height: 14px;
    width: 14px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #e4e7ea;
}
#myTabContent .form-check:hover input ~ .checkmark {
    background-color: #ccc;
}
#myTabContent .form-check input:checked ~ .checkmark {
    background-color: #2196F3;
    border: none;
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
#myTabContent .form-check input:checked ~ .checkmark:after {
    display: block;
}
.form-check .checkmark:after {
    left: 4px;
    top: 2px;
    width: 5px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}
.list-style-none {
    list-style: none;
}

.dataTables_processing {
    display: block;
    z-index: 999;
    border: 0;
}

.wrap-data {
    max-width: 200px;
}

div.dt-button-collection {
    width:100px !important;
}

ul.pagination > li.active > a {
    background-color: #89CFF0;
}

/***********
    Orders
************/
.orders-page .orders-export-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.orders-page .orders-export-fields {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.orders-page .orders-export-field {
    min-width: 140px;
}

.orders-page .orders-export-field label,
.orders-page .orders-filter-panel label {
    color: #5c6873;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.orders-page .orders-card-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.orders-page .orders-filter-summary {
    color: #73818f;
    font-size: 12px;
    margin-top: 2px;
}

.orders-page .orders-filter-panel {
    background-color: #f8f9fa;
    border: 1px solid #e4e7ea;
    margin-bottom: 16px;
    padding: 14px 14px 6px;
}

.orders-page .orders-filter-panel-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.orders-page .orders-filter-panel-header h6 {
    color: #23282c;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.orders-page .orders-clear-link {
    color: #3276b1;
    padding: 0;
}

.orders-page .orders-filter-alert {
    display: none;
    margin-bottom: 12px;
    padding: 8px 12px;
}

.orders-page .orders-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.orders-page .select2-container .select2-selection--multiple {
    min-height: calc(2.19rem + 2px);
}

.orders-page .select2-container--default .select2-selection--multiple {
    padding-left: .75rem;
    padding-right: .75rem;
}

.orders-page .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.orders-page .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-left: 0;
}

.orders-page .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-left: 0;
}

.orders-page .orders-table-wrap {
    overflow-x: auto;
}

.orders-page .orders-table {
    margin-bottom: 0;
}

.orders-page .orders-table thead th {
    background-color: #f0f3f5;
    color: #23282c;
    font-size: 12px;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.orders-page .orders-table tbody td {
    vertical-align: middle;
}

.orders-page .orders-id-cell {
    color: #73818f;
    font-size: 12px;
}

.orders-page .orders-primary-cell {
    min-width: 120px;
}

.orders-page .orders-muted-value {
    color: #5c6873;
}

.orders-page .orders-destination {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.orders-page .orders-destination small,
.orders-page .orders-date-cell small {
    color: #73818f;
    display: block;
    line-height: 1.3;
}

.orders-page .orders-date {
    display: block;
}

.orders-page .orders-badge {
    font-size: 11px;
    letter-spacing: 0;
    padding: 5px 7px;
}

.orders-page .badge-light {
    background-color: #eef2f5;
    border: 1px solid #d8dfe5;
    color: #23282c;
}

.orders-page .badge-warning {
    color: #23282c;
}

.orders-page .orders-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.logs-page .logs-error-text {
    display: block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.orders-page .dataTables_wrapper .dataTables_info,
.orders-page .dataTables_wrapper .dataTables_paginate,
.orders-page .dataTables_wrapper .dataTables_length {
    font-size: 12px;
    margin-top: 10px;
}

.orders-page .dataTables_processing {
    background: rgba(255, 255, 255, .92);
    border: 1px solid #e4e7ea;
    color: #23282c;
    font-weight: 700;
    padding: 12px;
}

@media (max-width: 767.98px) {
    .orders-page .orders-export-bar,
    .orders-page .orders-export-fields,
    .orders-page .orders-filter-actions {
        justify-content: stretch;
    }

    .orders-page .orders-export-field,
    .orders-page .orders-export-fields .btn,
    .orders-page .orders-filter-actions .btn {
        width: 100%;
    }

    .orders-page .orders-card-header,
    .orders-page .orders-filter-panel-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .orders-page .orders-action-group {
        justify-content: flex-start;
    }
}

/****************
    Detail Pages
*****************/
.detail-page {
    color: #23282c;
}

.detail-header,
.detail-card,
.detail-summary-card,
.detail-json-card {
    background-color: #fff;
    border: 1px solid #e4e7ea;
    margin-bottom: 16px;
}

.detail-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    padding: 16px;
}

.detail-eyebrow,
.detail-label,
.detail-list dt {
    color: #73818f;
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.detail-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-title-row h5 {
    line-height: 1.2;
}

.detail-subtitle {
    color: #5c6873;
    font-size: 13px;
    margin-top: 6px;
}

.detail-actions,
.detail-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.detail-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-summary-card {
    min-height: 92px;
    padding: 14px;
}

.detail-summary-card strong {
    display: block;
    font-size: 16px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.detail-summary-card small {
    color: #73818f;
    display: block;
    line-height: 1.35;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.detail-card,
.detail-json-card {
    display: flex;
    flex-direction: column;
}

.detail-card-header {
    align-items: center;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e4e7ea;
    display: flex;
    justify-content: space-between;
    min-height: 46px;
    padding: 10px 12px;
}

.detail-card-header h6 {
    color: #23282c;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 17px;
    font-weight: 700;
}

.detail-list {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.detail-list.detail-list-compact {
    grid-template-columns: 1fr;
}

.detail-list > div {
    border-bottom: 1px solid #eef2f5;
    min-height: 70px;
    padding: 12px;
}

.detail-list > div:nth-last-child(-n+2) {
    border-bottom: 0;
}

.detail-list.detail-list-compact > div:last-child {
    border-bottom: 0;
}

.detail-list dd {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.detail-inline-pre {
    background: transparent;
    border: 0;
    color: inherit;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    max-height: 120px;
    overflow: auto;
    padding: 0;
    white-space: pre-wrap;
}

.detail-badge {
    font-size: 11px;
    letter-spacing: 0;
    padding: 5px 7px;
}

.detail-count {
    background-color: #eef2f5;
    border: 1px solid #d8dfe5;
    color: #23282c;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
}

.detail-json-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-json-card-wide {
    grid-column: 1 / -1;
}

.detail-json-body {
    flex: 1;
    min-height: 220px;
    overflow: auto;
}

.detail-json-body pre,
.detail-payload-editor textarea,
.detail-log-json-grid pre {
    background-color: #1f2933;
    border: 0;
    color: #f8f9fa;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    min-height: 220px;
    padding: 12px;
    tab-size: 2;
    white-space: pre;
}

.detail-json-body pre.is-empty {
    color: #bac4ce;
}

.detail-payload-editor textarea {
    min-height: 420px;
    resize: vertical;
    width: 100%;
}

.detail-empty {
    color: #73818f;
    padding: 16px;
}

.detail-alert {
    margin-bottom: 12px;
}

.detail-table {
    margin-bottom: 0;
}

.detail-table-wrap {
    padding: 12px;
}

.detail-table-wrap .dataTables_wrapper {
    width: 100%;
}

.detail-table thead th {
    background-color: #f0f3f5;
    font-size: 12px;
    text-transform: uppercase;
}

.detail-log-json-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
}

.detail-log-json-grid strong {
    display: block;
    margin-bottom: 6px;
}

.detail-log-json-grid pre {
    min-height: 120px;
    overflow: auto;
}

@media (max-width: 991.98px) {
    .detail-header {
        flex-direction: column;
        gap: 12px;
    }

    .detail-actions {
        justify-content: flex-start;
    }

    .detail-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-list {
        grid-template-columns: 1fr;
    }

    .detail-list > div:nth-last-child(-n+2) {
        border-bottom: 1px solid #eef2f5;
    }

    .detail-list > div:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 767.98px) {
    .detail-actions,
    .detail-actions .btn,
    .detail-card-actions,
    .detail-card-actions .btn {
        width: 100%;
    }

    .detail-summary-grid,
    .detail-json-grid,
    .detail-log-json-grid {
        grid-template-columns: 1fr;
    }

    .detail-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}
