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

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

#app {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 12px 40px;
}

/* ヘッダー */
.header {
  padding: 20px 0 12px;
  border-bottom: 2px solid #3b82f6;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 1.5rem;
  color: #1e40af;
}

/* セクション */
.section {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.section h2 {
  font-size: 1rem;
  color: #374151;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

/* 入力行 */
.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-row input:focus {
  border-color: #3b82f6;
}

.input-row button,
button {
  padding: 9px 16px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.input-row button:hover,
button:hover {
  background: #2563eb;
}

/* タグリスト（ポジション一覧） */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 10px;
}

.tag-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 4px 12px 4px 14px;
  font-size: 0.88rem;
  color: #1e40af;
}

.tag-list li button {
  padding: 2px 6px;
  background: none;
  color: #ef4444;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  transition: background 0.15s;
}

.tag-list li button:hover {
  background: #fee2e2;
}

/* 日付行 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.section-header h2 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #6b7280;
}

.date-row input[type="date"] {
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}

.date-row input[type="date"]:focus {
  border-color: #3b82f6;
}

/* 空メッセージ */
.empty-msg {
  color: #9ca3af;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}

/* 配置テーブル */
.assignment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.assignment-table th {
  background: #eff6ff;
  color: #1e40af;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #bfdbfe;
}

.assignment-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

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

.assignment-table td:first-child {
  font-weight: 500;
  color: #374151;
  width: 45%;
}

.assignment-table input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.assignment-table input[type="text"]:focus {
  border-color: #3b82f6;
}

/* ボタン行 */
.btn-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
}

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

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

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

/* 印刷用スタイル */
@media print {
  body {
    background: #fff;
  }

  #app {
    max-width: 100%;
    padding: 0;
  }

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

  .section {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
    margin-bottom: 12px;
    page-break-inside: avoid;
  }

  .assignment-table th {
    background: #e8f0fe !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .assignment-table input[type="text"] {
    border: none;
    padding: 0;
    font-size: 1rem;
  }

  .print-title {
    display: block !important;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
  }

  .print-date {
    display: block !important;
    text-align: center;
    font-size: 1rem;
    margin-bottom: 16px;
    color: #555;
  }
}

/* 印刷タイトル（通常時は非表示） */
.print-title,
.print-date {
  display: none;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .section {
    padding: 14px;
  }

  .assignment-table th,
  .assignment-table td {
    padding: 8px 8px;
  }

  .assignment-table td:first-child {
    width: 40%;
    font-size: 0.85rem;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row button {
    width: 100%;
    text-align: center;
  }
}
