html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

@media (max-width: 767.98px) {
    .mobile-table thead {
        display: none;
    }

    .mobile-table, .mobile-table tbody, .mobile-table tr, .mobile-table td {
        display: block;
        width: 100%;
    }

        .mobile-table tr {
            margin-bottom: 1rem;
            border: 1px solid #dee2e6;
            border-radius: .5rem;
            overflow: hidden;
        }

        .mobile-table td {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            text-align: right;
            border: 0;
            border-bottom: 1px solid #eee;
        }

            .mobile-table td:last-child {
                border-bottom: 0;
            }

            .mobile-table td::before {
                content: attr(data-label);
                font-weight: 600;
                text-align: left;
            }

            .mobile-table td[data-label="Actions"] {
                display: block;
            }

                .mobile-table td[data-label="Actions"]::before {
                    display: block;
                    margin-bottom: .75rem;
                }

                .mobile-table td[data-label="Actions"] .btn {
                    flex: 1;
                }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}




.select2-container {
    width: 100% !important;
}

    .select2-container .select2-selection--single {
        height: 38px;
        padding: 4px 8px;
        border-color: #dee2e6;
    }

        .select2-container .select2-selection--single .select2-selection__rendered {
            line-height: 28px;
            padding-left: 0;
        }

        .select2-container .select2-selection--single .select2-selection__arrow {
            height: 36px;
        }





.swal2-popup.swal2-toast {
    border-radius: .75rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15);
    padding: .85rem 1rem;
}

    .swal2-popup.swal2-toast .swal2-title {
        font-size: .95rem;
        font-weight: 500;
        line-height: 1.5;
    }

    .swal2-popup.swal2-toast .swal2-icon {
        margin: 0 .65rem 0 0;
    }

@media (max-width: 575.98px) {
    .swal2-container.swal2-top-end {
        padding: .75rem;
    }

    .swal2-popup.swal2-toast {
        width: calc(100vw - 1.5rem);
    }
}



.partner-card {
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

    .partner-card:hover {
        border-color: #86b7fe !important;
    }

    .partner-card.partner-selected {
        border-color: #0d6efd !important;
        box-shadow: 0 0 0 .15rem rgba(13, 110, 253, .12);
    }

@media (max-width: 575.98px) {
    .card {
        border-radius: .75rem;
    }

    .card-body {
        padding: 1rem;
    }

    .navbar-brand {
        max-width: 75%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

    .page-header h3 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 700;
    }

    .page-header p {
        margin: .25rem 0 0;
        color: #6c757d;
        font-size: .9rem;
    }

/* Mobile record card */
.record-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .85rem;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06);
    margin-bottom: 1rem;
    overflow: hidden;
}

.record-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f0f1f3;
}

    .record-card-header h5 {
        margin: .2rem 0 0;
        font-size: 1.05rem;
        font-weight: 700;
    }

.record-code {
    color: #6c757d;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .03rem;
}

/* Record information */
.record-info {
    padding: .9rem 1rem;
}

    .record-info > div {
        display: grid;
        grid-template-columns: 22px 85px 1fr;
        gap: .35rem;
        align-items: center;
        padding: .45rem 0;
    }

    .record-info i {
        color: #0d6efd;
    }

    .record-info > div > span {
        color: #6c757d;
        font-size: .85rem;
    }

    .record-info > div > strong {
        font-size: .9rem;
        font-weight: 600;
        text-align: right;
    }

/* Tags and badges */
.record-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .35rem;
}

    .record-tags span {
        background: #f8f9fa;
        border: 1px solid #e5e7eb;
        border-radius: 2rem;
        color: #343a40;
        padding: .25rem .55rem;
        font-size: .8rem;
    }

    .record-tags strong {
        color: #0d6efd;
        margin-left: .25rem;
    }

/* Action buttons */
.record-actions {
    display: flex;
    gap: .6rem;
    padding: .8rem 1rem;
    background: #fafafa;
    border-top: 1px solid #f0f1f3;
}

    .record-actions .btn {
        flex: 1;
        padding: .5rem;
    }

/* Forms */
.form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .85rem;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06);
    overflow: hidden;
}

.form-card-header {
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #f0f1f3;
}

    .form-card-header h4 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 700;
    }

.form-card-body {
    padding: 1.25rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

/* Empty list */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    background: #fff;
    border: 1px dashed #ced4da;
    border-radius: .85rem;
    color: #6c757d;
}

    .empty-state i {
        display: block;
        margin-bottom: .75rem;
        color: #adb5bd;
        font-size: 2.5rem;
    }

    .empty-state h5 {
        color: #343a40;
    }

/* Desktop tables */
.data-table thead th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
}

.data-table tbody td {
    vertical-align: middle;
}

.data-table .table-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .4rem;
}

@media (max-width: 575.98px) {
    .page-header {
        align-items: flex-start;
    }

        .page-header h3 {
            font-size: 1.3rem;
        }

        .page-header p {
            display: none;
        }

        .page-header .btn {
            white-space: nowrap;
        }

    .record-card {
        border-radius: .75rem;
    }

    .record-info > div {
        grid-template-columns: 20px 78px 1fr;
    }

    .record-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

        .record-actions .btn:last-child:nth-child(odd) {
            grid-column: 1 / -1;
        }

    .form-card-body {
        padding: 1rem;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

        .form-actions .btn {
            width: 100%;
        }
}




.person-theme {
    --theme-color: #0d6efd;
    --theme-soft: #eef5ff;
}

.theme-customer {
    --theme-color: #0d6efd;
    --theme-soft: #eef5ff;
}

.theme-supplier {
    --theme-color: #d97706;
    --theme-soft: #fff7e6;
}

.theme-subcontractor {
    --theme-color: #7c3aed;
    --theme-soft: #f5f0ff;
}

.person-theme .page-header i,
.person-theme .record-info i {
    color: var(--theme-color);
}

.person-theme .record-card {
    border-top: 3px solid var(--theme-color);
}

.person-theme .record-code {
    color: var(--theme-color);
}

.person-theme .theme-button {
    color: #fff;
    background: var(--theme-color);
    border-color: var(--theme-color);
}

    .person-theme .theme-button:hover,
    .person-theme .theme-button:focus {
        color: #fff;
        filter: brightness(.9);
    }

.person-theme .theme-outline-button {
    color: var(--theme-color);
    border-color: var(--theme-color);
}

    .person-theme .theme-outline-button:hover {
        color: #fff;
        background: var(--theme-color);
    }

.person-theme .form-card-header {
    background: var(--theme-soft);
    border-bottom-color: color-mix(in srgb, var(--theme-color) 20%, white);
}

.person-theme .form-check-input:checked {
    background-color: var(--theme-color);
    border-color: var(--theme-color);
}




.filter-bar {
    padding: .75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}

.choice-card {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .65rem;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .choice-card:hover {
        border-color: var(--theme-color);
        box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--theme-color) 12%, transparent);
    }

.choice-icon {
    font-size: 1.25rem;
}

@media (max-width: 575.98px) {
    .filter-bar {
        padding: .6rem;
    }

        .filter-bar .input-group {
            flex-wrap: nowrap;
        }

        .filter-bar .btn {
            padding-left: .75rem;
            padding-right: .75rem;
        }

            .filter-bar .btn .me-1 {
                margin-right: 0 !important;
            }

    .choice-grid {
        grid-template-columns: 1fr;
    }
}



.app-theme {
    --theme-color: #0d6efd;
    --theme-soft: #eef5ff;
}

.theme-inventory {
    --theme-color: #198754;
    --theme-soft: #edf8f2;
}

.app-theme .page-header i,
.app-theme .record-info i {
    color: var(--theme-color);
}

.app-theme .record-card {
    border-top: 3px solid var(--theme-color);
}

.app-theme .record-code {
    color: var(--theme-color);
}

.app-theme .form-card-header {
    background: var(--theme-soft);
}

.app-theme .theme-button {
    color: #fff;
    background: var(--theme-color);
    border-color: var(--theme-color);
}

    .app-theme .theme-button:hover {
        color: #fff;
        filter: brightness(.9);
    }

.app-theme .theme-outline-button {
    color: var(--theme-color);
    border-color: var(--theme-color);
}

    .app-theme .theme-outline-button:hover {
        color: #fff;
        background: var(--theme-color);
    }

.setup-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

    .setup-tabs .btn {
        white-space: nowrap;
    }

.record-actions form {
    display: flex;
    flex: 1;
}

    .record-actions form .btn {
        width: 100%;
    }



.filter-panel {
    padding: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    box-shadow: 0 .15rem .5rem rgba(0, 0, 0, .04);
}

    .filter-panel .form-label {
        margin-bottom: .3rem;
    }

@media (max-width: 575.98px) {
    .filter-panel {
        padding: .75rem;
    }
}




.theme-contracts {
    --theme-color: #6f42c1;
    --theme-soft: #f5f0ff;
}

.app-theme .theme-badge {
    color: #fff;
    background: var(--theme-color);
}

.tree-card-header {
    padding-left: calc(1rem + var(--tree-level) * .7rem);
    position: relative;
}

    .tree-card-header::before {
        content: "";
        position: absolute;
        left: calc(.6rem + var(--tree-level) * .7rem);
        top: 0;
        bottom: 0;
        border-left: 2px solid color-mix(in srgb, var(--theme-color) 35%, white);
    }

.tree-indent {
    color: #adb5bd;
}

.record-actions.three-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

    .record-actions.three-actions form {
        width: 100%;
    }

@media (max-width: 400px) {
    .record-actions.three-actions {
        grid-template-columns: 1fr 1fr;
    }

        .record-actions.three-actions form {
            grid-column: 1 / -1;
        }
}


.theme-finance {
    --theme-color: #087f8c;
    --theme-soft: #edf9fa;
}

.currency-afn {
    color: #146c43;
    background: #d1e7dd;
    border: 1px solid #a3cfbb;
}

.currency-usd {
    color: #084298;
    background: #cfe2ff;
    border: 1px solid #9ec5fe;
}


.theme-customer-contract {
    --theme-color: #0d6efd;
    --theme-soft: #eef5ff;
}

.theme-subcontractor-contract {
    --theme-color: #7c3aed;
    --theme-soft: #f5f0ff;
}

.theme-equipment-contract {
    --theme-color: #d97706;
    --theme-soft: #fff7e6;
}

.form-section {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
}

    .form-section > h6 {
        margin-bottom: 1rem;
        color: var(--theme-color);
        font-weight: 700;
    }

.contract-detail-row {
    padding: .85rem;
    margin-bottom: .75rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-left: 3px solid var(--theme-color);
    border-radius: .65rem;
}

.detail-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .65rem;
    color: var(--theme-color);
}

.contract-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1rem;
    background: var(--theme-soft);
    border-radius: .65rem;
}

    .contract-total span {
        color: #495057;
    }

    .contract-total strong {
        color: var(--theme-color);
        font-size: 1.15rem;
    }

@media (max-width: 575.98px) {
    .form-section {
        padding: .75rem;
    }

    .contract-detail-row {
        padding: .7rem;
    }

    .contract-total {
        align-items: flex-start;
        flex-direction: column;
    }
}



.dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: .7rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .1);
}

.dropdown-item {
    padding: .55rem 1rem;
}

    .dropdown-item i {
        width: 1.25rem;
        text-align: center;
    }

.dropdown-header {
    color: #6c757d;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04rem;
}

@media (max-width: 575.98px) {
    .navbar .dropdown-menu {
        margin: .25rem 0 .5rem;
        border: 0;
        border-left: 3px solid #6f42c1;
        border-radius: .35rem;
        box-shadow: none;
        background: #f8f9fa;
    }
}



.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-right: 1rem;
    padding-top: .3rem;
    padding-bottom: .3rem;
    color: #111827 !important;
}

.app-brand-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    box-shadow: 0 .15rem .45rem rgba(15,23,42,.12);
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

    .app-brand-text strong {
        color: #1f2937;
        font-size: .9rem;
        font-weight: 750;
        white-space: nowrap;
    }

    .app-brand-text small {
        margin-top: .2rem;
        color: #b7791f;
        font-size: .63rem;
        font-weight: 600;
        letter-spacing: .035em;
        white-space: nowrap;
    }

@media (max-width: 575.98px) {
    .app-brand {
        gap: .4rem;
        margin-right: .25rem;
    }

    .app-brand-logo {
        width: 38px;
        height: 38px;
    }

    .app-brand-text strong {
        font-size: .82rem;
    }

    .app-brand-text small {
        font-size: .56rem;
    }
}