/* ==========================================================================
   Çeler Evleri — Aidat Takip Sistemi
   Tasarım sistemi. Dış bağımlılık yok; açık ve koyu tema desteklidir.
   ========================================================================== */

/* --- Tokenlar ------------------------------------------------------------ */
:root {
    color-scheme: light;

    --bg:            #f4f6fb;
    --bg-accent:     radial-gradient(1200px 600px at 15% -10%, #e8ecff 0%, transparent 60%),
                     radial-gradient(900px 500px at 110% 0%, #e6f7ff 0%, transparent 55%);
    --surface:       #ffffff;
    --surface-2:     #f7f9fd;
    --surface-3:     #eef2f9;
    --border:        #e2e8f2;
    --border-strong: #cfd8e8;

    --text:          #0d1526;
    --text-2:        #3d4a63;
    --muted:         #6b7794;
    --faint:         #98a2b8;

    --accent:        #5b5bd6;
    --accent-2:      #7c5cf0;
    --accent-soft:   #eceafe;
    --accent-text:   #4a3fc4;

    --ok:            #0f9d58;
    --ok-soft:       #e3f6ec;
    --warn:          #b7791f;
    --warn-soft:     #fdf3df;
    --bad:           #d64545;
    --bad-soft:      #fdeaea;
    --info:          #0f7fb5;
    --info-soft:     #e4f3fb;

    --shadow-sm:  0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
    --shadow:     0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 6px -2px rgba(16, 24, 40, .05);
    --shadow-lg:  0 24px 48px -12px rgba(16, 24, 40, .18);

    --r-sm: 8px;
    --r:    12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-full: 999px;

    --sidebar-w: 264px;
    --topbar-h: 64px;

    --ff: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", "Noto Sans", sans-serif;
    --ff-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;

    --ease: cubic-bezier(.22, 1, .36, 1);
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg:            #080a10;
    --bg-accent:     radial-gradient(1200px 600px at 15% -10%, #1a1b3d 0%, transparent 60%),
                     radial-gradient(900px 500px at 110% 0%, #0d2b3a 0%, transparent 55%);
    --surface:       #11141d;
    --surface-2:     #161a25;
    --surface-3:     #1c2130;
    --border:        #232838;
    --border-strong: #333a4f;

    --text:          #e9ecf5;
    --text-2:        #c3cadb;
    --muted:         #8b95ae;
    --faint:         #6a7490;

    --accent:        #7c6cf6;
    --accent-2:      #9d7cf8;
    --accent-soft:   #1e1b3d;
    --accent-text:   #b3a6ff;

    --ok:            #34d399;
    --ok-soft:       #0d2b23;
    --warn:          #fbbf24;
    --warn-soft:     #2e2413;
    --bad:           #f87171;
    --bad-soft:      #2d1518;
    --info:          #38bdf8;
    --info-soft:     #0c2632;

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, .4);
    --shadow:     0 6px 18px -4px rgba(0, 0, 0, .5);
    --shadow-lg:  0 28px 56px -16px rgba(0, 0, 0, .7);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--ff);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image: var(--bg-accent);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "tnum" 0;
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-weight: 650;
    letter-spacing: -.018em;
    line-height: 1.25;
    color: var(--text);
}
h1 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.9rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .97rem; }

p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent-text);
    text-decoration: none;
    transition: color .15s var(--ease);
}
a:hover { color: var(--accent-2); }

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

::selection { background: var(--accent); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Ekran okuyucular için */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon {
    width: 1.15em; height: 1.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
    vertical-align: -.19em;
}

/* --- Uygulama iskeleti ---------------------------------------------------- */
.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* İçerik sütunu: taşan tablolar sayfayı yatay kaydırmasın. */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Menü karartması ızgaranın dışındadır; masaüstünde hiç yer kaplamaz. */
.nav-scrim { display: none; }

/* --- Kenar çubuğu --------------------------------------------------------- */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 14px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 16px;
    color: var(--text);
}
.brand:hover { color: var(--text); }

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 60%, transparent);
    flex: none;
}
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 2.1; }

.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 680;
    font-size: .97rem;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-sub {
    display: block;
    font-size: .715rem;
    color: var(--muted);
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 550;
}

/* Sol menüdeki genel blok seçimi */
.block-switch {
    display: grid;
    gap: 5px;
    padding: 10px 11px 12px;
    margin: 0 0 4px;
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.block-switch label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .7rem;
    font-weight: 660;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}
.block-switch label .icon { width: 13px; height: 13px; }
.block-switch .select {
    padding: 7px 30px 7px 10px;
    font-size: .87rem;
    font-weight: 580;
    background-color: var(--surface);
}

.nav-group {
    padding: 14px 10px 6px;
    font-size: .68rem;
    font-weight: 660;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--faint);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--text-2);
    font-weight: 530;
    font-size: .905rem;
    position: relative;
    transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-item:hover {
    background: var(--surface-3);
    color: var(--text);
}
.nav-item .icon {
    width: 18px; height: 18px;
    color: var(--faint);
    transition: color .16s var(--ease);
}
.nav-item:hover .icon { color: var(--text-2); }

.nav-item.is-active {
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 620;
}
.nav-item.is-active .icon { color: var(--accent); }
.nav-item.is-active::before {
    content: "";
    position: absolute;
    left: -14px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: var(--r-full);
    background: var(--bad);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.6;
}
.nav-badge.is-quiet {
    background: var(--surface-3);
    color: var(--muted);
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 10px;
}

.balance-chip {
    padding: 12px 13px;
    border-radius: var(--r);
    background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
    border: 1px solid var(--border);
}
.balance-chip .label {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    font-weight: 620;
}
.balance-chip .value {
    display: block;
    margin-top: 3px;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.balance-chip .value.is-negative { color: var(--bad); }
.balance-chip .value.is-positive { color: var(--ok); }

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r);
}
.user-row:hover { background: var(--surface-2); }

/* --- Üst çubuk ------------------------------------------------------------ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--topbar-h);
    padding: 0 clamp(16px, 3vw, 30px);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar-title strong {
    font-size: 1.02rem;
    font-weight: 660;
    letter-spacing: -.015em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-title span {
    font-size: .78rem;
    color: var(--muted);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle { display: none; }

/* --- İçerik --------------------------------------------------------------- */
.content {
    padding: clamp(18px, 2.6vw, 30px);
    padding-bottom: 60px;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
    animation: rise .34s var(--ease) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 22px;
}
.page-head .grow { flex: 1 1 260px; min-width: 0; }
.page-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .9rem;
}
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Herkese açık görünüm (giriş yapılmamış) ------------------------------- */
.public-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.public-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px clamp(16px, 4vw, 34px);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.public-bar .brand { padding: 0; }

.public-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}
.public-nav a {
    padding: 8px 14px;
    border-radius: 9px;
    color: var(--text-2);
    font-weight: 560;
    font-size: .9rem;
}
.public-nav a:hover { background: var(--surface-2); color: var(--text); }
.public-nav a.is-on { background: var(--accent-soft); color: var(--accent-text); }

.public-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Menü dar ekranda gizlendiğinde (margin-left:auto onun üzerindeydi)
       düğmeler markanın hemen yanına yığılıyordu; sağa yaslanma burada
       da tanımlı olmalı. */
    margin-left: auto;
}

.public-shell .content {
    flex: 1;
    max-width: 1180px;
}

.public-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px clamp(16px, 4vw, 34px);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .82rem;
}
.public-foot a { color: var(--muted); }
.public-foot a:hover { color: var(--accent-text); }

/* Giriş çağrısı kutusu */
.login-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 22px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 14px 34px -14px color-mix(in srgb, var(--accent) 75%, transparent);
}
.login-cta .icon-wrap {
    display: grid;
    place-items: center;
    width: 46px; height: 46px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .18);
    flex: none;
}
.login-cta .icon-wrap .icon { width: 22px; height: 22px; }
.login-cta strong { display: block; font-size: 1.02rem; }
.login-cta span { font-size: .87rem; opacity: .88; }
.login-cta .btn {
    background: #fff;
    color: var(--accent-text);
    border-color: transparent;
    margin-left: auto;
}
.login-cta .btn:hover { background: #fff; filter: brightness(.96); color: var(--accent-text); }

/* --- Uygulama kurulum şeridi ---------------------------------------------- */
.install-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translate(-50%, 130%);
    z-index: 180;
    display: flex;
    align-items: center;
    gap: 13px;
    width: min(520px, calc(100vw - 24px));
    padding: 13px 15px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transition: transform .34s var(--ease), opacity .34s var(--ease);
    opacity: 0;
}
.install-banner.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
}
.install-banner .install-icon {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: 11px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #fff;
    flex: none;
}
.install-banner strong { display: block; font-size: .91rem; }
.install-banner span { font-size: .8rem; color: var(--muted); line-height: 1.5; }
.install-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* --- Ödeme ve iletişim şeridi ---------------------------------------------- */
/* --- İndirme göstergesi --------------------------------------------------- */
.indirme-kutu {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    font-size: .88rem;
    font-weight: 560;
    /* Kapalıyken tıklamayı engellemesin */
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 14px);
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.indirme-kutu.is-acik { opacity: 1; transform: translate(-50%, 0); }

.indirme-spin {
    width: 17px; height: 17px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    animation: indirme-don .7s linear infinite;
}
@keyframes indirme-don { to { transform: rotate(360deg); } }

/* İş bitince dönen halka onaya dönüşür */
.indirme-kutu.is-bitti { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.indirme-kutu.is-bitti .indirme-yazi { color: var(--ok); }
.indirme-kutu.is-bitti .indirme-spin {
    position: relative;
    animation: none;
    border-color: var(--ok);
}
/* İki kenarlı klasik onay işareti */
.indirme-kutu.is-bitti .indirme-spin::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    width: 5px;
    height: 9px;
    border: 2px solid var(--ok);
    border-top: 0;
    border-left: 0;
    transform: rotate(42deg);
}

@media (max-width: 480px) {
    .indirme-kutu { left: 12px; right: 12px; bottom: 14px; transform: none; justify-content: center; }
    .indirme-kutu.is-acik { transform: none; }
}

/* --- Sistem ekranındaki eylem satırı -------------------------------------- */
.sistem-eylem {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface-2);
}
.sistem-eylem > .grow { min-width: 220px; }
.sistem-eylem strong { display: block; font-size: .9rem; font-weight: 620; margin-bottom: 3px; }
.sistem-eylem span { font-size: .81rem; color: var(--muted); line-height: 1.55; }
.sistem-eylem form { flex: none; }
.sistem-tam { display: block; }

@media (max-width: 560px) {
    .sistem-eylem { align-items: stretch; }
    .sistem-eylem form, .sistem-eylem .btn { width: 100%; justify-content: center; }
}

/* --- Bölüm başlığı (uzun ayar listelerini gruplar) ------------------------ */
.grup-basligi {
    padding: 4px 2px 0;
}
.grup-basligi h2 {
    font-size: 1.02rem;
    font-weight: 680;
    letter-spacing: -.01em;
    margin: 0 0 3px;
}
.grup-basligi p {
    margin: 0;
    font-size: .82rem;
    color: var(--muted);
}
.grup-basligi + .card { margin-top: -4px; }

/* Liste içi grup ayracı */
.list-group {
    padding: 11px 16px 6px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

/* --- Dekont listesi (aidat kaydına ekli belgeler) ------------------------- */
.doc-list { display: grid; gap: 8px; }

.doc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface-2);
}

.doc-onizleme {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    flex: none;
    border-radius: 9px;
    overflow: hidden;
    background: var(--surface-3);
    color: var(--muted);
}
.doc-onizleme img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-onizleme.is-dosya .icon { width: 20px; height: 20px; }

/* --- Bildirim kutusu ------------------------------------------------------ */
.list-item.bildirim { align-items: flex-start; }
.list-item.bildirim .stat-icon { margin-top: 1px; }
.list-item.bildirim .title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    white-space: normal;
}
.list-item.bildirim .meta { flex-wrap: wrap; }
.bildirim-ozet {
    color: var(--muted);
    line-height: 1.5;
    margin: 2px 0 4px;
}
/* Okunmamış kayıt sol kenarından belli olsun */
.list-item.bildirim.is-yeni {
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Satır artık <button>; düğme görünümünü sıfırla, liste satırı gibi dursun */
button.list-item.bildirim {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--border);
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
button.list-item.bildirim:last-child { border-bottom: 0; }
button.list-item.bildirim:hover { background: var(--surface-2); }
button.list-item.bildirim.is-yeni:hover {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

/* Modaldaki künye şeridi: Tür / Tarih / Kanal / Durum */
.detay-serit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px 16px;
    margin: 0 0 16px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface-2);
}
.detay-serit > div { min-width: 0; }
.detay-serit dt {
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
}
.detay-serit dd {
    margin: 0;
    font-size: .87rem;
    font-weight: 580;
    overflow-wrap: anywhere;
}

/* Mesaj gövdesi ayrı bir alanda dursun */
.mesaj-alan {
    position: relative;
    padding: 26px 16px 16px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r);
    background: var(--surface-2);
}
.mesaj-etiket {
    position: absolute;
    top: 9px;
    left: 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .68rem;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.mesaj-etiket .icon { width: 13px; height: 13px; }

/* Modaldaki tam metin */
.bildirim-metin {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--text);
    overflow-wrap: anywhere;
}
.bildirim-metin p { margin: 0 0 10px; }
.bildirim-metin p:last-child { margin-bottom: 0; }
/* Bildirim gövdesindeki tablolar e-posta için satır içi stille gelir;
   modalda uygulamanın diliyle konuşsunlar. */
.bildirim-metin table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    background: var(--surface) !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-size: .87rem;
}
.bildirim-metin tr + tr td { border-top: 1px solid var(--border); }
.bildirim-metin td { padding: 9px 13px; }
.bildirim-metin td:first-child {
    color: var(--muted) !important;
    font-weight: 550;
    white-space: nowrap;
    width: 1%;
}
.bildirim-metin td:last-child { font-weight: 600; }
.bildirim-metin strong { color: var(--text); font-weight: 650; }
.bildirim-metin a { color: var(--accent-text); text-decoration: underline; }

@media (max-width: 640px) {
    .list-item.bildirim .value { display: none; }
}

/* --- Daire sakininin kendi borç kartı -------------------------------------- */
.benim-kart { border-left: 3px solid var(--muted); }
.benim-kart.tone-ok   { border-left-color: var(--ok); }
.benim-kart.tone-warn { border-left-color: var(--warn); }
.benim-kart.tone-bad  { border-left-color: var(--bad); }

.benim-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px 28px;
}
.benim-ana { flex: none; }
.benim-tutar {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin: 2px 0 4px;
    font-variant-numeric: tabular-nums;
}
.benim-kart.tone-bad  .benim-tutar { color: var(--bad); }
.benim-kart.tone-warn .benim-tutar { color: var(--warn); }
.benim-kart.tone-ok   .benim-tutar { color: var(--ok); }

.benim-detay {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
    margin: 0;
    flex: 1 1 240px;
}
.benim-detay dt {
    font-size: .74rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 3px;
}
.benim-detay dd {
    margin: 0;
    font-size: .93rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .benim-row { gap: 14px 18px; }
    .benim-tutar { font-size: 1.72rem; }
    .benim-detay { gap: 8px 20px; flex-basis: 100%; }
    .benim-row > .btn { width: 100%; justify-content: center; }
}

.pay-row {
    display: flex;
    align-items: flex-end;
    gap: 26px;
    flex-wrap: wrap;
}

.pay-item {
    display: grid;
    gap: 4px;
    padding-bottom: 2px;
}
.pay-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
}
.pay-label .icon { width: 14px; height: 14px; }
.pay-value {
    font-size: .95rem;
    font-weight: 620;
    color: var(--text);
    white-space: nowrap;
}
a.pay-value:hover { color: var(--accent-text); }

/* IBAN kutusu satırın kalanını doldursun, kopyala düğmesi yanında dursun */
.pay-row .row-tight { align-items: stretch; }
.pay-row code.input { flex: 1 1 auto; min-width: 0; }

@media (max-width: 640px) {
    /* Dar ekranda IBAN tam satır; yönetici ve telefon altta yan yana.
       Flex'te kalırsa IBAN kutusu daralıp beş satıra sarıyordu. */
    .pay-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 14px 16px;
    }
    .pay-row .field {
        grid-column: 1 / -1;
        min-width: 0 !important;
        width: 100%;
    }
    .pay-value { white-space: normal; overflow-wrap: anywhere; }
}

/* --- Fatura / fiş ekleri --------------------------------------------------- */
.attach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.attach {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface-2);
    transition: border-color .16s var(--ease);
}
.attach:hover { border-color: var(--accent); }

.attach-view {
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--surface-3);
}
.attach-view img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attach-file {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 5px;
    height: 100%;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .06em;
}
.attach-file .icon { width: 26px; height: 26px; }

.attach-meta {
    padding: 6px 8px;
    display: grid;
    gap: 1px;
    font-size: .72rem;
    min-width: 0;
}

.attach-del {
    position: absolute;
    top: 4px; right: 4px;
    opacity: 0;
    transition: opacity .16s var(--ease);
}
.attach:hover .attach-del,
.attach:focus-within .attach-del { opacity: 1; }
.attach-del .btn {
    width: 26px; height: 26px; padding: 4px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(4px);
    color: var(--bad);
}
.attach-del .btn:hover { background: var(--bad); color: #fff; }

/* Dosya seçici */
input[type="file"].input {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .85rem;
}
input[type="file"].input::file-selector-button {
    margin-right: 10px;
    padding: 5px 12px;
    border: 0;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}
input[type="file"].input::file-selector-button:hover {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Listedeki belge rozeti */
.chip.is-doc {
    padding: 2px 8px;
    margin-left: 6px;
    font-size: .72rem;
    cursor: pointer;
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent-text);
}
.chip.is-doc:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}
.chip.is-doc .icon { width: 13px; height: 13px; color: currentColor; }

/* Belge önizleme penceresi */
.doc-grid {
    display: grid;
    /* Üst sınır olmazsa tek belge pencerenin tamamına gerilir; okunaklı bir
       genişlikte tutup ortalıyoruz. Tam boyut için belgeye tıklanır. */
    grid-template-columns: repeat(auto-fit, minmax(240px, 360px));
    justify-content: center;
    gap: 14px;
}

.doc {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface-2);
}
/* Fiş/fatura genelde dikey çekilir. Genişliği doldurup boyu serbest bıraktık;
   böylece iki yanda boş alan kalmaz ve belge okunabilir büyüklükte görünür.
   Uzunsa pencerenin gövdesi kayar. */
.doc img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--surface-3);
}
.doc-file {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    min-height: 160px;
    color: var(--accent-text);
    font-size: .84rem;
    font-weight: 580;
}
.doc-file .icon { width: 34px; height: 34px; }

.doc figcaption {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-top: 1px solid var(--border);
    font-size: .78rem;
    color: var(--muted);
    min-width: 0;
}
.doc figcaption .truncate { flex: 1; }
.doc figcaption .btn { width: 28px; height: 28px; padding: 5px; }

dialog.modal.is-wide {
    width: min(880px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
}

/* Telefonda belge neredeyse tam ekran açılsın; fiş okunabilir olsun. */
@media (max-width: 640px) {
    dialog.modal,
    dialog.modal.is-wide {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: var(--r);
    }
    dialog.modal .card-head { padding: 12px 14px; }
    dialog.modal .card-body { padding: 12px; }
    dialog.modal .card-foot { padding: 11px 12px; }

    .doc-grid { grid-template-columns: 1fr; gap: 10px; }
    .doc figcaption { padding: 8px 10px; }

    /* Alt çubuktaki düğmeler dar ekranda alt alta binmesin */
    dialog.modal .card-foot .btn { flex: 1 1 auto; }
}

/* --- Bildirim durumu ------------------------------------------------------ */
.push-state {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: .87rem;
}
.push-state::before {
    content: "";
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--muted);
    flex: none;
}
.push-state[data-state="on"] { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.push-state[data-state="on"]::before { background: var(--ok); }
.push-state[data-state="blocked"],
.push-state[data-state="unsupported"] { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 28%, transparent); color: var(--bad); }
.push-state[data-state="blocked"]::before,
.push-state[data-state="unsupported"]::before { background: var(--bad); }
.push-state[data-state="unconfigured"] { background: var(--warn-soft); color: var(--warn); }
.push-state[data-state="unconfigured"]::before { background: var(--warn); }
.push-state[data-state="busy"]::before { background: var(--accent); animation: pulse 1s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: .3; } }

/* --- Kart ----------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Alt alta duran kartlar arasında boşluk. Izgara/esnek kutu içinde
   aralığı `gap` verir; oradaki kartlara ek üst boşluk hizayı bozuyordu. */
.card + .card { margin-top: 18px; }
/* Yalnızca ızgarada sıfırlanır; .stack'teki alışılmış aralık korunur. */
.grid > .card + .card,
.grid.cols-2 > .card + .card,
.grid.cols-3 > .card + .card,
.grid.cols-4 > .card + .card,
.grid.split > .card + .card,
.grid.split-wide > .card + .card { margin-top: 0; }

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}
.card-head h3 {
    font-size: .98rem;
    font-weight: 640;
}
.card-head .sub {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 450;
}
.card-head .spacer { margin-left: auto; }

.card-body { padding: 18px; }
.card-body.is-flush { padding: 0; }
.card-foot {
    padding: 13px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Izgara --------------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid.split  {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start; /* Kısa sütun boşa uzamasın */
}
/* Sütun sayısı fazla olan tablolar için daha geniş ana alan */
.grid.split-wide {
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
    align-items: start;
}

@media (max-width: 1080px) {
    .grid.split,
    .grid.split-wide { grid-template-columns: minmax(0, 1fr); }
}

/* --- İstatistik kartı ------------------------------------------------------ */
.stat {
    position: relative;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}
.stat::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--tone, var(--accent));
    opacity: .85;
}

.stat-top {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}
.stat-icon {
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--tone-soft, var(--accent-soft));
    color: var(--tone, var(--accent));
}
.stat-icon .icon { width: 17px; height: 17px; }
.stat-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
}
.stat-value {
    font-size: clamp(1.35rem, 1.1rem + .9vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.stat-meta {
    margin-top: 7px;
    font-size: .79rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.stat.tone-ok    { --tone: var(--ok);    --tone-soft: var(--ok-soft); }
.stat.tone-bad   { --tone: var(--bad);   --tone-soft: var(--bad-soft); }
.stat.tone-warn  { --tone: var(--warn);  --tone-soft: var(--warn-soft); }
.stat.tone-info  { --tone: var(--info);  --tone-soft: var(--info-soft); }

/* Tonu doğrudan simge kutusuna vermek için (bildirim kutusu gibi listelerde) */
.stat-icon.tone-ok     { --tone: var(--ok);     --tone-soft: var(--ok-soft); }
.stat-icon.tone-bad    { --tone: var(--bad);    --tone-soft: var(--bad-soft); }
.stat-icon.tone-warn   { --tone: var(--warn);   --tone-soft: var(--warn-soft); }
.stat-icon.tone-info   { --tone: var(--info);   --tone-soft: var(--info-soft); }
.stat-icon.tone-accent { --tone: var(--accent-text); --tone-soft: var(--accent-soft); }
.stat-icon.tone-muted  { --tone: var(--muted);  --tone-soft: var(--surface-3); }

.trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 650;
    font-size: .78rem;
}
.trend.up   { color: var(--ok); }
.trend.down { color: var(--bad); }
.trend.flat { color: var(--muted); }

/* --- Düğmeler ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: .885rem;
    font-weight: 590;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s var(--ease), border-color .16s var(--ease),
                transform .12s var(--ease), box-shadow .16s var(--ease), color .16s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled {
    opacity: .5;
    pointer-events: none;
}
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 65%, transparent);
}
.btn-primary:hover {
    color: #fff;
    filter: brightness(1.07);
    box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-2);
}
.btn-ghost:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-soft {
    background: var(--surface-3);
    color: var(--text-2);
}
.btn-soft:hover { background: var(--border); color: var(--text); }

.btn-ok   { background: var(--ok-soft);   color: var(--ok); }
.btn-ok:hover   { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.btn-bad  { background: var(--bad-soft);  color: var(--bad); }
.btn-bad:hover  { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }

/* Açık durumdaki ikon düğmesi (örn. "şifre değiştirme zorunlu") */
.btn-icon.is-on {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

/* Geri dönüşü olmayan işlemin onay düğmesi */
.btn-tehlike {
    background: var(--bad);
    color: #fff;
    box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--bad) 60%, transparent);
}
.btn-tehlike:hover {
    color: #fff;
    filter: brightness(1.06);
    box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--bad) 65%, transparent);
}
/* Mor odak halkası kırmızı düğmenin üzerinde yabancı duruyor */
.btn-tehlike:focus-visible { outline-color: var(--bad); }
.btn-warn { background: var(--warn-soft); color: var(--warn); }

.btn-sm { padding: 6px 11px; font-size: .81rem; border-radius: 8px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { padding: 12px 22px; font-size: .95rem; border-radius: 12px; }
.btn-block { width: 100%; }

.btn-icon {
    padding: 7px;
    width: 34px; height: 34px;
    border-radius: 9px;
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon .icon { width: 17px; height: 17px; }

.btn-row { display: flex; gap: 6px; align-items: center; }

/* Tema düğmesi: geçerli temaya göre tek ikon görünür */
.is-dark-icon { display: none; }
:root[data-theme="dark"] .is-dark-icon { display: inline-block; }
:root[data-theme="dark"] .is-light-icon { display: none; }

[data-copy].is-copied { color: var(--ok); }

/* --- Rozetler ------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: .765rem;
    font-weight: 620;
    line-height: 1.55;
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.badge.no-dot::before { display: none; }

.badge-ok    { background: var(--ok-soft);     color: var(--ok); }
.badge-warn  { background: var(--warn-soft);   color: var(--warn); }
.badge-bad   { background: var(--bad-soft);    color: var(--bad); }
.badge-info  { background: var(--info-soft);   color: var(--info); }
.badge-muted { background: var(--surface-3);   color: var(--muted); }
.badge-accent{ background: var(--accent-soft); color: var(--accent-text); }

/* Daire ve kişi rozetleri: ikonlu, çerçeveli */
.badge-daire, .badge-kisi {
    gap: 5px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-2);
}
.badge-daire { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.badge-daire .icon, .badge-kisi .icon { width: 12px; height: 12px; flex: none; }
/* İkon zaten var; noktaya gerek yok */
.badge-daire::before, .badge-kisi::before { display: none; }
/* Uzun isim kesilmek yerine alt satıra sarsın */
.badge-kisi { white-space: normal; text-align: left; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: .79rem;
    font-weight: 550;
    color: var(--text-2);
}
.chip .icon { width: 14px; height: 14px; color: var(--muted); }
a.chip:hover { border-color: var(--accent); color: var(--accent-text); }

/* Daire numarası göstergesi */
.flat-tag {
    display: inline-grid;
    place-items: center;
    min-width: 34px; height: 34px;
    padding: 0 8px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 700;
    font-size: .93rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: .78rem;
    font-weight: 680;
    letter-spacing: .02em;
    flex: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }

/* --- Tablo ---------------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Dar ekranda tablonun kaydırılabildiği görünsün */
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-track { background: var(--surface-2); }
.table-wrap::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .89rem;
}

table.data th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 14px;
    text-align: left;
    font-size: .73rem;
    font-weight: 660;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.data tbody tr {
    transition: background .13s var(--ease);
}
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }

table.data .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}
table.data .actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}
table.data .actions .btn-row { justify-content: flex-end; }
table.data .tight { width: 1%; white-space: nowrap; }
/* Metin ağırlıklı sütunlar erkenden sarmasın; gerekirse tablo yatay kayar. */
table.data .wide { min-width: 220px; }

table.data tfoot td {
    padding: 12px 14px;
    background: var(--surface-2);
    font-weight: 680;
    border-top: 2px solid var(--border);
}

.row-strong { font-weight: 600; color: var(--text); }
.row-sub { display: block; font-size: .79rem; color: var(--muted); font-weight: 450; }

.text-ok    { color: var(--ok); }
.text-bad   { color: var(--bad); }
.text-warn  { color: var(--warn); }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.nums { font-variant-numeric: tabular-nums; }

/* --- Boş durum ------------------------------------------------------------ */
.empty {
    padding: 52px 24px;
    text-align: center;
    color: var(--muted);
}
.empty .icon-wrap {
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: var(--surface-3);
    color: var(--faint);
}
.empty .icon-wrap .icon { width: 26px; height: 26px; }
.empty h4 { margin-bottom: 5px; color: var(--text-2); }
.empty p { font-size: .89rem; max-width: 44ch; margin-inline: auto; }
.empty .btn { margin-top: 16px; }

/* --- Formlar -------------------------------------------------------------- */
.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid .half { grid-column: span 2; }

/* Form sayfaları: dar kolon yerine ekranı kullanan iki sütunlu düzen.
   Sol tarafta asıl alanlar, sağda yardımcı bilgi/özet durur. */
.form-page {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    align-items: start;
}
.form-page > .stack { min-width: 0; }
.form-side { position: sticky; top: calc(var(--topbar-h) + 18px); }

@media (max-width: 1080px) {
    .form-page { grid-template-columns: minmax(0, 1fr); }
    .form-side { position: static; }
}

/* Geniş ekranda form alanları daha ferah dizilsin */
@media (min-width: 1100px) {
    .form-grid.roomy { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* align-content:start olmazsa, yanındaki alanın ipucu satırı yüzünden
   uzayan satırda bu alanın kutusu boyuna geriliyor. */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }

.field > label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-2);
}
.field .hint {
    font-size: .78rem;
    color: var(--muted);
}
.field .err {
    font-size: .78rem;
    color: var(--bad);
    font-weight: 550;
}

.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
    appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

/* Salt okunur kutular: IBAN, cron komutu, kurulum adresi…
   <code> ve <span> satır içi olduğundan dikey dolgu satır kutusunun dışına
   taşar; uzun bir IBAN dar ekranda sarınca kutular üst üste biner. */
code.input, span.input, .input[readonly] {
    display: block;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* Değiştirilemeyen alan düzenlenebilir gibi durmasın */
.input:disabled, .select:disabled, .textarea:disabled {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--muted);
    cursor: not-allowed;
}

.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.input.has-error, .select.has-error, .textarea.has-error {
    border-color: var(--bad);
}
.input.has-error:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent);
}

.select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7794' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}
:root[data-theme="dark"] .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b95ae' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.input[type="date"] { min-height: 41px; }
:root[data-theme="dark"] .input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(.75);
    cursor: pointer;
}

/* Para girişi */
.input-money { position: relative; }
.input-money .input { padding-right: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.input-money::after {
    content: "₺";
    position: absolute;
    right: 13px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-weight: 600;
    pointer-events: none;
}

.input-search { position: relative; }
.input-search .input { padding-left: 36px; }
.input-search .icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    width: 16px; height: 16px;
    pointer-events: none;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.check:hover { border-color: var(--border-strong); }
.check input {
    width: 17px; height: 17px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
    flex: none;
}
.check-text { font-size: .87rem; }
.check-text strong { display: block; font-weight: 600; }
.check-text span { color: var(--muted); font-size: .8rem; }
.check:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Segment seçici */
.segment {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--surface-3);
    border-radius: 10px;
}
.segment a, .segment button {
    padding: 6px 13px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .84rem;
    font-weight: 580;
    cursor: pointer;
    transition: background .16s var(--ease), color .16s var(--ease);
}
.segment a:hover, .segment button:hover { color: var(--text); }
.segment .is-on {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}
.filters .field { flex: 1 1 150px; }
.filters .actions { display: flex; gap: 8px; }

/* --- Bildirimler ---------------------------------------------------------- */
.flash-stack {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 200;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    font-size: .88rem;
    animation: slide-in .34s var(--ease) both;
}
.flash .icon { width: 18px; height: 18px; margin-top: 1px; }
.flash .msg { flex: 1; min-width: 0; }
.flash .close {
    border: 0; background: transparent; padding: 2px;
    color: var(--muted); cursor: pointer; line-height: 0;
}
.flash .close:hover { color: var(--text); }

.flash.is-success { border-left: 3px solid var(--ok); }
.flash.is-success .icon { color: var(--ok); }
.flash.is-error   { border-left: 3px solid var(--bad); }
.flash.is-error .icon { color: var(--bad); }
.flash.is-warning { border-left: 3px solid var(--warn); }
.flash.is-warning .icon { color: var(--warn); }
.flash.is-info    { border-left: 3px solid var(--info); }
.flash.is-info .icon { color: var(--info); }

.flash.is-leaving { animation: slide-out .28s var(--ease) forwards; }

@keyframes slide-in {
    from { opacity: 0; transform: translateX(24px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes slide-out {
    to { opacity: 0; transform: translateX(24px) scale(.97); }
}

/* display:flex taşıyan kutular hidden özniteliğini ezmesin */
[hidden] { display: none !important; }

.notice {
    display: flex;
    gap: 11px;
    padding: 13px 15px;
    border-radius: var(--r);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: .88rem;
    color: var(--text-2);
}
.notice .icon { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.notice.is-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.notice.is-bad  { background: var(--bad-soft);  border-color: color-mix(in srgb, var(--bad) 30%, transparent);  color: var(--bad); }
.notice.is-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }

/* --- İlerleme ------------------------------------------------------------- */
.bar {
    height: 7px;
    border-radius: var(--r-full);
    background: var(--surface-3);
    overflow: hidden;
}
.bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .6s var(--ease);
}
.bar.tone-ok  > span { background: var(--ok); }
.bar.tone-warn> span { background: var(--warn); }
.bar.tone-bad > span { background: var(--bad); }

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bar-row .bar { flex: 1; min-width: 60px; }
.bar-row .pct {
    font-size: .79rem;
    font-weight: 650;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: right;
}

/* --- Sütun grafik --------------------------------------------------------- */
.chart {
    display: flex;
    align-items: flex-end;
    gap: clamp(4px, 1.2vw, 12px);
    height: 190px;
    padding-top: 12px;
}
.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 0;
    height: 100%;
}
.chart-bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}
.chart-bar {
    flex: 1;
    max-width: 20px;
    min-height: 3px;
    border-radius: 5px 5px 2px 2px;
    background: var(--accent);
    position: relative;
    transition: opacity .18s var(--ease), transform .18s var(--ease);
    animation: grow .7s var(--ease) both;
    transform-origin: bottom;
}
.chart-bar.is-expense { background: var(--bad); opacity: .85; }
.chart-col:hover .chart-bar { opacity: 1; transform: scaleY(1.02); }

@keyframes grow {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

.chart-label {
    font-size: .71rem;
    color: var(--muted);
    font-weight: 560;
    white-space: nowrap;
}

.chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: .8rem;
    color: var(--muted);
}
.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chart-legend i {
    width: 9px; height: 9px;
    border-radius: 3px;
    background: var(--accent);
}
.chart-legend i.expense { background: var(--bad); }

/* --- Liste --------------------------------------------------------------- */
.list { display: grid; }
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    transition: background .13s var(--ease);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title {
    font-weight: 590;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item .meta {
    font-size: .79rem;
    color: var(--muted);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.list-item .value {
    font-weight: 660;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --- Tanım listesi ------------------------------------------------------- */
.deflist {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 18px;
    font-size: .89rem;
}
.deflist dt { color: var(--muted); font-weight: 550; }
.deflist dd { margin: 0; font-weight: 550; }

/* Etiket solda, değer sağda; satır satır ayrılmış künye listesi */
.detay { margin: 0; }
.detay > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    font-size: .88rem;
}
.detay > div:last-child { border-bottom: 0; }
.detay dt { color: var(--muted); font-weight: 550; flex: none; }
.detay dd {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Şifre alanında göster/gizle düğmesi */
.input-reveal { position: relative; display: flex; }
.input-reveal .input { padding-right: 42px; }
.input-reveal .reveal {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.input-reveal .reveal:hover { background: var(--surface-3); color: var(--text); }
.input-reveal .reveal.is-on { color: var(--accent-text); background: var(--accent-soft); }
.input-reveal .reveal .icon { width: 17px; height: 17px; }

/* --- Sayfalama ----------------------------------------------------------- */
.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pager .info {
    margin-right: auto;
    font-size: .83rem;
    color: var(--muted);
}
.pager a, .pager span.p {
    display: grid;
    place-items: center;
    min-width: 34px; height: 34px;
    padding: 0 9px;
    border-radius: 9px;
    border: 1px solid var(--border);
    font-size: .85rem;
    font-weight: 570;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: var(--accent); color: var(--accent-text); }
.pager .is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pager .gap { border: 0; color: var(--faint); }

/* --- Kalıcı pencere (modal) ---------------------------------------------- */
dialog.modal {
    width: min(560px, calc(100vw - 32px));
    /* Tarayıcının varsayılan max-width'i (100% - 6px - 2em) kutuyu daraltıyor;
       kendi genişliğimizin geçerli olması için birlikte ezilmeli. */
    max-width: calc(100vw - 32px);
    max-height: 88vh;
    max-height: 88dvh;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Başlık ve alt çubuk sabit kalsın, yalnızca gövde kaysın. */
dialog.modal[open] {
    display: flex;
    flex-direction: column;
    animation: pop .24s var(--ease);
}
dialog.modal .card-head,
dialog.modal .card-foot { flex: none; }
dialog.modal .card-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
/* Aynı pencerede birden çok form varsa (örn. düzenle + şifre) hepsi kaysın */
dialog.modal > form { display: contents; }

dialog.modal::backdrop {
    background: rgba(6, 8, 14, .55);
    backdrop-filter: blur(3px);
}

@keyframes pop {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* --- Onay penceresi (tarayıcının confirm kutusu yerine) ------------------- */
dialog.modal-onay { width: min(440px, calc(100vw - 32px)); }

.onay-govde {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 24px 24px 18px;
}

.onay-ikon {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    flex: none;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent-text);
}
.onay-ikon .icon { width: 21px; height: 21px; }

.modal-onay.is-tehlike .onay-ikon {
    background: var(--bad-soft);
    color: var(--bad);
}

.onay-baslik {
    margin: 2px 0 6px;
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -.01em;
}
.onay-metin {
    margin: 0;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--text-2);
}

.onay-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
}

@media (max-width: 480px) {
    .onay-govde { padding: 20px 18px 14px; }
    .onay-foot {
        flex-direction: column-reverse;
        padding: 12px 18px 18px;
    }
    .onay-foot .btn { width: 100%; justify-content: center; }
}

/* --- Giriş sayfası -------------------------------------------------------- */
.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-card {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: 34px 32px;
    animation: rise .4s var(--ease) both;
}
.auth-brand {
    display: grid;
    place-items: center;
    gap: 13px;
    margin-bottom: 26px;
    text-align: center;
}
.auth-brand .brand-mark { width: 52px; height: 52px; border-radius: 15px; }
.auth-brand .brand-mark .icon { width: 26px; height: 26px; }
.auth-brand h1 { font-size: 1.32rem; }
.auth-brand p { color: var(--muted); font-size: .87rem; margin: 0; }

.auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: .8rem;
    color: var(--muted);
}

/* --- Yardımcı sınıflar ---------------------------------------------------- */
.stack   { display: grid; gap: 16px; }
.stack-sm{ display: grid; gap: 9px; }
.row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow    { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.small { font-size: .82rem; }
.tiny  { font-size: .76rem; }
.bold  { font-weight: 650; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hide { display: none !important; }

/* --- Duyarlılık ----------------------------------------------------------- */
@media (max-width: 1024px) {
    .shell { grid-template-columns: minmax(0, 1fr); }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform .28s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: none; }

    .nav-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(6, 8, 14, .5);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .28s var(--ease);
        z-index: 35;
    }
    body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

    .menu-toggle { display: inline-grid; }
}

@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .public-bar { gap: 10px; padding: 10px 14px; }
    .public-nav { display: none; }
    .public-foot { padding: 16px 14px; font-size: .78rem; }
    .hide-xs { display: none; }
    .login-cta { padding: 16px; }
    .login-cta .btn { margin-left: 0; width: 100%; }
    .install-banner { bottom: 10px; padding: 11px 12px; }
    .content { padding: 14px; padding-bottom: 48px; }
    .card-body { padding: 14px; }
    .card-head { padding: 13px 14px; }
    .page-head { margin-bottom: 16px; }
    .page-actions { width: 100%; }
    /* Sabit genişlik yerine esneme payı: sığmayan düğme alt satıra iner,
       böylece sayfa yatay olarak taşmaz. */
    .page-actions .btn,
    .page-actions form { flex: 1 1 150px; }
    .page-actions form .btn { width: 100%; }
    .flash-stack { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; }
    table.data { font-size: .845rem; }
    table.data th, table.data td { padding: 10px 11px; }
    .topbar { padding: 0 14px; }
    .topbar-title span { display: none; }
    .grid { gap: 12px; }
}

/* --- Yazdırma ------------------------------------------------------------- */
@media print {
    .sidebar, .topbar, .page-actions, .pager, .flash-stack,
    .no-print, .btn, .filters, .nav-scrim { display: none !important; }

    body { background: #fff; color: #000; font-size: 11pt; }
    .shell { display: block; }
    .content { padding: 0; max-width: none; animation: none; }
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    table.data th { background: #f0f0f0 !important; color: #000; }
    a { color: #000; text-decoration: none; }
    .print-only { display: block !important; }
}

.print-only { display: none; }

/* --- Hareket duyarlılığı -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Sade herkese açık ekran ---------------------------------------------- */
.sade-govde { max-width: 1000px; margin-inline: auto; }
/* Alt sırada iki kart eşit yükseklikte durmasın, içeriği kadar olsun */
.sade-govde .grid.cols-2 { align-items: start; }


/* Sade ekrandaki yönetici künyesi: kart dolgusunun içinde kalır */
.sade-kunye {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.sade-kunye > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 13px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
}
.sade-kunye > div:last-child { border-bottom: 0; }
.sade-kunye dt { color: var(--muted); font-weight: 550; }
.sade-kunye dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* --- Yasal metin sayfaları ----------------------------------------------- */
.yasal-kapak {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 26px 28px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    background:
        radial-gradient(700px 260px at 100% -30%, var(--accent-soft) 0%, transparent 65%),
        var(--surface);
    box-shadow: var(--shadow-sm);
}
.yasal-kapak h1 { margin: 0 0 6px; font-size: 1.65rem; letter-spacing: -.02em; }
.yasal-kapak > .grow > p {
    margin: 0;
    max-width: 68ch;
    color: var(--text-2);
    line-height: 1.65;
}

.yasal-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: var(--r-lg);
    color: #fff;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 22px -10px var(--accent);
}
.yasal-mark .icon { width: 26px; height: 26px; }

.yasal-etiket {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
    font-size: .8rem;
    color: var(--muted);
}
.yasal-etiket span { display: inline-flex; align-items: center; gap: 6px; }
.yasal-etiket .icon { width: 15px; height: 15px; opacity: .8; }

.yasal-duzen {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
/* İçindekiler yoksa gövde tüm genişliği kullanır */
.yasal-duzen > .yasal-govde:only-child { grid-column: 1 / -1; }

.yasal-yan { position: sticky; top: calc(var(--topbar-h) + 16px); }

.yasal-nav { display: flex; flex-direction: column; }
.yasal-nav a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 15px;
    font-size: .87rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    transition: background .15s var(--ease), color .15s var(--ease);
}
.yasal-nav a:last-child { border-bottom: 0; }
.yasal-nav a:hover { background: var(--surface-2); color: var(--accent-text); }
.yasal-nav-no {
    flex: 0 0 auto;
    font-family: var(--ff-mono);
    font-size: .72rem;
    color: var(--faint);
}

.yasal-govde { display: flex; flex-direction: column; gap: 14px; }
.yasal-govde .card + .card { margin-top: 0; }

.yasal-bolum { scroll-margin-top: calc(var(--topbar-h) + 20px); }
.yasal-bolum-bas {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.yasal-bolum-bas h2 { margin: 0; font-size: 1.06rem; letter-spacing: -.01em; }
.yasal-no {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    border-radius: var(--r-sm);
    font-family: var(--ff-mono);
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent-soft);
}

.yasal-metin { line-height: 1.75; color: var(--text-2); }
.yasal-metin p { margin: 0 0 10px; }
.yasal-metin p:last-child { margin-bottom: 0; }
.yasal-metin ul { margin: 0 0 10px; padding-left: 0; list-style: none; }
.yasal-metin ul:last-child { margin-bottom: 0; }
.yasal-metin li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 6px;
}
.yasal-metin li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: .62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .65;
}

.yasal-son { background: var(--surface-2); }
.yasal-son h3 { margin: 0 0 4px; font-size: 1rem; }
.yasal-son-ic {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
/* Metin sütunu düğmelerin yanında ezilip tek kelimelik şeride dönmesin;
   yer kalmadığında satır atlar. */
.yasal-son-ic > .grow { flex: 1 1 260px; min-width: 0; }
.yasal-son-ic .btn-row { flex-wrap: wrap; }

@media (max-width: 900px) {
    .yasal-duzen { grid-template-columns: minmax(0, 1fr); }
    .yasal-yan { position: static; }
    .yasal-kapak { padding: 20px; gap: 14px; }
    .yasal-kapak h1 { font-size: 1.35rem; }
    .yasal-mark { width: 44px; height: 44px; }
    .yasal-mark .icon { width: 22px; height: 22px; }
}

@media (max-width: 600px) {
    .yasal-son-ic { align-items: stretch; gap: 14px; }
    .yasal-son-ic .btn-row .btn { flex: 1 1 auto; justify-content: center; }
}

/* --- IBAN alanı ---------------------------------------------------------- */
.iban-kutu .iban-metin {
    font-family: var(--ff-mono);
    font-size: .84rem;
    letter-spacing: .02em;
    overflow-wrap: anywhere;
}
/* Maskeliyken numara gri; açılınca normal metin rengine döner */
.iban-kutu:not(.is-acik) .iban-metin { color: var(--muted); }
.iban-kutu [data-copy][disabled] { opacity: .45; cursor: not-allowed; }
.iban-kutu [data-iban-goster] { flex: 0 0 auto; white-space: nowrap; }
