/* ==================== FATURA MODÜLÜ STİLLERİ - Modern Minimal Design ==================== */

/* Modern Renk Paleti - Sade ve Şık */
:root {
    --inv-text: #1a1a2e;
    --inv-text-secondary: #4a5568;
    --inv-text-muted: #718096;
    --inv-bg: #f7f8fc;
    --inv-card: #ffffff;
    --inv-border: #e8ecf3;
    --inv-border-light: #f1f4f9;
    --inv-primary: #4f46e5;
    --inv-primary-light: #eef2ff;
    --inv-success: #10b981;
    --inv-success-light: #ecfdf5;
    --inv-warning: #f59e0b;
    --inv-warning-light: #fffbeb;
    --inv-danger: #ef4444;
    --inv-danger-light: #fef2f2;
    --inv-radius: 12px;
    --inv-radius-sm: 6px;
    --inv-radius-xs: 4px;
    --inv-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --inv-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --inv-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --inv-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.invoice-module {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 450;
    color: var(--inv-text);
    width: 100%;
    height: 100%;
    min-width: 0;
    background: var(--inv-bg);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.tab-content.active .invoice-module {
    flex: 1;
}

.invoice-module .form-group {
    margin-bottom: 0;
}

.invoice-module .form-group label {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--inv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-module .form-control,
.invoice-module .form-select {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--inv-radius-sm);
    border: 1.5px solid var(--inv-border);
    background: var(--inv-card);
    color: var(--inv-text);
    transition: var(--inv-transition);
}

.invoice-module .form-control:focus,
.invoice-module .form-select:focus {
    border-color: var(--inv-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    outline: none;
}

.invoice-module .form-control:read-only {
    background: var(--inv-border-light);
    color: var(--inv-text-muted);
    border-color: transparent;
}

/* Ana Fatura Container */
.invoice-main-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--inv-bg);
    padding: 12px;
    gap: 12px;
}

/* Fatura Üst Toolbar */
.invoice-top-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--inv-card);
    border-radius: var(--inv-radius);
    box-shadow: var(--inv-shadow-sm);
    border: 1px solid var(--inv-border);
}

.invoice-status-tabs {
    display: flex;
    gap: 6px;
}

.invoice-status-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--inv-transition);
    border: none;
}

.invoice-status-tab.draft {
    background: var(--inv-warning-light);
    color: #b45309;
}

.invoice-status-tab.confirmed {
    background: var(--inv-success-light);
    color: #047857;
}

.invoice-status-tab.active {
    box-shadow: 0 0 0 2px var(--inv-primary);
}

.invoice-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--inv-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--inv-transition);
    border: 1.5px solid var(--inv-border);
    background: var(--inv-card);
    color: var(--inv-text-secondary);
}

.invoice-action-btn:hover {
    background: var(--inv-border-light);
    border-color: var(--inv-text-muted);
}

.invoice-action-btn.primary {
    background: var(--inv-primary);
    color: white;
    border-color: var(--inv-primary);
}

.invoice-action-btn.primary:hover {
    background: #4338ca;
    box-shadow: var(--inv-shadow);
}

.invoice-action-btn.success {
    background: var(--inv-success);
    color: white;
    border-color: var(--inv-success);
}

/* Fatura Header Bölümü - İki Sütunlu */
.invoice-header-card {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: var(--inv-card);
    border-radius: var(--inv-radius);
    box-shadow: var(--inv-shadow-sm);
    border: 1px solid var(--inv-border);
}

.invoice-header-left,
.invoice-header-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-header-divider {
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--inv-border), transparent);
    margin: -16px 0;
}

.invoice-form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-form-row label {
    min-width: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--inv-text-muted);
}

.invoice-form-row .form-control,
.invoice-form-row .form-select {
    flex: 1;
    height: 34px;
}

.invoice-form-row .form-control-icon {
    position: relative;
}

.invoice-form-row .form-control-icon input {
    padding-right: 34px;
}

.invoice-form-row .form-control-icon .icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--inv-text-muted);
    cursor: pointer;
    transition: var(--inv-transition);
}

.invoice-form-row .form-control-icon .icon:hover {
    color: var(--inv-primary);
}

/* Fatura Tab Menüsü */
.invoice-tabs-container {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    background: var(--inv-card);
    border-radius: var(--inv-radius) var(--inv-radius) 0 0;
    border-bottom: 1px solid var(--inv-border);
}

.invoice-tab-item {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--inv-text-muted);
    cursor: pointer;
    border-radius: var(--inv-radius-sm);
    transition: var(--inv-transition);
}

.invoice-tab-item:hover {
    background: var(--inv-border-light);
    color: var(--inv-text);
}

.invoice-tab-item.active {
    background: var(--inv-primary);
    color: white;
}

/* Fatura İçerik Alanı */
.invoice-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--inv-card);
    border-radius: 0 0 var(--inv-radius) var(--inv-radius);
    overflow: hidden;
}

/* Fatura Satırları Toolbar */
.invoice-lines-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--inv-border);
}

.invoice-lines-toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.invoice-lines-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.invoice-toolbar-icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--inv-radius-sm);
    border: 1.5px solid var(--inv-border);
    background: var(--inv-card);
    color: var(--inv-text-muted);
    cursor: pointer;
    transition: var(--inv-transition);
}

.invoice-toolbar-icon-btn:hover {
    background: var(--inv-primary-light);
    border-color: var(--inv-primary);
    color: var(--inv-primary);
}

.invoice-special-btn {
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--inv-transition);
}

.invoice-special-btn.coverage {
    background: var(--inv-danger-light);
    color: #dc2626;
}

.invoice-special-btn.coverage:hover {
    background: #fee2e2;
}

.invoice-special-btn.payment {
    background: var(--inv-border-light);
    color: var(--inv-text-secondary);
}

.invoice-special-btn.payment:hover {
    background: var(--inv-border);
}

/* Sağ Alt Özet Paneli */
.invoice-summary-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px;
    background: var(--inv-card);
    border-top: 1px solid var(--inv-border);
    min-width: 260px;
}

.invoice-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.invoice-summary-row.subtotal {
    font-weight: 600;
    color: var(--inv-text);
}

.invoice-summary-row.discount {
    color: var(--inv-danger);
}

.invoice-summary-row.tax {
    color: var(--inv-text-muted);
}

.invoice-summary-row.total {
    font-size: 15px;
    font-weight: 700;
    color: var(--inv-text);
    padding-top: 8px;
    border-top: 1.5px solid var(--inv-border);
    margin-top: 4px;
}

.invoice-summary-label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.invoice-summary-value {
    font-weight: 600;
}

.invoice-summary-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 9px;
    cursor: pointer;
    transition: var(--inv-transition);
}

.invoice-summary-icon.edit {
    background: var(--inv-border-light);
    color: var(--inv-text-muted);
}

.invoice-summary-icon.edit:hover {
    background: var(--inv-primary-light);
    color: var(--inv-primary);
}

.invoice-summary-icon.sync {
    background: var(--inv-primary-light);
    color: var(--inv-primary);
}

/* Modern Tablo Stilleri */
.invoice-lines-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--inv-text-muted);
    padding: 10px 8px;
    border-bottom: 2px solid var(--inv-border);
}

.invoice-lines-table tbody tr {
    transition: var(--inv-transition);
}

.invoice-lines-table tbody tr:hover {
    background: var(--inv-primary-light) !important;
}

.invoice-lines-table td {
    padding: 6px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--inv-border-light);
}

.invoice-lines-table .form-control,
.invoice-lines-table .form-select {
    font-size: 11px;
    padding: 3px 6px;
}

.invoice-tab {
    transition: var(--inv-transition);
    border-radius: var(--inv-radius-xs);
}

.invoice-tab:hover {
    background: var(--inv-primary-light);
}

.stock-select-row.selected,
.stock-select-row:hover {
    background: var(--inv-primary-light) !important;
}

.invoice-resizer:hover {
    background: #e2e8f0 !important;
}

.invoice-resizer:hover>div {
    background: #6366f1 !important;
}

.invoice-vertical-resizer:hover {
    background: #e2e8f0 !important;
}

.invoice-vertical-resizer:hover>div {
    background: #6366f1 !important;
}

/* Fatura satır tablosu kompakt stil */
.invoice-lines-table tbody tr {
    height: 22px !important;
}

.invoice-lines-table tbody tr:hover {
    background: var(--inv-primary-light) !important;
}

.invoice-lines-table tbody td {
    padding: 2px 4px !important;
    vertical-align: middle !important;
}

.invoice-lines-table tbody input,
.invoice-lines-table tbody select {
    height: 18px !important;
    min-height: 18px !important;
    line-height: 1.2 !important;
    border-radius: var(--inv-radius-xs) !important;
}

.invoice-lines-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid var(--inv-border);
    border-right: 1px solid var(--inv-border);
    position: relative;
    font-weight: 700;
    user-select: none;
}

/* Fatura Satırları Sütun Resize Sistemi */
.invoice-col-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    background: transparent;
    z-index: 20;
    transition: background 0.15s ease;
}

.invoice-col-resize-handle:hover {
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.4), rgba(79, 70, 229, 0.4), transparent);
}

.invoice-col-resize-handle.resizing {
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.7), rgba(79, 70, 229, 0.7), transparent);
}

/* Resize sırasında body cursor */
body.invoice-col-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}

body.invoice-col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

/* Header cell label container */
.invoice-header-cell-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--inv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 9px;
}

.invoice-lines-table thead th:last-child {
    border-right: none;
}

.invoice-lines-table thead th.dragging {
    opacity: 0.4;
    background: var(--inv-primary-light);
}

.invoice-lines-table thead th.drag-over {
    border-left: 3px solid var(--inv-primary) !important;
}

.invoice-lines-table thead th[draggable="true"]:hover {
    background: var(--inv-border-light);
}

.invoice-col-resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 5;
}

.invoice-col-resizer:hover {
    background: var(--inv-primary);
}

.invoice-lines-table tbody td {
    border-right: 1px solid var(--inv-border-light);
}

.invoice-lines-table tbody td:last-child {
    border-right: none;
}

/* Hızlı ekleme satırı - Modern stil */
.invoice-quick-add-row {
    background: linear-gradient(180deg, #fefce8 0%, #fef9c3 100%) !important;
    border-top: 2px dashed #facc15;
}

.invoice-quick-add-row:hover {
    background: linear-gradient(180deg, #fef9c3 0%, #fef08a 100%) !important;
}

.invoice-quick-add-row input:focus {
    outline: none;
    border-color: #eab308 !important;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

/* Hızlı arama dropdown */
#quickAddDropdown .quick-add-item:hover {
    background: var(--inv-primary-light) !important;
}

/* Fatura satırları sol araç çubuğu - Modern */
.invoice-toolbar-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: var(--inv-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: var(--inv-transition);
    box-shadow: var(--inv-shadow-sm);
}

.invoice-toolbar-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--inv-shadow);
}

.invoice-toolbar-btn:active {
    transform: translateY(0);
}

/* Seçili fatura satırı */
.invoice-lines-table tbody tr.invoice-line-selected {
    background: var(--inv-primary-light) !important;
    box-shadow: inset 0 0 0 2px var(--inv-primary);
}

.invoice-lines-table tbody tr.invoice-line-selected td {
    background: var(--inv-primary-light) !important;
}

.invoice-lines-table tbody tr.invoice-line-selected td:first-child {
    border-left: 3px solid var(--inv-primary) !important;
}

.invoice-lines-table tbody tr.invoice-line-selected td:last-child {
    border-right: none !important;
}

.invoice-lines-table tbody tr.invoice-line-selected:hover,
.invoice-lines-table tbody tr.invoice-line-selected:hover td {
    background: #ddd6fe !important;
}

/* Veri satırları */
.invoice-lines-table tbody tr.invoice-data-row {
    cursor: pointer;
    transition: var(--inv-transition);
}

.invoice-lines-table tbody tr.invoice-data-row:hover {
    background: var(--inv-border-light) !important;
}

/* ============ SATIR SÜRÜKLE-BIRAK (Drag & Drop Reorder) ============ */
.invoice-line-drag-handle {
    cursor: grab;
    user-select: none;
    transition: all 0.15s ease;
}

.invoice-line-drag-handle:hover {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

.invoice-line-drag-handle:active {
    cursor: grabbing;
}

.invoice-data-row.invoice-row-dragging {
    opacity: 0.4;
    background: #f1f5f9 !important;
}

.invoice-data-row.invoice-row-dragging td {
    opacity: 0.4;
}

.invoice-data-row.invoice-row-drag-over-top {
    box-shadow: 0 -2px 0 0 #7c3aed inset;
}

.invoice-data-row.invoice-row-drag-over-bottom {
    box-shadow: 0 2px 0 0 #7c3aed inset;
}

/* ============ ALT MARKA (VARIANT) SATIR STİLLERİ ============ */
.invoice-data-row.invoice-variant-row {
    background: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 30%, #faf8ff 100%) !important;
}

.invoice-data-row.invoice-variant-row:hover {
    background: linear-gradient(90deg, #ddd6fe 0%, #ede9fe 30%, #f3f0ff 100%) !important;
}

.invoice-data-row.invoice-variant-row td {
    font-size: 9.5px !important;
    color: #4c1d95;
}

.invoice-data-row.invoice-variant-row td input,
.invoice-data-row.invoice-variant-row td select {
    color: #5b21b6 !important;
    font-size: 9.5px !important;
}

.invoice-data-row.invoice-variant-row td:first-child {
    border-left: 3px solid #8b5cf6 !important;
    background: #ede9fe !important;
}

/* ============ SOLUK/BEKLEMEDE SATIR STİLLERİ ============ */
tr.invoice-data-row.invoice-line-dimmed,
.invoice-lines-table tbody tr.invoice-data-row.invoice-line-dimmed {
    opacity: 0.3 !important;
}

tr.invoice-data-row.invoice-line-dimmed:hover,
.invoice-lines-table tbody tr.invoice-data-row.invoice-line-dimmed:hover {
    opacity: 0.5 !important;
}

tr.invoice-data-row.invoice-line-dimmed td,
.invoice-lines-table tbody tr.invoice-data-row.invoice-line-dimmed td {
    color: #94a3b8 !important;
}

tr.invoice-data-row.invoice-line-dimmed td input,
tr.invoice-data-row.invoice-line-dimmed td select {
    color: #94a3b8 !important;
    pointer-events: none;
}

tr.invoice-data-row.invoice-line-dimmed td:first-child {
    border-left: 3px solid #f59e0b !important;
}

tr.invoice-data-row.invoice-line-dimmed td:last-child,
tr.invoice-data-row.invoice-line-dimmed td:nth-last-child(2),
tr.invoice-data-row.invoice-line-dimmed td:nth-last-child(3) {
    opacity: 1 !important;
}

/* ============ TESLİM EDİLDİ SATIR STİLLERİ ============ */
tr.invoice-data-row.invoice-line-delivered {
    background: linear-gradient(90deg, #f0fdf4 0%, #f7fef9 60%, #ffffff 100%) !important;
}

tr.invoice-data-row.invoice-line-delivered:hover {
    background: linear-gradient(90deg, #dcfce7 0%, #ecfdf5 60%, #f8fafc 100%) !important;
}

tr.invoice-data-row.invoice-line-delivered td:first-child {
    border-left: 3px solid #22c55e !important;
}

.invoice-variant-line-no {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: 9px;
    color: #7c3aed;
    font-weight: 600;
}

.invoice-variant-line-no .variant-arrow {
    color: #8b5cf6;
    font-size: 10px;
    margin-right: 1px;
    font-weight: 400;
}

/* Varyant toggle butonu */
.invoice-variant-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    margin-right: 2px;
    cursor: pointer;
    color: #8b5cf6;
    font-size: 7px;
    transition: transform 0.2s ease;
    border-radius: 2px;
    vertical-align: middle;
}

.invoice-variant-toggle:hover {
    background: #ede9fe;
    color: #6d28d9;
}

.invoice-variant-toggle.expanded {
    transform: rotate(90deg);
}

/* ============ SERİ TEKLİF PANELİ ============ */
.batch-quote-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99998;
    animation: bqFadeIn 0.15s ease;
}

.batch-quote-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 920px;
    max-width: 95vw;
    max-height: 85vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: bqSlideIn 0.2s ease;
}

@keyframes bqFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bqSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.batch-quote-panel .bq-header {
    padding: 10px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.batch-quote-panel .bq-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.batch-quote-panel .bq-footer {
    padding: 8px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.bq-row {
    display: grid;
    grid-template-columns: 70px 1fr 55px 75px 75px 28px;
    gap: 4px;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

.bq-row:hover {
    background: #f8fafc;
}

.bq-row.bq-row-nostok {
    grid-template-columns: 70px 1fr 100px 100px 55px 75px 75px 28px;
}

.bq-input {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 10px;
    height: 24px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.bq-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.bq-input-number {
    text-align: right;
}

.bq-select {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
    height: 24px;
    outline: none;
    cursor: pointer;
    background: white;
    width: 100%;
}

.bq-select:focus {
    border-color: #10b981;
}

.bq-search-wrap {
    position: relative;
}

.bq-search-dropdown {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 200000;
    max-height: 250px;
    overflow-y: auto;
    min-width: 400px;
}

.bq-search-item {
    padding: 5px 8px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    gap: 6px;
    align-items: center;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.1s;
}

.bq-search-item:hover,
.bq-search-item.bq-active {
    background: #ecfdf5;
}

.bq-search-item .bq-stock-code {
    color: #6366f1;
    font-weight: 600;
    min-width: 60px;
}

.bq-search-item .bq-stock-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bq-search-item .bq-stock-brand {
    color: #f59e0b;
    font-size: 9px;
    font-weight: 500;
}

.bq-search-item .bq-stock-qty {
    font-size: 9px;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
    padding: 1px 4px;
    border-radius: 3px;
    background: #fefce8;
}

.bq-search-item .bq-stock-price {
    color: #10b981;
    font-weight: 600;
    min-width: 55px;
    text-align: right;
}

.bq-remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 11px;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.15s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bq-remove-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Variant (Alt Marka) satırları */
.bq-variant-row {
    display: grid;
    grid-template-columns: 70px 1fr 55px 75px 75px 28px;
    gap: 4px;
    align-items: center;
    padding: 2px 0 2px 0;
    margin-left: 20px;
    border-left: 2px solid #a78bfa;
    padding-left: 10px;
    background: #faf5ff;
    border-bottom: 1px solid #f3e8ff;
    transition: background 0.1s;
}

.bq-variant-row:hover {
    background: #f3e8ff;
}

.bq-variant-row.bq-row-nostok {
    grid-template-columns: 70px 1fr 100px 100px 55px 75px 75px 28px;
}

.bq-add-variant-btn {
    background: none;
    border: 1px dashed #c4b5fd;
    color: #7c3aed;
    cursor: pointer;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 20px;
    white-space: nowrap;
}

.bq-add-variant-btn:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
}

/* ============ ALAN TİPİ AYIRT EDİCİ STİLLER - Minimal ============ */

/* Düzenlenebilir alanlar - beyaz arka plan */
.invoice-cell-editable-number,
.invoice-cell-editable-select,
.invoice-cell-editable-text,
.invoice-cell-searchable {
    background: #ffffff;
    transition: background 0.15s ease;
}

.invoice-cell-editable-number:hover,
.invoice-cell-editable-select:hover,
.invoice-cell-editable-text:hover,
.invoice-cell-searchable:hover {
    background: #f8fafc !important;
}

/* Focus durumunda border */
.invoice-cell-editable-number input:focus,
.invoice-cell-editable-select input:focus,
.invoice-cell-editable-select select:focus,
.invoice-cell-editable-text input:focus,
.invoice-cell-searchable input:focus {
    background: white !important;
    box-shadow: inset 0 0 0 1px #3b82f6;
    border-radius: 3px;
}

/* Stok kodu - hafif vurgu */
.invoice-cell-stock-code input {
    color: #1d4ed8 !important;
    font-weight: 600 !important;
}

/* Salt okunur hücreler - çok hafif gri arka plan */
.invoice-cell-readonly {
    background: #f8f9fa !important;
}

/* Hesaplanan toplam - hafif gri + kalın font */
.invoice-cell-calculated {
    background: #f8f9fa !important;
}

.invoice-cell-calculated span {
    font-weight: 700 !important;
    color: #1e293b !important;
}

/* Stok miktarı - sadece renk farkı (pozitif/negatif) */
.invoice-cell-stock-qty-positive {
    background: #f8f9fa !important;
    color: #16a34a !important;
    font-weight: 500;
}

.invoice-cell-stock-qty-zero {
    background: #f8f9fa !important;
    color: #dc2626 !important;
    font-weight: 500;
}

/* ============ K/Z (Kar/Zarar) SÜTUN STİLLERİ ============ */

/* K/Z badge stilleri */
.kz-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.3px;
    min-width: 16px;
    height: 16px;
}

.kz-badge:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.kz-badge.kz-positive {
    background: #dcfce7;
    color: #15803d;
}

.kz-badge.kz-negative {
    background: #fee2e2;
    color: #dc2626;
}

.kz-badge.kz-zero {
    background: #f3f4f6;
    color: #6b7280;
}

.kz-badge.kz-nodata {
    background: #f8fafc;
    color: #cbd5e1;
    font-weight: 400;
}

/* K/Z yüzde gizli/göster */
.kz-dot {
    font-size: 8px;
}

.kz-pct-text {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    margin-left: 0;
    transition: max-width 0.25s ease, opacity 0.2s ease, margin-left 0.25s ease;
    display: inline-block;
    white-space: nowrap;
}

.kz-cell.kz-revealed .kz-pct-text {
    max-width: 60px;
    opacity: 1;
    margin-left: 2px;
}

.kz-cell.kz-revealed .kz-dot {
    font-size: 7px;
}

/* K/Z Detay sütunları - gizli/göster animasyonu */
.kz-detail-th,
.kz-detail-td {
    display: none !important;
    max-width: 0;
    overflow: hidden;
    padding: 0 !important;
    border: none !important;
    opacity: 0;
    transition: max-width 0.35s ease, opacity 0.35s ease, padding 0.35s ease;
}

.kz-detail-expanded .kz-detail-th,
.kz-detail-expanded .kz-detail-td {
    display: table-cell !important;
    max-width: 100px;
    opacity: 1;
    padding: 2px 4px !important;
    border-right: 1px solid #cbd5e1 !important;
}

.kz-detail-th {
    background: #eff6ff !important;
    font-size: 8px !important;
    color: #3b82f6 !important;
    font-weight: 700 !important;
    white-space: nowrap;
    text-align: center;
}

.kz-detail-td {
    font-size: 9px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.kz-detail-td.kz-b-maliyet-cell {
    padding: 1px 2px !important;
}

.kz-detail-td.kz-b-maliyet-cell input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    background: #eff6ff !important;
}

.kz-detail-td.kz-cost-cell {
    color: #6b7280;
}

.kz-detail-td.kz-pct-cell {
    font-weight: 700;
}

.kz-detail-td.kz-profit-cell {
    font-weight: 700;
}

/* K/Z Hover Tooltip */
.kz-tooltip {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 10px 14px;
    min-width: 200px;
    max-width: 280px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
    font-family: inherit;
}

.kz-tooltip.kz-tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}

.kz-tooltip-header {
    font-size: 10px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kz-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 10px;
}

.kz-tooltip-label {
    color: #64748b;
    font-weight: 500;
}

.kz-tooltip-value {
    font-weight: 700;
    color: #1e293b;
}

.kz-tooltip-divider {
    border-top: 1px dashed #e2e8f0;
    margin: 4px 0;
}

.kz-tooltip-profit-positive {
    color: #15803d !important;
}

.kz-tooltip-profit-negative {
    color: #dc2626 !important;
}

/* Dark mode */
body.dark-mode .kz-badge.kz-positive {
    background: #14532d;
    color: #86efac;
}

body.dark-mode .kz-badge.kz-negative {
    background: #450a0a;
    color: #fca5a5;
}

body.dark-mode .kz-badge.kz-zero {
    background: #374151;
    color: #9ca3af;
}

body.dark-mode .kz-badge.kz-nodata {
    background: #1e293b;
    color: #475569;
}

/* K/Z Özet Popup */
.kz-summary-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    margin-left: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.85;
}

.kz-summary-btn:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.kz-summary-popup {
    position: fixed;
    z-index: 99999;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    padding: 14px 18px;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    color: #e0e7ff;
    font-size: 11px;
    animation: kzPopupIn 0.25s ease-out;
    pointer-events: auto;
}

.kz-summary-popup.closing {
    animation: kzPopupOut 0.3s ease-in forwards;
}

@keyframes kzPopupIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes kzPopupOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
}

.kz-summary-popup .kz-pop-title {
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #a5b4fc;
}

.kz-summary-popup .kz-pop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.kz-summary-popup .kz-pop-row:last-child {
    border-bottom: none;
    padding-top: 6px;
    margin-top: 2px;
}

.kz-summary-popup .kz-pop-label {
    color: #c7d2fe;
    font-size: 10px;
}

.kz-summary-popup .kz-pop-value {
    font-weight: 700;
    font-size: 12px;
}

.kz-summary-popup .kz-pop-positive {
    color: #4ade80;
}

.kz-summary-popup .kz-pop-negative {
    color: #f87171;
}

.kz-summary-popup .kz-pop-neutral {
    color: #e0e7ff;
}

.kz-summary-popup .kz-pop-timer {
    height: 2px;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.kz-summary-popup .kz-pop-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 2px;
    transition: width 0.1s linear;
}

body.dark-mode .kz-summary-popup {
    background: linear-gradient(135deg, #0f0e26, #1e1b4b);
}

body.dark-mode .kz-detail-th {
    background: #1e3a5f !important;
    color: #93c5fd !important;
}

body.dark-mode .kz-detail-td {
    color: #e2e8f0;
}

body.dark-mode .kz-tooltip {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .kz-tooltip-header {
    color: #f1f5f9;
    border-bottom-color: #334155;
}

body.dark-mode .kz-tooltip-label {
    color: #94a3b8;
}

body.dark-mode .kz-tooltip-value {
    color: #f1f5f9;
}

body.dark-mode .kz-tooltip-divider {
    border-top-color: #334155;
}

/* ============ K/Z STİLLERİ SONU ============ */

/* ============ ALAN TİPİ STİLLERİ SONU ============ */

/* Fatura satır sütun ayarları modal - Modern */
.invoice-col-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-height: 80vh;
    background: var(--inv-card);
    border-radius: var(--inv-radius);
    box-shadow: var(--inv-shadow-lg), 0 0 0 1px var(--inv-border);
    z-index: 999999;
    display: none;
    overflow: hidden;
}

.invoice-col-settings-modal.show {
    display: block;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.invoice-col-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--inv-bg);
    border-bottom: 1px solid var(--inv-border);
}

.invoice-col-settings-list {
    max-height: 50vh;
    overflow-y: auto;
    padding: 8px;
}

.invoice-col-settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: move;
}

.invoice-col-settings-item:hover {
    background: #334155;
}

.invoice-col-settings-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

.invoice-col-settings-item label {
    color: #e2e8f0;
    font-size: 13px;
    flex: 1;
    cursor: pointer;
}

.invoice-col-settings-item .custom-badge {
    background: #6366f1;
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
}

.invoice-col-settings-footer {
    padding: 12px 16px;
    background: #0f172a;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Koyu mod fatura stilleri */
body.dark-mode .invoice-module {
    background: var(--darker);
}

body.dark-mode .invoice-header-section {
    background: var(--bg-card) !important;
}

body.dark-mode .invoice-lines-section {
    background: var(--darker) !important;
}

body.dark-mode .invoice-lines-table thead th {
    background: var(--table-header-bg) !important;
    color: var(--text-secondary);
}

body.dark-mode .invoice-lines-table tbody tr:hover {
    background: var(--table-row-hover) !important;
}

body.dark-mode .invoice-toolbar {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

/* ==================== FATURA MODÜLÜ STİLLERİ SONU ==================== */
