/* Genel Stil Ayarları */
:root {
    --primary-color: #007bff; /* Daha canlı bir Bootstrap mavisi */
    --primary-color-darker: #0056b3;
    --secondary-color: #6c757d; /* Gri */
    --success-color: #198754; /* Yeşil */
    --danger-color: #dc3545; /* Kırmızı */
    --warning-color: #ffc107; /* Sarı */
    --info-color: #0dcaf0; /* Açık Mavi */
    --light-color: #f8f9fa; /* Açık Gri */
    --dark-color: #212529; /* Koyu Gri */
    --white-color: #fff;
    --sidebar-bg: #2c3e50; /* Koyu Mavi/Gri Sidebar */
    --sidebar-link-color: rgba(255, 255, 255, 0.7);
    --sidebar-link-hover-color: #fff;
    --sidebar-link-active-bg: var(--primary-color);
    --sidebar-width: 260px;
    --header-height: 65px; /* Header yüksekliği */
    --font-family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* Modern font */
    --border-radius: 0.375rem; /* Biraz daha yuvarlak köşeler */
    --box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08); /* Daha belirgin gölge */
    --input-border-color: #dee2e6;
    --input-focus-border-color: #86b7fe;
    --input-focus-box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px; /* Temel font boyutu */
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    background-color: #eef2f7; /* Daha yumuşak arka plan */
    color: #495057; /* Daha yumuşak metin rengi */
}

.page-container {
    display: flex;
    min-height: 100vh;
}

/* Kenar Çubuğu (Sidebar) */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--white-color);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    text-align: center;
    background-color: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--white-color);
    font-weight: 600;
    border: none;
    padding: 0;
}

.sidebar ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar ul li a {
    display: flex; /* İkon eklemek için */
    align-items: center;
    color: var(--sidebar-link-color);
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-left-color 0.2s ease-in-out;
    border-left: 4px solid transparent;
    font-size: 0.95rem;
}
/* İkonlar için yer (opsiyonel - font awesome vb. eklenebilir)
.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}
*/
.sidebar ul li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-link-hover-color);
}

.sidebar ul li a.active {
    background-color: var(--sidebar-link-active-bg);
    color: var(--sidebar-link-hover-color);
    border-left-color: var(--warning-color);
    font-weight: 600;
}

/* Çıkış linki */
.sidebar ul li.logout-link {
     margin-top: 1.5rem;
     padding-top: 1rem;
     border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar ul li.logout-link a {
    color: var(--warning-color); /* Çıkış linki farklı renk */
    border-left-color: transparent !important; /* Aktif stilini ez */
    background-color: transparent !important;
}
.sidebar ul li.logout-link a:hover {
    color: #ffdd80;
    background-color: rgba(255, 193, 7, 0.1) !important;
}


/* Ana İçerik Alanı */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
    background-color: #eef2f7; /* Ana içerik arka planı */
}

/* Header (Ana İçerik İçinde) */
.main-content header {
    background-color: var(--white-color);
    color: var(--dark-color);
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 900;
}

.main-content header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

/* Mobil Menü Butonu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0.5rem;
}

/* Main (Ana İçerik İçinde) */
.main-content main {
    flex-grow: 1;
    padding: 2rem; /* Daha fazla iç boşluk */
    background: transparent; /* Arka plan body'den gelsin */
    margin: 0;
    width: 100%;
    max-width: none;
    box-shadow: none;
    border-radius: 0;
}

/* İçerik Kartları */
.content-card {
    background-color: var(--white-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

main h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.6rem;
    margin-top: 0;
    margin-bottom: 1.8rem;
    font-size: 1.6rem;
    font-weight: 600;
}

main h3 {
    color: var(--dark-color);
    margin-top: 1.8rem;
    margin-bottom: 1.2rem;
    font-size: 1.3rem;
    font-weight: 600;
}
main h4 {
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Footer (Ana İçerik İçinde) */
.main-content footer {
    background: var(--white-color);
    color: var(--secondary-color);
    text-align: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
    font-size: 0.9rem;
}

/* Form Elemanları */
form label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #495057; font-size: 0.9rem; }
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="number"], form input[type="date"], form input[type="file"], form textarea, form select { display: block; width: 100%; padding: 0.65rem 0.9rem; font-size: 0.95rem; font-weight: 400; line-height: 1.5; color: var(--dark-color); background-color: #fff; background-clip: padding-box; border: 1px solid var(--input-border-color); appearance: none; border-radius: var(--border-radius); transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; box-sizing: border-box; margin-bottom: 1.2rem; }
form input[type="file"] { padding: 0.55rem 0.9rem; }
form input:focus, form textarea:focus, form select:focus { color: var(--dark-color); background-color: #fff; border-color: var(--input-focus-border-color); outline: 0; box-shadow: var(--input-focus-box-shadow); }
form textarea { min-height: 100px; resize: vertical; }
form button, input[type="submit"], a.button { display: inline-block; font-weight: 500; line-height: 1.5; color: #fff; text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; user-select: none; background-color: var(--primary-color); border: 1px solid var(--primary-color); padding: 0.65rem 1.2rem; font-size: 0.95rem; border-radius: var(--border-radius); transition: all 0.15s ease-in-out; }
form button:hover, input[type="submit"]:hover, a.button:hover { background-color: var(--primary-color-darker); border-color: var(--primary-color-darker); filter: brightness(1.1); }
.btn-success { background-color: var(--success-color); border-color: var(--success-color); } .btn-success:hover { background-color: #157347; border-color: #146c43; filter: brightness(1.1); }
.btn-danger { background-color: var(--danger-color); border-color: var(--danger-color); } .btn-danger:hover { background-color: #bb2d3b; border-color: #b02a37; filter: brightness(1.1); }
.btn-warning { background-color: var(--warning-color); border-color: var(--warning-color); color: var(--dark-color); } .btn-warning:hover { background-color: #ffca2c; border-color: #ffc720; color: var(--dark-color); filter: brightness(1.1); }
.btn-secondary { background-color: var(--secondary-color); border-color: var(--secondary-color); } .btn-secondary:hover { background-color: #5c636a; border-color: #565e64; filter: brightness(1.1); }
a.button.btn-secondary { color: var(--white-color); } /* Link butonlar için renk */
a.button.btn-warning { color: var(--dark-color); }

/* Tablolar */
.table-container { /* Tabloları sarmala (responsive için) */
    overflow-x: auto;
    background-color: var(--white-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}
table { width: 100%; margin-bottom: 0; color: var(--dark-color); vertical-align: middle; /* Ortala */ border-color: #e9ecef; border-collapse: collapse; }
table th, table td { padding: 0.9rem 1rem; vertical-align: middle; border-top: 1px solid #e9ecef; text-align: left; font-size: 0.9rem; }
table thead th { border-bottom: 2px solid #dee2e6; background-color: var(--light-color); font-weight: 600; color: #444; white-space: nowrap; }
table tbody tr:nth-of-type(odd) { background-color: rgba(0, 0, 0, 0.02); }
table tbody tr:hover { background-color: rgba(13, 110, 253, 0.06); }
table a { color: var(--primary-color); text-decoration: none; margin-right: 8px; font-weight: 500; } table a:hover { text-decoration: underline; color: var(--primary-color-darker); }
table td a.btn-danger { color: var(--danger-color); } table td a.btn-danger:hover { color: #bb2d3b; }
table td a.btn-warning { color: #b88b00; } table td a.btn-warning:hover { color: #9e7700; }

/* Özel Tablo Stilleri (Detay Sayfaları İçin) */
table.table-detail { border: none; box-shadow: none; padding: 0; background: none; }
table.table-detail th, table.table-detail td { border: none; padding: 0.6rem 0; border-bottom: 1px solid #eee; font-size: 0.95rem; }
table.table-detail th { width: 30%; font-weight: 600; text-align: left; padding-right: 1rem; color: var(--secondary-color); }
table.table-detail td { font-weight: 500; }

/* Yardımcı Sınıflar */
.error, .success { padding: 1rem 1.25rem; margin-bottom: 1.5rem; border: 1px solid transparent; border-radius: var(--border-radius); font-weight: 500; font-size: 0.95rem; }
.error { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }

/* Müşteri Seçme Listesi Stili */
.customer-selection-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
.customer-selection-list li {
    margin-bottom: 0.75rem;
}
.customer-selection-list li a {
    display: block;
    padding: 1rem 1.5rem;
    background-color: var(--white-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    border: 1px solid #eee;
}
.customer-selection-list li a:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}


/* Diğer İyileştirmeler */
a { color: var(--primary-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-color-darker); text-decoration: underline; }
p { margin-bottom: 1.2rem; }
form table { border: none; margin-top: 0; } form table td { border: none; padding: 0 10px 10px 0; } form table td:last-child { padding-right: 0; } form table label { margin-bottom: 0.2rem; } form table input, form table select, form table textarea { margin-bottom: 0; }

/* Dashboard Kutuları */
.dashboard-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { flex: 1; min-width: 220px; background-color: var(--white-color); padding: 1.5rem; border-radius: var(--border-radius); box-shadow: var(--box-shadow); text-align: center; border-top: 4px solid var(--primary-color); }
.stat-card h4 { margin-top: 0; margin-bottom: 0.5rem; color: var(--secondary-color); font-size: 0.9rem; text-transform: uppercase; font-weight: 600; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--dark-color); margin: 0.5rem 0; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--secondary-color); }
.stat-card.bakiye-alacakli { border-top-color: var(--success-color); }
.stat-card.bakiye-alacakli .stat-value { color: var(--success-color); }
.stat-card.bakiye-borclu { border-top-color: var(--danger-color); }
.stat-card.bakiye-borclu .stat-value { color: var(--danger-color); }
.stat-card.toplam-alacak { border-top-color: var(--success-color); }
.stat-card.toplam-borc { border-top-color: var(--danger-color); }


/* Responsive Kuralları */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: 0 0 20px rgba(0,0,0,0.2); }
    .main-content { margin-left: 0; width: 100%; }
    .mobile-menu-toggle { display: block; }
    .main-content main { padding: 1.5rem; }
    .table-container { /* Mobil için tablo sarmalayıcı */
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
    }
    table {
        /* display: block; Zaten table-container'da */
        /* overflow-x: auto; */
        /* white-space: nowrap; */
    }
}

@media (min-width: 993px) {
    .sidebar { transform: translateX(0); }
    .mobile-menu-toggle { display: none; }
}

/* Müşteri Grid Yapısı */
.musteri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.musteri-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
}

.musteri-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.musteri-info h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.musteri-actions {
    display: flex;
    justify-content: flex-end;
}

.musteri-actions .button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.musteri-actions .button i {
    font-size: 1rem;
}
