body {
  font-family: 'Montserrat', sans-serif;
  background: #1a1a1a;
  color: #ddd;
  padding: 0;
  margin: 0;
  max-width: 100%;
}

.upload-section {
  background: url('../images/TRUST-PATTERN-NEW-LARGE.png');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 9rem 2rem;
  text-align: center;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.upload-section h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  width: 400px;
}

.upload-section p {
  font-size: 1.1rem;
  margin: 0 0 2rem 0;
  opacity: 0.9;
}

.upload-box {
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 2rem;
  max-width: 450px;
  width: 100%;
  backdrop-filter: blur(10px);
}

.upload-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.upload-box input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
}

.upload-box input[type="file"]::file-selector-button {
  background: white;
  color: #667eea;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.upload-hint {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0;
}

.filter-section {
  background: #2d2d2d;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
}

#content {
  padding: 0.5rem 1rem;
  max-width: 100%;
  margin: auto;
}

h1 { 
  font-size: 1.5rem; 
  margin-bottom: 0.25rem; 
}

.meta {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 2rem;
}

h2 { 
  font-size: 1.1rem; 
  margin: 2rem 0 0.5rem; 
  color: #ddd; 
}

details {
  background: #2d2d2d;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s ease;
}

details[open] {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Transition for child elements (content) */
details > :not(summary) {
  opacity: 0;
  transition: opacity 0.8s ease;
  max-height: 0;
  overflow: hidden;
}

details[open] > :not(summary) {
  opacity: 1;
  max-height: 1000px;
}

details > summary {
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0;
}

details > summary:hover {
  opacity: 1;
}

details > summary h2 {
  margin: 0;
  display: inline;
  color: #ddd;
}

.export-btn, .export-unselected-btn, .export-selected-btn {
  transition: background 0.2s ease, transform 0.1s ease !important;
}

.export-btn:hover, .export-unselected-btn:hover, .export-selected-btn:hover {
  filter: brightness(1.1) !important;
  transform: translateY(-1px) !important;
}

details > *:not(summary) {
  margin-top: 1rem;
}

.red   { color: #c0392b; }
.orange{ color: #e67e22; }
.yellow{ color: #b8860b; }
.green { color: #27ae60; }
.blue  { color: #3498db; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #2d2d2d;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
  table-layout: fixed;
}

thead tr { background: #1a1a1a; }

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ccc;
  border-bottom: 1px solid #444;
  border-right: 1px solid #444;
  word-break: break-word;
}

th:last-child {
  border-right: none;
}

td {
  padding: 9px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid #444;
  color: #ddd;
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
}

td:last-child {
  border-right: none;
}

tr:last-child td { border-bottom: none; }

tr.editable-row { transition: none; }
tr.editable-row.selected td { background: #3d5a3d !important; }
tr.editable-row:hover td { background: #3a3a3a; }
tr.editable-row.selected:hover td { background: #4a7a4a !important; }

/* Incoming Stock - highlight rows that need top-up */
tr.incoming-stock-needs-topup {
  background: rgba(192, 57, 43, 0.25) !important;
}

tr.incoming-stock-needs-topup td {
  background: rgba(192, 57, 43, 0.25) !important;
}

.part-name-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
  min-height: 20px;
}

.select-btn {
  display: inline-block !important;
  animation: none;
  padding: 2px 8px !important;
  background: #2d2d2d !important;
  color: white !important;
  border: none !important;
  border-radius: 3px !important;
  cursor: pointer !important;
  font-size: 0.8rem !important;
  min-width: 20px;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  flex-shrink: 0;
}

.edit-btn {
  display: none;
  animation: fadeIn 0.2s ease;
  padding: 2px 8px !important;
  margin-left: auto !important;
  background: #2d2d2d !important;
  color: white !important;
  border: none !important;
  border-radius: 3px !important;
  cursor: pointer !important;
  font-size: 0.8rem !important;
  flex-shrink: 0;
  min-width: fit-content;
}

/* Show edit button when visible class is added */
.edit-btn.visible {
  display: inline-block !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.edit-row { transition: all 0.3s ease; }

strong { font-weight: 600; }

.filter-box {
  background: #2d2d2d;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: auto;
  justify-content: center;
}

.filter-box label {
  font-weight: 600;
  color: #ddd;
  margin: 0;
  white-space: nowrap;
}

.filter-box select {
  padding: 8px 12px;
  border: 1px solid #666;
  border-radius: 4px;
  font-size: 0.95rem;
  min-width: 180px;
  background: #3a3a3a;
  cursor: pointer;
  color: #ddd;
}

.filter-box select:hover {
  border-color: #667eea;
}

.filter-box button {
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}

.filter-box button:hover {
  background: #5568d3;
}

.tips {
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 450px;
  width: 100%;
  margin-top: 1.5rem;
}

.tips summary {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #667eea;
  padding: 0.5rem;
}

.tips summary:hover {
  opacity: 0.8;
}

.tips-content {
  color: #ddd;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.tips-content p {
  margin: 0.5rem 0;
}

.recent-files-container {
  margin-top: 1.5rem;
  text-align: center;
}

.recent-files-container summary {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: #ddd;
  padding: 0.5rem;
}

.recent-files-container summary:hover {
  opacity: 0.8;
}

#recent-files-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  justify-content: center;
}

#recent-files-list button {
  padding: 0.5rem 1rem;
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
  border: 1px solid #667eea;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

#recent-files-list button:hover {
  background: rgba(102, 126, 234, 0.3);
}

/* Login Modal Styles */
#login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../images/STUDIO-SEMI.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: 'Montserrat', sans-serif;
}

#login-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}

.login-container {
  padding: 3rem;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.4s ease;
  position: relative;
  z-index: 1;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-container h2 {
  color: white;
  text-align: center;
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
}

.login-container p {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin: 0 0 2rem 0;
  font-size: 0.95rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#login-form label {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

#password-input {
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  transition: all 0.2s ease;
}

#password-input:focus {
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

#password-input::placeholder {
  color: #999;
}

#login-form button {
  padding: 0.75rem;
  background: white;
  color: #000000;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#login-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#login-form button:active {
  transform: translateY(0);
}

#login-error {
  color: #ffcccc;
  text-align: center;
  font-size: 0.9rem;
  display: none;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

#app-container {
  display: none;
}

.logout-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: #000000;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1000;
  transition: background 0.2s ease;
}

.logout-btn:hover {
  background: #c0392b;
}
