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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #1e293b;
  min-height: 100vh;
}

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

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #2563eb;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
}

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

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

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

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

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

.required {
  color: #ef4444;
}

input[type="text"],
input[type="date"] {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus {
  border-color: #2563eb;
}

.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;
  width: 100%;
}

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

/* フィルタータブ */
.filter-section {
  margin-bottom: 12px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
}

.tab {
  padding: 7px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.tab:hover:not(.active) {
  border-color: #2563eb;
  color: #2563eb;
}

/* 一覧 */
.empty-msg {
  text-align: center;
  color: #94a3b8;
  padding: 40px 0;
  font-size: 0.95rem;
}

.order-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  border-left: 4px solid #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.order-card.arrived {
  border-left-color: #22c55e;
  opacity: 0.75;
}

.order-card.overdue {
  border-left-color: #ef4444;
}

.order-info {
  flex: 1;
  min-width: 0;
}

.order-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.order-item {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.order-vendor {
  font-size: 0.85rem;
  color: #64748b;
}

.order-dates {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.order-memo {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-pending {
  background: #fef3c7;
  color: #b45309;
}

.badge-arrived {
  background: #dcfce7;
  color: #15803d;
}

.badge-overdue {
  background: #fee2e2;
  color: #b91c1c;
}

.order-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-arrive {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-arrive:hover {
  background: #16a34a;
}

.btn-undo {
  background: #e2e8f0;
  color: #475569;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-undo:hover {
  background: #cbd5e1;
}

.btn-delete {
  background: none;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

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

  .order-card {
    flex-direction: column;
  }

  .order-actions {
    flex-direction: row;
    width: 100%;
  }

  .btn-arrive, .btn-undo, .btn-delete {
    flex: 1;
    text-align: center;
  }
}
