/* assets/cari-ekstre.css */

/* --- Başlık ve Genel Alanlar --- */
.page-header-flex {
    display: flex; justify-content: space-between; align-items: center;
    background: white; padding: 20px; border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); margin-bottom: 25px;
    flex-wrap: wrap; gap: 20px;
}

.header-left { display: flex; align-items: center; gap: 15px; }

.profile-icon {
    width: 60px; height: 60px; background: #eef2ff; color: #4f46e5;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
    flex-shrink: 0;
}

.page-title { margin: 0; color: #1e293b; font-size: 1.4rem; }
.cari-sub { color: #64748b; font-size: 0.95rem; margin-top: 5px; }

.row-primary { font-size: 1.1rem; color: #334155; margin-bottom: 3px; }
.row-secondary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.row-secondary i { color: #94a3b8; margin-right: 3px; }

/* --- Butonlar --- */
.header-actions {
    display: flex; flex-wrap: wrap; gap: 8px;
}

.btn-outline {
    background: white; border: 1px solid #cbd5e1; color: #475569;
    padding: 8px 15px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline:hover { background: #f8fafc; color: #1e293b; }

.btn-action {
    padding: 8px 15px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.9rem;
    display: inline-flex; align-items: center; gap: 6px; color: white; transition: all 0.2s; border: none;
}

.btn-satis { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2); }
.btn-satis:hover { transform: translateY(-2px); background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); }

.btn-giris { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.btn-giris:hover { background: linear-gradient(135deg, #059669 0%, #047857 100%); }

.btn-cikis { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.btn-cikis:hover { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); }


/* --- GRID LAYOUT (RESPONSIVE) --- */
.dashboard-grid {
    display: grid;
    /* Main column (table) takes available space but can shrink (minmax(0, 1fr)) */
    /* Side column takes fixed width (350px) */
    grid-template-columns: minmax(0, 1fr) 350px; 
    gap: 25px;
    align-items: start; /* Important for sticky sidebar */
}

/* Tablet ve Küçük Laptoplar (Daha dar sidebar) */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 20px;
    }
}

/* Mobiller (Alt alta dizilim) */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Stack vertically */
    }
    .side-column {
        margin-top: 20px;
        position: static !important; /* Disable sticky on mobile */
    }
    .page-header-flex {
        flex-direction: column; align-items: flex-start;
    }
    .header-actions {
        width: 100%; justify-content: flex-start; margin-top: 15px;
    }
}

/* --- Sticky Sidebar (Sabit Yan Panel) --- */
.side-column {
    position: sticky;
    top: 20px; /* Header'dan 20px aşağıda sabitlenir */
    z-index: 10;
}


/* --- Bakiye Kartı --- */
.balance-bar {
    padding: 20px; border-radius: 12px; color: white; margin-bottom: 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.balance-bar.negative { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.balance-bar.positive { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }

.balance-label { font-size: 0.9rem; font-weight: 600; opacity: 0.9; }
.balance-amount { font-size: 1.8rem; font-weight: 800; text-align: right; }
.balance-amount small { display: block; font-size: 0.8rem; font-weight: 600; opacity: 0.8; }

/* --- Tablo --- */
.ledger-table-box {
    background: white; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); overflow: hidden;
    width: 100%; /* Ensure it fits the grid cell */
}
.box-header { padding: 15px 20px; border-bottom: 1px solid #f1f5f9; }
.box-header h3 { margin: 0; color: #334155; font-size: 1rem; }

/* Tablo Scroll Ayarı */
.table-scroll { 
    width: 100%; 
    overflow-x: auto; /* Yatay scroll açılır */
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 800px; /* Min width ensures scroll trigger */ }
th { padding: 12px 15px; text-align: left; background: #f8fafc; color: #64748b; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; font-size: 0.9rem; }

.text-small { font-size: 0.85rem; }
.text-muted { color: #94a3b8; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-red { color: #dc2626; }
.text-green { color: #059669; }
.font-bold { font-weight: 700; }

.desc-text { font-weight: 600; color: #1e293b; min-width: 200px; display: block; }
.doc-no { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }

/* Badges */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; display: inline-block; margin-bottom: 3px; white-space: nowrap; }
.badge-hizmet { background: #fef3c7; color: #d97706; }
.badge-satis { background: #fee2e2; color: #991b1b; }
.badge-tahsilat { background: #dcfce7; color: #166534; }
.badge-alis { background: #dbeafe; color: #1e40af; }
.badge-tediye { background: #fef2f2; color: #991b1b; }
.badge-odendi { background: #ecfdf5; color: #047857; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

.total-row td { background: #f8fafc; font-weight: 800; border-top: 2px solid #e2e8f0; color: #1e293b; }

/* Vade */
.vade-alert { color: #dc2626; font-weight: 800; font-size: 0.85rem; margin-top: 4px; display: flex; align-items: center; gap: 5px; background: rgba(255, 255, 255, 0.6); padding: 2px 5px; border-radius: 4px; white-space: nowrap; }
.vade-normal { color: #64748b; font-size: 0.8rem; margin-top: 4px; font-weight: 500; white-space: nowrap; }
.row-gecikmis { background-color: #fef2f2 !important; border-left: 4px solid #ef4444; }
.row-gecikmis td { color: #7f1d1d; }

/* Butonlar */
.btn-hizli-ode { background: #10b981; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: 0.2s; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.btn-hizli-ode:hover { background: #059669; transform: scale(1.05); }

.btn-kapat { background: transparent; color: #9ca3af; border: 1px solid #e5e7eb; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; margin-left: 5px; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn-kapat:hover { background: #f3f4f6; color: #6b7280; }

/* Sağ Kolon Kartları */
.info-card { background: white; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); overflow: hidden; margin-bottom: 25px; }
.emanet-card { border-top: 4px solid #3b82f6; }
.card-title { padding: 15px; font-weight: 700; color: #334155; border-bottom: 1px solid #f1f5f9; }
.card-title i { margin-right: 8px; color: #3b82f6; }
.title-green { border-top: 4px solid #10b981; }
.title-green i { color: #10b981; }
.card-content { padding: 15px; }

.stock-list { list-style: none; padding: 0; margin: 0; }
.stock-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; }
.stock-list li:last-child { border-bottom: none; }
.s-name { font-weight: 600; color: #475569; }
.s-amount { font-weight: 800; color: #3b82f6; }

.btn-link { display: block; text-align: center; margin-top: 10px; color: #3b82f6; font-size: 0.85rem; text-decoration: none; font-weight: 600; }
.empty-state { text-align: center; color: #94a3b8; font-style: italic; padding: 10px; }

.payment-form-box { background: white; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); overflow: hidden; }
.payment-form-box form { padding: 15px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #64748b; margin-bottom: 4px; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; font-family: 'Inter'; }
.input-highlight { font-size: 1.1rem; font-weight: 700; color: #10b981; border-color: #86efac !important; }

.btn-submit { width: 100%; background: #10b981; color: white; padding: 12px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-submit:hover { background: #059669; }

@media print {
    .sidebar, header, .no-print, .btn-print, .header-actions { display: none !important; }
    .main-content { margin: 0 !important; width: 100% !important; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .side-column { display: none; }
    .ledger-table-box { box-shadow: none; border: 1px solid #000; }
    .table-scroll { overflow: visible; }
}