/* Genel renk paleti ve değişkenler */
:root {
    --color-background: #F4F6F8;
    --color-card-bg: #FFFFFF;
    --color-primary: #0A1931;
    --color-primary-light: #185ADB;
    --color-text: #1A1A1A;
    --shadow-card: 0 6px 20px rgba(0, 0, 0, 0.08);
    --radius-lg: 16px;
    --radius-md: 12px;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-background);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-light);
}

/* Login sayfası */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(10, 25, 49, 0.85), rgba(24, 90, 219, 0.65));
    padding: 40px 16px;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
}

.login-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 24px;
}

.login-submit {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    font-weight: 600;
}

.login-submit:hover,
.login-submit:focus {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

/* Uygulama düzeni */
.app-body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--color-primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    gap: 16px;
    box-shadow: 0 4px 16px rgba(10, 25, 49, 0.18);
}

.app-header__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 12px;
    border-radius: 999px;
}

.month-label {
    font-weight: 600;
    font-family: var(--font-heading);
    color: #FFFFFF;
    min-width: 120px;
    text-align: center;
}

.btn-icon {
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1;
}

.logout-btn {
    border-radius: var(--radius-md);
    font-weight: 500;
}

.logout-btn:hover,
.logout-btn:focus {
    color: #FFFFFF;
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 1200px; /* Masaüstü için genişletildi */
    margin: 40px auto;
    padding: 0 24px 40px;
}

.app-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
}

.app-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.app-card__title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    margin: 0;
    color: var(--color-primary);
}

.app-card__subtitle {
    margin: 4px 0 0;
    color: #5A6A85;
}

.app-card__actions.header-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.header-actions .top-action-btn {
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #101b3a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.header-actions .top-action-btn:hover {
    background: #18254a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.header-actions .top-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.app-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.app-card__filter-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.app-card__filter-row .form-label {
    font-weight: 500;
    color: var(--color-primary);
}

.app-table-wrapper {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(10, 25, 49, 0.06);
}

.app-table > thead {
    background: rgba(10, 25, 49, 0.05);
    font-weight: 600;
}

.app-table th {
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.85rem;
}

.app-table td {
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge--paid {
    background: rgba(24, 185, 129, 0.12);
    color: #129B66;
}

.status-badge--pending {
    background: rgba(240, 65, 65, 0.12);
    color: #D63C3C;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(10, 25, 49, 0.08);
    color: var(--color-primary);
}

.status-pill--paid {
    background: rgba(24, 185, 129, 0.12);
    color: #129B66;
}

.status-pill--pending {
    background: rgba(240, 65, 65, 0.12);
    color: #D63C3C;
}

.meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-top .badge-tip {
    font-size: 0.7rem;
    padding: 3px 8px;
}

.meta-name {
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.payment-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-title-wrap .payment-toggle-switch {
    display: inline-flex;
    margin: 0;
}

.payment-row-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 4px;
}

.payment-row-top .payment-title-wrap {
    flex: 1;
    min-width: 0;
}

.payment-amount {
    margin-left: auto;
    font-weight: 600;
    font-size: 1rem;
    color: #001833;
    white-space: nowrap;
}

.table-actions-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.price-table {
    display: none;
}

.app-table thead th:nth-child(3),
.app-table tbody td:nth-child(3) {
    display: none;
}

.payment-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.payment-row-top .payment-title-wrap {
    flex: 1;
    min-width: 0;
}

.payment-amount {
    margin-left: auto;
    font-weight: 600;
    font-size: 1rem;
    color: #001833;
    white-space: nowrap;
}

.payment-row-top .table-actions-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.payment-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-title-wrap .payment-toggle-switch {
    display: inline-flex;
    margin: 0;
}

.meta-cat {
    font-size: 0.75rem;
    color: #7b86a2;
    background: #f2f4f7;
    padding: 4px 10px;
    border-radius: 12px;
}

.meta-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.paid-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #7b86a2;
    cursor: pointer;
}

.paid-toggle .form-check-input {
    margin: 0;
}

.meta-note {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #7b86a2;
}

.price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-primary);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 32px;
}

/* MASAÜSTÜ GÖRÜNÜM - SADELEŞTİRME (min-width: 992px) */
@media (min-width: 992px) {
    /* Başlık bloğunu gizle */
    .app-card__title,
    .app-card__subtitle {
        display: none;
    }

    /* Kategori sütununu gizle */
    .app-table thead th:first-child,
    .app-table tbody td:first-child {
        display: none;
    }

    /* Kalem altındaki rozetleri gizle, ama toggle switch'i göster */
    .app-table .meta-badges .badge-tip,
    .app-table .meta-badges .status-badge {
        display: none;
    }

    /* Toggle switch'i görünür yap */
    .app-table .meta-badges .payment-toggle-switch {
        display: inline-block !important;
    }

    /* Kategori yazısını gizle */
    .app-table .meta-category {
        display: none;
    }

    /* Kalem sütununda toggle switch ve isim yan yana */
    .app-table .payment-card-content {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .app-table .meta-name {
        flex: 1;
        min-width: 0;
    }

    .app-table .meta-badges {
        display: flex;
        align-items: center;
        gap: 8px;
        order: -1; /* Toggle switch en başta olsun */
    }

    /* Durum sütununu gizle (4. sütun) */
    .app-table thead th:nth-child(4),
    .app-table tbody td:nth-child(4) {
        display: none;
    }


    /* İşlemler sütunundaki büyük butonları gizle */
    .app-table .table-actions {
        display: none;
    }

    /* İkon butonları göster */
    .app-table .table-actions-icons {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: flex-end;
    }

    /* Toggle switch göster - masaüstünde görünür ve modern */
    .app-table .payment-toggle-switch {
        display: inline-flex !important;
        margin-left: 0;
        margin-right: 16px;
        vertical-align: middle;
        flex-shrink: 0;
    }

    /* İkon butonları için stil */
    .app-table .table-actions-icons .summary-action-btn {
        border: none;
        background: transparent;
        color: var(--color-primary);
        font-size: 1rem;
        line-height: 1;
        padding: 4px 8px;
        border-radius: 4px;
        transition: background-color 0.2s ease, color 0.2s ease;
        cursor: pointer;
    }

    .app-table .table-actions-icons .summary-action-btn:hover,
    .app-table .table-actions-icons .summary-action-btn:focus {
        background: rgba(24, 90, 219, 0.1);
        color: var(--color-primary-light);
    }
}

/* Masaüstü görünümü - 4'lü grid */
@media (min-width: 1200px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet görünümü - 2x2 grid */
@media (min-width: 768px) and (max-width: 1199px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.summary-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border-top: 4px solid var(--color-primary);
}

.summary-card--balance {
    border-top-color: #129B66;
}

.summary-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.summary-card__actions {
    display: inline-flex;
    gap: 8px;
}

.summary-action-btn {
    border: none;
    background: transparent;
    color: var(--color-primary);
    font-size: 1.15rem;
    line-height: 1;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.summary-action-btn:hover,
.summary-action-btn:focus {
    background: rgba(24, 90, 219, 0.1);
    color: var(--color-primary-light);
}

.summary-action-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.summary-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    font-size: 0.75rem;
    color: rgba(10, 25, 49, 0.6);
    background: rgba(10, 25, 49, 0.1);
    border-radius: 50%;
    cursor: help;
}

.summary-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin: 0;
    color: var(--color-primary);
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 12px 0 0;
}

.app-footer {
    background: var(--color-background);
    text-align: center;
    padding: 24px 16px;
    color: #8A94A6;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(10, 25, 49, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
    border-radius: var(--radius-md);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #FFFFFF;
}

.switch-paid {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.table-actions .btn {
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.table-actions .btn .icon {
    font-size: 1rem;
}

.fab-add {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 24px;
    z-index: 100;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(10, 25, 49, 0.25);
}

.fab-add:focus-visible {
    outline: 3px solid rgba(24, 90, 219, 0.3);
    outline-offset: 2px;
}

.success-text {
    color: #1f9d55;
}

.danger-text {
    color: #dc3545;
}

.toast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-card);
}

.modal-header {
    border-bottom: 1px solid rgba(10, 25, 49, 0.08);
}

.modal-footer {
    border-top: 1px solid rgba(10, 25, 49, 0.08);
}

.form-control,
.form-select {
    border-radius: var(--radius-md);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(24, 90, 219, 0.15);
}

.badge-tip {
    font-size: 0.75rem;
    background: rgba(24, 90, 219, 0.15);
    color: var(--color-primary);
    border-radius: 999px;
    padding: 4px 10px;
}

/* paid status indicator */
.paid-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(17, 33, 65, 0.35);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.paid-dot.is-paid {
    border-color: #22c55e;
    background: #22c55e;
}

.kebab {
    display: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 0;
    background: #f2f5fa;
    color: #1d2b4f;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.kebab:focus-visible {
    outline: 2px solid rgba(24, 90, 219, 0.35);
    outline-offset: 2px;
}

.name-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-name {
    font-weight: 600;
    color: var(--color-text);
}

.paid-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(24, 185, 129, 0.15);
    color: #129B66;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.paid-pill.is-pending {
    background: #f0f2f6;
    color: #7b86a2;
}

.btn-edit {
    display: none;
    border: none;
    background: transparent;
    color: var(--color-primary);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-edit:focus-visible {
    outline: 2px solid rgba(24, 90, 219, 0.35);
    outline-offset: 2px;
}

.btn-edit:active {
    transform: scale(0.96);
}

.status-right,
.status-right-pending {
    display: none !important;
}

.badge-sabit-desktop {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 999px;
    background: #eef3ff;
    color: #234aa6;
    font-weight: 600;
}

.container-a4 {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 12px 16px;
}

/* ============================================
   MOBİL RESPONSIVE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .app-card__actions.header-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 10px;
    }

    .header-actions .top-action-btn {
        padding: 6px 4px;
        font-size: 11px;
        border-radius: 10px;
        min-height: 46px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
        background: #101b3a;
        color: #ffffff;
        gap: 2px;
    }

    .header-actions .top-action-btn .icon {
        font-size: 16px;
        margin-bottom: 1px;
    }

    .category-label {
        display: none !important;
    }

    .payment-row-top {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .payment-amount {
        font-size: 0.95rem;
    }

    .status-badge--paid {
        display: none !important;
    }
    .payment-title-wrap {
        gap: 0.4rem;
    }

    .payment-title-wrap .payment-toggle-switch {
        transform: scale(0.95);
        transform-origin: left center;
    }
    /* Header - Mobil Düzenleme */
    .app-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .app-header__brand {
        font-size: 1.05rem;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .app-header__brand span:first-child {
        font-size: 1.2rem;
    }

    .app-header__actions {
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .month-controls {
        flex: 1;
        min-width: 0;
        padding: 6px 10px;
        justify-content: center;
        order: 1;
    }

    .month-label {
        min-width: auto;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }

    .btn-icon {
        padding: 4px 8px;
        font-size: 1.2rem;
        min-width: 32px;
        flex-shrink: 0;
    }

    .logout-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
        flex-shrink: 0;
        order: 2;
    }

    /* Ana İçerik - Mobil Düzenleme */
    .app-main {
        margin: 16px auto;
        padding: 0 12px 24px;
    }

    .app-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .app-card__header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 20px;
    }

    .app-card__title {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    .app-card__subtitle {
        font-size: 0.85rem;
        margin-top: 0;
    }

    /* Aksiyon Butonları - Mobil Grid Düzeni */
    .app-card__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .app-card__actions .btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.875rem;
        border-radius: 10px;
        font-weight: 500;
        box-shadow: 0 2px 8px rgba(10, 25, 49, 0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .app-card__actions .btn:active {
        transform: scale(0.97);
    }

    .app-card__actions .btn-primary {
        grid-column: 1 / -1;
        order: -1;
        padding: 12px 16px;
        font-size: 0.95rem;
        font-weight: 600;
    }

    .app-card__actions .btn-outline-danger {
        grid-column: 1 / -1;
    }

    /* Buton sıralaması: 1. satır: Gelir Ekle + Yeni Kalem Ekle, 2. satır: Sabit Şablonlar + Sabitleri Kopyala, 3. satır: Ayı Temizle */
    .app-card__actions #btn-income-add {
        order: 1;
    }

    .app-card__actions #btn-payment-add {
        order: 2;
        grid-column: auto;
    }

    .app-card__actions #btn-fixed-templates {
        order: 3;
    }

    .app-card__actions #btn-copy-fixed {
        order: 4;
    }

    .app-card__actions #btn-clear-month {
        order: 5;
    }

    /* Kategori Filtresi */
    .app-card__filter-row {
        margin-bottom: 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .app-card__filter-row .form-label {
        font-size: 0.9rem;
    }

    .app-card__filter-row .form-select {
        font-size: 0.875rem;
        padding: 8px 12px;
    }

    /* Tablo - Mobil Kart Görünümü */
    .app-table-wrapper {
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    .app-table {
        display: block;
        width: 100%;
    }

    .app-table thead {
        display: none;
    }

    .app-table tbody {
        display: block;
        width: 100%;
    }

    .app-table tbody tr {
        display: block;
        width: 100%;
        background: var(--color-card-bg);
        border: 1px solid rgba(10, 25, 49, 0.08);
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .app-table tbody tr:active {
        transform: scale(0.98);
    }

    .app-table tbody tr td {
        display: block;
        width: 100%;
        padding: 0;
        border: none;
        text-align: left !important;
    }

    /* Kart İçi Düzen */
    .app-table tbody tr td:first-child {
        /* Kategori - Gizle (artık kalem adının altında gösteriliyor) */
        display: none;
    }

    .app-table tbody tr td:nth-child(2) {
        /* Kalem Adı ve Bilgiler */
        margin-bottom: 0;
        padding-right: 100px; /* Tutar ve ikonlar için alan bırak */
    }

    .app-table tbody tr td:nth-child(3) {
        /* Tutar - Sağ üst köşe, büyük ve net */
        position: absolute;
        top: 8px;
        right: 10px;
        width: auto;
        margin-bottom: 0;
    }

    .app-table tbody tr td:nth-child(3) .price {
        font-size: 16px;
        font-weight: 700;
        color: var(--color-primary);
        white-space: nowrap;
        line-height: 1.2;
    }

    .app-table tbody tr td:nth-child(4) {
        /* Durum - Mobilde gizle (artık meta-badges içinde) */
        display: none;
    }

    .app-table tbody tr td:nth-child(5) {
        /* İşlemler - Tutarın altında ikonlar */
        position: absolute;
        top: 30px;
        right: 10px;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        width: auto;
    }

    /* Kart İçi İçerik Düzenleme */
    .app-table tbody tr {
        position: relative;
    }

    /* Mobil kart içi yapı */
    .payment-card-content {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }


    .meta-badges .badge-tip {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .meta-badges .status-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .meta-badges {
        display: none;
    }

    .payment-toggle-switch {
        width: 40px;
        height: 22px;
        margin: 0;
    }

    .payment-toggle-switch .toggle-slider::before {
        width: 16px;
        height: 16px;
        top: 3px;
        left: 3px;
    }

    .payment-toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(18px);
    }

    .app-table tbody tr {
        padding: 8px 10px;
        margin-bottom: 8px;
        border-radius: 10px;
    }

    /* İşlem Butonları - Mobil */
    .table-actions {
        display: flex;
        gap: 8px;
        justify-content: stretch;
        width: 100%;
    }

    .table-actions .btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
        text-align: center;
        white-space: nowrap;
    }

    .table-actions .btn-sm {
        padding: 8px 10px;
    }

    /* Özet Kartları - Mobil Dikey Stack (1 kart yan yana) */
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 24px;
    }
    
    /* Küçük ekranlarda 2 kart yan yana göstermek isterseniz (opsiyonel) */
    @media (min-width: 480px) and (max-width: 768px) {
        .summary-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    .summary-card {
        padding: 16px;
        border-radius: 12px;
    }

    .summary-card h3 {
        font-size: 0.9rem;
    }

    .summary-value {
        font-size: 1.3rem;
        margin-top: 8px;
    }

    .summary-card__top {
        margin-bottom: 8px;
    }

    .summary-action-btn {
        font-size: 1rem;
        padding: 4px 8px;
    }

    /* Boş Durum Mesajı */
    .app-table tbody tr td[colspan] {
        padding: 40px 16px !important;
        text-align: center;
        font-size: 0.9rem;
    }

    /* Container Padding */
    .container-a4 {
        padding: 8px 12px;
    }

    /* FAB Butonu - Mobilde Göster */
    .fab-add {
        display: block;
    }

    /* Modal - Mobil Optimizasyonu */
    .modal-dialog {
        margin: 16px;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    /* Form Elemanları - Mobil */
    .form-control,
    .form-select {
        font-size: 16px; /* iOS zoom önleme */
        padding: 10px 12px;
    }

    /* Boşluk Optimizasyonları */
    .app-card__subtitle {
        display: none; /* Mobilde subtitle'ı gizle, yer kazan */
    }
}

/* Mobil için kategori bilgisini data attribute'dan al */
.app-table tbody tr[data-payment-id] {
    position: relative;
}

/* ============================================
   KÜÇÜK MOBİL EKRANLAR - KOMPAKT GÖRÜNÜM (max-width: 576px)
   ============================================ */
@media (max-width: 576px) {
    /* Genel font küçültme */
    body {
        font-size: 14px;
    }

    /* Header bar - kompakt */
    .app-header {
        padding: 8px 12px;
        min-height: auto;
    }

    .app-header__brand {
        font-size: 0.95rem;
        gap: 6px;
    }

    .app-header__brand span:first-child {
        font-size: 1rem;
    }

    .app-header__actions {
        gap: 6px;
    }

    .month-controls {
        padding: 3px 6px;
    }

    .month-label {
        font-size: 12px;
        max-width: 100px;
    }

    .btn-icon {
        padding: 3px 6px;
        font-size: 1rem;
        min-width: 28px;
    }

    .logout-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    /* Ana içerik - kompakt */
    .app-main {
        margin: 8px auto;
        padding: 0 8px 16px;
    }

    .container-a4 {
        padding: 4px 8px;
    }

    /* Üstteki beyaz kart - kompaktlaştır */
    .app-card {
        padding: 12px 12px;
        border-radius: 10px;
    }

    .app-card__header {
        gap: 10px;
        margin-bottom: 12px;
    }

    .app-card__title {
        font-size: 20px;
        margin-bottom: 2px;
        display: none; /* Mobilde başlığı tamamen gizle */
    }

    .app-card__subtitle {
        display: none; /* Mobilde açıklama metnini tamamen gizle */
    }

    /* Tüm butonlar - küçült */
    .btn {
        font-size: 12px;
        padding: 6px 10px;
        min-height: 34px;
        border-radius: 8px;
    }

    .btn-sm {
        font-size: 12px;
        padding: 6px 10px;
        min-height: 34px;
    }

    /* Aksiyon butonları - tek satırda 4 kare buton */
    .app-card__actions {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
    }

    .app-card__actions .btn {
        flex: 1;
        min-width: 0;
        font-size: 11px;
        padding: 6px 2px;
        min-height: 34px;
        border-radius: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* "Yeni Kalem Ekle" butonunu mobilde gizle (FAB kullanılıyor) */
    .app-card__actions #btn-payment-add {
        display: none;
    }

    /* Buton sıralaması: Gelir Ekle, Sabit Şablonlar, Sabitleri Kopyala, Temizle */
    .app-card__actions #btn-income-add {
        order: 1;
    }

    .app-card__actions #btn-fixed-templates {
        order: 2;
    }

    .app-card__actions #btn-copy-fixed {
        order: 3;
    }

    .app-card__actions #btn-clear-month {
        order: 4;
    }

    /* "Ayı Temizle" buton text'ini "Temizle" olarak değiştir */
    .app-card__actions #btn-clear-month {
        font-size: 0;
        position: relative;
    }

    .app-card__actions #btn-clear-month::after {
        content: "Temizle";
        font-size: 11px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        white-space: nowrap;
    }

    /* Kategori filtresi */
    .app-card__filter-row {
        margin-bottom: 12px;
        gap: 6px;
    }

    .app-card__filter-row .form-label {
        font-size: 0.85rem;
    }

    .app-card__filter-row .form-select {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    /* Ödeme listesi - kompakt kartlar */
    .app-table-wrapper {
        margin-bottom: 12px;
    }

    .app-table tbody tr {
        padding: 10px 12px;
        margin-bottom: 10px;
        border-radius: 12px;
    }

    .payment-card-content {
        flex-direction: column;
        gap: 6px;
    }

    .app-table tbody tr td:nth-child(3) {
        display: block;
        position: static;
        width: 100%;
        margin-bottom: 0;
    }

    .meta-name {
        font-size: 13px;
        line-height: 1.3;
    }

    .meta-category {
        font-size: 11px;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        margin-top: 0;
        color: #7b86a2;
    }

    .meta-badges {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 4px;
    }

    .payment-row-top {
        flex-wrap: nowrap;
    }

    .payment-amount {
        font-size: 0.95rem;
    }

    /* "Sabit" ve "Beklemede" rozetlerini mobilde gizle */
    .meta-badges .badge-tip,
    .meta-badges .status-badge {
        display: none;
    }

    /* İşlem butonları - mobilde gizle, ikonları göster */
    .table-actions {
        display: none; /* Mobilde büyük butonları gizle */
    }

    /* İkon butonları - "Kalan Param" kartındaki ikonlarla aynı stil */
    .table-actions-icons .summary-action-btn {
        border: none;
        background: transparent;
        color: var(--color-primary);
        font-size: 1rem;
        line-height: 1;
        padding: 4px;
        border-radius: 4px;
        transition: background-color 0.2s ease, color 0.2s ease;
        cursor: pointer;
    }

    .table-actions-icons .summary-action-btn:hover,
    .table-actions-icons .summary-action-btn:focus {
        background: rgba(24, 90, 219, 0.1);
        color: var(--color-primary-light);
    }

    /* Modern iOS tarzı Toggle Switch - ödeme durumu için */
    .payment-toggle-switch {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 26px;
        margin-left: 8px;
        vertical-align: middle;
        cursor: pointer;
        flex-shrink: 0;
    }

    .payment-toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

    .toggle-slider {
        position: relative;
        width: 100%;
        height: 100%;
        background-color: #d4d7dd; /* Soft gri - OFF durumu */
        border-radius: 999px;
        transition: background-color 0.2s ease;
    }

    .toggle-slider::before {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 20px;
        height: 20px;
        border-radius: 999px;
        background-color: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
        transition: transform 0.2s ease;
    }

    .payment-toggle-switch input:checked + .toggle-slider {
        background-color: #22c55e; /* Canlı yeşil - ON durumu */
    }

    .payment-toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px);
    }

    /* Mobilde biraz daha küçük */
    @media (max-width: 576px) {
        .payment-card-content {
            gap: 6px;
        }

        .meta-name {
            font-size: 13px;
        }

        .meta-badges {
            gap: 4px;
        }

        .payment-toggle-switch {
            width: 36px;
            height: 20px;
        }

        .toggle-slider::before {
            width: 14px;
            height: 14px;
            top: 3px;
            left: 3px;
        }

        .payment-toggle-switch input:checked + .toggle-slider::before {
            transform: translateX(16px);
        }
    }

    /* Özet kartları - mobilde 2x2 grid */
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-top: 12px;
    }

/* Modern ON/OFF Switch – Ödeme Durumu (Direkt Checkbox) */
.payment-toggle-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    border: none;
    outline: none;
    background-color: #e5e7eb;
    position: relative;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    transition: background-color 0.2s ease;
    margin: 0;
    padding: 0;
}

.payment-toggle-input::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
    transition: transform 0.2s ease;
}

.payment-toggle-input:checked {
    background-color: #22c55e;
}

.payment-toggle-input:checked::before {
    transform: translateX(20px);
}

/* Masaüstünde biraz daha büyük */
@media (min-width: 992px) {
    .payment-toggle-input {
        width: 48px;
        height: 26px;
    }

    .payment-toggle-input::before {
        width: 20px;
        height: 20px;
        top: 3px;
        left: 3px;
    }

    .payment-toggle-input:checked::before {
        transform: translateX(22px);
    }
}

/* --------------------------
   MOBİL ÜST BUTONLAR & SWITCH
   -------------------------- */
@media (max-width: 768px) {
    .app-card__actions.header-actions {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        margin-bottom: 12px;
    }

    .header-actions .top-action-btn {
        padding: 6px 4px;
        font-size: 11px;
        border-radius: 10px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
        min-height: 46px;
        gap: 2px;
    }

    .header-actions .top-action-btn::before {
        display: block;
        font-size: 14px;
        margin-bottom: 2px;
    }

    /* Gelir Ekle */
    .top-action-btn#btn-income-add::before {
        content: "💰";
    }

    /* Sabit Şablonlar */
    .top-action-btn#btn-fixed-templates::before {
        content: "📌";
    }

    /* Sabitleri Kopyala */
    .top-action-btn#btn-copy-fixed::before {
        content: "📋";
    }

    /* Ayı Temizle */
    .top-action-btn#btn-clear-month::before {
        content: "🧹";
    }

    .header-actions .top-action-btn span,
    .header-actions .top-action-btn {
        font-size: 11px;
        white-space: nowrap;
    }

    .category-label {
        display: none !important;
    }

    .payment-title-wrap .payment-toggle-switch {
        transform: scale(0.9);
        transform-origin: left center;
        margin-right: 4px;
    }
}

/* ===== Masaüstü Ödeme Switch'i (PC görünüm) ===== */
.payment-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

/* Gerçek checkbox gizleniyor */
.payment-switch-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* Görünen slider */
.payment-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #e5e7eb;
    border-radius: 999px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

/* Slider'ın topu */
.payment-switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 4px;
    top: 4px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

/* ON durumu */
.payment-switch-input:checked + .payment-switch-slider {
    background-color: #22c55e; /* yeşil */
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.4);
}

.payment-switch-input:checked + .payment-switch-slider::before {
    transform: translateX(20px);
}

/* Hover efekti (PC için) */
@media (hover: hover) {
    .payment-switch-slider:hover {
        box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.16);
    }
}


/* Özet kartları - mobilde 2x2 grid (devam) */
@media (max-width: 576px) {
    .summary-card {
        padding: 8px 6px;
        border-radius: 8px;
        margin-bottom: 0;
        min-height: auto;
    }

    .summary-card h3 {
        font-size: 11px;
        margin: 0;
        line-height: 1.2;
    }

    .summary-value {
        font-size: 14px;
        margin-top: 4px;
        line-height: 1.2;
    }

    .summary-card__top {
        margin-bottom: 2px;
    }

    .summary-action-btn {
        font-size: 0.85rem;
        padding: 2px 4px;
    }

    /* Boş durum mesajı */
    .app-table tbody tr td[colspan] {
        padding: 30px 12px !important;
        font-size: 0.85rem;
    }

    /* Modal - kompakt */
    .modal-dialog {
        margin: 12px;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-footer {
        padding: 10px 12px;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    /* Form elemanları - kompakt ama okunabilir */
    .form-control,
    .form-select {
        font-size: 14px;
        padding: 8px 10px;
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    /* FAB butonu - küçült */
    .fab-add {
        padding: 10px 14px;
        font-size: 0.85rem;
        right: 12px;
        bottom: 16px;
    }
}

