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

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

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

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1e40af;
}

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

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

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

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

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

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
}

.required {
  color: #ef4444;
}

input[type="text"],
input[type="date"],
textarea {
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.95rem;
  width: 100%;
  background: #f9fafb;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

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

.btn-primary {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

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

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

#searchInput {
  flex: 1;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: #fff;
}

#searchInput:focus {
  outline: none;
  border-color: #3b82f6;
}

/* 件数 */
.record-count {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 8px;
}

/* 記録一覧 */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-msg {
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
  padding: 32px 0;
}

.record-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  position: relative;
}

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

.card-date {
  font-size: 0.8rem;
  color: #6b7280;
}

.card-dept {
  font-size: 1rem;
  font-weight: 700;
  color: #1e40af;
}

.btn-delete {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

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

.card-medicine {
  font-size: 0.9rem;
  color: #374151;
  margin-bottom: 4px;
}

.card-medicine .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-right: 4px;
}

.card-medicine .value {
  color: #059669;
  font-weight: 500;
}

.card-memo {
  font-size: 0.85rem;
  color: #6b7280;
  white-space: pre-wrap;
  margin-top: 4px;
}

.no-medicine {
  color: #d1d5db;
}

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