/**
 * ERP Sistemi - Ana CSS Dosyası
 * BizimHesap benzeri modern tasarım
 */

:root {
    --primary-color: #4361ee;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Para birimi formatı */
.currency-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.currency-positive {
    color: var(--success-color);
}

.currency-negative {
    color: var(--danger-color);
}

/* Genel Stil */
body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

/* Sidebar Layout */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #4361ee 0%, #3730a3 100%);
    color: #fff;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Body Layout - Sidebar için margin */
body {
    margin: 0;
    padding: 0;
}

/* Main tag - Sidebar yanında */
main,
.main-content {
    margin-left: 260px !important;
    padding: 0 !important;
    min-height: 100vh;
}

/* Container Fluid - Full width, no centering */
main .container-fluid,
.main-content .container-fluid,
.container-fluid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    max-width: none !important;
    width: 100% !important;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    main,
    .main-content {
        margin-left: 0 !important;
    }
    
    main .container-fluid,
    .main-content .container-fluid,
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Kartlar */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

/* Summary Cards */
.summary-card {
    border-left: 4px solid;
}

.summary-card.success {
    border-left-color: var(--success-color);
}

.summary-card.danger {
    border-left-color: var(--danger-color);
}

.summary-card .amount {
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0;
}

.summary-card.success .amount {
    color: var(--success-color);
}

.summary-card.danger .amount {
    color: var(--danger-color);
}

/* Tablolar */
.table {
    background-color: #fff;
    font-size: 13px;
}

.table thead th {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* Butonlar */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid #e5e7eb;
}

.nav-tabs .nav-link {
    color: #6b7280;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 20px;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

/* Form */
.form-label {
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Positive/Negative Numbers */
.text-positive {
    color: var(--success-color);
    font-weight: 600;
}

.text-negative {
    color: var(--danger-color);
    font-weight: 600;
}

/* Status Indicators */
.status-active {
    color: var(--success-color);
}

.status-passive {
    color: #9ca3af;
}

/* Profile Card (Cari Detay) */
.profile-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.profile-card h2 {
    margin-bottom: 16px;
    font-size: 28px;
}

.profile-card .info-item {
    margin-bottom: 8px;
}

.profile-card .info-item i {
    width: 20px;
    margin-right: 8px;
}

/* Totals Panel (Fatura Sağ Panel) */
.totals-panel {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.totals-panel .total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.totals-panel .total-row.grand-total {
    border-top: 2px solid #e5e7eb;
    margin-top: 12px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Invoice Table */
.invoice-table {
    margin-bottom: 0;
}

/* Fatura tablosu - dropdown görünür olsun */
.invoice-table-wrapper {
    overflow: visible !important;
}
.invoice-table td {
    overflow: visible !important;
}

.invoice-table thead th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.invoice-table input {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 8px;
    width: 100%;
    font-size: 13px;
}

/* Stok ara ve adet giriş - daha büyük ve görünür */
.invoice-table .product-search-input,
.invoice-table .product-autocomplete-wrap input {
    min-width: 200px;
    font-size: 14px;
    padding: 8px 10px;
}

.invoice-table td input[name="miktar[]"] {
    min-width: 140px;
    font-size: 14px;
    padding: 8px 10px;
}

.invoice-table .remove-row {
    cursor: pointer;
    color: var(--danger-color);
}

/* İşlemler dropdown - tablo içinde div altında kalmasın */
.table-responsive .dropdown-menu,
.table .dropdown-menu {
    z-index: 9999 !important;
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

.page-link {
    color: var(--primary-color);
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #d1d5db;
}

.page-link:hover {
    background-color: #f3f4f6;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 12px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        margin-top: 12px;
        width: 100%;
    }
    
    .action-buttons .btn {
        flex: 1;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 8px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo i {
    font-size: 64px;
    color: var(--primary-color);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 32px;
    font-weight: 700;
}

