/* CSS Reset & Variables */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg-dark: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-panel-hover: rgba(15, 23, 42, 0.05);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: rgba(15, 23, 42, 0.08);
    --accent: #0f172a;
    --accent-hover: #1e293b;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --success-hover: #059669;
    --info: #3b82f6;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(15, 23, 42, 0.08);
    
    font-family: 'Outfit', 'Inter', sans-serif;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; border: 2px solid var(--bg-dark); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Typography & Utils */
h1, h2, h3 { font-weight: 600; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; transition: all 0.2s; }
.text-right { text-align: right; }

/* Layout App Container */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.logo {
    display: flex;
    align-items: center;
    padding: 24px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}
.logo-icon {
    font-size: 24px;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
    padding: 10px;
    border-radius: 8px;
}
.logo-text h1 { font-size: 18px; line-height: 1.2; }
.logo-text span { font-size: 12px; color: var(--accent); font-weight: 600; }

.menu {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
}
.menu-item i { width: 20px; text-align: center; font-size: 16px; }
.menu-item:hover { background: var(--bg-panel-hover); color: var(--text-primary); }
.menu-item.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }

.menu-group { display: flex; flex-direction: column; }
.sub-menu { display: none; padding-left: 12px; flex-direction: column; gap: 4px; margin-top: 4px; }
.sub-menu.open { display: flex; }
.sub-item { padding: 10px 16px; font-size: 13px; }
.has-submenu { justify-content: flex-start; }
.chevron { margin-left: auto; font-size: 12px; transition: transform 0.2s; }
.has-submenu.open .chevron { transform: rotate(180deg); }

.user-profile {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-panel-hover);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 12px; color: var(--text-secondary); }

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.module {
    display: none; /* JS will toggle */
    width: 100%; height: 100%;
    padding: 24px 32px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-in-out;
}
.module.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Shared Module Header */
.module-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.module-header h1 { font-size: 24px; }
.module-header .subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* Buttons */
.btn {
    padding: 10px 16px; border-radius: 6px; font-weight: 500; font-size: 14px;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-panel-hover); color: var(--text-primary); }
.btn-secondary:hover { background: #475569; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-veresiye { background: var(--info); color: white; }
.btn-veresiye:hover { background: #2563eb; }

/* 1. POS Module Specific Layout */
#pos-module { padding: 0; }
.pos-layout {
    display: flex;
    height: 100vh;
}
.products-area {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.cart-area {
    width: 380px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

/* Search & Categories */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}
.search-bar i { position: absolute; left: 16px; top: 14px; color: var(--text-secondary); }
.search-bar input {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 12px 12px 42px;
    border-radius: 8px;
    font-size: 15px;
}
.search-bar input:focus { border-color: var(--accent); }

.categories {
    display: flex; gap: 10px; margin-bottom: 24px;
    overflow-x: auto; padding-bottom: 4px;
}
.category-btn {
    padding: 8px 16px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}
.category-btn.active, .category-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    align-content: start;
}
.product-card {
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); border-color: var(--accent); }
.product-card:active { transform: translateY(0); }
.product-img {
    width: 100%; aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fff; /* since AI images have white bg */
}
.product-title {
    font-size: 14px; font-weight: 500;
    margin-bottom: 4px;
    text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.product-price { font-size: 16px; font-weight: 700; color: var(--accent); }
.product-stock { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* Cart Area */
.cart-header {
    padding: 20px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.cart-header h2 { font-size: 18px; display: flex; align-items: center; gap: 8px;}
.btn-icon { background: transparent; color: var(--text-secondary); font-size: 18px; }
.btn-icon:hover { color: var(--danger); }

.cart-items {
    flex: 1; padding: 16px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
}
.empty-cart { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-secondary); opacity: 0.5; }
.empty-cart i { font-size: 48px; margin-bottom: 12px; }

.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-dark); padding: 12px; border-radius: 8px;
    border: 1px solid var(--border-color);
}
.cart-item-info h4 { font-size: 14px; margin-bottom: 4px; }
.cart-item-info span { font-size: 13px; color: var(--accent); font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }

.remove-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s all;
    margin-left: 5px;
}

.remove-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}
.qty-btn { width: 28px; height: 28px; background: var(--bg-panel-hover); color: white; border-radius: 4px; display: flex; justify-content: center; align-items: center;}
.qty-display { font-size: 14px; font-weight: 600; width: 20px; text-align: center; }

.cart-summary {
    padding: 20px; background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
}
.summary-line { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); }
.summary-line.total { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-color); color: white; font-size: 18px; font-weight: 700; }
.summary-line.total span:last-child { color: var(--accent); }

.cart-actions {
    padding: 0 20px 20px 20px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
#btn-pay-trigger { grid-column: 1 / -1; font-size: 16px; padding: 14px; display: flex; justify-content: center;}

/* Data Tables for other modules */
.cards-layout { display: flex; flex-direction: column; gap: 24px; }
.data-table-container {
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
}
.data-table-container h2 { font-size: 18px; margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { font-size: 13px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; }
.data-table td { font-size: 14px; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table td { vertical-align: middle; }

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-high { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); } /* Green */
.status-mid { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.2); }  /* Blue */
.status-low { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.1); }   /* Red */

/* Table Product Image */
.p-table-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 1px solid var(--border-color);
}
.p-table-img-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid var(--border-color);
}

/* Dashboard Stats (Bank) */
.dashboard-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.stat-card {
    background: var(--bg-panel); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 24px;
    display: flex; align-items: center; gap: 20px;
}
.stat-icon {
    width: 60px; height: 60px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: white;
}
.bg-green { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.bg-blue { background: rgba(59, 130, 246, 0.2); color: var(--info); }
.bg-yellow { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.stat-details h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500;}
.stat-amount { font-size: 28px; font-weight: 700; color: white; }

/* Etiket Module */
.etiket-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; height: calc(100vh - 120px); }
.etiket-products { background: var(--bg-panel); padding: 20px; border-radius: 12px; overflow-y:auto; border: 1px solid var(--border-color);}
.etiket-preview-container { background: #cbd5e1; padding: 20px; border-radius: 12px; overflow-y:auto; display: flex; flex-direction: column; align-items: center;}
.a4-page {
    width: 21cm; min-height: 29.7cm;
    background: white; color: black;
    padding: 1cm;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start;
}
.empty-etiket-hint { width: 100%; text-align: center; color: #64748b; margin-top: 5cm; font-size: 14px;}
.etiket-item {
    width: 45%; height: 4cm;
    border: 2px solid #000;
    padding: 10px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.etiket-item .e-adi { font-size: 16px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.etiket-item .e-fiyat { font-size: 32px; font-weight: bold; text-align: right;}
.etiket-item .e-barkod { font-size: 10px; text-align: center; font-family: monospace; letter-spacing: 2px;}

/* Print styles */
@media print {
    @page { size: 210mm 290mm; margin: 15mm; }
    body, html { background: white; color: black; font-family: 'Inter', sans-serif; height: auto !important; }
    
    /* Etiket Modülü Yazdırma Davranışı (Varsayılan) */
    body:not(.printing-rapor) * { visibility: hidden; }
    body:not(.printing-rapor) #etiket-a4-preview, 
    body:not(.printing-rapor) #etiket-a4-preview * { visibility: visible; color: black; }
    body:not(.printing-rapor) #etiket-a4-preview { position: absolute; left: 0; top: 0; margin: 0; box-shadow: none; width: 100%; border: none; }
    
    /* Stok Raporu Yazdırma Davranışı (Çoklu sayfa desteği için display:none izolasyonu) */
    body.printing-rapor .sidebar, 
    body.printing-rapor .module-header,
    body.printing-rapor .cards-layout:not(#stok-rapor-print-area) { 
        display: none !important; 
    }
    
    body.printing-rapor .app-container,
    body.printing-rapor .main-content,
    body.printing-rapor .module.active {
        display: block !important; 
        width: 100% !important; 
        height: auto !important; 
        overflow: visible !important; 
        padding: 0 !important; 
        margin: 0 !important; 
    }
    
    body.printing-rapor #stok-rapor-print-area { 
        display: block !important; 
        width: 100% !important; 
        margin: 0 !important; 
        padding: 0 !important; 
        box-shadow: none; 
        border: none;
        background: transparent;
        color: black;
    }
    
    body.printing-rapor * { color: black !important; }
    
    .print-only { display: block !important; }
    .hide-on-print, .hide-on-print * { display: none !important; }
    .btn { display: none !important; }
    
    /* Rapor A4 Tablo Tasarımı */
    body.printing-rapor .data-table { width: 100%; border-collapse: collapse; margin-top: 10px; page-break-inside: auto; }
    body.printing-rapor .data-table tr { page-break-inside: avoid; page-break-after: auto; }
    body.printing-rapor .data-table th, body.printing-rapor .data-table td { border: 1px solid #000 !important; padding: 10px 12px !important; text-align: left; font-size: 13px !important; }
    body.printing-rapor .data-table th { background-color: #f1f5f9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-weight: bold !important; text-transform: uppercase; font-size: 12px !important; }
}

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-panel); width: 400px; border-radius: 16px;
    border: 1px solid var(--border-color); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
    animation: scaleUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

@keyframes scaleUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
    padding: 20px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.close-modal { background: transparent; color: var(--text-secondary); font-size: 20px; }
.close-modal:hover { color: white; }
.modal-body { padding: 24px; }
.payment-amount-display {
    text-align: center; background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 8px; padding: 20px; margin-bottom: 24px;
    display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px;
}
.payment-amount-display strong { font-size: 36px; color: var(--accent); }
.payment-methods { display: flex; flex-direction: column; gap: 12px; }
.payment-method-btn {
    padding: 16px; background: var(--bg-dark); border: 1px solid var(--border-color);
    border-radius: 8px; color: white; font-size: 16px; display: flex; align-items: center; gap: 16px; transition: all 0.2s;
}
.payment-method-btn i { font-size: 24px; color: var(--accent); }
.payment-method-btn:hover { border-color: var(--accent); background: rgba(245, 158, 11, 0.05); transform: translateY(-2px); }

/* Premium Toast System (Main Screen Focus) */
#pro-toast-container {
    position: fixed; top: 100px; left: 50%;
    transform: translateX(-50%);
    z-index: 10000; display: flex; flex-direction: column; gap: 12px;
    pointer-events: none;
    align-items: center;
}
.pro-toast {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(25px);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: white;
    padding: 24px 40px; border-radius: 20px; min-width: 450px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.7), 0 0 50px rgba(99, 102, 241, 0.1);
    display: flex; align-items: center; justify-content: center; gap: 25px;
    pointer-events: auto;
    transition: 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    animation: toastDown 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.pro-toast span { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.pro-toast i { font-size: 32px; filter: drop-shadow(0 0 15px currentColor); }
.pro-toast.success { border-top: 4px solid var(--success); }
.pro-toast.success i { color: var(--success); }
.pro-toast.error { border-top: 4px solid var(--danger); }
.pro-toast.error i { color: var(--danger); }


@keyframes toastDown {
    from { transform: translateY(-30px) opacity(0); filter: blur(10px); }
    to { transform: translateY(0) opacity(1); filter: blur(0); }
}



/* Page Transitions */
.view-section { animation: sectionFade 0.4s ease-out; }
@keyframes sectionFade {
    from { opacity: 0; transform: translateY(15px); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Glass Utilities */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

/* Premium Custom Modal / Alert System */
.sys-modal-overlay {
    position: fixed; inset: 0; background: rgba(2, 6, 23, 0.85); backdrop-filter: blur(12px);
    z-index: 20000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.sys-modal-overlay.active { opacity: 1; pointer-events: auto; }

.sys-modal-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 1), rgba(15, 23, 42, 1));
    border: 1px solid rgba(99, 102, 241, 0.3); border-radius: 28px;
    width: 90%; max-width: 480px; padding: 40px; text-align: center;
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8), 0 0 60px rgba(99, 102, 241, 0.1);
    transform: scale(0.9) translateY(30px); filter: blur(10px);
    transition: 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.sys-modal-overlay.active .sys-modal-card { transform: scale(1) translateY(0); filter: blur(0); }

.sys-modal-icon {
    width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 25px; font-size: 32px; background: rgba(99, 102, 241, 0.1); color: var(--accent);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}
.sys-modal-title { font-size: 24px; font-weight: 800; margin-bottom: 12px; color: white; letter-spacing: -0.5px; }
.sys-modal-msg { font-size: 15px; color: var(--text-dim); line-height: 1.6; margin-bottom: 30px; }

.sys-modal-footer { display: flex; gap: 15px; justify-content: center; }
.sys-modal-btn {
    padding: 14px 30px; border-radius: 15px; font-weight: 700; cursor: pointer; border: none; transition: 0.3s;
    font-size: 14px; min-width: 120px;
}
.sys-modal-btn-cancel { background: rgba(51, 65, 85, 0.5); color: white; border: 1px solid rgba(255,155,255,0.1); }
.sys-modal-btn-cancel:hover { background: rgba(71, 85, 105, 0.6); }

.sys-modal-btn-confirm { background: var(--accent); color: white; box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4); }
.sys-modal-btn-confirm:hover { transform: translateY(-2px); box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.5); }


/* Advanced Label Designer Styles */
.etiket-designer-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    height: calc(100vh - 180px);
}

.designer-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.designer-panel h3 {
    font-size: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

.panel-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Canvas Area */
.editor-panel {
    justify-content: center;
    align-items: center;
    background: #0f172a; /* Darker focus area */
    position: relative;
    overflow: auto;
}

.canvas-container {
    padding: 20px;
    background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 20px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.label-canvas {
    background: white;
    color: black;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    /* Dimensions set by JS */
}

.drag-item {
    position: absolute;
    cursor: move;
    white-space: nowrap;
    user-select: none;
    padding: 2px 4px;
    border: 1px dashed transparent;
    transition: background 0.2s, border 0.2s;
}

.drag-item:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent);
}

.drag-item.active {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.2);
    z-index: 10;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent);
    right: -5px;
    bottom: -5px;
    cursor: nwse-resize;
    border-radius: 2px;
    display: none;
    z-index: 11;
}

.drag-item.active .resize-handle {
    display: block;
}

.barcode-preview-stripe {
    font-family: 'Libre Barcode 39', cursive, monospace;
    font-size: 32px;
    line-height: 1;
    pointer-events: none; /* Let drag events pass through to parent */
}

.barcode-text {
    display: block;
    font-size: 10px;
    text-align: center;
    pointer-events: none;
}

/* Settings Styles */
.settings-group {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.settings-group h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.settings-group label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.settings-group input {
    width: 100%;
    padding: 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: white;
    font-size: 12px;
}

.check-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.check-label input {
    width: auto;
}

.canvas-hint {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Print Specifics */
@media print {
    body * { visibility: hidden; }
    .print-preview-container, .print-preview-container * { visibility: visible; }
    .print-preview-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm; /* A4 Width */
        display: block !important;
        background: white !important;
    }
    
    .print-page {
        width: 210mm;
        height: 297mm;
        page-break-after: always;
        position: relative;
        overflow: hidden;
        background: white;
    }

    .print-label {
        position: absolute;
        border: 0.1mm solid #eee; /* Light boundary for cutting */
        box-sizing: border-box;
        overflow: hidden;
        color: black;
    }

    .print-item {
        position: absolute;
        white-space: nowrap;
    }
}

/* Excel Import Modal Specific Styles */
#excel-upload-step div:hover {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    cursor: pointer;
}

.excel-map-select {
    transition: all 0.2s;
}

.excel-map-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
    outline: none;
}

#excel-mapping-step h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

#excel-mapping-step p {
    font-size: 14px;
}

#excel-preview-head th {
    background: var(--bg-dark);
    position: sticky;
    top: 0;
}

/* ============================================================
   TEKLIF A4 PRINT TEMPLATE STYLES
   ============================================================ */

/* Screen: Hide the print template completely */
.teklif-print-container {
    display: none;
}

/* On-screen preview mode (when body has class) */
body.printing-teklif .teklif-print-container {
    display: block;
}

/* Print mode: Show only teklif template */
@media print {
    body.printing-teklif * {
        visibility: hidden !important;
    }
    body.printing-teklif .teklif-print-container,
    body.printing-teklif .teklif-print-container * {
        visibility: visible !important;
    }
    body.printing-teklif .teklif-print-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        margin: 0;
        padding: 0;
    }
    body.printing-teklif {
        background: white !important;
    }
}

/* A4 Page Dimensions */
.teklif-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: white;
    color: #1a1a1a;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 11px;
    line-height: 1.5;
    padding: 15mm 18mm 12mm 18mm;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header Section */
.teklif-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 3px solid #1a1a1a;
    margin-bottom: 0;
}

.teklif-company-info {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.teklif-company-logo {
    width: 52px;
    height: 52px;
    background: #f59e0b;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.teklif-company-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.teklif-company-detail {
    font-size: 9.5px;
    color: #555;
    margin: 1px 0;
    line-height: 1.4;
}

.teklif-doc-badge {
    text-align: right;
}

.teklif-doc-badge h2 {
    font-size: 20px;
    font-weight: 800;
    color: #f59e0b;
    letter-spacing: 2px;
    margin: 0;
    padding: 10px 20px;
    border: 2px solid #f59e0b;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.05);
}

/* Info Bar */
.teklif-info-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #ddd;
    border-top: none;
    margin-bottom: 16px;
}

.teklif-info-cell {
    padding: 8px 12px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.teklif-info-cell:last-child {
    border-right: none;
}

.teklif-info-label {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
    margin-bottom: 2px;
}

.teklif-info-value {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Customer Section */
.teklif-customer-section {
    margin-bottom: 16px;
}

.teklif-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    background: #1a1a1a;
    padding: 6px 12px;
    margin: 0 0 0 0;
    font-weight: 700;
}

.teklif-customer-details {
    border: 1px solid #ddd;
    border-top: none;
    padding: 10px 12px;
    background: #fafafa;
}

.teklif-cust-row {
    display: flex;
    margin-bottom: 4px;
}

.teklif-cust-row:last-child {
    margin-bottom: 0;
}

.teklif-cust-label {
    width: 160px;
    font-weight: 600;
    font-size: 10px;
    color: #555;
    flex-shrink: 0;
}

.teklif-cust-value {
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Items Table */
.teklif-table-section {
    margin-bottom: 16px;
    flex: 1;
}

.teklif-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
}

.teklif-table th {
    background: #1a1a1a;
    color: white;
    font-weight: 700;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    text-align: left;
    border: 1px solid #1a1a1a;
}

.teklif-table td {
    padding: 7px 10px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.teklif-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.teklif-table tbody tr:hover {
    background: #fff8e1;
}

.teklif-table .col-sno {
    text-align: center;
    font-weight: 600;
    color: #888;
}

.teklif-table .col-price,
.teklif-table .col-total {
    text-align: right;
    font-weight: 600;
}

.teklif-table .col-qty {
    text-align: center;
}

.teklif-table .col-unit {
    text-align: center;
    color: #666;
}

/* Totals Area */
.teklif-totals {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.teklif-notes-area {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 14px;
    background: #fafafa;
}

.teklif-notes-area h4 {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 700;
}

.teklif-notes-area ul {
    list-style: disc;
    padding-left: 16px;
    font-size: 9px;
    color: #555;
    line-height: 1.6;
}

.teklif-totals-box {
    width: 220px;
    flex-shrink: 0;
}

.teklif-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 11px;
    border-bottom: 1px solid #eee;
}

.teklif-total-row span:first-child {
    color: #555;
    font-weight: 500;
}

.teklif-total-row span:last-child {
    font-weight: 700;
    color: #1a1a1a;
}

.teklif-grand-total {
    background: #1a1a1a;
    border: none;
    border-radius: 4px;
    margin-top: 4px;
}

.teklif-grand-total span:first-child {
    color: #ccc !important;
    font-weight: 700 !important;
}

.teklif-grand-total span:last-child {
    color: #f59e0b !important;
    font-size: 14px;
}

/* Footer / Signature */
.teklif-footer {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-top: auto;
    padding-top: 20px;
}

.teklif-sign-box {
    flex: 1;
    text-align: center;
}

.teklif-sign-line {
    width: 100%;
    height: 1px;
    background: #aaa;
    margin-bottom: 8px;
    margin-top: 50px;
}

.teklif-sign-box p {
    font-size: 10px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.teklif-sign-box span {
    font-size: 9px;
    color: #888;
}

/* Bottom Bar */
.teklif-bottom-bar {
    text-align: center;
    padding-top: 12px;
    margin-top: 16px;
    border-top: 2px solid #1a1a1a;
}

.teklif-bottom-bar p {
    font-size: 8px;
    color: #888;
    margin: 1px 0;
}

/* Print-specific overrides for teklif */
@media print {
    body.printing-teklif .teklif-page {
        width: 210mm;
        min-height: 297mm;
        padding: 12mm 15mm 10mm 15mm;
        margin: 0;
        box-shadow: none;
    }

    body.printing-teklif .teklif-company-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-teklif .teklif-doc-badge h2 {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-teklif .teklif-section-title {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-teklif .teklif-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-teklif .teklif-table tbody tr:nth-child(even) {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-teklif .teklif-grand-total {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.printing-teklif .teklif-grand-total span {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Cari Geçmişi Tab Stilleri */
.tab-btn {
    transition: all 0.3s ease;
}
.tab-btn:hover {
    background: rgba(255,255,255,0.05) !important;
}
.tab-btn.active {
    color: var(--accent) !important;
    border-bottom: 2px solid var(--accent) !important;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.history-table th {
    text-align: left;
    padding: 10px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.history-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.history-table tr:hover {
    background: rgba(255,255,255,0.02);
}

/* --- Premium Ekstre Yazdırma Stilleri --- */
.print-only { display: none !important; }

@media print {
    body.printing-ekstre > * { display: none !important; }
    
    body.printing-ekstre #print-ekstre-container { 
        display: block !important; 
        position: absolute; 
        left: 0; top: 0; width: 100%; 
        background: white !important;
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact;
    }
    
    body.printing-ekstre #print-ekstre-container, 
    body.printing-ekstre #print-ekstre-container * {
        visibility: visible !important;
        color: #1e293b !important;
    }

    body.printing-ekstre .ekstre-page {
        padding: 5mm;
        font-family: 'Inter', 'Segoe UI', sans-serif;
    }

    .ekstre-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8fafc !important;
        padding: 30px;
        border-radius: 12px;
        border-left: 6px solid #1e40af !important;
        margin-bottom: 30px;
    }

    .ekstre-logo-area {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .ekstre-logo-area i { font-size: 45px; color: #1e40af !important; }
    .ekstre-logo-area h2 { margin: 0; font-size: 26px; color: #1e3a8a !important; font-weight: 800; }
    .ekstre-logo-area span { font-size: 13px; color: #64748b !important; letter-spacing: 1px; }

    .ekstre-info { text-align: right; }
    .ekstre-info h1 { margin: 0; font-size: 24px; color: #1e40af !important; font-weight: 900; }
    .ekstre-info p { margin: 5px 0 0; color: #64748b !important; font-size: 14px; font-weight: 500; }

    .ekstre-customer-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        margin-bottom: 40px;
        background: white !important;
        padding: 25px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    }

    .customer-details h3 { 
        margin: 0 0 12px; 
        font-size: 20px; 
        color: #1e3a8a !important; 
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 8px;
    }
    .customer-details p { margin: 4px 0; font-size: 14px; color: #475569 !important; }

    .balance-summary {
        background: #f1f5f9 !important;
        padding: 15px;
        border-radius: 8px;
    }

    .summary-item {
        display: flex;
        justify-content: space-between;
        margin-bottom: 6px;
        font-size: 14px;
        color: #475569 !important;
    }

    .summary-item strong { color: #0f172a !important; }

    .main-balance {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 2px solid #cbd5e1 !important;
        font-size: 20px;
        font-weight: 800;
        color: #1e40af !important;
    }

    .ekstre-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin-bottom: 40px;
    }

    .ekstre-table th {
        background: white !important;
        color: #000 !important;
        padding: 12px 10px;
        text-align: left;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid #000 !important;
        border-top: 1px solid #e2e8f0;
    }

    .ekstre-table th:first-child { border-radius: 8px 0 0 0; }
    .ekstre-table th:last-child { border-radius: 0 8px 0 0; }

    .ekstre-table td {
        padding: 12px;
        border-bottom: 1px solid #e2e8f0;
        font-size: 12px;
        vertical-align: top;
    }

    .print-method-tag {
        display: inline-block;
        font-size: 10px;
        background: #f1f5f9 !important;
        color: #1e40af !important;
        padding: 2px 8px;
        border-radius: 4px;
        margin-top: 4px;
        font-weight: 700;
        border: 1px solid #e2e8f0;
    }

    .ekstre-table tr:nth-child(even) { background: #f8fafc !important; }
    
    .text-right { text-align: right !important; }

    .ekstre-footer {
        margin-top: 60px;
        background: #f8fafc !important;
        padding: 20px;
        border-radius: 12px;
        font-size: 12px;
        color: #64748b !important;
        line-height: 1.6;
    }

    .ekstre-signatures {
        display: flex;
        justify-content: space-around;
        margin-top: 60px;
    }

    .sign-area {
        width: 250px;
        border-top: 2px solid #1e3a8a !important;
        text-align: center;
        padding-top: 15px;
        font-weight: 700;
        color: #1e3a8a !important;
    }

    .ekstre-bottom-line {
        text-align: center;
        margin-top: 60px;
        font-weight: 700;
        color: #94a3b8 !important;
        font-size: 11px;
    }
}

/* ============================================================
   SIPARIS A4 PRINT TEMPLATE STYLES (INDIGO THEME)
   ============================================================ */

.siparis-print-container {
    display: none;
}

body.printing-siparis .siparis-print-container {
    display: block;
}

@media print {
    body.printing-siparis * {
        visibility: hidden !important;
    }
    body.printing-siparis .siparis-print-container,
    body.printing-siparis .siparis-print-container * {
        visibility: visible !important;
    }
    body.printing-siparis .siparis-print-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        margin: 0;
        padding: 0;
    }
    body.printing-siparis {
        background: white !important;
    }
}

.siparis-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: white;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    font-size: 11pt;
    padding: 20mm;
    box-sizing: border-box;
}

.siparis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #1e1b4b;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.siparis-logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.siparis-logo-icon {
    width: 60px;
    height: 60px;
    background: #1e1b4b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border-radius: 12px;
}

.siparis-company-name {
    font-size: 24pt;
    font-weight: 800;
    color: #1e1b4b;
    margin: 0;
}

.siparis-header-right {
    text-align: right;
}

.siparis-form-title {
    background: #1e1b4b;
    color: white;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 18pt;
    font-weight: 700;
    margin-bottom: 10px;
}

.siparis-barcode {
    font-family: 'Libre Barcode 39', cursive;
    font-size: 42pt;
    margin-top: 5px;
}

.siparis-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.siparis-info-box h3 {
    font-size: 10pt;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.siparis-data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.siparis-data-label {
    font-weight: 600;
    color: #475569;
}

.siparis-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.siparis-table th {
    background: #f1f5f9 !important;
    color: #1e1b4b;
    padding: 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid #1e1b4b;
}

.siparis-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.siparis-table tr:nth-child(even) {
    background: #f8fafc !important;
}

.siparis-footer {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 40px;
}

.siparis-notes {
    flex: 1;
    margin-right: 40px;
}

.siparis-totals {
    width: 250px;
}

.siparis-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.siparis-grand-total {
    font-size: 14pt;
    font-weight: 800;
    color: #1e1b4b;
    border-bottom: none;
    padding-top: 15px;
}

.siparis-signature-area {
    display: flex;
    justify-content: space-around;
    margin-top: 50px;
    text-align: center;
}

.siparis-sign-box {
    width: 200px;
    border-top: 1px solid #1e1b4b;
    padding-top: 10px;
    font-size: 9pt;
    color: #64748b;
}
