:root {
    --navy: #0d172b;
    --navy-2: #111e35;
    --navy-3: #172741;
    --page: #e9eef5;
    --panel: #ffffff;
    --line: #aeb8c6;
    --line-soft: #d9e0e9;
    --text: #071122;
    --muted: #61728c;
    --blue: #2f66ea;
    --blue-dark: #1e4fc7;
    --orange: #ff7415;
    --orange-dark: #e65e00;
    --red: #ff6d74;
    --green: #23b875;
    --footer: #020817;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--page);
}

button,
input {
    font: inherit;
}

.partner-body {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.partner-header {
    min-height: 108px;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(420px, 1fr);
    align-items: stretch;
    color: #fff;
    background: var(--navy);
    border-bottom: 1px solid #20304a;
}

.partner-brand-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 25px;
}

.partner-brand {
    color: #fff;
    text-decoration: none;
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.partner-subtitle {
    margin-top: 6px;
    color: #a9b8cf;
    font-size: 12px;
}

.partner-label {
    display: block;
    color: #9eb0c9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.partner-balance {
    min-width: 164px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 24px;
    border-right: 1px solid #34445d;
    border-left: 1px solid #34445d;
    background: var(--navy-2);
    text-align: center;
}

.partner-balance strong {
    margin-top: 7px;
    font-size: 23px;
    line-height: 1;
}

.partner-balance small {
    margin-top: 10px;
    font-weight: 800;
}

.balance-negative {
    color: var(--red);
}

.balance-positive {
    color: #6be2a7;
}

.partner-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
    padding: 12px 22px;
}

.header-action {
    min-width: 126px;
    padding: 13px 18px;
    color: #fff;
    text-align: center;
    text-decoration: none;
    background: #121f35;
    font-size: 13px;
    font-weight: 800;
}

.partner-client {
    min-width: 174px;
    padding: 10px 16px;
    border: 1px solid #34445d;
    text-align: right;
}

.partner-client strong {
    display: block;
    margin-top: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-logout {
    padding: 11px 13px;
    border: 1px solid #34445d;
    color: #dbe4f2;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.header-logout:hover {
    border-color: var(--orange);
    color: #fff;
}

.partner-workspace {
    min-height: 600px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 8px;
    padding: 9px;
}

.catalog-panel,
.cart-panel {
    border: 1px solid #8995a5;
    background: var(--panel);
}

.catalog-panel {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto minmax(360px, 1fr) auto;
    padding: 14px 16px 10px;
}

.panel-heading h1,
.cart-heading h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -0.01em;
}

.panel-heading p,
.cart-help {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.search-box {
    height: 49px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    border: 1px solid #8491a2;
    background: #eef3f9;
}

.search-icon {
    margin-left: 13px;
    color: #516f9b;
    font-size: 27px;
}

.search-box input {
    min-width: 0;
    flex: 1;
    height: 100%;
    border: 0;
    outline: 0;
    color: #0b1525;
    background: transparent;
    font-size: 15px;
}

.search-box input::placeholder {
    color: #8694a8;
}

.results-table-wrap {
    min-height: 0;
    margin-top: 8px;
    overflow: auto;
    border: 1px solid #8995a5;
    background: #fff;
}

.results-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.results-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 40px;
    padding: 8px 10px;
    color: #050b16;
    background: #e6edf6;
    text-align: left;
    font-weight: 900;
    white-space: nowrap;
}

.results-table td {
    padding: 9px 10px;
    border-top: 1px solid #edf0f4;
}

.results-table th:nth-child(1) { width: 15%; }
.results-table th:nth-child(2) { width: 19%; }
.results-table th:nth-child(3) { width: 23%; }
.results-table th:nth-child(4) { width: 11%; }
.results-table th:nth-child(5) { width: 8%; }
.results-table th:nth-child(6) { width: 11%; }
.results-table th:nth-child(7) { width: 8%; }
.results-table th:nth-child(8) { width: 9%; }

.empty-row td {
    height: 390px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #63728a;
    text-align: center;
}

.empty-state-icon {
    margin-bottom: 14px;
    color: #8093ad;
    font-size: 35px;
}

.empty-state strong {
    color: #39485d;
}

.empty-state small {
    margin-top: 6px;
}

.selected-bar {
    min-height: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 7px 12px;
    border: 1px solid #c5cfdb;
    color: #657791;
    background: #f6f9fd;
    font-size: 12px;
}

.cart-panel {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 9px;
}

.cart-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cart-counter {
    padding: 7px 12px;
    color: #1f5be0;
    background: #dce7ff;
    font-size: 12px;
    font-weight: 900;
}

.cart-list {
    min-height: 200px;
    flex: 1;
    margin-top: 10px;
    padding: 7px;
    border: 1px solid #d3dce7;
    background: #f7f9fc;
}

.cart-empty {
    height: 100%;
    min-height: 180px;
    display: grid;
    place-items: center;
    border: 1px solid #e2e7ee;
    color: #9aa6b6;
    font-size: 12px;
}

.cart-total {
    margin-top: 8px;
    padding: 13px 16px;
    color: #fff;
    background: var(--navy);
}

.cart-total span {
    display: block;
    color: #b7c6dc;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.cart-total strong {
    display: block;
    margin-top: 9px;
    font-size: 21px;
}

.cart-button {
    width: 100%;
    min-height: 39px;
    margin-top: 5px;
    border: 0;
    font-size: 12px;
    font-weight: 900;
}

.cart-button:disabled {
    opacity: 1;
    cursor: default;
}

.cart-button-blue {
    color: #fff;
    background: var(--blue);
}

.cart-button-orange {
    color: #fff;
    background: var(--orange);
}

.cart-button-dark {
    color: #fff;
    background: #4d5f77;
}

.cart-button-light {
    color: #0d172b;
    background: #dfe7f2;
}

.partner-footer {
    min-height: 64px;
    padding: 10px 20px;
    color: #fff;
    background: var(--footer);
    font-size: 12px;
    line-height: 1.85;
}

.partner-footer strong {
    display: inline-block;
    min-width: 230px;
    margin-right: 2px;
}

.footer-oem {
    color: #ff8a25;
}

.footer-aftermarket {
    color: #4da6ff;
}

/* Login page retained, but brought closer to the Partner visual language. */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #07101f;
}

.auth-shell {
    width: min(1120px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: 1fr 0.86fr;
    overflow: hidden;
    border: 1px solid #26354d;
    border-radius: 22px;
    background: #0d172b;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.brand-panel,
.login-panel {
    padding: clamp(38px, 5vw, 70px);
}

.brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background: #0b203a;
}

.brand-mark,
.mobile-brand {
    font-size: 38px;
    font-weight: 900;
}

.brand-mark span,
.mobile-brand span {
    color: var(--orange);
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--orange);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-panel h1 {
    max-width: 620px;
    margin: 28px 0 0;
    font-size: clamp(38px, 5vw, 60px);
    line-height: 1.08;
}

.brand-copy {
    max-width: 520px;
    color: #9eb0c9;
    font-size: 17px;
    line-height: 1.6;
}

.brand-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #23b875;
    box-shadow: 0 0 0 6px rgba(35, 184, 117, 0.14);
}

.login-panel {
    display: grid;
    place-items: center;
    color: #0b1525;
    background: #fff;
}

.login-card {
    width: min(410px, 100%);
}

.mobile-brand {
    display: none;
    margin-bottom: 30px;
}

.login-card h2 {
    margin: 0;
    font-size: 38px;
}

.muted {
    margin: 10px 0 28px;
    color: #6a7890;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #f1b8b8;
    color: #a82a2a;
    background: #fff1f1;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 9px;
}

.login-form label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 900;
}

.login-form input {
    height: 52px;
    padding: 0 14px;
    border: 1px solid #c5cfdb;
    outline: 0;
    background: #f8fafc;
}

.login-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(47, 102, 234, 0.13);
}

.login-form button {
    height: 52px;
    margin-top: 16px;
    border: 0;
    color: #fff;
    background: var(--orange);
    font-weight: 900;
    cursor: pointer;
}

.login-form button:hover {
    background: var(--orange-dark);
}

.support-note {
    color: #7b879a;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 1050px) {
    .partner-header {
        grid-template-columns: 1fr auto;
    }

    .partner-balance {
        grid-row: 1;
        grid-column: 2;
    }

    .partner-actions {
        grid-column: 1 / -1;
        border-top: 1px solid #2b3a52;
    }

    .partner-workspace {
        grid-template-columns: 1fr;
    }

    .cart-panel {
        min-height: 430px;
    }
}

@media (max-width: 720px) {
    .partner-brand-block {
        padding: 15px;
    }

    .partner-brand {
        font-size: 21px;
    }

    .partner-balance {
        min-width: 145px;
    }

    .partner-actions {
        justify-content: space-between;
        gap: 8px;
        padding: 10px 12px;
    }

    .partner-client {
        min-width: 0;
        flex: 1;
    }

    .header-action {
        display: none;
    }

    .partner-workspace {
        padding: 6px;
    }

    .catalog-panel,
    .cart-panel {
        padding: 12px;
    }

    .panel-heading h1 {
        font-size: 18px;
    }

    .results-table-wrap {
        min-height: 420px;
    }

    .partner-footer strong {
        display: block;
        min-width: 0;
    }

    .auth-body {
        padding: 0;
    }

    .auth-shell {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
    }

    .brand-panel {
        display: none;
    }

    .mobile-brand {
        display: block;
    }
}


.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.result-counter {
    flex: 0 0 auto;
    padding: 7px 11px;
    color: #1e55c9;
    background: #dce7ff;
    font-size: 12px;
    font-weight: 900;
}

.search-box {
    padding-right: 5px;
}

.search-box input {
    padding: 0;
}

.search-submit {
    height: 39px;
    min-width: 84px;
    border: 0;
    color: #fff;
    background: var(--blue);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.search-submit:hover {
    background: var(--blue-dark);
}

.search-clear {
    width: 30px;
    color: #657791;
    text-align: center;
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
}

.search-alert {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #e5a9a9;
    color: #9b2727;
    background: #fff1f1;
    font-size: 12px;
    font-weight: 800;
}

.result-row {
    cursor: default;
}

.result-row:nth-child(even) {
    background: #f8fafc;
}

.result-row:hover {
    background: #edf4ff;
}

.article-number {
    color: #0b2758;
    font-weight: 900;
}

.price-retail {
    color: #45556c;
    font-weight: 700;
    white-space: nowrap;
}

.discount-cell {
    color: #d45c0b;
    font-weight: 900;
    white-space: nowrap;
}

.price-client {
    color: #0d4fd0;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .search-submit {
        min-width: 70px;
    }
}


.results-form {
    min-height: 0;
    display: contents;
}

.results-table {
    min-width: 1060px;
}

.results-table th.select-column {
    width: 38px;
    padding: 0;
}

.results-table th:nth-child(2) { width: 14%; }
.results-table th:nth-child(3) { width: 18%; }
.results-table th:nth-child(4) { width: 22%; }
.results-table th:nth-child(5) { width: 11%; }
.results-table th:nth-child(6) { width: 8%; }
.results-table th:nth-child(7) { width: 11%; }
.results-table th:nth-child(8) { width: 8%; }
.results-table th:nth-child(9) { width: 9%; }

.select-cell {
    text-align: center;
}

.select-cell input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.result-row:has(input:checked) {
    background: #dceaff;
    outline: 1px solid #7da5f5;
    outline-offset: -1px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #4f6078;
    font-size: 12px;
    font-weight: 800;
}

.quantity-control input {
    width: 74px;
    height: 28px;
    padding: 0 7px;
    border: 1px solid #aeb9c8;
    background: #fff;
    text-align: center;
    font-weight: 900;
}

.cart-message {
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid #9acbb4;
    color: #176d48;
    background: #effaf4;
    font-size: 12px;
    font-weight: 800;
}

.cart-message-error {
    border-color: #e4aaaa;
    color: #9a2929;
    background: #fff1f1;
}

.cart-list {
    overflow-y: auto;
}

.cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 9px;
    border-bottom: 1px solid #dfe5ed;
    background: #fff;
}

.cart-line:last-child {
    border-bottom: 0;
}

.cart-line-main {
    min-width: 0;
}

.cart-line-main strong,
.cart-line-main span,
.cart-line-main small {
    display: block;
}

.cart-line-main strong {
    color: #0c1d37;
    font-size: 12px;
}

.cart-line-main span {
    margin-top: 4px;
    overflow: hidden;
    color: #56677f;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-line-main small {
    margin-top: 6px;
    color: #718198;
    font-size: 10px;
}

.cart-line-side {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.cart-line-side > strong {
    color: #0d4fd0;
    font-size: 12px;
    white-space: nowrap;
}

.cart-remove {
    width: 24px;
    height: 24px;
    border: 1px solid #d5dde8;
    color: #8e2630;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 18px;
}

.cart-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}


.cart-button-orange:not(:disabled) {
    cursor: pointer;
}

.cart-button-orange:not(:disabled):hover {
    background: var(--orange-dark);
}
