/**
 * CordeoCRM Satış Yönetimi
 * Modüle özel yerleşim kurallarıdır. Buton, modal, sekme, form ve tablo
 * geometrileri merkezi UI çekirdeğinden gelir.
 */

html body.ccrm-app.ccrm-ui-v4 .cordeocrm-sales-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
    color: var(--ccrm-text);
    font-family: var(--ccrm-font);
}

html body.ccrm-app.ccrm-ui-v4 .cordeocrm-sales-page .ccrm-ui-page__header {
    margin-bottom: 18px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-alert {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid var(--ccrm-border-soft);
    border-radius: var(--ccrm-radius-sm);
    background: var(--ccrm-surface);
    font-size: 11.5px;
    line-height: 1.5;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-alert.is-success {
    border-color: #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-alert.is-error {
    border-color: #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-subtabs {
    margin-top: 8px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0 0;
    border-top: 1px solid var(--ccrm-border-soft);
    border-bottom: 1px solid var(--ccrm-border-soft);
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary > button {
    appearance: none;
    display: grid;
    min-width: 0;
    min-height: 92px;
    align-content: center;
    gap: 4px;
    padding: 14px 20px;
    border: 0;
    border-right: 1px solid var(--ccrm-border-soft);
    background: transparent;
    color: var(--ccrm-text);
    text-align: left;
    cursor: pointer;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary > button:last-child {
    border-right: 0;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary > button:hover,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary > button:focus-visible {
    background: var(--ccrm-hover);
    outline: 0;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary span {
    color: var(--ccrm-muted);
    font-size: 10.5px;
    font-weight: 500;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary strong {
    color: var(--ccrm-text);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.15;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary small {
    color: var(--ccrm-muted);
    font-size: 11px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-bulk-bar {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 8px 10px;
    border: 1px solid var(--ccrm-border-soft);
    border-radius: var(--ccrm-radius-sm);
    background: var(--ccrm-hover);
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-bulk-bar > strong {
    font-size: 11.5px;
    font-weight: 500;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-bulk-bar > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

html body.ccrm-app.ccrm-ui-v4 .cordeocrm-sales-page .ccrm-ui-list-toolbar {
    margin-top: 18px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-search {
    display: block;
    width: 210px;
    margin: 0;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-search input,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-sort {
    height: 36px;
    min-height: 36px;
    font-size: 11.5px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-sort {
    width: 190px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-total {
    color: var(--ccrm-muted);
    font-size: 11px;
    white-space: nowrap;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-table-wrap,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-table-wrap {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-table {
    min-width: 1030px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-table th,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-table td {
    vertical-align: middle;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-table tbody tr[data-sales-row] {
    cursor: pointer;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-table tbody tr[data-sales-row]:hover,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-table tbody tr[data-sales-row].is-selected {
    background: var(--ccrm-hover);
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-col-check {
    width: 38px;
    min-width: 38px;
    text-align: center;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-col-check input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--ccrm-primary);
    cursor: pointer;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-col-actions {
    width: 64px;
    min-width: 64px;
    text-align: right;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-record-title {
    display: block;
    max-width: 250px;
    overflow: hidden;
    color: var(--ccrm-text);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-type {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 500;
    white-space: nowrap;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-type--lead { color: #15803d; }
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-type--opportunity { color: #c2410c; }
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-type--quote { color: #4f46e5; }
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-type--order { color: #b91c1c; }
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-type--contract { color: #a16207; }

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-status {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-status.is-waiting,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-status.is-neutral {
    background: #f8fafc;
    color: #64748b;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-status.is-approved,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-status.is-positive {
    background: #ecfdf5;
    color: #047857;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-status.is-rejected {
    background: #fef2f2;
    color: #b91c1c;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-pagination__button {
    appearance: none;
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ccrm-border);
    border-radius: var(--ccrm-radius-xs);
    background: var(--ccrm-surface);
    color: var(--ccrm-muted);
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-pagination__button:hover,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-pagination__button:focus-visible,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-pagination__button.is-active {
    border-color: var(--ccrm-primary);
    background: var(--ccrm-primary);
    color: #fff;
    outline: 0;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-choice {
    display: grid;
    min-height: 92px;
    align-content: center;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--ccrm-border-soft);
    border-radius: var(--ccrm-radius-sm);
    background: var(--ccrm-surface);
    color: var(--ccrm-text);
    text-decoration: none;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-choice:hover,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-choice:focus-visible {
    border-color: var(--ccrm-primary);
    background: var(--ccrm-hover);
    outline: 0;
    text-decoration: none;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-choice strong {
    font-size: 12px;
    font-weight: 600;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-choice span {
    color: var(--ccrm-muted);
    font-size: 11px;
    line-height: 1.45;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-form-grid > label,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-form-grid .ccrm-sales-field {
    display: grid;
    align-content: start;
    gap: 6px;
    margin: 0;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-label-text,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-form-grid > label > span {
    color: var(--ccrm-text);
    font-size: 11.5px;
    font-weight: 500;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-inline-required {
    color: var(--ccrm-danger);
    font-style: normal;
    font-weight: 500;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-full,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-section,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-taxonomy-fields {
    grid-column: 1 / -1;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-section {
    margin-top: 4px;
    padding: 10px 0 4px;
    border-bottom: 1px solid var(--ccrm-border-soft);
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-section strong {
    font-size: 12px;
    font-weight: 600;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-field-help {
    color: var(--ccrm-muted);
    font-size: 10.5px;
    line-height: 1.4;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-table {
    min-width: 760px;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-table tbody tr[data-sales-open-modal] {
    cursor: pointer;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-table tbody tr[data-sales-open-modal]:hover {
    background: var(--ccrm-hover);
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-confirm-text {
    margin: 0;
    color: var(--ccrm-text);
    font-size: 12px;
    line-height: 1.6;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-confirm-text strong {
    font-weight: 600;
}

html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-record-modal .ccrm-payment-box,
html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-record-modal [data-ccrm-payments-box] {
    margin-top: 20px;
}

@media (max-width: 900px) {
    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary {
        grid-template-columns: 1fr;
    }

    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary > button {
        border-right: 0;
        border-bottom: 1px solid var(--ccrm-border-soft);
    }

    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-opportunity-summary > button:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 767px) {
    html body.ccrm-app.ccrm-ui-v4 .cordeocrm-sales-page {
        width: calc(100% - 24px);
        padding: 22px 0 48px;
    }

    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-subtabs {
        margin-top: 6px;
    }

    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-bulk-bar,
    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-bulk-bar > div {
        align-items: stretch;
        flex-direction: column;
    }

    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-search,
    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-sort {
        width: 100%;
    }

    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-choice-grid,
    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-form-grid {
        grid-template-columns: 1fr;
    }

    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-full,
    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-modal-section,
    html body.ccrm-app.ccrm-ui-v4 .ccrm-sales-taxonomy-fields {
        grid-column: auto;
    }
}
