:root {
    --cf-bg: #f4f7fa;
    --cf-surface: #ffffff;
    --cf-surface-soft: #f7fafd;
    --cf-border: #d7e1e9;
    --cf-border-strong: #b8c8d5;
    --cf-text: #172b3d;
    --cf-muted: #637586;
    --cf-accent: #1689e8;
    --cf-accent-dark: #125f9c;
    --cf-accent-soft: #e7f3fd;
    --cf-radius: 12px;
    --cf-shadow: 0 10px 28px rgba(22, 48, 70, 0.09);
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--cf-bg);
    color: var(--cf-text);
}

.cf-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 28px 0;
    background: linear-gradient(180deg, #fbfcfe 0%, var(--cf-bg) 100%);
}

.cf-login-page > .container {
    width: 100%;
}

.cf-login-card {
    padding: 26px;
    border: 1px solid var(--cf-border);
    border-top: 4px solid var(--cf-accent);
    border-radius: 16px;
    background: var(--cf-surface);
    box-shadow: var(--cf-shadow);
}

.cf-logo-link {
    display: inline-block;
    border-radius: 10px;
}

.cf-logo-link:focus-visible {
    outline: 3px solid rgba(22, 137, 232, 0.3);
    outline-offset: 4px;
}

.cf-logo-link img {
    display: block;
    max-width: 170px !important;
    height: auto;
}

.cf-login-card .form-group {
    margin-bottom: 14px;
}

.form-control,
.form-select {
    min-height: 38px;
    border-color: var(--cf-border-strong);
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cf-accent);
    box-shadow: 0 0 0 3px rgba(22, 137, 232, 0.14);
}

.btn {
    border-radius: 8px;
    text-transform: none;
}

.cf-app-page {
    min-height: 100vh;
}

.cf-app-page > .container-fluid {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 0;
}

.cf-navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 58px;
    border-bottom: 1px solid var(--cf-border);
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 4px 16px rgba(22, 48, 70, 0.07);
}

.cf-navbar .container-fluid {
    gap: 10px;
}

.cf-navbar .navbar-collapse {
    justify-content: flex-start !important;
}

.cf-navbar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    margin-right: 4px;
    padding: 4px 8px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: #fff;
}

.cf-navbar-brand img {
    display: block;
    max-width: 96px;
    max-height: 34px;
    object-fit: contain;
}

.cf-navbar-brand:focus-visible {
    outline: 3px solid rgba(22, 137, 232, 0.25);
    outline-offset: 2px;
}

.cf-navbar .navbar-nav {
    width: 100%;
    align-items: center;
    gap: 2px;
}

.cf-navbar .navbar-nav > .nav-item:last-child {
    margin-left: auto;
}

.cf-navbar .nav-link {
    border-radius: 8px;
    color: #294052 !important;
    font-size: 0.9rem;
    font-weight: 600;
}

.cf-navbar .nav-link:hover,
.cf-navbar .nav-link:focus {
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark) !important;
}

.cf-navbar .nav-link .fa {
    color: var(--cf-accent);
}

.cf-navbar .dropdown-menu {
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: var(--cf-surface);
    box-shadow: var(--cf-shadow);
}

.cf-navbar .dropdown-item {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 7px;
}

.cf-navbar .dropdown-item:hover,
.cf-navbar .dropdown-item:focus {
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark);
}

.cf-navbar .highlight {
    background: #d9ecfd !important;
    color: var(--cf-accent-dark) !important;
}

.cf-navbar .cf-navbar-attention {
    background: #fff3cd !important;
    color: #664d03 !important;
}

.cf-navbar .dropdown-submenu {
    position: relative;
}

.cf-navbar .dropdown-submenu > .dropdown-menu {
    display: none;
    position: absolute;
    top: -6px;
    left: calc(100% - 1px);
    width: max-content;
    min-width: 220px;
    max-width: min(380px, calc(100vw - 24px));
    white-space: normal;
}

.cf-navbar .dropdown-submenu > .dropdown-menu.show {
    display: block;
}

.cf-navbar .dropdown-submenu > .dropdown-toggle::after {
    display: none;
}

.cf-navbar .dropdown-submenu > .dropdown-toggle .fa {
    margin-left: auto !important;
}

.cf-navbar .dropdown-menu label.container {
    display: flex;
    gap: 8px;
    align-items: center;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 7px 10px;
}

.cf-navbar .dropdown-menu .form-check {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    min-height: 34px;
    margin: 0;
    padding: 6px 10px;
}

.cf-navbar .dropdown-menu .form-check-input {
    float: none;
    flex: 0 0 auto;
    margin: 0;
}

.cf-navbar .dropdown-menu .form-check-label {
    margin: 0;
}

.cf-context-bar {
    display: flex;
    gap: 12px;
    align-items: stretch;
    justify-content: space-between;
    margin: 0 12px 10px;
    padding: 10px;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    background: var(--cf-surface);
    box-shadow: 0 5px 18px rgba(22, 48, 70, 0.06);
}

.cf-context-identity {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
}

.cf-context-card {
    display: flex;
    flex: 1 1 260px;
    gap: 10px;
    align-items: center;
    min-width: 0;
    min-height: 58px;
    padding: 8px 12px;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: var(--cf-surface-soft);
}

.cf-context-farm {
    border-left: 4px solid var(--cf-accent);
}

.cf-context-module {
    border-left: 4px solid #60768a;
}

.cf-context-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark);
    font-size: 1.05rem;
}

.cf-context-module .cf-context-icon {
    background: #edf2f7;
    color: #455d73;
}

.cf-context-content {
    min-width: 0;
    text-align: left;
}

.cf-context-label {
    display: block;
    margin-bottom: 2px;
    color: var(--cf-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.1;
    text-transform: uppercase;
}

.cf-context-value {
    overflow: hidden;
    color: var(--cf-text);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#idAtkualneGospodarstwo:empty::after {
    content: "Ładowanie danych gospodarstwa...";
    color: var(--cf-muted);
    font-weight: 500;
}

#idNaglowekTabeli:empty::after {
    content: "Wybierz widok z menu";
    color: var(--cf-muted);
    font-weight: 500;
}

.cf-date-range {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    align-items: flex-end;
    padding-left: 12px;
    border-left: 1px solid var(--cf-border);
}

.cf-date-field {
    display: grid;
    gap: 4px;
    margin: 0;
    color: var(--cf-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.cf-date-field .form-control {
    width: 164px;
    min-width: 164px;
    min-height: 38px;
    padding-right: 8px;
    padding-left: 10px;
    background: #fff;
    color-scheme: light;
    font-size: 0.9rem;
}

.cf-refresh-button {
    min-height: 38px;
    white-space: nowrap;
}

.cf-workspace {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin: 0 12px 16px;
    padding: 12px;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 6px 20px rgba(22, 48, 70, 0.05);
}

.cf-search-group .input-group-text {
    border-color: var(--cf-border-strong);
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark);
    font-weight: 700;
}

.cf-search-filters {
    border-color: var(--cf-border) !important;
    background: var(--cf-surface-soft) !important;
}

.cf-search-filters summary {
    color: var(--cf-accent-dark);
}

.cf-table-host {
    flex: 1 1 280px;
    height: auto !important;
    min-height: 280px;
    max-height: max(240px, calc(100dvh - 280px));
    overflow: auto !important;
    text-align: center;
    border: 1px solid var(--cf-border);
    border-radius: 10px;
    background: var(--cf-surface);
}

.cf-data-table {
    width: max-content;
    min-width: 100%;
    margin-bottom: 0 !important;
    border-color: var(--cf-border) !important;
}

.cf-data-table th,
.cf-data-table td {
    border-color: #e1e7ed !important;
    vertical-align: middle;
}

.cf-data-table th,
.cf-table-header {
    z-index: 2;
    background: #edf5fc !important;
    color: #25445d !important;
    font-weight: 700;
}

.cf-data-table tbody tr:hover {
    background: #f4f8fc !important;
}

.cf-data-table button.fa,
.cf-data-table button[class*="fa-"] {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--cf-border-strong) !important;
    border-radius: 7px;
    background: #fff !important;
    color: #2e4354;
}

.modal-content {
    overflow: visible;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    box-shadow: var(--cf-shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--cf-border);
    background: var(--cf-surface-soft);
}

.modal-title {
    color: #21394d;
    font-weight: 700;
}

.modal-body {
    overflow-x: visible;
}

.modal-body input[type="date"],
.modal-body input[type="datetime-local"] {
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--cf-border-strong);
    border-radius: 8px;
    background: #fff;
}

.modal-body .input-group-text {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    width: 100%;
    white-space: normal;
}

.modal-body .input-group-text > .form-control,
.modal-body .input-group-text > .form-select {
    flex: 1 1 220px;
    min-width: 0;
}

.cf-modal-table-host {
    height: min(600px, 58vh) !important;
    overflow: auto !important;
    text-align: center;
    border: 1px solid var(--cf-border);
    border-radius: 9px;
    background: #fff;
}

.cf-control-row {
    align-items: center;
    gap: 8px;
}

.cf-control-row .form-select {
    min-width: 0;
}

.cf-icon-button,
.cf-step-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0 !important;
    border: 1px solid var(--cf-border-strong) !important;
    border-radius: 8px;
    background: #fff !important;
    color: #2e4354 !important;
    line-height: 1;
}

.cf-icon-button:hover,
.cf-step-button:hover {
    border-color: var(--cf-accent) !important;
    background: var(--cf-accent-soft) !important;
    color: var(--cf-accent-dark) !important;
}

.cf-icon-button .fa,
.cf-step-button.fa {
    font-size: 1.05rem;
}

.cf-step-button.fa-plus,
.cf-step-button.fa-minus {
    font-size: 0;
}

.cf-step-button.fa-plus::before,
.cf-step-button.fa-minus::before {
    font-size: 1.05rem;
}

#idkomunikatsukces,
#idkomunikatdanger,
#idkomunikatwarning {
    top: 72px;
    left: 50%;
    z-index: 1090 !important;
    max-width: min(680px, calc(100vw - 24px));
    transform: translateX(-50%);
    border-radius: 10px;
    box-shadow: var(--cf-shadow);
}

@media (min-width: 1200px) {
    .cf-app-page > .container-fluid {
        height: 100dvh;
        overflow: hidden;
    }

    .cf-table-host {
        height: 0 !important;
        min-height: 0;
        max-height: none;
    }

    .cf-navbar .navbar-collapse {
        justify-content: center !important;
    }

    .cf-navbar .navbar-nav {
        width: auto;
    }

    .cf-navbar .navbar-nav > .nav-item:last-child {
        margin-left: 0;
    }
}

@media (max-width: 1199.98px) {
    .cf-context-bar {
        flex-wrap: wrap;
    }

    .cf-context-identity {
        flex: 1 1 620px;
    }

    .cf-date-range {
        flex: 1 1 auto;
        justify-content: flex-end;
        padding-top: 8px;
        padding-left: 0;
        border-top: 1px solid var(--cf-border);
        border-left: 0;
    }

    .cf-navbar .navbar-nav {
        align-items: stretch;
        padding-top: 8px;
    }

    .cf-navbar .navbar-nav > .nav-item:last-child {
        margin-left: 0;
    }

    .cf-navbar .dropdown-menu {
        box-shadow: none;
    }

    .cf-navbar .navbar-collapse {
        max-height: calc(100dvh - 70px);
        overflow-y: auto;
    }

    .cf-navbar .dropdown-submenu > .dropdown-menu {
        position: static;
        width: calc(100% - 12px);
        max-width: none;
        margin: 4px 0 4px 12px;
        border-left: 3px solid var(--cf-accent-soft);
        white-space: normal;
    }

    .cf-navbar .dropdown-menu .form-check {
        max-width: 100%;
    }

    .cf-navbar .dropdown-menu .form-check input[type="number"] {
        flex: 1 1 72px;
        width: auto !important;
        max-width: 100px;
    }

}

@media (min-width: 768px) and (max-width: 991.98px) {
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        width: calc(100% - 32px);
        max-width: none;
        margin-right: 16px;
        margin-left: 16px;
    }
}

@media (max-width: 767.98px) {
    .cf-login-page {
        align-items: flex-start;
        padding: 14px 0;
    }

    .cf-login-card {
        padding: 18px;
    }

    .cf-workspace {
        margin-right: 8px;
        margin-left: 8px;
        padding: 9px;
    }

    .cf-context-bar {
        margin-right: 8px;
        margin-left: 8px;
        padding: 8px;
    }

    .cf-context-identity {
        display: grid;
        grid-template-columns: 1fr;
        flex-basis: 100%;
    }

    .cf-context-card {
        min-height: 54px;
    }

    .cf-date-range {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        width: 100%;
    }

    .cf-date-field .form-control {
        width: 100%;
        min-width: 0;
    }

    .cf-table-host {
        min-height: 240px;
    }

    .modal-dialog {
        width: calc(100% - 16px);
        max-width: none;
        margin: 8px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-footer {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
    }

    .modal-footer .btn {
        min-height: 40px;
    }

    .modal-footer .btn[style*="position: absolute"] {
        position: static !important;
        left: auto !important;
        margin-right: auto;
    }

    .cf-control-row {
        justify-content: flex-start !important;
    }

    .cf-control-row .form-select {
        flex: 1 1 calc(100% - 96px);
    }

    #idBtnSprawdzIrz {
        flex: 1 1 100%;
        margin-top: 6px;
    }
}

@media (max-width: 480px) {
    .cf-date-range {
        grid-template-columns: 1fr;
    }

    .cf-refresh-button {
        width: 100%;
    }

    .cf-context-value {
        white-space: normal;
    }

    .cf-icon-button,
    .cf-step-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
    }

    .modal-body .input-group-text > label {
        flex: 1 1 100%;
    }
}

.cf-order-page {
    position: relative;
    min-height: 100vh;
    padding: 24px 0 32px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 8% 0%, rgba(22, 137, 232, 0.16) 0, rgba(22, 137, 232, 0) 34%),
        radial-gradient(circle at 92% 12%, rgba(42, 157, 85, 0.14) 0, rgba(42, 157, 85, 0) 28%),
        linear-gradient(180deg, #fbfcfe 0%, var(--cf-bg) 100%);
    color: var(--cf-text);
}

.cf-order-container {
    max-width: 1160px;
}

.cf-order-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--cf-shadow);
    transform: translate(-50%, -50%);
}

.cf-order-spinner .spinner-border {
    width: 2.6rem;
    height: 2.6rem;
    color: var(--cf-accent);
}

.cf-order-hero,
.cf-order-wizard,
.cf-order-summary,
.cf-order-success {
    border: 1px solid var(--cf-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--cf-shadow);
}

.cf-order-hero {
    display: grid;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    padding: 20px;
    border-color: rgba(184, 200, 213, 0.85);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(231, 243, 253, 0.9)),
        var(--cf-surface);
}

.cf-order-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 86px;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.cf-order-logo-wrap img {
    max-width: 170px;
    max-height: 76px;
    object-fit: contain;
}

.cf-order-eyebrow {
    margin: 0 0 5px;
    color: var(--cf-accent-dark);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cf-order-hero h1 {
    margin: 0;
    color: var(--cf-text);
    font-size: clamp(1.7rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.05;
}

.cf-order-lead {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--cf-muted);
    font-size: 1rem;
}

.cf-order-shell {
    display: grid;
    gap: 16px;
    align-items: start;
}

.cf-order-wizard {
    min-width: 0;
    padding: 18px;
}

.cf-order-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 16px;
    padding: 6px;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #eef6fd;
}

.cf-order-step-pill {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 9px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--cf-muted);
    font-weight: 700;
}

.cf-order-step-pill strong {
    font: inherit;
}

.cf-order-step-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #fff;
    color: var(--cf-accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.cf-order-step-pill:hover,
.cf-order-step-pill:focus-visible {
    background: #fff;
    color: var(--cf-text);
}

.cf-order-step-pill-active {
    background: linear-gradient(135deg, var(--cf-accent), var(--cf-accent-dark));
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 137, 232, 0.2);
}

.cf-order-step-pill-active span {
    background: #fff;
    color: var(--cf-accent-dark);
}

.cf-order-step-pill-done:not(.cf-order-step-pill-active) {
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark);
}

.cf-order-step {
    display: none;
    min-height: 360px;
    padding: 20px;
    border: 1px solid var(--cf-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.cf-order-step-active {
    display: block;
}

.cf-order-section-title {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.cf-order-section-title > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark);
    font-weight: 800;
}

.cf-order-section-title h2,
.cf-order-summary h2,
.cf-order-success h2 {
    margin: 0;
    color: var(--cf-text);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 800;
    line-height: 1.15;
}

.cf-order-section-title p:not(.cf-order-eyebrow),
.cf-order-summary p,
.cf-order-success p {
    margin: 6px 0 0;
    color: var(--cf-muted);
}

.cf-order-type-grid {
    display: grid;
    gap: 12px;
}

.cf-order-type-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cf-order-type-card {
    display: grid;
    gap: 7px;
    min-height: 132px;
    padding: 16px;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cf-order-type-card strong {
    color: var(--cf-text);
    font-size: 1.15rem;
    font-weight: 800;
}

.cf-order-type-card > span:not(.cf-order-type-icon) {
    color: var(--cf-muted);
}

.cf-order-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark);
    font-size: 1.1rem;
    font-weight: 800;
}

.cf-order-type-card:hover,
.cf-order-type-input:focus-visible + .cf-order-type-card {
    border-color: var(--cf-accent);
    box-shadow: 0 0 0 3px rgba(22, 137, 232, 0.12);
    transform: translateY(-1px);
}

.cf-order-type-input:checked + .cf-order-type-card {
    border-color: var(--cf-accent);
    background: linear-gradient(180deg, #fff 0%, #f3faff 100%);
    box-shadow: 0 10px 22px rgba(22, 137, 232, 0.12);
}

.cf-order-type-input:checked + .cf-order-type-sell {
    border-color: #2a9d55;
    background: linear-gradient(180deg, #fff 0%, #f2fbf5 100%);
    box-shadow: 0 10px 22px rgba(42, 157, 85, 0.12);
}

.cf-order-type-input:checked + .cf-order-type-sell .cf-order-type-icon {
    background: #e5f6ec;
    color: #1f7b40;
}

.cf-order-product-grid {
    display: grid;
    gap: 14px;
}

.cf-order-product-fields .select2-container {
    width: 100% !important;
}

.cf-order-product-fields .select2-container .select2-selection--single,
.cf-order-step .form-control,
.cf-order-step .form-select {
    min-height: 42px;
    border-color: var(--cf-border-strong);
    border-radius: 10px;
    background: #fff;
}

.cf-order-product-fields .select2-container .select2-selection--single {
    padding-top: 6px;
}

.cf-order-product-fields .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 8px;
    right: 8px;
}

.cf-order-product-actions {
    margin-top: 12px;
}

.cf-order-product-actions .btn,
.cf-order-next,
.cf-order-submit,
.cf-order-success-button {
    min-height: 42px;
    border-radius: 10px;
    font-weight: 700;
}

.cf-order-product-fields > .select2-container {
    display: none !important;
}

.cf-order-product-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.cf-order-product-choice {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--cf-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--cf-text);
    font-weight: 800;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cf-order-product-choice:hover,
.cf-order-product-choice:focus-visible,
.cf-order-product-choice-active {
    border-color: var(--cf-accent);
    background: var(--cf-accent-soft);
    color: var(--cf-accent-dark);
    box-shadow: 0 8px 18px rgba(22, 137, 232, 0.12);
    transform: translateY(-1px);
}

.cf-order-config-message {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #f0c36d;
    border-radius: 10px;
    background: #fff8e6;
    color: #6d4b00;
    font-weight: 700;
}

.cf-order-sale-mode .cf-order-product-preview {
    display: none !important;
}

.cf-order-product-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 146px;
    padding: 12px;
    border: 1px dashed var(--cf-border-strong);
    border-radius: 14px;
    background: var(--cf-surface-soft);
    color: var(--cf-muted);
    text-align: center;
    cursor: pointer;
}

.cf-order-product-preview:hover,
.cf-order-product-preview:focus-visible {
    border-color: var(--cf-accent);
    background: #fff;
    color: var(--cf-accent-dark);
}

.cf-order-product-preview img {
    width: 100%;
    max-height: 180px;
    border-radius: 10px;
    object-fit: contain;
}

.cf-order-items-wrap {
    margin-top: 16px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 16px rgba(22, 48, 70, 0.04);
}

.cf-order-items-wrap table {
    margin: 0;
}

.cf-order-items-wrap thead {
    background: var(--cf-surface-soft);
}

.cf-order-items-wrap th {
    color: #294052;
    font-weight: 800;
}

.cf-order-items-wrap td {
    vertical-align: middle;
}

.cf-order-item-name {
    font-weight: 800;
}

.cf-order-quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cf-order-quantity-control .form-control {
    width: 70px;
    min-height: 38px;
    padding-right: 8px;
    padding-left: 8px;
    text-align: center;
}

.cf-order-quantity-control .form-control::-webkit-outer-spin-button,
.cf-order-quantity-control .form-control::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.cf-order-quantity-control .form-control[type="number"] {
    appearance: textfield;
}

.cf-order-quantity-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    border: 1px solid var(--cf-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--cf-accent-dark);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.cf-order-quantity-button:hover,
.cf-order-quantity-button:focus-visible {
    border-color: var(--cf-accent);
    background: var(--cf-accent-soft);
}

.cf-order-item-remove {
    text-align: right;
}

.cf-order-transport-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: var(--cf-surface-soft);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cf-order-transport-card:hover,
.cf-order-transport-card:focus-within {
    border-color: var(--cf-accent);
    background: #fff;
}

.cf-order-transport-card input {
    margin-top: 4px;
}

.cf-order-transport-card strong,
.cf-order-transport-card small {
    display: block;
}

.cf-order-transport-card strong {
    color: var(--cf-text);
}

.cf-order-transport-card small {
    color: var(--cf-muted);
}

.cf-order-consent {
    padding: 14px 14px 14px 42px;
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    background: var(--cf-surface-soft);
}

.cf-order-consent .form-check-input {
    margin-left: -28px;
}

.cf-order-step-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 22px;
}

.cf-order-step-actions .btn {
    min-width: 140px;
}

.cf-order-step-actions-end {
    justify-content: flex-end;
}

.cf-order-summary {
    padding: 18px;
    border-top: 4px solid var(--cf-accent);
}

.cf-order-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--cf-border);
}

.cf-order-summary-row span {
    color: var(--cf-muted);
    font-weight: 700;
}

.cf-order-summary-row strong {
    color: var(--cf-text);
    text-align: right;
}

.cf-order-summary-note {
    padding: 12px;
    border-radius: 10px;
    background: var(--cf-accent-soft);
    line-height: 1.45;
}

.cf-order-success {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 18px;
    border-color: #bfe6d0;
    background: linear-gradient(135deg, #f2fbf5 0%, #ffffff 100%);
}

.cf-order-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #2a9d55;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
}

.cf-order-footer-link {
    margin-top: 16px;
    font-size: 0.85rem;
}

.cf-order-footer-link a {
    color: var(--cf-muted);
}

.cf-order-footer-link img {
    width: min(130px, 45vw);
    height: auto;
}

.cf-order-photo-modal .modal-body {
    min-height: 400px;
}

.cf-order-photo-modal #photoContaineri {
    max-width: 100%;
    max-height: 70vh;
}

@media (min-width: 768px) {
    .cf-order-hero {
        grid-template-columns: 190px 1fr;
        padding: 22px;
    }

    .cf-order-shell {
        grid-template-columns: minmax(0, 1fr) 310px;
    }

    .cf-order-type-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cf-order-product-grid {
        grid-template-columns: minmax(0, 1fr) 230px;
        align-items: stretch;
    }

    .cf-order-sale-mode .cf-order-product-grid {
        grid-template-columns: 1fr;
    }

    .cf-order-summary {
        position: sticky;
        top: 18px;
    }
}

@media (max-width: 767px) {
    .cf-order-page {
        padding: 12px 0 22px;
    }

    .cf-order-container {
        padding-right: 10px;
        padding-left: 10px;
    }

    .cf-order-hero {
        padding: 16px;
        text-align: center;
    }

    .cf-order-progress {
        position: sticky;
        top: 8px;
        z-index: 5;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .cf-order-step-pill {
        min-height: 38px;
        padding: 6px 4px;
        font-size: 0;
    }

    .cf-order-step-pill strong {
        display: none;
    }

    .cf-order-step-pill span {
        margin: 0;
    }

    .cf-order-step {
        min-height: auto;
        padding: 16px;
    }

    .cf-order-section-title h2 {
        font-size: 1.22rem;
    }

    .cf-order-type-card {
        min-height: 122px;
    }

    .cf-order-step-actions {
        position: sticky;
        bottom: 8px;
        z-index: 4;
        flex-direction: column-reverse;
        padding: 10px;
        border: 1px solid var(--cf-border);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--cf-shadow);
    }

    .cf-order-step-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .cf-order-step-actions-end {
        flex-direction: column;
    }

    .cf-order-items-wrap {
        border: 0;
        overflow: visible;
    }

    .cf-order-items-wrap table,
    .cf-order-items-wrap tbody,
    .cf-order-items-wrap tr,
    .cf-order-items-wrap td {
        display: block;
        width: 100%;
    }

    .cf-order-items-wrap thead {
        display: none;
    }

    .cf-order-items-wrap tr {
        margin-bottom: 10px;
        padding: 12px;
        border: 1px solid var(--cf-border);
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 6px 16px rgba(22, 48, 70, 0.06);
    }

    .cf-order-items-wrap td {
        padding: 7px 0;
        border: 0;
    }

    .cf-order-items-wrap td[data-label]::before {
        display: block;
        margin-bottom: 4px;
        color: var(--cf-muted);
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        content: attr(data-label);
    }

    .cf-order-item-remove {
        text-align: left;
    }

    .cf-order-quantity-control {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        width: 100%;
    }

    .cf-order-quantity-control .form-control {
        width: 100%;
    }

    .cf-order-quantity-button {
        width: 44px;
        min-width: 44px;
        height: 42px;
    }

    .cf-order-item-remove .btn {
        width: 100%;
        min-height: 40px;
    }
}
