* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: #2c3e50;
  color: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.8rem;
}

.user-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

main {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

section {
  margin-bottom: 40px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: #95a5a6;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

.btn:hover {
  background: #7f8c8d;
}

.btn-primary {
  background: #3498db;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #e74c3c;
}

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

.btn-small {
  padding: 5px 15px;
  font-size: 0.9rem;
}

.btn-success {
  background: #27ae60;
}

.btn-success:hover {
  background: #229954;
}

.btn-danger {
  background: #e74c3c;
}

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

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #2c3e50;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #3498db;
}

/* Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

/* Job Card */
.job-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #3498db;
}

.job-card h3 {
  margin-bottom: 15px;
  color: #2c3e50;
}

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

.job-info-item {
  padding: 10px;
  background: white;
  border-radius: 5px;
}

.job-info-item strong {
  display: block;
  color: #7f8c8d;
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pending {
  background: #ffeaa7;
  color: #d63031;
}

.status-in-progress {
  background: #74b9ff;
  color: #0984e3;
}

.status-completed {
  background: #55efc4;
  color: #00b894;
}

/* STL Preview */
#stl-preview {
  margin: 20px 0;
  border: 2px dashed #ddd;
  border-radius: 8px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

#stl-preview canvas {
  width: 100% !important;
  height: 400px !important;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: #34495e;
  color: white;
  font-weight: 600;
}

tr:hover {
  background: #f8f9fa;
}

tr.clickable {
  cursor: pointer;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  border-bottom: 2px solid #ddd;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #7f8c8d;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: #2c3e50;
}

.tab-btn.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: white;
  margin: 50px auto;
  padding: 30px;
  border-radius: 8px;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

/* Utilities */
.loading {
  text-align: center;
  padding: 20px;
  color: #7f8c8d;
}

.error {
  background: #ffe5e5;
  color: #c0392b;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  border-left: 4px solid #c0392b;
}

.success {
  background: #d5f4e6;
  color: #27ae60;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  border-left: 4px solid #27ae60;
}

.welcome {
  text-align: center;
  padding: 40px 20px;
}

.welcome h2 {
  border: none;
  margin-bottom: 20px;
}

.login-prompt {
  text-align: center;
  padding: 60px 20px;
}

.login-prompt h2 {
  border: none;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row,
  .job-info {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    text-align: center;
  }

  .user-info {
    margin-top: 10px;
  }

  .tabs {
    overflow-x: auto;
  }
}
