/* Option C CRUD layout: compact form card on top + full-width table below.
   Replaces the Option A drawer. Selectors keep .inf-crud-option1 so existing blades convert. */

.inf-crud-legacy-add {
    display: none !important;
}

.inf-crud-option1.inf-crud-skip,
.inf-crud-option1:not(:has(> .inf-crud-form-col)):not(:has(.inf-crud-form-col .add-visitor)) {
    /* Filter rows, profile tabs, reports: leave Bootstrap columns alone */
}

.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 16px;
}

.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) > .inf-crud-pagehead,
.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) > .inf-crud-toolbar {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    order: 0;
}

.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) > .inf-crud-form-col {
    position: relative !important;
    top: auto;
    right: auto;
    left: auto;
    z-index: auto;
    transform: none !important;
    pointer-events: auto !important;
    height: auto !important;
    overflow: visible;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    order: 1;
}

.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) > .inf-crud-list-col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    order: 2;
}

.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) > .inf-crud-form-col > .row,
.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) > .inf-crud-form-col > .row > [class*="col-"] {
    height: auto;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.inf-crud-pagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 0 4px;
}

.inf-crud-pagehead__title {
    margin: 0;
    margin-right: auto;
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
}

.inf-crud-pagehead .primary-btn,
.inf-crud-form-col .primary-btn,
.inf-crud-form-col .primary-btn.fix-gr-bg {
    background: #0066cc !important;
    background-image: none !important;
    border: 0;
    border-radius: 8px;
    box-shadow: none !important;
    min-height: 36px;
}

.inf-crud-form-col .white-box {
    height: auto !important;
    border-radius: 12px;
    box-shadow: none !important;
    overflow: visible;
    padding: 16px 20px 18px;
    margin: 0;
    background: #fff;
    border: 1px solid #e5e5ea;
}

.inf-crud-form-col .white-box > .main-title {
    margin-bottom: 8px;
}

.inf-crud-form-col .white-box > .main-title h3 {
    margin-bottom: 0 !important;
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
}

.inf-crud-form-col .add-visitor {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.inf-crud-form-col .add-visitor > .row {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 1 1 200px;
    max-width: 320px;
    width: auto;
}

.inf-crud-form-col .add-visitor > .row > [class*="col-"] {
    max-width: 100% !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.inf-crud-form-col .add-visitor > .row.mt-40,
.inf-crud-form-col .add-visitor > .row:has(> [class*="col-"] > .text-center),
.inf-crud-form-col .add-visitor > .row:has(.submit),
.inf-crud-form-col .add-visitor > .row:has(button.primary-btn) {
    flex: 0 0 auto;
    max-width: none;
    margin-left: auto;
}

.inf-crud-form-col .add-visitor > .row:has(.submit) .text-center,
.inf-crud-form-col .add-visitor > .row.mt-40 .text-center {
    text-align: right !important;
}

.inf-crud-form-col .add-visitor > .row:has(textarea),
.inf-crud-form-col .add-visitor > .row:has(input[type="file"]),
.inf-crud-form-col .add-visitor > .row:has(.common-checkbox),
.inf-crud-form-col .add-visitor > .row:has(input[type="checkbox"].common-checkbox) {
    flex: 1 1 100%;
    max-width: 100%;
}

.inf-crud-form-col .primary_input_field,
.inf-crud-form-col .primary_input input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.inf-crud-form-col .form-control:not(select):not([type="checkbox"]) {
    border-radius: 8px !important;
    box-shadow: none !important;
}

.inf-crud-form-col input[type="checkbox"].common-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.inf-crud-form-col input[type="checkbox"].common-checkbox + label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 4px 14px;
    margin: 0 8px 8px 0;
    border-radius: 999px;
    background: #f2f2f2;
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none !important;
}

.inf-crud-form-col input[type="checkbox"].common-checkbox:checked + label {
    background: #0066cc;
    color: #fff;
}

.inf-crud-form-col .add-visitor > .row:has(.common-checkbox) > [class*="col-"] > div,
.inf-crud-form-col .add-visitor > .row:has(.common-checkbox) > [class*="col-"] > .d-flex {
    display: inline;
}

.inf-crud-list-col .white-box {
    box-shadow: none !important;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    overflow-x: auto;
}

.inf-crud-search {
    position: relative;
    max-width: 280px;
    margin: 0 0 12px;
}

.inf-crud-search input {
    width: 100%;
    height: 36px;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    background: #fff;
    color: #1d1d1f;
    font-size: 14px;
    box-shadow: none;
}

.inf-crud-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
    pointer-events: none;
}

.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) .inf-crud-list-col .dataTables_filter,
.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) .inf-crud-list-col .dt-search {
    display: none !important;
}

.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) .inf-crud-list-col table thead th,
.inf-crud-option1:has(> .inf-crud-form-col):has(> .inf-crud-list-col):not(.inf-crud-skip) .inf-crud-list-col .QA_table thead th {
    background: #f5f5f7 !important;
    box-shadow: none !important;
}

.inf-crud-drawer-close,
.inf-crud-backdrop,
.inf-crud-toolbar {
    display: none !important;
}

body.inf-crud-drawer-open {
    overflow: auto;
}

@media (max-width: 767.98px) {
    .inf-crud-form-col .add-visitor > .row {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .inf-crud-form-col .add-visitor > .row.mt-40,
    .inf-crud-form-col .add-visitor > .row:has(button.primary-btn) {
        margin-left: 0;
        width: 100%;
    }

    .inf-crud-form-col .add-visitor > .row:has(.submit) .text-center,
    .inf-crud-form-col .add-visitor > .row.mt-40 .text-center {
        text-align: center !important;
    }

    .inf-crud-search {
        max-width: none;
    }
}
