:root { --primary-color: #a04000; --secondary-color: #fdf2e9; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f4f5f7; margin: 0; padding: 20px; color: #333; }
#erp-wrapper { max-width: 1450px; margin: auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-top: 5px solid var(--primary-color); transition: 0.3s; position: relative;}

.company-selector-bar { background: #2c3e50; color: white; padding: 10px 20px; border-radius: 5px; margin-bottom: 25px; display: flex; justify-content: space-between; align-items: center; }
.company-selector-bar select { padding: 8px 15px; font-size: 16px; font-weight: bold; border-radius: 4px; border: none; cursor: pointer; outline: none; background: #fff; color: #2c3e50; }

.header-section { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px dashed #eee; padding-bottom: 15px; margin-bottom: 20px; }
.brand h1 { color: var(--primary-color); margin: 0; font-size: 26px; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s;}
.brand p { margin: 5px 0 0 0; color: #5b8cba; font-weight: 600; font-size: 13px; text-transform: uppercase; }

.crm-section { background: #fdfdfd; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px 20px; margin-bottom: 20px; }
.crm-title { font-size: 12px; color: #7f8c8d; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; font-weight: bold; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.info-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; margin-bottom: 15px; }

.form-group label { display: block; font-size: 11px; font-weight: bold; color: #555; margin-bottom: 5px; text-transform: uppercase; }
.form-group input, .form-group select { width: 100%; padding: 8px 10px; border: 1px solid #ced4da; border-radius: 4px; font-size: 13px; box-sizing: border-box; background-color: #fff; }
.readonly-bg { background-color: #f1f3f5 !important; color: #495057; font-weight: bold; border: 1px solid #ced4da; }
.pin-result { font-size: 10px; color: #27ae60; font-weight: bold; margin-top: 4px; display: block; height: 12px;}

.product-area { border: 1px solid #dee2e6; border-radius: 5px; margin-bottom: 10px; overflow-x: auto;}

/* 🎯 ALIGNMENT FIX: Dono mein same Column Width aur same Gap (8px) laga diya hai */
.table-header { display: grid; grid-template-columns: 30px 1.5fr 1.2fr 65px 60px 60px 80px 50px 75px 80px 85px 85px 70px 40px; gap: 8px; background-color: #f1f3f5; padding: 12px 10px; font-size: 10px; font-weight: bold; color: #5b8cba; text-transform: uppercase; text-align: center; align-items: center; box-sizing: border-box; }
.table-row { display: grid; grid-template-columns: 30px 1.5fr 1.2fr 65px 60px 60px 80px 50px 75px 80px 85px 85px 70px 40px; gap: 8px; padding: 10px; align-items: flex-start; border-bottom: 1px solid #eee; box-sizing: border-box; }

/* 🛡️ GRID BLOWOUT FIX: Inputs ko zabardasti grid se bahar aane se rokna */
.table-row > div { min-width: 0; } 
.table-row input, .table-row select { width: 100%; box-sizing: border-box; min-width: 0; padding: 6px; font-size: 12px; border: 1px solid #ccc; border-radius: 4px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.combo-note { font-size: 9px; color: #d35400; display: block; text-align: center; line-height: 1.2; margin-top: 4px; font-weight:bold;}
.sub-prod-select { display: none; margin-top: 5px; border-color: #9b59b6 !important; background-color: #fcf3ff !important; color: #8e44ad; font-weight: bold; }
.finish-select { display: none; margin-top: 5px; border-color: #27ae60 !important; background-color: #eafaf1 !important; color: #27ae60; font-weight: bold; }

.btn-add-row { background-color: #27ae60; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 13px; margin-bottom: 20px; }
.btn-remove { background-color: #e74c3c; color: white; border: none; padding: 6px; border-radius: 4px; cursor: pointer; width: 100%; font-weight:bold; }

.flex-wrapper { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; }
.layout-visualizer { flex: 1; background: #fafafa; border: 1px solid #ddd; border-radius: 8px; padding: 15px; }
.layout-visualizer h3 { margin-top: 0; font-size: 14px; color: #2c3e50; text-transform: uppercase; border-bottom: 2px solid #eee; padding-bottom: 10px; }

.render-area-box { display: flex; flex-wrap: wrap; gap: 20px; justify-content: flex-start; }

.summary-container { width: 450px; }
.summary-box { background: #fdfdfd; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; height: fit-content; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; color: #555; align-items: center; }
.material-breakdown { background: #e8f8f5; padding: 15px; border-radius: 4px; border: 1px solid #1abc9c; margin-bottom: 15px; }
.material-item { font-size: 13px; color: #16a085; display: flex; justify-content: space-between; margin-bottom: 5px; font-weight: bold;}
.summary-total { display: flex; justify-content: space-between; margin-top: 15px; padding-top: 15px; border-top: 2px solid #cbd5e1; font-size: 20px; font-weight: bold; color: var(--primary-color); }
.hidden-profit-box { background: #e8f8f5; border: 1px dashed #27ae60; padding: 12px; border-radius: 6px; margin-top: 15px; display: flex; justify-content: space-between; font-weight: bold; color: #27ae60; font-size: 15px; }

.btn-cloud-save { border: none; padding: 14px 40px; font-size: 16px; font-weight: bold; border-radius: 6px; cursor: pointer; color: white; transition: 0.3s; text-transform: uppercase;}
.btn-cloud-save:hover { opacity: 0.9; transform: translateY(-2px); }