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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: #f5f7fa;
  color: #1e293b;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

header {
  background: #2563eb;
  color: #fff;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

header h1 {
  font-size: 1.3rem;
}

/* Form Section */
.form-section {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-section h2 {
  font-size: 1rem;
  color: #2563eb;
  margin-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.required {
  color: #ef4444;
}

input[type="text"],
input[type="date"],
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

textarea {
  resize: vertical;
  font-family: inherit;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* List Section */
.list-section {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
}

.list-header h2 {
  font-size: 1rem;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: #2563eb;
  color: #fff;
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 0.8rem;
}

.btn-print {
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-print:hover {
  background: #0d9488;
}

.empty-message {
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  padding: 30px 0;
}

/* Work Order Card */
.work-order-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fafafa;
  page-break-inside: avoid;
}

.work-order-card:last-child {
  margin-bottom: 0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-number {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.card-date {
  font-size: 0.75rem;
  color: #64748b;
}

.btn-delete {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.btn-delete:hover {
  color: #ef4444;
  background: #fee2e2;
}

.card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.field-item.full {
  grid-column: 1 / -1;
}

.field-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-value {
  font-size: 0.92rem;
  color: #1e293b;
  font-weight: 500;
}

.field-value.deadline {
  color: #dc2626;
  font-weight: 700;
}

/* Print Styles */
@media print {
  body {
    background: #fff;
  }

  .no-print {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  header {
    background: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border-radius: 0;
    margin-bottom: 10px;
  }

  .list-section {
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  .work-order-card {
    border: 1px solid #999;
    margin-bottom: 10px;
  }

  .badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Responsive */
@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .card-fields {
    grid-template-columns: 1fr;
  }

  .field-item.full {
    grid-column: 1;
  }
}
