:root {
    --cp-bg: #f7f8f3;
    --cp-surface: #ffffff;
    --cp-surface-soft: #f1f6ef;
    --cp-primary: #4f7d63;
    --cp-primary-dark: #365c49;
    --cp-primary-light: #dfece2;
    --cp-text: #24332b;
    --cp-text-soft: #6f7d75;
    --cp-border: #dfe7e1;
    --cp-danger: #c75b5b;
    --cp-danger-soft: #fff0f0;
    --cp-warning: #c28a35;
    --cp-warning-soft: #fff7e7;
    --cp-success: #4f7d63;
    --cp-success-soft: #edf7ef;
    --cp-radius-sm: 10px;
    --cp-radius-md: 16px;
    --cp-radius-lg: 24px;
    --cp-shadow-sm: 0 6px 18px rgba(43, 70, 55, 0.06);
    --cp-shadow-md: 0 16px 40px rgba(43, 70, 55, 0.10);
    --cp-transition: 180ms ease;
    /* Tüm uygulama ekranlarının ortak yerleşim standardı */
    --cp-content-max-width: 1500px;
    --cp-content-padding: 32px;
    --cp-page-section-gap: 22px;
    --cp-summary-card-height: 132px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
    scrollbar-gutter: stable;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--cp-bg);
    color: var(--cp-text);
    font-family: "Manrope", "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--cp-primary);
    text-decoration: none;
}

    a:hover {
        color: var(--cp-primary-dark);
    }

/* =========================================================
   TÜM MODÜLLER İÇİN ORTAK SAYFA YERLEŞİMİ
   ========================================================= */

.cp-page-shell {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.cp-module-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    margin-bottom: 28px;
}

    .cp-module-header > div {
        min-width: 0;
    }

.cp-module-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--cp-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cp-module-title {
    margin: 0;
    color: var(--cp-text);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.cp-module-subtitle {
    max-width: 650px;
    margin: 9px 0 0;
    color: var(--cp-text-soft);
    font-size: 0.94rem;
    line-height: 1.65;
}

.cp-module-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 10px;
}

    .cp-module-header-actions .cp-btn-ghost,
    .cp-module-header-actions .cp-btn-primary,
    .cp-module-header > .cp-btn-ghost,
    .cp-module-header > .cp-btn-primary {
        flex: 0 0 156px;
        width: 156px;
        min-width: 156px;
        max-width: 156px;
        min-height: 48px;
        padding: 0 16px;
        white-space: nowrap;
    }

/* =========================================================
   ORTAK UYARI ALANLARI
   ========================================================= */

.cp-alert-success,
.cp-alert-error {
    width: 100%;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: var(--cp-radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
}

.cp-alert-success {
    border: 1px solid #cfe3d4;
    background: var(--cp-success-soft);
    color: var(--cp-primary-dark);
}

.cp-alert-error {
    border: 1px solid #efcaca;
    background: #fff3f3;
    color: #9f2f2f;
}

/* =========================================================
   ORTAK ÖZET KARTLARI
   ========================================================= */

.cp-summary-grid,
.cp-income-summary,
.cp-expense-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    margin-bottom: var(--cp-page-section-gap);
}

.cp-income-record-summary,
.cp-income-record-update-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    width: 100%;
    margin-bottom: var(--cp-page-section-gap);
}

.cp-summary-card,
.cp-income-summary-card,
.cp-expense-summary-card {
    display: flex;
    min-width: 0;
    min-height: var(--cp-summary-card-height);
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 22px;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-md);
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow-sm);
}

    .cp-summary-card span,
    .cp-income-summary-card span,
    .cp-expense-summary-card span {
        color: var(--cp-text-soft);
        font-size: 0.8rem;
        font-weight: 600;
    }

    .cp-summary-card strong,
    .cp-income-summary-card strong,
    .cp-expense-summary-card strong {
        color: var(--cp-primary-dark);
        font-size: 1.55rem;
        font-weight: 700;
        letter-spacing: -0.03em;
    }

/* =========================================================
   ORTAK LİSTE KARTI
   ========================================================= */

.cp-list-card {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-lg);
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow-sm);
}

.cp-list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--cp-border);
}

    .cp-list-card-header h2 {
        margin: 0;
        color: var(--cp-text);
        font-size: 1rem;
        font-weight: 700;
    }

    .cp-list-card-header p {
        margin: 5px 0 0;
        color: var(--cp-text-soft);
        font-size: 0.78rem;
    }

.cp-list-count {
    flex-shrink: 0;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--cp-primary-light);
    color: var(--cp-primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

/* =========================================================
   ORTAK FORM YAPISI
   ========================================================= */

.cp-form-card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-lg);
    background: var(--cp-surface);
    box-shadow: var(--cp-shadow-sm);
}

.cp-module-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cp-form-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.cp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.cp-form-group-full {
    grid-column: 1 / -1;
}

.cp-label {
    color: var(--cp-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.cp-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-sm);
    background: var(--cp-surface);
    color: var(--cp-text);
    outline: none;
    transition: border-color var(--cp-transition), box-shadow var(--cp-transition), background-color var(--cp-transition);
}

    .cp-input::placeholder {
        color: #a0aaa4;
    }

    .cp-input:hover {
        border-color: #c8d6cc;
    }

    .cp-input:focus {
        border-color: var(--cp-primary);
        box-shadow: 0 0 0 4px rgba(79, 125, 99, 0.13);
    }

.cp-select {
    cursor: pointer;
}

.cp-money-field {
    position: relative;
}

.cp-money-symbol {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    color: var(--cp-primary-dark);
    font-weight: 800;
    transform: translateY(-50%);
}

.cp-money-input {
    padding-left: 38px;
}

.cp-field-help {
    color: var(--cp-text-soft);
    font-size: 0.75rem;
    line-height: 1.5;
}

.cp-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cp-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--cp-primary);
    cursor: pointer;
}

.cp-checkbox-label {
    color: var(--cp-text-soft);
    font-size: 0.9rem;
    cursor: pointer;
}

.cp-optional-toggle {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 16px;
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-sm);
    background: var(--cp-surface-soft);
}

    .cp-conditional-field[hidden],
    .cp-optional-toggle[hidden] {
        display: none;
    }

.cp-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 6px;
    padding-top: 22px;
    border-top: 1px solid var(--cp-border);
}

/* =========================================================
   ORTAK BUTONLAR
   ========================================================= */

.cp-btn-primary,
.cp-btn-ghost {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--cp-radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    transition: background-color var(--cp-transition), border-color var(--cp-transition), color var(--cp-transition), transform var(--cp-transition), box-shadow var(--cp-transition);
}

.cp-btn-primary {
    border-color: var(--cp-primary);
    background: var(--cp-primary);
    color: #ffffff;
}

    .cp-btn-primary:hover {
        border-color: var(--cp-primary-dark);
        background: var(--cp-primary-dark);
        color: #ffffff;
        box-shadow: var(--cp-shadow-sm);
        transform: translateY(-1px);
    }

    .cp-btn-primary:active {
        transform: translateY(0);
    }

.cp-btn-ghost {
    border-color: var(--cp-border);
    background: var(--cp-surface);
    color: var(--cp-text);
}

    .cp-btn-ghost:hover {
        border-color: #c8d6cc;
        background: var(--cp-surface-soft);
        color: var(--cp-primary-dark);
        transform: translateY(-1px);
    }

.cp-btn-block {
    width: 100%;
}

/* =========================================================
   ORTAK ROZETLER
   ========================================================= */

.cp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.cp-badge-active,
.cp-badge-current {
    background: var(--cp-success-soft);
    color: var(--cp-primary-dark);
}

.cp-badge-passive,
.cp-badge-ended {
    background: #f0f1ef;
    color: var(--cp-text-soft);
}

.cp-badge-planned,
.cp-badge-required {
    background: #fff3d6;
    color: #8a6516;
}

.cp-badge-optional {
    background: #eef2f7;
    color: #5f6875;
}

.cp-badge-partial {
    background: #e9f1ff;
    color: #315e9b;
}

/* =========================================================
   ORTAK TABLO İŞLEM BUTONLARI
   ========================================================= */

.cp-table-action-link,
.cp-table-action-status,
.cp-table-action-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
}

.cp-table-action-link {
    border: 1px solid var(--cp-border);
    background: var(--cp-surface);
    color: var(--cp-primary-dark);
}

    .cp-table-action-link:hover {
        border-color: var(--cp-primary);
        background: var(--cp-primary-light);
        color: var(--cp-primary-dark);
    }

.cp-table-action-status {
    border: 1px solid #dfcfa7;
    background: #fffaf0;
    color: #866317;
}

    .cp-table-action-status:hover {
        border-color: #c9ab62;
        background: #fff1cf;
        color: #6f500d;
    }

.cp-table-action-delete {
    border: 1px solid #efcaca;
    background: #fff7f7;
    color: #a43b3b;
}

    .cp-table-action-delete:hover {
        border-color: #d99a9a;
        background: #fdeaea;
        color: #8f2929;
    }

.cp-table-action-disabled {
    color: var(--cp-text-soft);
    font-size: 0.72rem;
}

/* =========================================================
   VALIDATION
   ========================================================= */

.cp-validation-summary {
    display: none;
    padding: 12px 14px;
    border: 1px solid #efcccc;
    border-radius: var(--cp-radius-sm);
    background: var(--cp-danger-soft);
    color: var(--cp-danger);
    font-size: 0.9rem;
}

    .cp-validation-summary.validation-summary-errors {
        display: block;
    }

    .cp-validation-summary ul {
        margin: 0;
        padding-left: 18px;
    }

.cp-validation-message {
    min-height: 18px;
    color: var(--cp-danger);
    font-size: 0.8rem;
}

.input-validation-error {
    border-color: var(--cp-danger);
    background: #fffafa;
}

    .input-validation-error:focus {
        border-color: var(--cp-danger);
        box-shadow: 0 0 0 4px rgba(199, 91, 91, 0.12);
    }

/* =========================================================
   TABLET VE MOBİL ORTAK STANDARDI
   ========================================================= */

@media (max-width: 820px) {
    .cp-module-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 24px;
    }

    .cp-module-header-actions {
        width: 100%;
    }

        .cp-module-header-actions .cp-btn-ghost,
        .cp-module-header-actions .cp-btn-primary {
            flex: 1 1 0;
            width: auto;
            min-width: 0;
            max-width: none;
        }
}

@media (max-width: 760px) {
    .cp-summary-grid,
    .cp-income-summary,
    .cp-expense-summary {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .cp-summary-card,
    .cp-income-summary-card,
    .cp-expense-summary-card {
        min-height: 118px;
    }

    .cp-list-card-header {
        align-items: flex-start;
        padding: 19px 18px;
    }

    .cp-form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .cp-form-group-full {
        grid-column: 1;
    }
}

@media (max-width: 640px) {
    .cp-form-card {
        padding: 22px 18px;
        border-radius: var(--cp-radius-md);
    }

    .cp-form-actions {
        flex-direction: column-reverse;
    }

        .cp-form-actions .cp-btn-ghost,
        .cp-form-actions .cp-btn-primary {
            width: 100%;
        }
}

@media (max-width: 520px) {
    .cp-module-header-actions {
        flex-direction: column;
    }

        .cp-module-header-actions .cp-btn-ghost,
        .cp-module-header-actions .cp-btn-primary,
        .cp-module-header > .cp-btn-ghost,
        .cp-module-header > .cp-btn-primary {
            width: 100%;
            min-width: 0;
            max-width: none;
        }
}
.cp-alert-warning {
    width: 100%;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #ead9ad;
    border-radius: var(--cp-radius-sm);
    background: var(--cp-warning-soft);
    color: #7c5a18;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.55;
}