:root {
    --poultry-forest: #c8102e;
    --poultry-forest-deep: #111111;
    --poultry-leaf: #c8102e;
    --poultry-gold: #111111;
    --poultry-ink: #111111;
    --poultry-muted: #595959;
    --poultry-paper: #ffffff;
    --poultry-line: #dedede;
}

body:not(.poultry-login-page) {
    background: #f7f7f7;
    color: var(--poultry-ink);
}

body:not(.poultry-login-page) .panel {
    border: 1px solid var(--poultry-line);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(25, 56, 43, .06);
}

body:not(.poultry-login-page) .panel-heading {
    border-color: var(--poultry-line);
    border-radius: 12px 12px 0 0;
}

body:not(.poultry-login-page):not(.poultry-step-page) input:not([type=checkbox]):not([type=radio]):not([type=submit]),
body:not(.poultry-login-page):not(.poultry-step-page) select,
body:not(.poultry-login-page):not(.poultry-step-page) textarea {
    box-sizing: border-box;
    border: 1px solid #dedede;
    border-radius: 6px;
    background-color: #fff;
    color: var(--poultry-ink);
}

body:not(.poultry-login-page):not(.poultry-step-page) input:disabled,
body:not(.poultry-login-page):not(.poultry-step-page) select:disabled,
body:not(.poultry-login-page):not(.poultry-step-page) textarea:disabled {
    border-style: dotted;
    background-color: #f4f4f4;
    color: #555;
}

body:not(.poultry-login-page) .btn-primary {
    background-color: var(--poultry-forest);
    border-color: var(--poultry-forest);
}

body:not(.poultry-login-page) .btn-primary:hover,
body:not(.poultry-login-page) .btn-primary:focus {
    background-color: var(--poultry-forest-deep);
    border-color: var(--poultry-forest-deep);
}

body:not(.poultry-login-page) .form-control:focus,
body:not(.poultry-login-page) input:focus,
body:not(.poultry-login-page) select:focus,
body:not(.poultry-login-page) textarea:focus {
    border-color: var(--poultry-leaf);
    box-shadow: 0 1px 0 0 var(--poultry-leaf);
}

body.poultry-step-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 90% 5%, rgba(200, 16, 46, .08), transparent 32%),
        var(--poultry-paper);
    font-family: "Segoe UI", Arial, sans-serif;
}

body.poultry-step-page .login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    height: auto;
    width: 100%;
    padding: 36px 20px;
}

body.poultry-step-page .login-container .page-content,
body.poultry-step-page .login-container .content-wrapper,
body.poultry-step-page .login-container .content,
body.poultry-step-page .login-container form {
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body.poultry-step-page .login-container .page-content,
body.poultry-step-page .login-container .content-wrapper,
body.poultry-step-page .login-container .content {
    margin: 0;
    padding: 0;
}

body.poultry-step-page .poultry-step-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 36px !important;
    border: 1px solid var(--poultry-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(25, 56, 43, .09);
}

body.poultry-step-page .poultry-step-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 38px;
    color: var(--poultry-ink);
    font-size: 17px;
    font-weight: 700;
}

body.poultry-step-page .poultry-step-brand small {
    display: block;
    margin-top: 4px;
    color: var(--poultry-muted);
    font-size: 9px;
    letter-spacing: 1.5px;
}

body.poultry-step-page .poultry-step-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: #f4f4f4;
    color: var(--poultry-leaf);
}

body.poultry-step-page .poultry-step-card h2 {
    margin: 11px 0 8px;
    color: var(--poultry-ink);
    font-size: 27px;
    font-weight: 700;
}

body.poultry-step-page .poultry-form-intro {
    margin: 0 0 28px;
    color: var(--poultry-muted);
    font-size: 14px;
}

body.poultry-step-page .poultry-step-card .form-group {
    margin: 0 0 16px;
}

body.poultry-step-page .poultry-step-card .select2-container,
body.poultry-step-page .poultry-step-card select.form-control {
    width: 100% !important;
    max-width: 100%;
}

body.poultry-step-page .poultry-step-card select.form-control {
    height: 50px;
    padding: 0 14px;
    border: 1px solid #dedede;
    border-radius: 9px;
    background-color: #fff;
    color: var(--poultry-ink);
    font-size: 14px;
}

body.poultry-step-page .poultry-step-card .select2-container--default .select2-selection--single {
    height: 50px;
    border: 1px solid #dedede;
    border-radius: 9px;
    background: #fff;
}

body.poultry-step-page .poultry-step-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 14px;
    color: var(--poultry-ink);
    line-height: 48px;
    text-align: left;
}

body.poultry-step-page .poultry-step-card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    right: 8px;
}

body.poultry-step-page .poultry-step-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    margin-top: 10px;
    padding: 0 17px;
    border-radius: 9px;
    background: var(--poultry-forest);
    font-weight: 700;
}

body.poultry-step-page .poultry-step-submit:hover {
    background: var(--poultry-forest-deep);
}

body.poultry-step-page .position-right {
    margin-left: auto;
    color: #fff;
}

body.poultry-login-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--poultry-paper);
    color: var(--poultry-ink);
    font-family: "Segoe UI", Arial, sans-serif;
}

.poultry-login-page *,
.poultry-login-page *::before,
.poultry-login-page *::after {
    box-sizing: border-box;
}

body.poultry-login-page .poultry-login * {
    margin: 0;
}

.poultry-login-page .poultry-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    background: #f4f4f4;
}

.poultry-login-page .poultry-login-form {
    width: 100%;
    max-width: 390px;
    margin: 0;
    padding: 36px;
    border: 1px solid #dedede;
    border-top: 4px solid #c8102e;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .10);
}

.poultry-login-page .poultry-login-form h2 {
    margin: 0 0 24px;
    color: #111;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
}

.poultry-login-page .poultry-login-form label {
    display: block;
    margin: 20px 0 8px;
    color: #111;
    font-size: 13px;
    font-weight: 700;
}

.poultry-login-page .poultry-input-wrap {
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 15px;
    border: 1px solid #dedede;
    border-radius: 9px;
    background: #fff;
    color: #555;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.poultry-login-page .poultry-input-wrap:focus-within {
    border-color: var(--poultry-leaf);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .12);
}

.poultry-login-page .poultry-input-wrap > i {
    width: 20px;
    font-size: 15px;
}

.poultry-login-page .poultry-input-wrap input {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 0 0 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--poultry-ink);
    font-size: 14px;
    font-family: inherit;
    outline: 0;
}

.poultry-login-page .poultry-input-wrap input::placeholder {
    color: #666;
}

.poultry-login-page .poultry-login-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    margin-top: 28px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background: var(--poultry-forest);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: background .18s ease, transform .18s ease;
}

.poultry-login-page .poultry-login-submit:hover {
    transform: translateY(-1px);
    background: var(--poultry-forest-deep);
}

.poultry-login-page .poultry-login-submit i {
    color: #fff;
}

.poultry-login-page .poultry-login-note {
    margin: 24px 0 0;
    color: #555;
    font-size: 12px;
    text-align: center;
}

.poultry-login-page .poultry-login-note i {
    margin-right: 5px;
    color: var(--poultry-leaf);
}

.poultry-login-page .poultry-login-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #f1c9c4;
    border-radius: 8px;
    background: #fff4f2;
    color: #a13a2e;
    font-size: 13px;
}

@media (max-width: 760px) {
    .poultry-login-page .poultry-login {
        min-height: 100vh;
        padding: 20px;
    }

    .poultry-login-page .poultry-login-form {
        padding: 30px 24px;
    }

    body.poultry-step-page .login-container {
        min-height: 100vh;
        padding: 24px 16px;
    }

    body.poultry-step-page .poultry-step-card {
        padding: 26px 22px !important;
    }

    body.poultry-step-page .poultry-step-brand {
        margin-bottom: 30px;
    }

    body.poultry-step-page .poultry-step-card h2 {
        font-size: 24px;
    }
}

@media (max-width: 380px) {
    body.poultry-step-page .login-container {
        padding: 14px 10px;
    }

    body.poultry-step-page .poultry-step-card {
        padding: 22px 16px !important;
    }
}

/* =====================================================================
   CRIM theme - black / white / red (inner pages)
   ===================================================================== */
:root {
    --crim-red: #c8102e;
    --crim-red-dark: #9e0c24;
    --crim-red-soft: #fdecef;
    --crim-black: #111111;
    --crim-ink: #1c1c1c;
    --crim-muted: #6b6b6b;
    --crim-line: #e2e2e2;
    --crim-bg: #f4f4f4;
}

body:not(.poultry-login-page):not(.poultry-step-page) {
    background: var(--crim-bg);
    color: var(--crim-ink);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
}

body:not(.poultry-login-page) .panel {
    margin: 10px 4px;
    overflow: visible;
    border: 1px solid var(--crim-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
}

body:not(.poultry-login-page) .panel > .panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    height: auto !important;
    padding: 10px 16px;
    border-bottom: 3px solid var(--crim-red);
    border-radius: 10px 10px 0 0;
    background: var(--crim-black) !important;
    color: #fff;
}

body:not(.poultry-login-page) .panel > .panel-heading::before,
body:not(.poultry-login-page) .panel > .panel-heading::after {
    display: none;
}

body:not(.poultry-login-page) .panel > .panel-heading .panel-title,
body:not(.poultry-login-page) .panel > .panel-heading .panel-title a,
body:not(.poultry-login-page) .panel > .panel-heading h4 {
    margin: 0;
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
}

body:not(.poultry-login-page) .panel > .panel-heading [class*="col-"] {
    float: none;
    width: auto;
    padding: 0;
}

body:not(.poultry-login-page) .panel-body {
    padding: 14px 16px;
}

body:not(.poultry-login-page) .panel-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--crim-line);
    border-radius: 0 0 10px 10px;
    background: #fafafa;
}

/* labels */
body:not(.poultry-login-page) .label-control,
body:not(.poultry-login-page) .control-label {
    color: #333;
    font-size: 12px;
    font-weight: 600;
}

/* inputs */
body:not(.poultry-login-page):not(.poultry-step-page) .form-control,
body:not(.poultry-login-page):not(.poultry-step-page) input[type=text],
body:not(.poultry-login-page):not(.poultry-step-page) input[type=number],
body:not(.poultry-login-page):not(.poultry-step-page) input[type=date],
body:not(.poultry-login-page):not(.poultry-step-page) input[type=email],
body:not(.poultry-login-page):not(.poultry-step-page) input[type=search],
body:not(.poultry-login-page):not(.poultry-step-page) input[type=password] {
    box-sizing: border-box;
    min-height: 30px;
    padding: 3px 8px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    background-color: #fff;
    color: var(--crim-ink);
    font-size: 13px;
}

body:not(.poultry-login-page):not(.poultry-step-page) input:focus:not([readonly]),
body:not(.poultry-login-page):not(.poultry-step-page) select:focus,
body:not(.poultry-login-page):not(.poultry-step-page) textarea:focus,
body:not(.poultry-login-page):not(.poultry-step-page) .form-control:focus {
    border-color: var(--crim-red) !important;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .14) !important;
}

body:not(.poultry-login-page):not(.poultry-step-page) input:disabled,
body:not(.poultry-login-page):not(.poultry-step-page) select:disabled,
body:not(.poultry-login-page):not(.poultry-step-page) textarea:disabled,
body:not(.poultry-login-page):not(.poultry-step-page) input[readonly] {
    border-style: solid;
    border-color: #e6e6e6;
    background-color: #f7f7f7;
    color: #333;
    font-size: 13px;
}

/* select2 */
body:not(.poultry-login-page):not(.poultry-step-page) .select2-container--default .select2-selection--single {
    min-height: 30px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
}

body:not(.poultry-login-page) .select2-container--default.select2-container--focus .select2-selection--single,
body:not(.poultry-login-page) .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--crim-red);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--crim-red) !important;
    color: #fff !important;
}

/* tables */
body:not(.poultry-login-page) .table > thead > tr > th,
body:not(.poultry-login-page) .mySearchTr th,
body:not(.poultry-login-page) .mySearchTr td {
    border-color: #2a2a2a !important;
    background: var(--crim-black) !important;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.mySearchTr {
    background-color: var(--crim-black) !important;
}

.mySearchTr2 {
    background-color: var(--crim-red-soft) !important;
}

body:not(.poultry-login-page) .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafafa;
}

body:not(.poultry-login-page) .table > tbody > tr:hover > td {
    background-color: var(--crim-red-soft);
}

body:not(.poultry-login-page) .table-bordered,
body:not(.poultry-login-page) .table-bordered > tbody > tr > td {
    border-color: var(--crim-line);
}

.searchModal tr:focus {
    background: var(--crim-red-soft) !important;
}

.searchModal .clickable-row {
    cursor: pointer;
}

/* buttons */
body:not(.poultry-login-page) .btn-primary,
body:not(.poultry-login-page) .btn-success {
    border-color: var(--crim-red);
    background-color: var(--crim-red);
    color: #fff;
}

body:not(.poultry-login-page) .btn-primary:hover,
body:not(.poultry-login-page) .btn-primary:focus,
body:not(.poultry-login-page) .btn-success:hover {
    border-color: var(--crim-black);
    background-color: var(--crim-black);
    color: #fff;
}

body:not(.poultry-login-page) .btn-default {
    border-color: #cfcfcf;
    background: #fff;
    color: var(--crim-black);
}

/* record action bar (includes/buttons.php) */
table.crim-actions {
    border-collapse: separate;
    border-spacing: 4px 0;
}

.crim-actions .buttonform {
    padding: 0 !important;
    border: 0 !important;
}

.crim-actions .btn.crim-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #cfcfcf;
    border-radius: 7px;
    background: #fff;
    color: var(--crim-black);
    font-size: 12px;
    font-weight: 700;
    box-shadow: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.crim-actions .btn.crim-act .fa {
    color: inherit;
    font-size: 13px;
}

.crim-actions .btn.crim-act:hover,
.crim-actions .btn.crim-act:focus {
    border-color: var(--crim-black);
    background: var(--crim-black);
    color: #fff;
}

.crim-actions .btn.crim-act[disabled] {
    opacity: .35;
}

.crim-actions .btn.crim-act-dark {
    border-color: var(--crim-black);
    background: var(--crim-black);
    color: #fff;
}

.crim-actions .btn.crim-act-dark:hover {
    border-color: var(--crim-red);
    background: var(--crim-red);
}

.crim-actions .btn.crim-act-red {
    border-color: var(--crim-red);
    background: var(--crim-red);
    color: #fff;
}

.crim-actions .btn.crim-act-red:hover,
.crim-actions .btn.crim-act-red:focus {
    border-color: var(--crim-red-dark);
    background: var(--crim-red-dark);
}

.crim-actions .btn.crim-act-danger {
    border-color: var(--crim-red);
    color: var(--crim-red);
}

.crim-actions .btn.crim-act-danger:hover {
    background: var(--crim-red);
    color: #fff;
}

.crim-act-label {
    display: inline;
}

@media (max-width: 600px) {
    .crim-act-label {
        display: none;
    }
}

/* modal */
body:not(.poultry-login-page) .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 10px;
}

body:not(.poultry-login-page) .modal-header {
    border-bottom: 3px solid var(--crim-red);
    background: var(--crim-black);
    color: #fff;
}

body:not(.poultry-login-page) .modal-header .modal-title {
    color: #fff;
    font-weight: 700;
}

body:not(.poultry-login-page) .modal-header .close {
    color: #fff;
    opacity: .85;
    text-shadow: none;
}

/* small components */
.crim-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
}

.crim-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.crim-badge-on {
    background: var(--crim-black);
    color: #fff;
}

.crim-badge-off {
    border: 1px solid var(--crim-red);
    background: var(--crim-red-soft);
    color: var(--crim-red);
}

.crim-empty {
    padding: 34px 16px;
    color: var(--crim-muted);
    text-align: center;
}

.crim-empty .fa {
    margin-bottom: 10px;
    color: var(--crim-red);
    font-size: 30px;
}

/* active switch (supplier master) */
.crim-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 0;
    cursor: pointer;
    user-select: none;
}

.crim-switch input[type=checkbox] {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
}

.crim-switch-track {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cfcfcf;
    transition: background .15s ease;
}

.crim-switch-track::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    content: "";
    transition: transform .15s ease;
}

.crim-switch input:checked + .crim-switch-track {
    background: var(--crim-red);
}

.crim-switch input:checked + .crim-switch-track::after {
    transform: translateX(18px);
}

.crim-switch input:focus-visible + .crim-switch-track {
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .25);
}

.crim-switch input:disabled + .crim-switch-track {
    opacity: .55;
}

.crim-switch input:disabled ~ .crim-switch-text {
    color: var(--crim-muted);
}

.crim-switch-text {
    color: var(--crim-ink);
    font-size: 13px;
    font-weight: 600;
}

/* supplier rate entry */
.supprate-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    margin: 0 0 10px;
}

.supprate-head label {
    display: block;
    margin-bottom: 4px;
}

.supprate-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    color: var(--crim-muted);
}

.supprate-stats b {
    color: var(--crim-red);
    font-size: 20px;
}

.supprate-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 2px 10px;
}

.supprate-filter-wrap {
    position: relative;
    flex: 1 1 220px;
}

.supprate-filter-wrap .fa {
    position: absolute;
    top: 50%;
    left: 10px;
    color: var(--crim-muted);
    transform: translateY(-50%);
}

body:not(.poultry-login-page) .supprate-filter-wrap input.supprate-filter {
    width: 100%;
    padding-left: 30px;
}

body:not(.poultry-login-page) .btn.crim-btn-ghost {
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--crim-black);
    border-radius: 6px;
    background: #fff;
    color: var(--crim-black);
    font-size: 12px;
    font-weight: 700;
    text-transform: none;
}

body:not(.poultry-login-page) .btn.crim-btn-ghost:hover {
    background: var(--crim-black);
    color: #fff;
}

.supprate-table {
    margin-bottom: 0;
}

.supprate-table > tbody > tr > td {
    padding: 5px 8px !important;
    vertical-align: middle !important;
    border-top: 1px solid #efefef !important;
    font-size: 13px;
}

.supprate-table .srno {
    color: var(--crim-muted);
}

.supprate-name {
    font-weight: 600;
}

.supprate-muted {
    color: var(--crim-muted);
}

.supprate-muted small {
    display: block;
    font-size: 10px;
}

body:not(.poultry-login-page) .supprate-table input.rate {
    width: 100%;
    max-width: 130px;
    margin-left: auto;
    font-weight: 700;
    text-align: right;
}

.supprate-table tr.is-filled > td {
    background: #fff;
}

.supprate-table tr.is-filled > td:first-child {
    box-shadow: inset 3px 0 0 var(--crim-red);
}

@media (max-width: 767px) {
    .supprate-stats {
        align-items: flex-start;
        margin-top: 6px;
    }
}

/* helper inputs some screens keep in the heading (financial-year dates) */
input.zstdate,
input.zenddate {
    display: none !important;
}

@media (max-width: 600px) {
    body:not(.poultry-login-page) .panel-body {
        padding: 10px 8px;
    }

    .supprate-table > thead > tr > th,
    .supprate-table > tbody > tr > td {
        padding: 5px 4px !important;
        white-space: normal !important;
    }

    .supprate-table th:first-child,
    .supprate-table td:first-child {
        width: 28px;
    }

    .supprate-name {
        font-size: 12px;
    }

    body:not(.poultry-login-page) .supprate-table input.rate {
        max-width: 84px;
    }
}

.supprate-datebar {
    display: flex;
    gap: 6px;
}

.supprate-datebar input.vouchdt {
    flex: 1 1 auto;
}

body:not(.poultry-login-page) .supprate-datebar .btn.crim-btn-ghost {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 30px;
}

.supprate-datebar .btn.disabled {
    opacity: .3;
    pointer-events: none;
}

body.poultry-step-page .poultry-step-card h2 {
    margin: 0 0 22px;
}

body.poultry-step-page .panel.poultry-step-card {
    margin: 0 auto;
}

body.poultry-step-page .poultry-step-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px;
}

/* =====================================================================
   Responsive layer - all screens (phones, tablets, desktops)
   ===================================================================== */
html {
    -webkit-text-size-adjust: 100%;
}

img,
iframe,
video {
    max-width: 100%;
}

/* wide tables scroll inside their own box instead of widening the page */
.crim-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crim-table-scroll > table {
    margin-bottom: 0;
}

body:not(.poultry-login-page) .select2-container {
    max-width: 100%;
}

/* ---------- tablets & phones ---------- */
@media (max-width: 991px) {
    body:not(.poultry-login-page):not(.poultry-step-page) {
        overflow-x: hidden;
    }

    body:not(.poultry-login-page) .panel {
        margin: 8px 0;
    }

    /* modal boxes use the full width */
    body:not(.poultry-login-page) .modal-dialog {
        width: auto;
        margin: 10px;
    }

    body:not(.poultry-login-page) .modal-body .row > [class*="col-"] {
        margin-bottom: 6px;
    }
}

/* ---------- phones ---------- */
@media (max-width: 767px) {
    body:not(.poultry-login-page):not(.poultry-step-page) {
        font-size: 14px;
    }

    /* page containers take the full width */
    body:not(.poultry-login-page):not(.poultry-step-page) form > [class*="col-"],
    body:not(.poultry-login-page):not(.poultry-step-page) > [class*="col-"],
    body:not(.poultry-login-page):not(.poultry-step-page) .container,
    body:not(.poultry-login-page):not(.poultry-step-page) .container-fluid {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    body:not(.poultry-login-page) .row {
        margin-left: 0;
        margin-right: 0;
    }

    /* form fields: label above input, one field per line */
    body:not(.poultry-login-page) .panel-body [class*="col-"],
    body:not(.poultry-login-page) .modal-body [class*="col-"] {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        left: auto !important;
        right: auto !important;
    }

    body:not(.poultry-login-page) .panel-body [class*="col-"].text-right,
    body:not(.poultry-login-page) .panel-body [class*="col-"].text-center {
        text-align: left !important;
    }

    body:not(.poultry-login-page) .panel-body .label-control,
    body:not(.poultry-login-page) .panel-body .control-label,
    body:not(.poultry-login-page) .panel-body label {
        margin: 8px 0 3px;
    }

    body:not(.poultry-login-page) .panel-body .crim-table-scroll label,
    body:not(.poultry-login-page) .panel-body .table-responsive label {
        margin: 0;
    }

    body:not(.poultry-login-page) .panel-body .row {
        margin-bottom: 2px;
    }

    body:not(.poultry-login-page):not(.poultry-step-page) .panel-body input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
    body:not(.poultry-login-page):not(.poultry-step-page) .panel-body select,
    body:not(.poultry-login-page):not(.poultry-step-page) .panel-body textarea,
    body:not(.poultry-login-page):not(.poultry-step-page) .panel-body .form-control {
        max-width: 100% !important;
        min-height: 38px;
        font-size: 16px; /* stops iPhone zooming into the field */
    }

    body:not(.poultry-login-page) .panel-body > .row .select2-container,
    body:not(.poultry-login-page) .panel-body [class*="col-"] > .select2-container {
        width: 100% !important;
    }

    body:not(.poultry-login-page):not(.poultry-step-page) .select2-container--default .select2-selection--single {
        min-height: 38px;
    }

    body:not(.poultry-login-page):not(.poultry-step-page) .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 36px;
    }

    body:not(.poultry-login-page):not(.poultry-step-page) .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 36px;
    }

    /* tables: natural column widths + sideways scrolling */
    .crim-table-scroll > table,
    .table-responsive > table {
        width: auto !important;
        min-width: 100%;
    }

    .crim-table-scroll > table > thead > tr > th,
    .crim-table-scroll > table > tbody > tr > td,
    .crim-table-scroll > table > tfoot > tr > td {
        white-space: nowrap;
    }

    /* entry grids keep each box wide enough to read and type in */
    table.crim-grid > tbody > tr > td input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
    table.crim-grid > tbody > tr > td select {
        min-width: 78px;
        font-size: 15px !important;
    }

    table.crim-grid > tbody > tr > td input.srno,
    table.crim-grid > tbody > tr > td input[name^="srno"] {
        min-width: 40px;
    }

    table.crim-grid > tbody > tr > td .select2-container {
        min-width: 170px;
    }

    /* the supplier-rate grid is laid out for phones already */
    table.crim-grid.supprate-table {
        min-width: 0;
    }

    table.supprate-table > tbody > tr > td input.rate {
        min-width: 0;
    }

    /* action buttons wrap instead of overflowing */
    body:not(.poultry-login-page) .panel-footer {
        padding: 8px 6px;
    }

    body:not(.poultry-login-page) .panel-footer .btn {
        margin-bottom: 4px;
    }

    /* page headings on report outputs */
    #head td {
        white-space: normal !important;
    }
}

/* ---------- small phones ---------- */
@media (max-width: 380px) {
    .crim-actions .btn.crim-act {
        min-width: 36px;
        padding: 0 9px;
    }
}

/* select2: the template adds 7px padding that pushes the text down */
.select2-container--default .select2-selection--single {
    padding: 0 !important;
}

body:not(.poultry-login-page):not(.poultry-step-page) .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
}

body.poultry-step-page .poultry-step-card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 48px;
}

@media (max-width: 767px) {
    body:not(.poultry-login-page):not(.poultry-step-page) .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 36px;
    }

    table.crim-grid > tbody > tr > td input.srno,
    table.crim-grid > tbody > tr > td input[name^="srno"] {
        width: 44px !important;
        min-width: 44px !important;
        text-align: center;
    }
}

/* older "form-title" screens (Outstanding bills, backup) */
body:not(.poultry-login-page) .forms-panel {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--crim-line);
    border-radius: 10px;
    background: #fff;
}

body:not(.poultry-login-page) .forms-panel .form-title {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-bottom: 3px solid var(--crim-red);
    background: var(--crim-black);
}

body:not(.poultry-login-page) .forms-panel .form-title h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

@media (max-width: 767px) {
    body:not(.poultry-login-page) .forms-panel {
        float: none !important;
        width: auto !important;
        margin: 8px 6px !important;
    }

    body:not(.poultry-login-page) .forms-panel form [class*="col-"] {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        text-align: left !important;
    }

    body:not(.poultry-login-page) .forms-panel .form-group {
        margin: 0 10px 8px;
    }
}

/* Bootstrap rows sitting directly on the page (no .container) stick out 15px each side */
body:not(.poultry-login-page):not(.poultry-step-page) > .row,
body:not(.poultry-login-page):not(.poultry-step-page) > form > .row,
body:not(.poultry-login-page):not(.poultry-step-page) > div > .row:first-child {
    margin-left: 0;
    margin-right: 0;
}

@media (max-width: 991px) {
    body:not(.poultry-login-page):not(.poultry-step-page) .row {
        margin-left: 0;
        margin-right: 0;
    }
}

/* ===== Customer master: Items panel matches the form height ===== */
.crim-cust-items .panel {
    display: flex;
    flex-direction: column;
}

.crim-cust-items .panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
}

.crim-cust-items .crim-cust-table {
    margin: 0;
}

.crim-cust-items .crim-cust-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.crim-cust-items .crim-cust-table > tbody > tr > td {
    padding: 4px 6px;
    vertical-align: middle;
}

.crim-cust-items .crim-cust-table .remove {
    color: var(--crim-red);
    cursor: pointer;
}

.crim-cust-items .panel-footer {
    flex: 0 0 auto;
}

@media (min-width: 992px) {
    form.crim-cust-layout {
        display: flex;
        align-items: stretch;
    }

    form.crim-cust-layout > .crim-cust-main,
    form.crim-cust-layout > .crim-cust-items {
        float: none;
    }

    /* the Items column takes the form's height; its list scrolls inside */
    form.crim-cust-layout > .crim-cust-items {
        position: relative;
    }

    form.crim-cust-layout > .crim-cust-items > .panel {
        position: absolute;
        top: 0;
        right: 2px;
        bottom: 0;
        left: 2px;
        margin: 10px 4px;
    }
}

@media (max-width: 991px) {
    .crim-cust-items .panel-body {
        max-height: 60vh;
    }
}

body:not(.poultry-login-page) .crim-cust-items .panel-body {
    padding: 0;
}

@media (min-width: 992px) {
    form.crim-cust-layout > .crim-cust-items > .panel {
        top: 2px;
        bottom: 2px;
    }
}

/* ===== SweetAlert2 in the CRIM theme ===== */
.swal2-container {
    z-index: 20000 !important;
}

.swal2-popup {
    border-top: 4px solid #c8102e;
    border-radius: 12px !important;
    font-family: "Segoe UI", Roboto, Arial, sans-serif !important;
}

.swal2-popup .swal2-title {
    color: #111;
    font-size: 20px;
}

.swal2-popup .swal2-html-container {
    color: #333;
    font-size: 15px;
}

.swal2-popup .swal2-styled {
    min-width: 92px;
    border-radius: 7px !important;
    font-weight: 700;
}

.swal2-popup .swal2-timer-progress-bar {
    background: #c8102e;
}

/* ===== Opening Balance: list fits the screen, totals + headings stay on top ===== */
.openbal-scroll {
    float: left;
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--crim-line);
    border-radius: 8px;
}

.openbal-scroll #detail {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 !important;
    background: #fff;
}

.openbal-scroll #openbal {
    margin: 0;
}

.openbal-scroll #openbal tr:first-child > th,
.openbal-scroll #openbal tr:first-child > td {
    position: sticky;
    z-index: 2;
    background: var(--crim-black) !important;
    color: #fff !important;
}

.openbal-scroll #openbal tr:first-child > th label,
.openbal-scroll #openbal tr:first-child > td label {
    margin: 0;
    color: #fff;
}

/* #data carries Bootstrap's .table-responsive (its own scroll area) - that stops the pinning */
.openbal-scroll > #data {
    overflow: visible !important;
}


/* ---------- entry mode badge (Add / Edit) next to the form title ---------- */
.crim-mode {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    color: #fff !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 18px;
    text-transform: uppercase;
    vertical-align: middle;
}
.crim-mode-add {
    background: #1e9e4a;
}
.crim-mode-edit {
    background: #f08c00;
}

/* total under an entry table (Retail Sale, Sunday Stock Balance): right-aligned with the table */
.crim-total-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 6px 0 0;
}
.crim-total-line label {
    margin: 0;
    font-weight: 800;
}
.crim-total-line .form-control {
    width: 170px;
    max-width: 50%;
}

/* Cash / Bank Receipt & Payment: entries of the day (right side) */
.cb-day td { font-size: 13px; vertical-align: middle !important; }
.cb-day th { white-space: nowrap; }
.cb-day .cb-row:hover td { background: #fdecee; }
.cb-day .cb-total td { border-top: 2px solid #111 !important; background: #fff; font-weight: 800; font-size: 14px; }
table.crim-actions, table.crim-actions > tbody, table.crim-actions > tbody > tr { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; }
table.crim-actions > tbody > tr > td { display: block; }

/* Purchase Invoice: row buttons (edit / delete / remove from bill) */
.pi-acts { white-space: nowrap; width: 1%; vertical-align: middle !important; }
.pi-acts .btn { width: 26px; height: 24px; margin: 0 1px; padding: 0; line-height: 22px; border: 1px solid #cfcfcf; border-radius: 5px; background: #fff; color: #111; font-size: 12px; box-shadow: none; }
.pi-acts .btn:hover { border-color: #111; background: #111; color: #fff; }
.pi-acts .pi-del { border-color: #e7a1ab; color: #c8102e; }
.pi-acts .pi-del:hover { border-color: #c8102e; background: #c8102e; color: #fff; }
.pi-table td { vertical-align: middle !important; }
.pi-table td:nth-child(2) { white-space: nowrap; }

/* Purchase DC / Outsource entries already billed in a Purchase Invoice */
.panel.crim-billed { box-shadow: 0 0 0 2px #1f6fd1, 0 4px 14px rgba(31, 111, 209, .18) !important; }
.panel.crim-billed > .panel-body { background: #f1f6fe; }
.crim-billed-note { margin: -4px 0 10px; padding: 8px 10px; border-left: 4px solid #1f6fd1; border-radius: 4px; background: #e2edfc; color: #0b3f86; font-size: 12.5px; font-weight: 600; }
.crim-billed-note a { color: #0b3f86; font-weight: 800; text-decoration: underline; }
.crim-billed-no { color: #1f6fd1; font-weight: 800; }
tr.crim-billed-row > td { background: #eef4fd !important; }
tr.crim-billed-row.info > td { background: #d9e8fb !important; }
th[title="Purchase Invoice the entry is billed in"] { white-space: nowrap; }
