
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;700;800;900&family=Roboto:wght@400;500;700;900&display=swap');

body { font-family: 'Roboto', 'Heebo', sans-serif; background: #f3f4f6; color: #333; }

/* Layout */
.page-wrapper { max-width: 65%; width: 1000px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 50px; }
@media print { .page-wrapper { max-width: 210mm; width: 100%; } }

#loaderOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8); z-index: 9999;
    display: none; align-items: center; justify-content: center;
}
.spinner { border: 4px solid #f3f3f3; border-top: 4px solid #e11d48; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.upload-container { display: flex; height: 100vh; align-items: center; justify-content: center; background: #f9fafb; }
.upload-card { background: white; padding: 3rem; border-radius: 1rem; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.05); border: 1px solid #e5e7eb; width: 100%; max-width: 600px; }
.drop-zone { border: 2px dashed #cbd5e1; border-radius: 0.5rem; padding: 2rem; transition: all 0.2s; background: #f8fafc; cursor: pointer; position: relative; }
.drop-zone:hover, .drop-zone.dragover { border-color: #e11d48; background: #fff1f2; }

.config-card { background: white; padding: 10mm; margin-bottom: 10mm; box-shadow: 0 4px 6px rgba(0,0,0,0.1); min-height: auto; position: relative; transition: all 0.3s ease; }

.clean-input { background: transparent; border: 1px solid transparent; width: 100%; color: inherit; font-family: inherit; font-weight: inherit; font-size: inherit; padding: 0; margin: 0; outline: none; transition: all 0.2s; border-radius: 2px; }
.clean-input:hover, .clean-input:focus { background-color: #ffffff; border-color: #cbd5e1; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.main-desc-input { border: none; background: transparent; outline: none; width: 100%; line-height: 1.2; padding: 0; margin: 0; font-family: inherit; resize: none; font-size: 1rem; }

.force-hidden { display: none !important; }
.show-hidden-mode .force-hidden { display: table-row !important; background-color: #fff1f2 !important; color: #94a3b8; }
.blacklisted-row { color: #94a3b8; font-style: italic; }
.row-highlighted { background-color: #ffff00 !important; }

.tool-btn { padding: 4px; border-radius: 4px; font-size: 10px; color: #64748b; transition: all 0.2s; background: transparent; cursor: pointer; }
.tool-btn:hover { background-color: #f1f5f9; color: #0f172a; }
.tool-btn.active-marker { color: #d97706; background-color: #fef3c7; }
.tool-btn.delete-row:hover { color: #ef4444; background-color: #fee2e2; }

.card-actions { position: absolute; top: 0; right: 0; background: #f8fafc; border-bottom-left-radius: 8px; padding: 6px 10px; display: flex; gap: 8px; border-left: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; align-items: center; z-index: 10; }
.snap-container { display: flex; gap: 8px; margin-bottom: 15px; }
.snap-box { flex: 1; border: 1px solid #e2e8f0; border-radius: 4px; padding: 5px; text-align: center; }
.snap-val { font-size: 16px; font-weight: 800; color: #1e3a8a; line-height: 1.1; }
.snap-label { font-size: 9px; font-weight: 700; color: #64748b; text-transform: uppercase; }

.snap-box input.clean-input { text-align: center; }
.snap-val input.clean-input { font-size: 16px; font-weight: 800; color: inherit; line-height: 1; }
.snap-label input.clean-input { font-size: 9px; font-weight: 700; color: inherit; text-transform: uppercase; }

.flat-tbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.flat-tbl th { text-align: left; background: #f1f5f9; padding: 4px 6px; border-bottom: 2px solid #cbd5e1; }
.flat-tbl td { border-bottom: 1px solid #e2e8f0; padding: 3px 6px; vertical-align: middle; }

#grand-total-section { margin-top: auto; background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 15px 20px; margin-bottom: 20px; }
.sec-title { background: #f8fafc; border-left: 4px solid #0f172a; padding: 4px 8px; font-weight: 700; font-size: 13px; margin: 15px 0 8px 0; text-transform: uppercase; }
.no-print { @media print { display: none !important; } }

/* Color Classes */
.row-tce { background-color: #f3e8ff !important; } .row-tce input { color: #6b21a8 !important; font-weight: 900 !important; }
.tce-box { background-color: #7e22ce !important; border-color: #581c87 !important; color: white !important; min-width: 140px; }
.row-sap { background-color: #e0f2fe !important; } .row-sap input { color: #0284c7 !important; font-weight: 900 !important; }
.sap-box { background-color: #007db8 !important; border-color: #005c87 !important; color: white !important; min-width: 140px; }
.tce-box .snap-val, .sap-box .snap-val { color: white !important; font-size: 16px; }
.tce-box .snap-label, .sap-box .snap-label { color: white !important; opacity: 0.9; }

/* --- Cover Page Styles --- */
#cover-page { 
    background: white; padding: 15mm; margin-bottom: 10mm; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); border: 1px solid #e5e7eb;
    display: none; /* Hidden by default */
}
#cover-page.visible { display: block; }

/* Central Toggle Button in Navbar */
.absolute-center {
    position: absolute; left: 50%; transform: translateX(-50%); top: 50%; transform: translate(-50%, -50%);
}
/* מניעת בחירת טקסט בזמן שימוש בידית הגרירה */
.drag-handle {
    user-select: none;
    -webkit-user-select: none;
}

/* מניעת סימון טקסט בכל הטבלה בזמן שגרירה פעילה */
.sortable-chosen {
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(243, 244, 246, 0.5); /* אופציונלי: צבע רקע עדין לשורה שנגררת */
}

/* ביטול בחירת טקסט כללית בזמן גרירה (Fallback mode) */
.sortable-fallback {
    user-select: none !important;
    -webkit-user-select: none !important;
    opacity: 0.8;
}