﻿/* =========================================================
   Defne Sitesi – site.css (LIGHT-FIRST, MOBILE-ÖNCELİK)
   - Yüksek kontrast, büyük dokunma alanları
   - Mobil tam genişlik menü + overlay
   - Kart, tablo, buton, form stilleri
   - Koyu modu ZORLAMAZ (sistem koyu olsa bile açık kalsın)
   ========================================================= */

/* ---------- Temel Değişkenler ---------- */
:root {
    --bg: #f7f9fc;
    --panel: #ffffff;
    --text: #0b1220;
    --muted: #667085;
    --brand: #2563eb; /* mavi (bir ton daha koyu) */
    --brand-2: #22c55e; /* vurgulu yeşil */
    --danger: #dc2626;
    --warning: #d97706;
    --success: #16a34a;
    --border: #e6eaf3;
    --ring: rgba(37,99,235,.22);
    --card: #ffffff;
    --shadow: 0 10px 24px rgba(16,24,40,.08);
}

/* iOS/Safari koyu görünüm ipucu: açık şema kullan */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light;
    }
    /* açık şemayı koru */
}

/* Kullanışlı ölçüler */
:root {
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --container: 1120px;
}

/* ---------- Reset & Base ---------- */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font: 16px/1.6 "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

/* Daha okunur başlıklar */
h1, h2, h3 {
    margin: 0 0 .5rem;
    line-height: 1.25;
}

h1 {
    font-size: clamp(1.6rem,2.5vw,2.0rem);
}

h2 {
    font-size: clamp(1.3rem,2vw,1.6rem);
}

h3 {
    font-size: clamp(1.1rem,1.6vw,1.25rem);
}

/* Bağlantılar */
a {
    color: var(--brand);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* ---------- Düzen (Layout) ---------- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 20px;
}

/* Üst bar – açık ve opak */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(16,24,40,.06);
}

.header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

/* Marka */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .2px;
}

    .brand img {
        height: 38px;
        width: auto;
        display: block;
    }

    .brand .name {
        font-size: 18px;
    }

/* ---------- Navigasyon ---------- */
.nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

    .nav a {
        color: var(--text);
        text-decoration: none;
        padding: 10px 14px;
        border-radius: var(--radius-sm);
        border: 1px solid transparent;
        font-weight: 600;
        transition: .18s ease;
    }

        .nav a:hover {
            background: #f2f4f7;
            border-color: var(--border);
        }

        .nav a.active {
            background: linear-gradient(45deg,var(--brand),var(--brand-2));
            color: #fff;
            box-shadow: 0 6px 18px rgba(37,99,235,.25);
        }

/* Hamburger (mobil) */
.hamb {
    display: none;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    line-height: 1;
}

/* Mobil menü paneli */
@media (max-width: 768px) {
    .hamb {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 10px);
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 12px;
        flex-direction: column;
    }

        .nav.open {
            display: flex;
        }

        .nav a {
            padding: 14px 12px;
            border-radius: var(--radius-sm);
        }
}

/* Menü açıkken arka plan overlay (Site.Master içine <div id="overlay"> eklemeye gerek yok, pseudo ile) */
.topbar::after {
    content: "";
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(1px);
}

@media (max-width:768px) {
    .nav.open ~ * {
    }
    /* yer tutucu */
    .topbar.menu-open::after {
        display: block;
    }
}

/* JS tarafında:
   toggleNav() içinde:
   document.getElementById('nav').classList.toggle('open');
   document.querySelector('.topbar').classList.toggle('menu-open');
*/

/* ---------- Izgara ve Kartlar ---------- */
.grid {
    display: grid;
    gap: 16px;
}

    .grid.cols-2 {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .grid.cols-3 {
        grid-template-columns: repeat(3,minmax(0,1fr));
    }

@media (max-width:900px) {
    .grid.cols-3 {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width:640px) {
    .grid.cols-2, .grid.cols-3 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

    .card h3 {
        margin: 0 0 8px;
    }

.muted {
    color: var(--muted);
    font-size: .95rem;
}

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: .16s ease;
    user-select: none;
}

    .btn:hover {
        box-shadow: 0 0 0 6px var(--ring);
        transform: translateY(-1px);
    }

    .btn.primary {
        background: linear-gradient(90deg,var(--brand),var(--brand-2));
        color: #fff;
        border-color: transparent;
    }

    .btn.danger {
        background: #fee2e2;
        color: #991b1b;
        border-color: #fecaca;
    }

    .btn.ghost {
        background: transparent;
    }

/* Dokunmatik hedef büyüklüğü */
button, .btn, .nav a {
    min-height: 44px;
}

/* ---------- Etiketler / Kod parçaları ---------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #e0e7ff;
    font-weight: 600;
    font-size: .85rem;
}

.code {
    font-family: ui-monospace,SFMono-Regular,Consolas,monospace;
    font-size: 1rem;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f2f4f7;
    border: 1px solid var(--border);
}

/* ---------- Tablolar ---------- */
/* Yatay kaydırma sarmalayıcı */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOS momentum */
}

/* GridView tablo stili (layout .grid ile karışmasın diye ayrı sınıf) */
.grid-table {
    width: auto; /* 100% değil: içeriğe göre büyüsün */
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

    /* Başlık & hücreler */
    .grid-table th, .grid-table td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
    }

/* Mobilde satır kırmayı kapat → genişlik taşsın, scroll oluşsun */
@media (max-width:768px) {
    .table-scroll .grid-table {
        min-width: 800px;
    }
        /* gerekirse artır */
        .table-scroll .grid-table th,
        .table-scroll .grid-table td {
            white-space: nowrap;
        }
}

.grid-table tr:last-child td {
    border-bottom: none;
}

.grid-table th {
    background: #f8fafc;
    text-align: left;
    font-weight: 700;
}

/* ---------- Form Elemanları ---------- */
input[type="text"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    outline: none;
    transition: .15s ease;
}

    input:focus, select:focus, textarea:focus {
        box-shadow: 0 0 0 6px var(--ring);
        border-color: var(--brand);
    }

/* ---------- Bildirim (Toast) ---------- */
.toast {
    position: fixed;
    bottom: 18px;
    right: 18px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(8px);
    transition: .2s ease;
    pointer-events: none;
}

    .toast.show {
        opacity: 1;
        transform: none;
    }

/* ---------- Alt Bilgi ---------- */
footer {
    color: var(--muted);
    text-align: center;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    margin-top: 30px;
    background: #fff;
}

/* ---------- Yardımcı Sınıflar ---------- */
.center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.right {
    text-align: right;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: .25rem !important;
}

.mt-2 {
    margin-top: .5rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: .5rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.hide {
    display: none !important;
}

/* ---------- Hareket kısıtlaması (erişilebilirlik) ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ---------- Güvenli alan (iPhone alt çentik) ---------- */
@supports (padding: max(0px)) {
    .toast {
        right: max(18px, env(safe-area-inset-right));
        bottom: max(18px, env(safe-area-inset-bottom));
    }
}

/* ---------- Özel: Banka kartlarında IBAN kopyala butonu hizası ---------- */
.bank-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}
/* Mobilde geniş tabloyu yatay kaydırılabilir yap */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOS için momentum scroll */
}

    .table-scroll > table {
        width: max-content; /* içeriğe göre genişlesin, böylece scroll oluşur */
        min-width: 700px; /* çok dar ekranlarda bile bir taban ver */
        table-layout: auto;
    }

@media (max-width:768px) {
    .table-scroll > table th,
    .table-scroll > table td {
        white-space: nowrap;
    }
    /* sayı/başlık kırılmasın */
}


.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.badge-success {
    background: linear-gradient(90deg,#22c55e,#16a34a);
}

.badge-warning {
    background: linear-gradient(90deg,#f59e0b,#d97706);
}

.badge-danger {
    background: linear-gradient(90deg,#ef4444,#b91c1c);
}
/* Modern GridView tasarımı */
.gv-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #444;
}

    .gv-modern th {
        background: #f9fafb;
        padding: 12px 10px;
        font-weight: 600;
        border-bottom: 1px solid #e5e7eb;
        color: #111827;
    }

    .gv-modern td {
        padding: 12px 10px;
        border-bottom: 1px solid #f1f1f1;
    }

    /* Alternatif satır */
    .gv-modern tr:nth-child(even) td {
        background: #fafafa;
    }

    /* Hover */
    .gv-modern tr:hover td {
        background: #f3f4f6;
    }

/* Hücre köşelerinin daha yumuşak görünmesi için */
.card .gv-modern {
    border-radius: 10px;
    overflow: hidden;
}

/* Tutar ve Bakiye sağa hizalı */
.gv-modern td:nth-child(5),
.gv-modern td:nth-child(7) {
    text-align: right;
    font-weight: 600;
}

/* Hareket renkleri */
.gv-modern td:nth-child(6) {
    font-weight: 600;
}

    .gv-modern td:nth-child(6):contains("Borç") {
        color: #b91c1c;
    }

    .gv-modern td:nth-child(6):contains("Alacak") {
        color: #15803d;
    }
.gv-modern th {
    padding: 14px 12px !important;
    font-size: 15px;
}

.gv-modern td {
    padding: 12px 12px !important;
}
    .gv-modern td.tutar,
    .gv-modern td.bakiye {
        text-align: right;
        font-weight: 600;
    }
.gv-modern tr:nth-child(even) td {
    background: #f6f7f9;
}

.gv-modern tr:hover td {
    background: #eef1f5;
}
.gv-modern td:nth-child(4) {
    white-space: normal !important;
}