* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f5f7;
    color: #20232a;
}

a {
    color: inherit;
}

.topbar {
    height: 64px;
    background: #15171a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.topbar strong {
    margin-right: 12px;
    letter-spacing: 1px;
}

.top-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.container {
    width: min(1280px, calc(100% - 40px));
    margin: 32px auto 80px;
}

.container.narrow {
    max-width: 900px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

h1 {
    margin: 0 0 6px;
}

h2 {
    margin-top: 0;
}

.muted {
    color: #737881;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid #d5d8dd;
    background: white;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
}

.btn.primary {
    background: #15171a;
    color: white;
    border-color: #15171a;
}

.btn.large {
    min-height: 50px;
    padding-left: 28px;
    padding-right: 28px;
}

.btn.full {
    width: 100%;
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.stat {
    background: white;
    border: 1px solid #e1e3e7;
    border-radius: 12px;
    padding: 18px;
}

.stat small {
    display: block;
    color: #777;
    margin-bottom: 8px;
}

.stat strong {
    font-size: 24px;
}

.card,
.form-card {
    background: white;
    border: 1px solid #e1e3e7;
    border-radius: 12px;
}

.form-card {
    padding: 24px;
    margin-bottom: 20px;
}

.filters {
    display: grid;
    grid-template-columns: 1fr 220px auto;
    gap: 10px;
    margin-bottom: 18px;
}

input,
textarea,
select {
    width: 100%;
    font: inherit;
    border: 1px solid #ccd0d7;
    border-radius: 8px;
    padding: 11px 12px;
    background: white;
}

textarea {
    resize: vertical;
}

label {
    display: block;
    font-weight: 600;
    margin: 18px 0 7px;
}

.grid.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 15px 16px;
    border-bottom: 1px solid #eceef1;
}

th {
    font-size: 13px;
    color: #70757e;
    background: #fafafa;
}

.click-row {
    cursor: pointer;
}

.click-row:hover {
    background: #f7f8fa;
}

.status {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: #eceef1;
}

.status-signed {
    background: #dff5e5;
}

.status-draft {
    background: #eceef1;
}

.status-sent,
.status-viewed,
.status-otp_pending {
    background: #fff0c7;
}

.status-cancelled {
    background: #ffe0e0;
}

.status-completed {
    background: #dfeaff;
}

.status.big {
    font-size: 14px;
    padding: 9px 12px;
}

.section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.stage-editor {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #dfe2e7;
    border-radius: 10px;
    background: #fafbfc;
}

.stage-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stage-title {
    font-size: 18px;
}

.remove-stage,
.link-button {
    border: 0;
    background: none;
    cursor: pointer;
    color: #a22;
}

.money-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    border-top: 2px solid #eceef1;
    margin-top: 24px;
    padding-top: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-box {
    width: min(420px, calc(100% - 30px));
    background: white;
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 32px;
}

.brand {
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.login-box .btn {
    margin-top: 22px;
}

.alert {
    padding: 13px;
    margin: 16px 0;
    border-radius: 8px;
    background: #ffe5e5;
    color: #851d1d;
}

.empty {
    padding: 50px;
    text-align: center;
    color: #777;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.details {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
}

.details dt {
    color: #777;
}

.details dd {
    margin: 0;
}

.description {
    white-space: pre-wrap;
    line-height: 1.55;
}

.stage-view {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 15px;
    padding: 16px 0;
    border-bottom: 1px solid #eceef1;
}

.stage-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #15171a;
    color: white;
    display: grid;
    place-items: center;
    font-weight: bold;
}

.stage-content p {
    margin: 6px 0;
}

.stage-price {
    font-weight: bold;
    white-space: nowrap;
}

.version-row {
    display: grid;
    grid-template-columns: 150px 1fr 180px;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eceef1;
    align-items: center;
}

.version-row small {
    display: block;
    color: #777;
    margin-top: 4px;
}

.version-row code {
    font-size: 11px;
    word-break: break-all;
}

.event {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #eceef1;
}

.event-time {
    color: #777;
}

.contract-number {
    font-size: 14px;
    color: #777;
    margin-bottom: 6px;
}

.back-link {
    text-decoration: none;
}

@media (max-width: 800px) {
    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .filters,
    .grid.two,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .version-row,
    .event {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dde1e7;
    border-radius: 9px;
    margin: 12px 0;
    font-weight: normal;
    line-height: 1.45;
    cursor: pointer;
}

.check-row input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 2px 0 0;
}

.client-sign {
    margin-top: 22px;
    min-height: 58px;
}

.contract-text {
    line-height: 1.6;
}


/* =========================================================
   KADRON CONTRACT — CLIENT UI 2026
   ========================================================= */

.client-body {
    background:
        radial-gradient(circle at top left, #f0f3f8 0, transparent 420px),
        #f6f7f9;
    color: #111827;
    min-height: 100vh;
}

.client-topbar {
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid #e8eaf0;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
}

.client-topbar-inner {
    width: min(1040px, calc(100% - 40px));
    height: 72px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.client-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.client-brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: #111827;
    color: white;
    border-radius: 9px;
    font-weight: 800;
    font-size: 17px;
}

.client-brand strong {
    display: block;
    font-size: 14px;
    letter-spacing: .12em;
}

.client-brand span {
    display: block;
    font-size: 11px;
    color: #8a909b;
    margin-top: 2px;
}

.secure-label {
    color: #657080;
    font-size: 12px;
}

.client-wrap {
    width: min(960px, calc(100% - 40px));
    margin: 52px auto 90px;
}

.contract-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 28px;
}

.eyebrow {
    color: #767e8a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    margin-bottom: 13px;
}

.contract-hero h1 {
    font-size: clamp(30px, 4vw, 46px);
    max-width: 690px;
    line-height: 1.08;
    letter-spacing: -.035em;
    margin: 0;
}

.contract-number-modern {
    color: #858b96;
    margin-top: 12px;
    font-size: 13px;
}

.modern-status {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: #e9ecf0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
}

.modern-status-signed {
    color: #166534;
    background: #dcfce7;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr .8fr 1fr;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: white;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(17,24,39,.035);
}

.summary-item {
    min-height: 92px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #edf0f3;
}

.summary-item:last-child {
    border-right: 0;
}

.summary-item span {
    font-size: 11px;
    color: #8a919c;
    margin-bottom: 7px;
}

.summary-item strong {
    font-size: 15px;
}

.summary-item .summary-price {
    font-size: 20px;
}

.modern-card {
    background: white;
    border: 1px solid #e6e8ec;
    border-radius: 16px;
    padding: 30px;
    margin-top: 18px;
    box-shadow: 0 8px 30px rgba(17,24,39,.03);
}

.modern-card-title {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 25px;
}

.modern-card-title h2 {
    font-size: 19px;
    margin: 0 0 4px;
    letter-spacing: -.01em;
}

.modern-card-title p {
    margin: 0;
    color: #8a919c;
    font-size: 12px;
}

.section-number {
    width: 34px;
    height: 25px;
    border-radius: 7px;
    background: #f0f2f5;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    font-size: 10px;
    color: #737b87;
    font-weight: 800;
}

.party-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.party-box {
    border: 1px solid #e9ebef;
    background: #fafbfc;
    border-radius: 12px;
    padding: 21px;
}

.party-label {
    display: block;
    font-size: 9px;
    color: #8d949f;
    font-weight: 800;
    letter-spacing: .13em;
    margin-bottom: 10px;
}

.party-box strong {
    font-size: 15px;
}

.party-box p {
    color: #6c7480;
    font-size: 13px;
    line-height: 1.6;
    margin: 8px 0 0;
}

.service-highlight {
    border-left: 3px solid #111827;
    padding: 3px 0 3px 18px;
}

.service-highlight strong {
    font-size: 16px;
}

.service-highlight p {
    color: #626b77;
    line-height: 1.7;
    margin: 9px 0 0;
    white-space: pre-wrap;
}

.modern-stage-table {
    border: 1px solid #e8eaee;
    border-radius: 12px;
    overflow: hidden;
}

.modern-stage-head {
    display: grid;
    grid-template-columns: 65px 1fr 130px;
    padding: 12px 17px;
    background: #f7f8fa;
    border-bottom: 1px solid #e7e9ed;
    color: #8a919d;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.modern-stage-head div:last-child {
    text-align: right;
}

.modern-stage-row {
    display: grid;
    grid-template-columns: 65px 1fr 130px;
    align-items: center;
    padding: 18px 17px;
    border-bottom: 1px solid #eef0f3;
}

.stage-circle {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: #111827;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

.modern-stage-description strong {
    font-size: 14px;
}

.modern-stage-description p {
    margin: 5px 0 0;
    color: #808792;
    font-size: 12px;
    line-height: 1.5;
}

.modern-stage-price {
    text-align: right;
    font-size: 14px;
    font-weight: 700;
}

.modern-total {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 50px;
    background: #fafbfc;
}

.modern-total div {
    font-size: 12px;
    color: #737b87;
}

.modern-total strong {
    font-size: 21px;
}

.terms {
    display: grid;
    gap: 0;
}

.term {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 13px;
    padding: 17px 0;
    border-bottom: 1px solid #eff1f3;
}

.term:last-child {
    border-bottom: 0;
}

.term > span {
    color: #a0a6af;
    font-size: 11px;
    font-weight: 800;
}

.term strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.term p {
    max-width: 760px;
    color: #68717d;
    font-size: 13px;
    line-height: 1.65;
    margin: 0;
}

.acceptance-card {
    border-color: #d9dde3;
}

.modern-check {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 13px;
    align-items: flex-start;
    border: 1px solid #e5e7eb;
    padding: 17px;
    border-radius: 11px;
    margin: 11px 0;
    cursor: pointer;
    font-weight: 400;
    transition: .15s ease;
}

.modern-check:hover {
    border-color: #aeb4be;
    background: #fafbfc;
}

.modern-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modern-check-box {
    width: 21px;
    height: 21px;
    border: 1.5px solid #aeb4bd;
    border-radius: 6px;
    position: relative;
}

.modern-check input:checked + .modern-check-box {
    background: #111827;
    border-color: #111827;
}

.modern-check input:checked + .modern-check-box:after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.modern-check > span:last-child {
    color: #68717d;
    font-size: 12.5px;
    line-height: 1.55;
}

.modern-check strong {
    display: block;
    color: #202630;
    margin-bottom: 4px;
    font-size: 13px;
}

.sign-summary {
    margin-top: 25px;
    border-top: 1px solid #e7e9ed;
    padding-top: 22px;
    display: grid;
    grid-template-columns: 1fr minmax(280px, 390px);
    gap: 25px;
    align-items: center;
}

.sign-summary > div span {
    display: block;
    font-size: 11px;
    color: #818995;
    margin-bottom: 4px;
}

.sign-summary > div strong {
    font-size: 24px;
}

.modern-sign-button {
    border: 0;
    border-radius: 11px;
    background: #111827;
    color: white;
    min-height: 62px;
    padding: 11px 20px;
    cursor: pointer;
    text-align: left;
    transition: .15s ease;
}

.modern-sign-button:hover {
    background: #232a36;
    transform: translateY(-1px);
}

.modern-sign-button span {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.modern-sign-button small {
    display: block;
    margin-top: 3px;
    color: #c7cbd2;
}

.sign-note {
    text-align: right;
    color: #9299a3;
    font-size: 10.5px;
    margin: 10px 0 0;
}

.signed-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 21px;
    border-radius: 14px;
    background: #effcf3;
    border: 1px solid #ccebd5;
    margin: 18px 0;
}

.signed-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #15803d;
    color: white;
    font-weight: 800;
}

.signed-banner strong,
.signed-banner span {
    display: block;
}

.signed-banner strong {
    color: #14532d;
    margin-bottom: 3px;
}

.signed-banner span {
    color: #4f7c5e;
    font-size: 12px;
}

.download-card {
    background: #111827;
    color: white;
    border-radius: 16px;
    padding: 23px 25px;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.download-card strong,
.download-card span {
    display: block;
}

.download-card span {
    color: #aeb5c0;
    font-size: 12px;
    margin-top: 4px;
}

.modern-download-button {
    color: #111827;
    background: white;
    border-radius: 9px;
    padding: 12px 18px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.modern-alert {
    display: flex;
    flex-direction: column;
    padding: 16px 19px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    border-radius: 12px;
    margin: 15px 0;
    color: #991b1b;
}

.modern-alert span {
    font-size: 12px;
    margin-top: 3px;
}

.client-footer {
    padding: 30px 4px;
    margin-top: 22px;
    color: #9299a4;
    font-size: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand .client-brand-mark {
    width: 26px;
    height: 26px;
    font-size: 12px;
    border-radius: 7px;
}

.footer-brand strong {
    font-size: 10px;
}

@media (max-width: 720px) {

    .client-topbar-inner,
    .client-wrap {
        width: min(100% - 28px, 960px);
    }

    .secure-label {
        display: none;
    }

    .client-wrap {
        margin-top: 30px;
    }

    .contract-hero {
        flex-direction: column;
        gap: 16px;
    }

    .contract-hero h1 {
        font-size: 30px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .summary-item:nth-child(2) {
        border-right: 0;
    }

    .summary-item {
        border-bottom: 1px solid #edf0f3;
    }

    .party-grid {
        grid-template-columns: 1fr;
    }

    .modern-card {
        padding: 21px;
        border-radius: 14px;
    }

    .modern-stage-head {
        display: none;
    }

    .modern-stage-row {
        grid-template-columns: 43px 1fr;
        gap: 8px;
    }

    .modern-stage-price {
        grid-column: 2;
        text-align: left;
        margin-top: 7px;
    }

    .modern-total {
        justify-content: space-between;
        gap: 15px;
    }

    .sign-summary {
        grid-template-columns: 1fr;
    }

    .sign-note {
        text-align: left;
    }

    .download-card {
        flex-direction: column;
        align-items: stretch;
    }

    .modern-download-button {
        text-align: center;
    }

}

.client-body,
.client-body button,
.client-body input,
.client-body textarea {
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
}

