/* Yönetici ve Müşteri Paneli Temel Stilleri */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    overflow-x: hidden; /* Mobil kaydırmayı engellemek için */
}
/* Ana Konteyner: Header'ın altından başlar, menü ve içeriği tutar */
.admin-panel-container {
    display: flex;
    min-height: 100vh;
    padding-top: 60px;
    transition: margin-left 0.3s;
}
/* Sabit Header */
header {
    background-color: #14305e;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed; 
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
/* Header Başlığı ve Bilgi Yazıları Düzeltildi */
header h2 { 
    font-size: 18px;
    margin: 0;
}
.header-info { /* Aktif İşletme / Kalan Gün Bilgisi */
    font-size: 13px; 
    line-height: 1.3;
    margin-right: 20px;
    text-align: right;
}

/* Sol Navigasyon Menüsü (Sidebar) */
.sidebar {
    width: 250px; 
    background-color: #2c3e50;
    flex-shrink: 0;
    position: fixed; 
    top: 60px; 
    bottom: 0;
    overflow-y: auto; 
    z-index: 999;
}
/* Navigasyon Stilleri... */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar h4 {
    color: #bdc3c7;
    font-size: 14px;
    padding: 10px 15px 5px;
    margin: 0;
    border-bottom: 1px solid #34495e;
}
.sidebar ul li a {
    display: block;
    color: #ecf0f1;
    padding: 12px 15px;
    text-decoration: none;
    transition: background-color 0.2s;
}
.sidebar ul li a:hover, 
.sidebar ul li a.active {
    background-color: #34495e;
    color: #fff;
}
/* Ana İçerik Alanı (MASAÜSTÜ) */
.content {
    flex-grow: 1;
    padding: 20px;
    margin-left: 250px; 
}

/* ======================================================= */
/* GİRİŞ/KAYIT FORMLARI VE KUTUCUK DÜZELTMESİ */
/* ======================================================= */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}
/* TÜM inputlar ve textarea için genel stil */
.login-container input[type="text"], 
.login-container input[type="password"],
.login-container input[type="email"],
.login-container input[type="number"],
.login-container input[type="date"],
.login-container input,
.modal-content input,
.modal-content textarea { /* Modal inputları da eklendi */
    width: 100%; 
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    display: block; 
    margin-left: auto; 
    margin-right: auto;
}

/* YENİ MODAL FORM GRUBU STİLLERİ (UX için) */
.modal-content label {
    display: block;
    text-align: left;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 3px;
}
/* İki Sütunlu Yan Yana Yerleşim için */
.form-group-flex {
    display: flex;
    gap: 15px; 
    margin-bottom: 10px;
}
.form-group-item {
    flex: 1; 
    min-width: 45%;
}


/* Tablo Stilleri */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.data-table th {
    background-color: #007bff;
    color: white;
}
.data-table tr:nth-child(even) { 
    background-color: #f7f7f7;
}
.data-table tr:hover {
    background-color: #e9ecef;
}

/* Durum Renkleri (Python Mantığına Göre) */
.cari-table .borclu { color: #dc3545; } /* Kırmızı (Size Borçlu) */
.cari-table .alacakli { color: #28aa45; } /* Yeşil (Siz Borçlusunuz) */

/* Alert ve Buton Stilleri */
.alert { 
    padding: 15px; 
    margin-bottom: 20px; 
    border-radius: 4px; 
    font-weight: 500;
}
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-warning { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.btn-primary { 
    background-color: #007bff; 
    color: white; 
    padding: 10px 20px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer;
    transition: background-color 0.2s;
}

/* YENİ İŞLEM TİPİ BUTON RENKLERİ VE TABLO RENKLERİ EKLENDİ */
.btn-danger { background-color: #dc3545; color: white; } /* Borç Ekle */
.btn-success { background-color: #28aa45; color: white; } /* Alacak Ekle */
.btn-info { background-color: #17a2b8; color: white; } /* Tahsilat */
.btn-warning { background-color: #ffc107; color: #333; } /* Ödeme */

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; }

/* Eklenen İşlem Renkleri (cari_detay ve transactions sayfaları için) */
.borclu { color: #dc3545 !important; } 
.alacakli { color: #28aa45 !important; } 
.tahsilat-color { color: #17a2b8 !important; } /* Tahsilat */
.odeme-color { color: #f39c12 !important; }    /* Ödeme */


/* Modal Stilleri */
.modal {
    position: fixed;
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    display: none; 
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}


/* ======================================================= */
/* MOBİL UYUM DÜZELTMELERİ (768px altı) */
/* ======================================================= */
@media (max-width: 768px) {
    /* KRİTİK DÜZELTME: Mobil Kaydırmayı Engelle */
    body {
        overflow-x: hidden; 
    }
    
    /* Header Düzeltme */
    header {
        padding: 10px 15px;
        justify-content: flex-start;
    }
    
    /* Hamburger Menü Butonunu Göster */
    #menuToggle {
        display: block !important;
        order: -1; 
    }

    /* Kalan Gün/İşletme Bilgisini Mobilde Gizle */
    .header-info {
        display: none;
    }

    /* Yan Menü (Sidebar) */
    .sidebar {
        width: 250px; 
        position: fixed;
        left: -250px; 
        top: 60px;
        z-index: 999;
        transition: left 0.3s ease;
        height: calc(100vh - 60px);
        overflow-x: hidden;
    }
    
    /* İçerik: MASAÜSTÜ MARJİNİNİ SIFIRLA */
    .content {
        margin-left: 0 !important; 
        width: 100%;
        padding: 15px;
        box-sizing: border-box;
    }
    
    /* Menü Açıkken Görünüm */
    .sidebar.open {
        left: 0; 
        box-shadow: 2px 0 10px rgba(0,0,0,0.5); 
    }

    /* İstatistik Kartları (Mobil cihazda dikey yığılmalı) */
    .stats-grid {
        grid-template-columns: 1fr; 
    }
    
    /* Modalı Mobilde Tek Sütun Yap */
    .form-group-flex {
        flex-direction: column;
        gap: 0;
    }
}