body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
  }
  .container {
    display: flex;
    height: 100vh;
  }
  .left-panel {
    width: 320px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #ddd;
    overflow-y: auto;
  }
  .main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
  }
  .upload-section {
    background-color: white;
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .file-input-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
  }
  .file-input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
  .file-input-button {
    display: inline-block; padding: 10px 20px; background-color: #3498db; color: white;
    border-radius: 4px; cursor: pointer; font-weight: 600; transition: background-color 0.3s;
  }
  .file-input-button:hover { background-color: #2980b9; }
  .file-name { margin-left: 15px; font-style: italic; color: #7f8c8d; }
  .brand-selector {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .brand-selector label { font-weight: 600; display: block; margin-bottom: 8px; color: #2c3e50; }
  .brand-selector select {
    width: 100%; padding: 10px 15px; border: 1px solid #ddd; border-radius: 4px; background-color: white;
    font-size: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .fibre-compositions {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .fibre-compositions label { 
    font-weight: 600; 
    display: block; 
    margin-bottom: 15px; 
    color: #2c3e50;
    font-size: 18px;
  }
  .compositions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  .composition-item {
    display: flex;
    flex-direction: column;
  }
  .composition-item label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #34495e;
    font-size: 14px;
  }
  .composition-item input, .composition-item select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .care-instructions-section {
    background-color: white;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .care-instructions-section label { 
    font-weight: 600; 
    display: block; 
    margin-bottom: 15px; 
    color: #2c3e50;
    font-size: 18px;
  }
  .care-symbol-section {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .care-symbol-section label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
  }
  .care-symbol-section select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .action-buttons {
    margin-top: 20px;
  }
  .view-table-btn, .export-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  .view-table-btn {
    background-color: #2ecc71;
    color: white;
  }
  .view-table-btn:hover {
    background-color: #27ae60;
  }
  .export-btn {
    background-color: #3498db;
    color: white;
  }
  .export-btn:hover {
    background-color: #2980b9;
  }
  .label-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Increased min-width */
    gap: 20px; 
    margin-bottom: 30px;
  }
  .label-group {
    background-color: #f8f9fa; 
    border-radius: 6px; 
    padding: 14px;
    border-left: 4px solid #3498db; 
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
  }
  .label-group:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
  .label-group label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 650;
  color: #2c3e50;
  white-space: nowrap;       /* Prevent text wrap */
  transform: scaleX(0.85);   /* Adjust horizontal scale (0.75–1.00) */
  transform-origin: left;    /* Keeps left edge aligned when scaling */
}

  .ref-dropdown-container {
    display: flex; 
    align-items: center; 
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping if needed */
  }
  .label-group select {
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    background-color: white;
    font-size: 14px; 
    flex: 1;
    white-space: normal;         /* Allow text to wrap */
    word-break: break-word;      /* Break long words */
    overflow-wrap: break-word;   /* Break long words */
    min-width: 0;                /* Prevent overflow in flex/grid */
    max-width: 100%;             /* Prevent overflow */
    height: auto;                /* Allow height to grow */
    line-height: 1.3;
    display: block;              /* Ensure block for wrapping */
    min-height: 36px;            /* Ensure minimum height */
    box-sizing: border-box;      /* Include padding in width calculation */
  }
  .label-group select option {
    white-space: normal !important; /* Allow option text to wrap */
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 5px;                /* Add padding to options */
  }
  .label-group input[type="number"] {
    width: 70px; 
    padding: 6px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    font-size: 14px;
    box-sizing: border-box;      /* Include padding in width calculation */
  }
  .label-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: 36px;
    height: auto;
    box-sizing: border-box;
  }
  .notification {
    position: fixed; top: 20px; right: 20px; padding: 15px 20px; background-color: #2ecc71; color: white;
    border-radius: 4px; box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transform: translateX(150%); transition: transform 0.3s ease; z-index: 1000;
  }
  .notification.show { transform: translateX(0); }
  .notification.error { background-color: #e74c3c; }
  
  /* Table section styles */
  .table-section {
    margin-bottom: 30px;
  }

  .table-actions {
    margin-bottom: 10px;
    text-align: right;
  }

  .add-row-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
  }

  .add-row-btn:hover {
    background-color: #27ae60;
  }

  .remove-row-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
  }

  .remove-row-btn:hover {
    background-color: #c0392b;
  }
  
  .input-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
  }
  .input-table th, .input-table td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
  }
  .input-table th:last-child, .input-table td:last-child {
    width: 60px;
    text-align: center;
  }
  .input-table th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
  }
  .input-table td input {
    width: 100%;
    padding: 5px;
    border: none;
    outline: none;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
  }
  
  /* Modal styles */
  .modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
  }
  .modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 10px;
    border: 1px solid #888;
    width: 100%;
    max-width: 1780px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-height: 80vh;
    overflow: auto;
  }
  .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }
  .close:hover {
    color: black;
  }
  .modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 16px;
    min-width: max-content;
  }
  .modal-table th, .modal-table td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: left;
    white-space: nowrap;
  }
  .modal-table th {
    background-color: #3498db;
    color: white;
    position: sticky;
    top: 0;
    font-weight: 600;
  }
  .modal-table tr:nth-child(even) {
    background-color: #f2f2f2;
  }
  .modal-table tr:hover {
    background-color: #e6f7ff;
  }
  .modal-actions {
    text-align: right;
    margin-top: 20px;
  }
  .modal-btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
  }
  .modal-btn:hover {
    background-color: #2980b9;
  }
  .filename-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: 40px;
    height: auto;
  }
  .filename-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
  }
  
  /* Job Order Section Styles */
  .job-order-section {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .job-order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
  .job-order-item {
    display: flex;
    flex-direction: column;
  }
  .job-order-item label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
  }
  .job-order-item input, .job-order-item select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    /* Added text wrapping properties */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: 36px;
    height: auto;
    box-sizing: border-box;
  }
  .job-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
  }
  .job-action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  .save-job-btn {
    background-color: #2ecc71;
    color: white;
  }
  .save-job-btn:hover {
    background-color: #27ae60;
  }
  .load-job-btn {
    background-color: #f39c12;
    color: white;
  }
  .load-job-btn:hover {
    background-color: #e67e22;
  }
  .clear-job-btn {
    background-color: #e74c3c;
    color: white;
  }
  .clear-job-btn:hover {
    background-color: #c0392b;
  }
  .top-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  .home-btn, .layout-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
  }
  .home-btn {
    background-color: #3498db;
    color: white;
  }
  .home-btn:hover {
    background-color: #2980b9;
  }
  .layout-btn {
    background-color: #9b59b6;
    color: white;
  }
  .layout-btn:hover {
    background-color: #8e44ad;
  }
  
  /* Additional styles for buttons in label groups */
  .label-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .add-ref-btn-inline, .remove-ref-btn-inline, .view-ref-btn-inline {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    font-weight: bold;
  }
  
  .add-ref-btn-inline {
    background-color: #2ecc71;
    color: white;
  }
  
  .remove-ref-btn-inline {
    background-color: #e74c3c;
    color: white;
  }
  
  .view-ref-btn-inline {
    background-color: #3498db;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .additional-reference {
    background-color: white;
  }

  /* Styles for the centered image modal */
#imageModal .image-modal-content {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 270px; /* 150px image + 20px padding */
  height: 270px;
  padding: 10px;
  border: 1px solid #888;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  background-color: rgba(254, 254, 254, 2); /* Semi-transparent white background */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#imageModal .close {
  position: absolute;
  top: 5px;
  right: 10px;
  color: #aaa;
  font-size: 20px;
  font-weight: bold;
}

#imageModal .close:hover {
  color: #000;
}

#imageModal #modalImage {
  /* object-fit: contain; ensures the image fits without distortion */
  object-fit: contain; 
}

/* Styles for reference-wise tables container */
.ref-wise-tables-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.ref-section {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background-color: #f9f9f9;
}

.ref-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.ref-section table {
  margin-top: 10px;
}

/* Styles for reference-wise tables container */
.ref-wise-tables-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.ref-section {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background-color: #f9f9f9;
}

.ref-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.ref-section table {
  margin-top: 10px;
}

/* Styles for reference-wise tables container */
.ref-wise-tables-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.ref-section {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background-color: #f9f9f9;
}

.ref-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.ref-section table {
  margin-top: 10px;
}

/* Styles for reference-wise tables container */
.ref-wise-tables-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.ref-section {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background-color: #f9f9f9;
}

.ref-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.ref-section table {
  margin-top: 10px;
}


/* Style for the new View Data button in label groups */
.view-ref-data-btn-inline {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  border: none;
  font-weight: bold;
  background-color: #9b59b6;
  color: white;
  margin-left: 2px;
}

.view-ref-data-btn-inline:hover {
  background-color: #8e44ad;
}

/* Styles for reference-wise tables container */
.ref-wise-tables-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.ref-section {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  background-color: #f9f9f9;
}

.ref-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.ref-section table {
  margin-top: 10px;
}

/* ====== ORDER NUMBER SECTION ====== */
.order-no-section {
  background-color: #fff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border-left: 4px solid #3498db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.order-no-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: #2c3e50;
}
.order-no-section input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 15px;
  background-color: #fff;
  box-sizing: border-box;
}