/* Shared visual system for catalog pages, reusable CRUD modals, and labels. */
.catalog-page {
    min-height: calc(100vh - 50px);
    background: #f6f8fc;
}

.catalog-page-header {
    padding: 24px 24px 16px;
}

.catalog-page-heading,
.catalog-modal-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

.catalog-page-icon,
.catalog-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 13px;
    background: #eaf2ff;
    color: #1769e8;
    font-size: 19px;
    box-shadow: inset 0 0 0 1px rgba(23, 105, 232, 0.08);
}

.catalog-page-header h1 {
    margin: 0 0 4px;
    color: #172542;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.2;
}

.catalog-page-header p {
    margin: 0;
    color: #758099;
    font-size: 13px;
}

.catalog-page-content {
    padding: 0 24px 24px;
}

.catalog-page .catalog-card {
    margin: 0 0 18px;
    overflow: visible;
    border: 1px solid #e5eaf2;
    border-top: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(22, 39, 75, 0.06);
}

.catalog-page .catalog-card > .box-header {
    min-height: 66px;
    padding: 19px 20px;
    border-bottom: 1px solid #edf0f5;
    border-radius: 12px 12px 0 0;
}

.catalog-page .catalog-card > .box-header .box-title {
    color: #263754;
    font-size: 17px;
    font-weight: 700;
    line-height: 28px;
}

.catalog-page .catalog-card > .box-body {
    padding: 20px;
}

.catalog-card-tools {
    top: 14px !important;
    right: 18px !important;
}

.catalog-add-button,
.catalog-primary-button,
.catalog-submit-button {
    min-height: 38px;
    padding: 9px 16px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(135deg, #2376ec, #1262df);
    box-shadow: 0 6px 14px rgba(23, 105, 232, 0.18);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.catalog-add-button i,
.catalog-primary-button i,
.catalog-submit-button i {
    margin-right: 5px;
}

.catalog-add-button:hover,
.catalog-add-button:focus,
.catalog-primary-button:hover,
.catalog-primary-button:focus,
.catalog-submit-button:hover,
.catalog-submit-button:focus {
    background: linear-gradient(135deg, #1268e7, #0d57cb);
    box-shadow: 0 8px 18px rgba(23, 105, 232, 0.25);
    color: #fff;
}

.catalog-alert {
    border: 1px solid #f4d79d;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(107, 77, 15, 0.05);
}

.catalog-table-wrap {
    overflow: visible;
}

.catalog-table.dataTable tbody td {
    vertical-align: middle;
}

.catalog-table.dataTable thead th:last-child,
.catalog-table.dataTable tbody td:last-child {
    min-width: 145px;
    text-align: center;
}

.taxonomy-icon {
    background: #eeeafd;
    color: #7255d9;
}

.unit-icon {
    background: #e8f7f7;
    color: #159a9c;
}

.warranty-icon {
    background: #eaf8f0;
    color: #24a963;
}

.price-group-icon {
    background: #fff4df;
    color: #d88a13;
}

.label-icon {
    background: #eaf2ff;
    color: #1769e8;
}

.variation-icon {
    background: #f0eefe;
    color: #7357dd;
}

.tax-rate-icon {
    background: #fff0e7;
    color: #dc7131;
}

.import-icon {
    background: #e9f8f0;
    color: #20a765;
}

/* Shared modal layout. */
.catalog-modal-dialog {
    width: min(560px, calc(100% - 30px));
    margin: 45px auto;
}

.catalog-modal-wide {
    width: min(640px, calc(100% - 30px));
}

.catalog-modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(10, 25, 55, 0.24);
}

.catalog-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 15px 20px;
    border-bottom: 1px solid #e9edf4;
    background: #fff;
}

.catalog-modal-header::before,
.catalog-modal-header::after {
    display: none;
    content: none;
}

.catalog-modal-heading {
    min-width: 0;
    margin-right: auto;
}

.catalog-modal-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 11px;
    font-size: 17px;
}

.catalog-modal-heading .modal-title {
    margin: 0;
    color: #172542;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.catalog-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    border-radius: 8px;
    background: #f4f6f9 !important;
    color: #536078;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    opacity: 1;
    text-shadow: none;
}

.catalog-modal-close:hover,
.catalog-modal-close:focus {
    background: #e9edf4 !important;
    color: #172542;
    opacity: 1;
}

.catalog-modal-body {
    max-height: calc(100vh - 210px);
    padding: 22px 22px 8px;
    overflow-y: auto;
    background: #fbfcfe;
}

.catalog-modal-body .form-group {
    margin-bottom: 17px;
}

.catalog-modal-body .form-group > label,
.catalog-modal-body > strong > label {
    margin-bottom: 7px;
    color: #35435e;
    font-size: 12px;
    font-weight: 600;
}

.catalog-modal-body .form-control {
    min-height: 42px;
    border: 1px solid #dfe5ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    color: #273650;
    font-size: 13px;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.catalog-modal-body textarea.form-control {
    min-height: 86px;
    resize: vertical;
}

.catalog-modal-body .form-control:focus {
    border-color: #8bb3ee;
    box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.09);
}

.catalog-modal-body .help-block {
    margin: 6px 1px 0;
    color: #8791a5;
    font-size: 11px;
    line-height: 1.45;
}

.catalog-modal-body .checkbox {
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    background: #fff;
}

.catalog-modal-body .checkbox label {
    color: #45516a;
    font-size: 12px;
    font-weight: 500;
}

.catalog-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 15px 20px;
    border-top: 1px solid #e9edf4;
    background: #fff;
}

.catalog-modal-footer::before,
.catalog-modal-footer::after {
    display: none;
}

.catalog-cancel-button {
    min-height: 38px;
    margin: 0 !important;
    padding: 9px 16px;
    border: 1px solid #dfe5ef;
    border-radius: 7px;
    background: #fff;
    color: #56627a;
    font-size: 12px;
    font-weight: 600;
}

.catalog-cancel-button:hover,
.catalog-cancel-button:focus {
    border-color: #ccd4e1;
    background: #f5f7fa;
    color: #273650;
}

.catalog-submit-button {
    margin: 0 !important;
}

.catalog-inline-table {
    margin: 0;
    border: 1px solid #e3e8f1;
    border-radius: 8px;
    background: #fff;
}

.catalog-inline-table > tbody > tr > th,
.catalog-inline-table > tbody > tr > td {
    padding: 9px;
    border-top: 0;
}

.warranty-duration-group {
    display: flex;
    gap: 8px;
    overflow: hidden;
}

.warranty-duration-group .form-control {
    width: auto !important;
    flex: 1 1 50%;
    float: none !important;
}

.variation-modal-body .control-label {
    padding-top: 11px;
    text-align: left;
}

.variation-add-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #1769e8;
    box-shadow: 0 5px 12px rgba(23, 105, 232, 0.18);
}

.variation-add-value:hover,
.variation-add-value:focus {
    background: #0f5fd8;
}

#variation_values .form-group {
    margin-bottom: 10px;
}

/* Product and opening-stock import screens. */
.import-page-content > .row {
    margin-right: 0;
    margin-left: 0;
}

.import-page-content > .row > .col-sm-12 {
    padding: 0;
}

.import-upload-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 6px;
}

.import-dropzone {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    flex: 1 1 auto;
    padding: 18px;
    border: 1px dashed #bfcde0;
    border-radius: 11px;
    background: #f8fbff;
}

.import-dropzone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 11px;
    background: #e7f7ef;
    color: #22a568;
    font-size: 20px;
}

.import-dropzone .form-group {
    width: 100%;
    margin: 0;
}

.import-dropzone label {
    display: block;
    margin-bottom: 7px;
    color: #35435e;
    font-size: 12px;
    font-weight: 700;
}

.import-file-input {
    display: block;
    width: 100%;
    padding: 7px;
    border: 1px solid #dfe5ef;
    border-radius: 7px;
    background: #fff;
    color: #5f6c84;
    font-size: 11px;
}

.import-dropzone small {
    display: block;
    margin-top: 6px;
    color: #8a95a9;
    font-size: 10px;
}

.import-upload-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    min-width: 210px;
}

.import-upload-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.import-template-button {
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid #bfe5d2;
    border-radius: 7px;
    background: #effaf4;
    color: #218a57;
    font-size: 11px;
    font-weight: 600;
}

.import-template-button i {
    margin-right: 6px;
}

.import-template-button:hover,
.import-template-button:focus {
    border-color: #8fd0af;
    background: #e5f7ed;
    color: #167246;
}

.import-instructions-intro {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border-left: 3px solid #72a6ee;
    border-radius: 0 8px 8px 0;
    background: #f4f8fe;
    color: #5d6980;
    font-size: 12px;
    line-height: 1.5;
}

.import-instructions-intro > i {
    margin-top: 2px;
    color: #1769e8;
    font-size: 16px;
}

.import-instructions-wrap {
    max-height: 620px;
    overflow: auto;
    border: 1px solid #e3e8f1;
    border-radius: 9px;
}

.import-instructions-table {
    min-width: 760px;
    margin-bottom: 0 !important;
}

.import-instructions-table > tbody > tr:first-child > th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f4f6fa;
    box-shadow: 0 1px 0 #dfe5ef;
}

.import-instructions-table > tbody > tr > th:first-child,
.import-instructions-table > tbody > tr > td:first-child {
    width: 72px;
    text-align: center;
}

.import-instructions-table > tbody > tr > th:nth-child(2),
.import-instructions-table > tbody > tr > td:nth-child(2) {
    width: 31%;
}

.import-instructions-table > tbody > tr > td {
    padding: 11px 13px;
    border-right: 1px solid #e6eaf1;
    color: #46536c;
    font-size: 11px;
    line-height: 1.45;
    vertical-align: top;
}

.import-instructions-table > tbody > tr > td:last-child {
    text-align: left;
}

.import-instructions-table .text-muted {
    color: #8a94a7;
}

/* Selling price group import/export. */
.price-transfer-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -6px;
}

.price-transfer-panel {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-height: 145px;
    margin: 6px;
    padding: 18px !important;
    border: 1px solid #e5eaf2;
    border-radius: 10px;
    background: #fbfcfe;
    width: calc(50% - 12px);
}

.price-transfer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 10px;
    background: #eaf2ff;
    color: #1769e8;
    font-size: 16px;
}

.price-import-panel .price-transfer-icon {
    background: #eaf8f0;
    color: #24a963;
}

.price-transfer-panel h4 {
    margin: 0 0 13px;
    color: #33415c;
    font-size: 13px;
    font-weight: 700;
}

.price-transfer-panel form {
    min-width: 0;
    flex: 1 1 auto;
}

.price-transfer-panel .form-group:last-child {
    margin-bottom: 0;
}

.catalog-file-input {
    display: block;
    width: 100%;
    padding: 7px;
    border: 1px dashed #cad4e3;
    border-radius: 7px;
    background: #fff;
    color: #66728a;
    font-size: 11px;
}

.price-import-instructions {
    margin: 12px 6px 6px;
    padding: 15px 18px !important;
    border-left: 3px solid #75a8ef;
    border-radius: 0 8px 8px 0;
    background: #f5f8fd;
    width: calc(100% - 12px);
    color: #59667e;
    font-size: 12px;
}

.price-import-instructions h4 {
    margin: 0 0 8px;
    color: #33415c;
    font-size: 13px;
    font-weight: 700;
}

.price-import-instructions p {
    margin: 4px 0;
}

/* Label creation screen. */
.label-page-content .label-card > .box-body {
    padding: 20px;
}

.label-search-row,
.label-products-row {
    margin-right: 0;
    margin-left: 0;
}

.label-search-row > [class*='col-'],
.label-products-row > [class*='col-'] {
    width: 100%;
    margin-left: 0;
}

.label-search-group {
    max-width: 760px;
    margin: 0 auto 18px;
}

.label-search-input .input-group-addon {
    padding: 0 15px;
    border: 1px solid #dfe5ef;
    border-right: 0;
    border-radius: 9px 0 0 9px;
    background: #f6f9fe;
    color: #1769e8;
}

.label-search-input .form-control {
    height: 44px;
    border: 1px solid #dfe5ef;
    border-radius: 0 9px 9px 0;
    box-shadow: none;
    font-size: 13px;
}

.label-search-input .form-control:focus {
    border-color: #8bb3ee;
    box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.09);
}

.label-product-table-wrap {
    overflow-x: auto;
    border-radius: 9px;
}

.label-product-table {
    margin-bottom: 0 !important;
}

.label-options-wrap {
    overflow: visible;
}

.label-options-table {
    margin: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 8px;
    border: 0;
    background: transparent;
}

.label-options-table > tbody > tr > td {
    padding: 14px;
    vertical-align: top;
    border: 1px solid #e4e9f1 !important;
    border-radius: 9px;
    background: #fbfcfe;
}

.label-options-table .checkbox {
    margin: 0 0 11px;
}

.label-options-table .checkbox label {
    color: #34415e;
    font-size: 12px;
}

.label-options-table .input-group-addon {
    border-color: #dfe5ef;
    border-radius: 7px 0 0 7px;
    background: #f3f6fa;
    color: #66728a;
    font-size: 11px;
}

.label-options-table .form-control,
.label-barcode-setting .form-control {
    height: 38px;
    border-color: #dfe5ef;
    border-radius: 0 7px 7px 0;
    box-shadow: none;
    font-size: 12px;
}

.label-options-table .form-control:focus,
.label-barcode-setting .form-control:focus {
    border-color: #8bb3ee;
    box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.08);
}

.label-settings-row hr {
    margin: 12px 0 18px;
    border-color: #e8ecf3;
}

.label-barcode-setting label {
    margin-bottom: 7px;
    color: #35435e;
    font-size: 12px;
    font-weight: 600;
}

.label-preview-action {
    margin-top: 8px;
}

.label-preview-panel {
    margin: 0 24px 24px;
    padding: 18px;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(22, 39, 75, 0.06);
}

.label-preview-panel h3 {
    margin: 0 0 14px;
    color: #263754;
    font-size: 16px;
    font-weight: 700;
}

.label-print-button {
    min-height: 40px;
    border: 0;
    border-radius: 7px;
    background: #21b877;
    font-weight: 600;
}

#preview_box {
    background: #f6f8fc;
}

@media (max-width: 767px) {
    .catalog-page-header {
        padding: 18px 14px 12px;
    }

    .catalog-page-header h1 {
        font-size: 22px;
    }

    .catalog-page-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 11px;
        font-size: 17px;
    }

    .catalog-page-content {
        padding: 0 12px 18px;
    }

    .catalog-page .catalog-card > .box-header {
        min-height: 62px;
        padding: 17px 14px;
    }

    .catalog-page .catalog-card > .box-header .box-title {
        max-width: calc(100% - 95px);
        font-size: 15px;
    }

    .catalog-card-tools {
        right: 12px !important;
    }

    .catalog-page .catalog-card > .box-body,
    .label-page-content .label-card > .box-body {
        padding: 14px 12px;
    }

    .catalog-modal-dialog,
    .catalog-modal-wide {
        width: calc(100% - 20px);
        margin: 20px auto;
    }

    .catalog-modal-header {
        padding: 14px;
    }

    .catalog-modal-body {
        max-height: calc(100vh - 180px);
        padding: 18px 14px 5px;
    }

    .catalog-modal-footer {
        padding: 13px 14px;
    }

    .price-transfer-panel {
        width: calc(100% - 12px);
    }

    .variation-modal-body .control-label {
        padding-top: 0;
        margin-bottom: 7px;
    }

    .variation-add-value {
        margin-top: 8px;
    }

    .import-upload-layout {
        align-items: stretch;
        flex-direction: column;
        padding: 0;
    }

    .import-upload-actions {
        width: 100%;
        min-width: 0;
    }

    .import-dropzone {
        align-items: flex-start;
        width: 100%;
        padding: 14px;
    }

    .label-options-wrap {
        overflow-x: auto;
    }

    .label-options-table {
        min-width: 700px;
    }

    .label-preview-panel {
        margin: 0 12px 18px;
    }
}
