/* Global responsive safety layer for SCS screens. */

body:not(.scs-ui-redesign) {
    overflow-x: hidden;
}

body:not(.scs-ui-redesign) img,
body:not(.scs-ui-redesign) video,
body:not(.scs-ui-redesign) canvas,
body:not(.scs-ui-redesign) svg {
    max-width: 100%;
}

body:not(.scs-ui-redesign) .container,
body:not(.scs-ui-redesign) .container-fluid {
    /* max-width: 100%; */
}

body:not(.scs-ui-redesign) .row,
body:not(.scs-ui-redesign) [class*="col-"],
body:not(.scs-ui-redesign) .card,
body:not(.scs-ui-redesign) .form-section,
body:not(.scs-ui-redesign) .products-section,
body:not(.scs-ui-redesign) .account-section {
    min-width: 0;
}

body:not(.scs-ui-redesign) .form-control,
body:not(.scs-ui-redesign) .form-select,
body:not(.scs-ui-redesign) input,
body:not(.scs-ui-redesign) select,
body:not(.scs-ui-redesign) textarea,
body:not(.scs-ui-redesign) .select2-container {
    max-width: 100%;
}

body:not(.scs-ui-redesign) .table-responsive,
body:not(.scs-ui-redesign) .products-section,
body:not(.scs-ui-redesign) .dataTables_wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {

    body:not(.scs-ui-redesign) .container,
    body:not(.scs-ui-redesign) .container-fluid {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }

    body:not(.scs-ui-redesign) .card,
    body:not(.scs-ui-redesign) .form-section,
    body:not(.scs-ui-redesign) .products-section,
    body:not(.scs-ui-redesign) .account-section {
        border-radius: 10px !important;
    }

    body:not(.scs-ui-redesign) .btn,
    body:not(.scs-ui-redesign) button {
        max-width: 100%;
        white-space: normal;
    }

    body:not(.scs-ui-redesign) .action-buttons {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
    }
}

body.scs-ui-redesign {
    overflow-x: hidden;
}

body.scs-ui-redesign img,
body.scs-ui-redesign video,
body.scs-ui-redesign canvas,
body.scs-ui-redesign svg {
    max-width: 100%;
}

body.scs-ui-redesign .content-body,
body.scs-ui-redesign .content-body.app-content-shell {
    min-width: 0;
}

body.scs-ui-redesign .content-body .container,
body.scs-ui-redesign .content-body .container-fluid,
body.scs-ui-redesign .content-body .container-sm,
body.scs-ui-redesign .content-body .container-md,
body.scs-ui-redesign .content-body .container-lg,
body.scs-ui-redesign .content-body .container-xl,
body.scs-ui-redesign .content-body .container-xxl {
    max-width: 100%;
}

body.scs-ui-redesign .row {
    min-width: 0;
}

body.scs-ui-redesign [class*="col-"] {
    min-width: 0;
}

body.scs-ui-redesign .card,
body.scs-ui-redesign .premium-card,
body.scs-ui-redesign .dash-card,
body.scs-ui-redesign .modal-content {
    max-width: 100%;
}

body.scs-ui-redesign .card-header,
body.scs-ui-redesign .premium-card-header,
body.scs-ui-redesign .modal-header,
body.scs-ui-redesign .modal-footer {
    gap: .75rem;
}

body.scs-ui-redesign .card-header .card-title,
body.scs-ui-redesign .card-header h1,
body.scs-ui-redesign .card-header h2,
body.scs-ui-redesign .card-header h3,
body.scs-ui-redesign .card-header h4,
body.scs-ui-redesign .card-header h5 {
    min-width: 0;
    overflow-wrap: anywhere;
}

body.scs-ui-redesign .form-control,
body.scs-ui-redesign .form-select,
body.scs-ui-redesign textarea,
body.scs-ui-redesign select,
body.scs-ui-redesign input {
    max-width: 100%;
}

body.scs-ui-redesign .select2-container {
    max-width: 100%;
}

body.scs-ui-redesign .select2-container--default .select2-selection--single .select2-selection__rendered {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.scs-ui-redesign .table-responsive,
body.scs-ui-redesign .dataTables_wrapper,
body.scs-ui-redesign .dataTables_scroll,
body.scs-ui-redesign .dataTables_scrollBody {
    width: 100%;
    max-width: 100%;
}

body.scs-ui-redesign .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.scs-ui-redesign .table,
body.scs-ui-redesign table {
    max-width: 100%;
}

body.scs-ui-redesign .table th,
body.scs-ui-redesign .table td {
    vertical-align: middle;
    overflow-wrap: normal;
}

body.scs-ui-redesign .btn,
body.scs-ui-redesign .btn-premium,
body.scs-ui-redesign .btn-premium-danger,
body.scs-ui-redesign .btn-premium-warning,
body.scs-ui-redesign .btn-outline-primary,
body.scs-ui-redesign .btn-outline-secondary {
    white-space: normal;
}

body.scs-ui-redesign .dropdown-menu {
    max-width: min(92vw, 360px);
    overflow-wrap: anywhere;
}

body.scs-ui-redesign .pagination {
    flex-wrap: wrap;
    gap: .35rem;
}

body.scs-ui-redesign .alert {
    overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
    body.scs-ui-redesign .content-body.app-content-shell {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    body.scs-ui-redesign .dataTables_wrapper .dataTables_length,
    body.scs-ui-redesign .dataTables_wrapper .dataTables_filter,
    body.scs-ui-redesign .dataTables_wrapper .dataTables_info,
    body.scs-ui-redesign .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        width: 100%;
        text-align: left !important;
    }

    body.scs-ui-redesign .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 991.98px) {
    body.scs-ui-redesign .page-titles {
        padding: .85rem 1rem !important;
    }

    body.scs-ui-redesign .page-titles .row,
    body.scs-ui-redesign .page-titles {
        gap: .5rem;
    }

    body.scs-ui-redesign .card-header,
    body.scs-ui-redesign .premium-card-header,
    body.scs-ui-redesign .modal-header,
    body.scs-ui-redesign .modal-footer {
        flex-wrap: wrap;
    }

    body.scs-ui-redesign .card-header>*,
    body.scs-ui-redesign .premium-card-header>* {
        min-width: 0;
    }

    body.scs-ui-redesign .card-header .d-flex,
    body.scs-ui-redesign .premium-card-header .d-flex,
    body.scs-ui-redesign .modal-footer {
        flex-wrap: wrap;
    }

    body.scs-ui-redesign .table th,
    body.scs-ui-redesign .table td {
        min-width: 120px;
    }

    body.scs-ui-redesign .table th:first-child,
    body.scs-ui-redesign .table td:first-child {
        min-width: 72px;
    }

    body.scs-ui-redesign .table td .btn-group,
    body.scs-ui-redesign .table td .dropdown,
    body.scs-ui-redesign .table td .d-flex {
        flex-wrap: wrap;
        gap: .35rem;
    }
}

@media (max-width: 767.98px) {
    body.scs-ui-redesign .content-body.app-content-shell {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
        padding-top: .75rem !important;
    }

    body.scs-ui-redesign .content-body .container,
    body.scs-ui-redesign .content-body .container-fluid,
    body.scs-ui-redesign .content-body .container-sm,
    body.scs-ui-redesign .content-body .container-md,
    body.scs-ui-redesign .content-body .container-lg,
    body.scs-ui-redesign .content-body .container-xl,
    body.scs-ui-redesign .content-body .container-xxl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.scs-ui-redesign .page-titles {
        margin-bottom: .75rem !important;
    }

    body.scs-ui-redesign .page-titles h1,
    body.scs-ui-redesign .page-titles h2,
    body.scs-ui-redesign .page-titles h3,
    body.scs-ui-redesign .page-titles h4 {
        font-size: 1rem !important;
        line-height: 1.3;
    }

    body.scs-ui-redesign .breadcrumb,
    body.scs-ui-redesign .page-titles .breadcrumb {
        flex-wrap: wrap;
        font-size: .78rem;
        margin-bottom: 0;
    }

    body.scs-ui-redesign .card,
    body.scs-ui-redesign .premium-card,
    body.scs-ui-redesign .dash-card {
        border-radius: 10px !important;
        margin-bottom: .85rem;
    }

    body.scs-ui-redesign .card-header,
    body.scs-ui-redesign .card-body,
    body.scs-ui-redesign .premium-card-header,
    body.scs-ui-redesign .premium-card .card-body,
    body.scs-ui-redesign .modal-header,
    body.scs-ui-redesign .modal-body,
    body.scs-ui-redesign .modal-footer {
        padding: .9rem !important;
    }

    body.scs-ui-redesign .card-header {
        align-items: flex-start !important;
    }

    body.scs-ui-redesign .card-header .card-title,
    body.scs-ui-redesign .card-header h3,
    body.scs-ui-redesign .card-header h4,
    body.scs-ui-redesign .card-header h5 {
        font-size: 1rem !important;
        line-height: 1.35;
    }

    body.scs-ui-redesign .row.g-3 {
        --bs-gutter-y: .75rem;
    }

    body.scs-ui-redesign label,
    body.scs-ui-redesign .form-label {
        font-size: .82rem;
        line-height: 1.25;
    }

    body.scs-ui-redesign .form-control,
    body.scs-ui-redesign .form-select,
    body.scs-ui-redesign .select2-container--default .select2-selection--single {
        min-height: 40px;
        font-size: .88rem !important;
    }

    body.scs-ui-redesign textarea.form-control {
        min-height: 88px;
    }

    body.scs-ui-redesign .btn,
    body.scs-ui-redesign .btn-premium,
    body.scs-ui-redesign .btn-premium-danger,
    body.scs-ui-redesign .btn-premium-warning {
        min-height: 40px;
        padding: .55rem .8rem !important;
        font-size: .86rem !important;
    }

    body.scs-ui-redesign .btn-group,
    body.scs-ui-redesign .btn-toolbar,
    body.scs-ui-redesign .action-buttons,
    body.scs-ui-redesign .card-header .d-flex,
    body.scs-ui-redesign .premium-card-header .d-flex {
        width: 100%;
    }

    body.scs-ui-redesign .card-header .btn,
    body.scs-ui-redesign .premium-card-header .btn {
        flex: 1 1 auto;
    }

    body.scs-ui-redesign .dataTables_wrapper {
        padding: .75rem !important;
    }

    body.scs-ui-redesign .dataTables_wrapper .dataTables_length label,
    body.scs-ui-redesign .dataTables_wrapper .dataTables_filter label {
        display: grid;
        width: 100%;
        gap: .35rem;
    }

    body.scs-ui-redesign .dataTables_wrapper .dataTables_length select,
    body.scs-ui-redesign .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: none !important;
    }

    body.scs-ui-redesign .dataTables_wrapper .dataTables_paginate {
        display: flex;
        flex-wrap: wrap;
        gap: .35rem;
        justify-content: flex-start;
    }

    body.scs-ui-redesign .modal-dialog {
        margin: .75rem;
    }

    body.scs-ui-redesign .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    body.scs-ui-redesign .content-body.app-content-shell {
        padding-left: .5rem !important;
        padding-right: .5rem !important;
    }

    .topbar-greeting {
        font-size: 12px;
        color: var(--text-muted) #6b4423;
        font-weight: 600;
    }


    body.scs-ui-redesign .card-header,
    body.scs-ui-redesign .card-body,
    body.scs-ui-redesign .premium-card-header,
    body.scs-ui-redesign .premium-card .card-body,
    body.scs-ui-redesign .modal-header,
    body.scs-ui-redesign .modal-body,
    body.scs-ui-redesign .modal-footer {
        padding: .75rem !important;
    }

    body.scs-ui-redesign .table th,
    body.scs-ui-redesign .table td {
        min-width: 110px;
        padding: .55rem .6rem !important;
        font-size: .82rem;
    }

    body.scs-ui-redesign .pagination .page-link,
    body.scs-ui-redesign .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-width: 34px;
        min-height: 34px;
        padding: .35rem .55rem !important;
    }

    body.scs-ui-redesign .dropdown-menu {
        max-width: calc(100vw - 1rem);
    }

    body.scs-ui-redesign .btn-group {
        display: flex;
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    .purchase-entry-page .purchase-product-header {
        display: none !important;
    }

    .purchase-entry-page .purchase-product-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem !important;
        margin-top: .85rem !important;
        padding: .75rem;
        border: 1px solid #fed7aa;
        border-radius: 10px;
        background: #fffaf5;
    }

    .purchase-entry-page .purchase-product-row>[class*="col-"] {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }

    .purchase-entry-page .purchase-product-field {
        display: grid;
        gap: .25rem;
    }

    .purchase-entry-page .purchase-product-field::before {
        content: attr(data-label);
        color: #7f1d1d;
        font-size: .72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    .purchase-entry-page .purchase-product-field:first-child,
    .purchase-entry-page .purchase-product-actions {
        grid-column: 1 / -1;
    }

    .purchase-entry-page .purchase-product-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem !important;
    }

    .purchase-entry-page .purchase-product-actions .btn {
        width: 100%;
        min-height: 38px;
        border-radius: 8px;
    }

    .purchase-entry-page .purchase-summary-table {
        float: none !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .purchase-entry-page .purchase-summary-table th,
    .purchase-entry-page .purchase-summary-table td {
        display: block;
        width: 100%;
        min-width: 0 !important;
        padding: .35rem 0 !important;
        text-align: left !important;
        border: 0 !important;
    }

    .purchase-entry-page .purchase-summary-table tr {
        display: block;
        padding: .5rem 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .purchase-entry-page .purchase-summary-table td .d-flex {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: .5rem !important;
    }

    .quotation-entry-page .quotation-product-header {
        display: none !important;
    }

    .quotation-entry-page #productRows>.product-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem !important;
        margin-top: .85rem !important;
        padding: .75rem;
        border: 1px solid #fed7aa;
        border-radius: 10px;
        background: #fffaf5;
        text-align: left !important;
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"] {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        display: grid;
        gap: .25rem;
        min-width: 0 !important;
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]::before {
        color: #7f1d1d;
        font-size: .72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(1),
    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(9) {
        grid-column: 1 / -1;
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(1)::before {
        content: "Product";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(2)::before {
        content: "Item Code";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(3)::before {
        content: "Unit";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(4)::before {
        content: "Qty";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(5)::before {
        content: "MRP";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(6)::before {
        content: "Disc %";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(7)::before {
        content: "Disc Amt";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(8)::before {
        content: "Total";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(9)::before {
        content: "Action";
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(9) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem !important;
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(9)::before {
        grid-column: 1 / -1;
    }

    .quotation-entry-page #productRows>.product-row>[class*="col"]:nth-child(9) .btn {
        width: 100%;
        min-height: 38px;
        border-radius: 8px;
    }

    .quotation-entry-page #productRows .select2-container {
        width: 100% !important;
    }

    .quotation-entry-page .table-responsive .table.border-0 th,
    .quotation-entry-page .table-responsive .table.border-0 td {
        min-width: 0 !important;
    }
}