﻿/* 1. VARIABLES & CORE */
:root {
    --bs-body-color: #333;
    --bs-body-bg: #fff;
    --bs-highlight-bg: #FFFF00;
    --bs-font-sans-serif: 'Roboto', sans-serif;
}

body {
    background-color: #eff2f6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    margin: 10px;
    border-radius: 8px;
    background-color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: none !important;
}

.footer-link {
    text-decoration: none;
    font-weight: 600;
}

    .footer-link:hover {
        text-decoration: underline;
    }

.footer-text {
    color: #6c757d;
    font-size: 0.9rem;
    letter-spacing: 0.02rem;
}

a {
    text-decoration: none;
}

/* 2. TYPOGRAPHY */
.h1, h1 {
    font-size: 1.625rem;
}

.h2, h2 {
    font-size: 1.25rem;
}

.h3, h3 {
    font-size: 1.0625rem;
}

.h4, h4 {
    font-size: .9375rem;
}

.h5, h5 {
    font-size: .85rem;
}

.h6, h6 {
    font-size: .8rem;
}

.fw-semibold, .fw-semi-bold {
    font-weight: 500 !important;
}

.fw-bold {
    font-weight: 600 !important;
}

.text-decoration-underline {
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
}

.white-space-pre-line {
    white-space: pre-line;
}

/* 3. TABLES */
.table {
    --bs-table-bg: transparent;
    color: #000;
    margin-bottom: 0;
}

    .table > :not(:first-child) {
        border-top: none;
    }

.table-bordered td,
.table-bordered th {
    border: 1px solid #dee2e6;
}

.table-bordered > :not(caption) > * {
    border-width: 0;
}

.table thead tr th {
    text-align: center;
    vertical-align: middle;
}

.table tr td {
    padding: .3rem;
    vertical-align: middle;
}

.table .thead-light th {
    border-color: #ddd;
    background-color: #f6f9fc;
}

td, th {
    white-space: nowrap;
}

.thead-dark tr:not(.search-row) th:last-child {
    border-right-color: #dee2e6;
}

/* Table inputs */
.table tr td .form-control {
    padding: .4rem;
}

.table tr td.p-0 .form-control {
    height: 34px;
}

    .table tr td.p-0 .form-control:focus {
        box-shadow: none;
        background-color: #fbe4ca;
    }

/* 4. FORMS & INPUTS */
.form-control {
    background-color: #fff;
    border: 1px solid #ced4da;
    color: #000;
}

    .form-control:disabled,
    .form-control[readonly] {
        background-color: #e9ecef;
        opacity: 1;
    }

    .form-control.highlight {
        background-color: #fff1e1;
    }

.form-floating > textarea.form-control {
    height: unset;
}

.form-check label {
    cursor: pointer;
}

/* Select2 overrides */
.select2-dropdown {
    z-index: 99999999;
}

.select2-container .select2-search--inline {
    display: block;
}

    .select2-container .select2-search--inline .select2-search__field {
        margin-top: 0;
    }

.select2-results__option[aria-selected=true] {
    display: none;
}

.select2-selection--single {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Interaction states */
.select2-container--disabled .select2-selection__arrow {
    height: 100% !important;
    background: #EEE !important;
    top: 0 !important;
    right: 0 !important;
}

.select2-selection:focus .select2-selection__arrow {
    background: #fff;
}

.select2-results__option.select2-results__option--highlighted {
    background: #ddd;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected="true"] {
    background: #0082c3 !important;
    color: #fff !important;
}

.select2-container--default .select2-selection--single {
    border-color: #ced4da;
}

/* Bootstrap 5 specific */
select + .select2-container--bootstrap-5 {
    z-index: 0;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    height: auto;
}

    .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
        display: block;
    }

        .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
            float: left;
            margin-bottom: .2rem;
        }

    .select2-container--bootstrap-5 .select2-selection--multiple .select2-search {
        width: unset;
    }

/* Table specific Select2 */
td .select2-container {
    width: 100% !important;
}

td:not(.skip-style) .select2-container .select2-selection.select2-selection--multiple {
    padding: .2rem 1.5rem 0 .2rem !important;
    min-height: 40px !important;
    font-size: inherit !important;
}

.jconfirm select.form-select + .select2-container .select2-selection,
td > select.form-select + .select2-container .select2-selection {
    padding: .5rem 2rem .5rem .4rem;
    height: 38px;
}

    td > select.form-select + .select2-container .select2-selection .select2-selection__arrow {
        top: 17%;
        right: 7px;
    }

/* 5. BUTTONS */
.btn-teal {
    --bs-btn-color: #fff;
    --bs-btn-bg: #20c997;
    --bs-btn-border-color: #20c997;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #1aa179;
    --bs-btn-hover-border-color: #1aa179;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #168b67;
    --bs-btn-active-border-color: #168b67;
    --bs-btn-focus-shadow-rgb: 32,201,151;
}

.btn-outline-teal {
    --bs-btn-color: #20c997;
    --bs-btn-border-color: #20c997;
    --bs-btn-hover-bg: #20c997;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #20c997;
    --bs-btn-focus-shadow-rgb: 32,201,151;
}

.btn-indigo {
    --bs-btn-color: #fff;
    --bs-btn-bg: #6610f2;
    --bs-btn-border-color: #6610f2;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #520dc2;
    --bs-btn-hover-border-color: #520dc2;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #4a0bb3;
    --bs-btn-active-border-color: #4a0bb3;
    --bs-btn-focus-shadow-rgb: 102,16,242;
}

.btn-outline-indigo {
    --bs-btn-color: #6610f2;
    --bs-btn-border-color: #6610f2;
    --bs-btn-hover-bg: #6610f2;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #6610f2;
    --bs-btn-focus-shadow-rgb: 102,16,242;
}

.btn-orange {
    --bs-btn-color: #fff;
    --bs-btn-bg: #fd7e14;
    --bs-btn-border-color: #fd7e14;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #e96b0c;
    --bs-btn-hover-border-color: #e96b0c;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #d45f09;
    --bs-btn-active-border-color: #d45f09;
    --bs-btn-focus-shadow-rgb: 253,126,20;
}

.btn-outline-orange {
    --bs-btn-color: #fd7e14;
    --bs-btn-border-color: #fd7e14;
    --bs-btn-hover-bg: #fd7e14;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #fd7e14;
    --bs-btn-focus-shadow-rgb: 253,126,20;
}

.btn-pink {
    --bs-btn-color: #fff;
    --bs-btn-bg: #d63384;
    --bs-btn-border-color: #d63384;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #b82a6f;
    --bs-btn-hover-border-color: #b82a6f;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #a62462;
    --bs-btn-active-border-color: #a62462;
    --bs-btn-focus-shadow-rgb: 214,51,132;
}

.btn-outline-pink {
    --bs-btn-color: #d63384;
    --bs-btn-border-color: #d63384;
    --bs-btn-hover-bg: #d63384;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #d63384;
    --bs-btn-focus-shadow-rgb: 214,51,132;
}

/* 6. CARDS */
.card {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header, .card-footer {
    padding: .7rem .7rem;
}

    /* Card Select2 */
    .card-header .select2-container:not(:first-of-type) {
        margin-left: .5rem !important;
    }

    .card-header .select2-container .select2-selection {
        padding: .5rem 1.5rem .4rem .5rem;
        height: 35px;
    }

        .card-header .select2-container .select2-selection .select2-selection__arrow {
            top: 10%;
            right: 4px;
        }

/* Card Table styles */
.table thead.tableSlimHead th,
.table.tableSlimHead thead th {
    font-size: 13px;
}

.table.tableSlimHead th {
    padding: .4rem;
}

.table.tableEndNoBorder td:first-child,
.table.tableEndNoBorder th:first-child {
    border-left: 0;
}

.table.tableEndNoBorder td:last-child,
.table.tableEndNoBorder th:last-child {
    border-right: 0;
}

.table.tableBorderLastChild tbody tr:last-child td {
    border-bottom: 1px solid #ddd;
}

.table.tableSlimHead thead.thead-dark th[colspan] {
    border-bottom: 1px solid;
}

.table.tableSlimHead thead.thead-dark tr:not(:first-child):not(.search-row) th:last-child {
    border-right: 1px solid;
}

/* Card Accents */
.card-accent {
    position: relative;
}

    .card-accent::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 4px;
        border-radius: 2px;
    }

    .card-accent.primary::before {
        background-color: var(--bs-primary);
    }

    .card-accent.success::before {
        background-color: var(--bs-success);
    }

    .card-accent.warning::before {
        background-color: var(--bs-warning);
    }

    .card-accent.info::before {
        background-color: var(--bs-info);
    }

    .card-accent.danger::before {
        background-color: var(--bs-danger);
    }

    .card-accent.teal::before {
        background-color: #20c997;
    }

    .card-accent.indigo::before {
        background-color: #6610f2;
    }

    .card-accent.orange::before {
        background-color: #fd7e14;
    }

    .card-accent.pink::before {
        background-color: #d63384;
    }

/* 7. CHIPS & LOGOS */
.section-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

    .section-chip.primary {
        background-color: rgba(var(--bs-primary-rgb), .12);
        color: var(--bs-primary);
    }

    .section-chip.success {
        background-color: rgba(var(--bs-success-rgb), .12);
        color: var(--bs-success);
    }

    .section-chip.warning {
        background-color: rgba(var(--bs-warning-rgb), .15);
        color: var(--bs-warning);
    }

    .section-chip.info {
        background-color: rgba(var(--bs-info-rgb), .15);
        color: var(--bs-info);
    }

    .section-chip.danger {
        background-color: rgba(var(--bs-danger-rgb), .15);
        color: var(--bs-danger);
    }

    .section-chip.teal {
        background-color: rgba(32,199,151,.12);
        color: #20c997;
    }

    .section-chip.indigo {
        background-color: rgba(102,16,242,.12);
        color: #6610f2;
    }

    .section-chip.orange {
        background-color: rgba(253,126,20,.15);
        color: #fd7e14;
    }

    .section-chip.pink {
        background-color: rgba(214,51,132,.15);
        color: #d63384;
    }

.cddl-logo, .mt-logo {
    width: 100px;
}

/* 8. SIZING UTILITIES */
.action, .serial {
    width: 45px;
    text-align: center;
}

.action {
    padding-top: 0;
    padding-bottom: 0;
}

.td-amount {
    width: 115px;
    text-align: right;
}

.serial-col {
    width: 35px;
}

.quantity-col, .amount-col, .date-col, .action-col {
    width: 80px;
}

td.amount-col {
    text-align: right;
}

/* Fixed pixel widths */
.col-20p {
    width: 20px;
}

.col-40p {
    width: 40px;
}

.col-50p {
    width: 50px;
}

.col-60p {
    width: 60px;
}

.col-80p {
    width: 80px;
}

.col-100p {
    width: 100px;
}

.col-120p {
    width: 120px;
}

.col-150p {
    width: 150px;
}

.col-180p {
    width: 180px;
}

.col-200p {
    width: 200px;
}

.col-250p {
    width: 250px;
}

.col-300p {
    width: 300px;
}

.col-7pt {
    width: 7%;
}

/* Min widths */
.col-20pm {
    min-width: 20px;
}

.col-40pm {
    min-width: 40px;
}

.col-50pm {
    min-width: 50px;
}

.col-60pm {
    min-width: 60px;
}

.col-80pm {
    min-width: 80px;
}

.col-100pm {
    min-width: 100px;
}

.col-120pm {
    min-width: 120px;
}

.col-150pm {
    min-width: 150px;
}

.col-180pm {
    min-width: 180px;
}

.col-200pm {
    min-width: 200px;
}

.col-250pm {
    min-width: 250px;
}

.col-300pm {
    min-width: 300px;
}

/* Heights */
.mh-120p {
    height: 120px;
}

.mh-100p {
    height: 100px;
}

.mh-80p {
    height: 80px;
}

/* 9. OVERLAYS & MODALS */
#notificationItems.dropdown-menu {
    width: 350px;
    word-wrap: break-word;
    right: -50px;
    left: auto;
}

#profileItems.dropdown-menu {
    word-wrap: break-word;
    right: 0px;
    left: auto;
    top: auto;
}

.modal-xl {
    max-width: 98% !important;
}

/* 10. HELPER UTILITIES */
.align-top * {
    vertical-align: top !important;
}

.align-middle * {
    vertical-align: middle !important;
}

.align-bottom * {
    vertical-align: bottom !important;
}

/* Borders */
.border-radius-0 {
    border-radius: 0;
}

.border-black {
    border-color: #000 !important;
}

.border-top-only {
    border-width: 1px 0 0 0 !important;
}

.border-right-only {
    border-width: 0 1px 0 0 !important;
}

.border-bottom-only {
    border-width: 0 0 1px 0 !important;
}

.border-left-only {
    border-width: 0 0 0 1px !important;
}

.border-dotted {
    border-style: dotted !important;
    border-width: 1px;
}

.border-dashed {
    border-style: dashed !important;
    border-width: 1px;
}

.border-dashed-top {
    border-top-style: dashed !important;
    border-width: 1px;
}

.border-dashed-bottom {
    border-bottom-style: dashed !important;
    border-width: 1px;
}

.border-dashed-left {
    border-left-style: dashed !important;
    border-width: 1px;
}

.border-dashed-right {
    border-right-style: dashed !important;
    border-width: 1px;
}

/* Misc */
.cursor-pointer {
    cursor: pointer;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.mark, mark {
    padding: 0;
}

.word-break {
    word-break: break-all;
}