/* cash sayfalari - yeni tasarim (cl-* / db-* / dp-* desenleri app.css icinde)
   Bu dosyadaki siniflar cs- onekini kullanir. */

/* --------------------------------------------------------------------------
   Hesap listesi (/hesaplar)
   -------------------------------------------------------------------------- */

.cs-table {
    --cl-cols: minmax(240px, 2fr) 140px minmax(200px, 1.6fr) 120px 120px 150px 110px;
}

/* Durum cipleri baglanti olarak */
a.cs-chip {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* Tur grubu ara basligi */
.cs-group {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 960px;
    padding: 8px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 12.5px;
    color: var(--ink-2);
}

.cl-row-head + .cl-body > .cs-group:first-child { border-top: 0; }
.cs-group > span { font-weight: 600; color: var(--ink); }
.cs-group small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cs-group b { font-weight: 600; color: var(--ink); }
.cs-group + .cl-row { border-top: 1px solid var(--divider); }

.cs-name { display: flex; align-items: center; gap: 12px; }

.cs-avatar {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
}

.cs-avatar .icon { font-size: 18px; }
.cs-avatar.type-cash { background: var(--credit-soft); color: var(--credit-ink); }
.cs-avatar.type-bank { background: var(--brand-soft); color: var(--brand); }
.cs-avatar.type-pos { background: var(--violet-soft); color: var(--violet); }
.cs-avatar.type-credit_card { background: var(--warn-soft); color: var(--warn-ink); }

/* Detaydaki buyuk simge */
.dp-avatar.cs-avatar { width: 52px; height: 52px; border-radius: 12px; }
.dp-avatar.cs-avatar .icon { font-size: 24px; }

.cs-sub-mobile { display: none; }

.cs-type { display: flex; flex-wrap: wrap; gap: 4px; }

.cl-pill.cs-pill-cash { background: var(--credit-soft); color: var(--credit-ink); }
.cl-pill.cs-pill-bank { background: var(--brand-soft); color: var(--brand); }
.cl-pill.cs-pill-pos { background: var(--violet-soft); color: var(--violet); }
.cl-pill.cs-pill-credit_card { background: var(--warn-soft); color: var(--warn-ink); }

.cs-bank { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-bank span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.cs-bank small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cs-flow { text-align: right; color: var(--ink-2); white-space: nowrap; }

.cs-balance { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.cs-balance b { font-weight: 600; white-space: nowrap; }
.cs-balance small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cs-balance small.is-ok { color: var(--credit-ink); }
.cs-balance small.is-pos { color: var(--violet); }
.cs-balance small.is-zero { font-weight: 400; }
.cl-row-head .cs-balance, .cl-row-head .cs-flow { display: block; text-align: right; }

.cs-last { color: var(--ink-2); white-space: nowrap; }

@media (max-width: 899px) {
    .cs-group { min-width: 0; padding: 8px 14px; }

    .cs-table .cl-row { grid-template-columns: minmax(0, 1fr) auto; }
    .cs-type, .cs-bank, .cs-flow, .cs-last { display: none; }
    .cs-sub-mobile { display: inline; }
    .cs-balance { padding-right: 14px; }
}

/* --------------------------------------------------------------------------
   Hesap detayi (/hesaplar/{id})
   -------------------------------------------------------------------------- */

.cs-in { color: var(--credit) !important; }
.cs-out { color: var(--debt) !important; }

.cs-iban { letter-spacing: .02em; }

/* Kart icindeki yon sekmeleri */
.cs-tabs {
    display: flex;
    gap: 2px;
    margin-top: 6px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}

a.cl-tab { text-decoration: none; }
.cs-tabs .cl-tab { padding: 10px 10px 9px; font-size: 13.5px; }

/* Hareket tablosu */
.cs-tx { overflow-x: auto; }

.cs-tx-row {
    display: grid;
    grid-template-columns: 100px minmax(220px, 1fr) 120px 120px 130px 44px;
    align-items: center;
    min-width: 720px;
    border-top: 1px solid var(--divider);
    font-size: 13.5px;
    color: var(--ink);
}

.cs-tx-row > span { min-width: 0; padding: 10px 12px; }
.cs-tx-row > span:first-child { padding-left: 20px; }
.cs-tx-row > span:last-child { padding-right: 14px; }
.cs-tx-row:not(.is-head):hover { background: var(--surface-2); }

.cs-tx-row.is-head {
    border-top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
}

.cs-tx-row.is-head > span { padding-top: 8px; padding-bottom: 8px; }
.cs-tx-row.is-head + .cs-tx-row { border-top: 0; }

.cs-tx-row .is-num { text-align: right; white-space: nowrap; }

.cs-tx-date { color: var(--ink-2); white-space: nowrap; }

.cs-tx-desc { display: flex; flex-direction: column; gap: 3px; }

.cs-tx-desc b {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.cs-tx-desc small {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
    padding-left: 30px;
    font-size: 12px;
    color: var(--ink-3);
}

.cs-tx-desc small:empty { display: none; }
.cs-tx-desc small a { color: var(--brand); text-decoration: none; }
.cs-tx-desc .cl-pill { padding: 1px 6px; font-size: 11px; }

.cs-tx-dir {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 6px;
    display: grid;
    place-items: center;
}

.cs-tx-dir .icon { font-size: 13px; }
.cs-tx-dir.is-in { background: var(--credit-soft); color: var(--credit-ink); }
.cs-tx-dir.is-out { background: var(--debt-soft); color: var(--debt-ink); }

.cs-tx-amt { font-weight: 600; }
.cs-tx-bal { color: var(--ink-2); }
.cs-tx-date-mobile, .cs-tx-mobile-amt { display: none; }

.cs-tx-tools { display: flex; justify-content: flex-end; }

.cs-tool {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--ink-3);
    text-decoration: none;
}

.cs-tool .icon { font-size: 16px; }
.cs-tool:hover { background: var(--surface-2); color: var(--ink); }
.cs-tool.is-danger:hover { background: var(--debt-soft); color: var(--debt); }

.cs-tx-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 12px 20px 8px;
    border-top: 1px solid var(--divider);
    font-size: 12.5px;
    color: var(--ink-3);
}

.cs-tx-foot span:last-child { margin-left: auto; }
.cs-tx-foot b { color: var(--ink); font-weight: 600; }

/* POS bloke listesi kart icinde */
.cs-pos-list { margin-top: 8px; border-top: 1px solid var(--divider); }

.cs-notes {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink);
    white-space: pre-wrap;
}

@media (max-width: 899px) {
    .cs-tx { overflow: visible; }
    .cs-tx-row.is-head { display: none; }

    .cs-tx-row {
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) auto 40px;
        grid-template-areas:
            "desc amt tools"
            "desc bal tools";
    }

    .cs-tx-row > span { padding: 6px 8px; }
    .cs-tx-desc { grid-area: desc; padding-left: 16px !important; }
    .cs-tx-mobile-amt { display: block; grid-area: amt; text-align: right; font-weight: 600; white-space: nowrap; padding-bottom: 0 !important; }
    .cs-tx-bal { grid-area: bal; font-size: 12px; padding-top: 0 !important; }
    .cs-tx-tools { grid-area: tools; padding-right: 8px !important; }
    .cs-tx-date, .cs-tx-amt { display: none; }
    .cs-tx-date-mobile { display: inline; }
    .cs-tx-foot { padding: 12px 16px 8px; }
}

/* --------------------------------------------------------------------------
   Para giris / cikis ve virman panelleri
   -------------------------------------------------------------------------- */

.cs-sheet .cs-sheet-title { padding-left: 16px; font-weight: 650; }
.cs-sheet .cs-sheet-close { padding-right: 16px; }

.cs-sheet-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.cs-sheet-note > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cs-sheet-note b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cs-sheet-note small { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }

.cs-sheet-icon {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
}

.cs-sheet-icon .icon { font-size: 17px; }
.cs-sheet-note.is-in .cs-sheet-icon { background: var(--credit-soft); color: var(--credit-ink); }
.cs-sheet-note.is-out .cs-sheet-icon { background: var(--debt-soft); color: var(--debt-ink); }

.cs-sheet .cs-sheet-actions { margin: 18px 0 22px; }

/* --------------------------------------------------------------------------
   Hesap formu (/hesaplar/yeni, /hesaplar/{id}/duzenle)
   Form karti otomatik (app.css); tur kutulari ve oran tablosu kenar boslugu
   form kartlariyla hizalansin.
   -------------------------------------------------------------------------- */

.page[data-name="cash-form"] .surface-list {
    margin: 0 var(--fm-gutter, 10px) !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
}

.page[data-name="cash-form"] .form-hint { padding-left: calc(var(--fm-gutter, 10px) + 4px); padding-right: calc(var(--fm-gutter, 10px) + 4px); }
