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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f9;
  color: #333;
  font-size: 15px;
}

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

h1 {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

h2 {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #4a90d9;
}

.staff-input,
.time-input {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

button {
  padding: 8px 14px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

button:hover {
  background: #357abd;
}

.staff-list,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.staff-tag,
.slot-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e8f0fe;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
}

.staff-tag .del-btn,
.slot-tag .del-btn {
  background: none;
  color: #999;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.staff-tag .del-btn:hover,
.slot-tag .del-btn:hover {
  color: #e74c3c;
  background: none;
}

/* 週ナビ */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.week-nav button {
  background: #eee;
  color: #333;
  font-size: 13px;
  padding: 6px 10px;
}

.week-nav button:hover {
  background: #ddd;
}

#weekLabel {
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  flex: 1;
}

/* テーブル */
.table-wrapper {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
}

th {
  background: #4a90d9;
  color: #fff;
  padding: 8px 6px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #357abd;
  white-space: nowrap;
}

td {
  border: 1px solid #ddd;
  padding: 4px;
  vertical-align: top;
  min-width: 80px;
}

td.time-label {
  background: #f0f4ff;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  color: #555;
}

td.shift-cell {
  min-height: 40px;
}

td.shift-cell.empty {
  background: #fdecea;
}

.cell-staff {
  display: inline-block;
  margin: 2px;
  padding: 2px 8px;
  background: #d4edda;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
}

.cell-staff:hover {
  background: #f8d7da;
  text-decoration: line-through;
}

.cell-select {
  width: 100%;
  padding: 3px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 2px;
}

/* 凡例 */
.legend {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

.empty-mark {
  color: #e74c3c;
}

/* 操作ボタン行 */
.btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-clear {
  background: #e0e0e0;
  color: #555;
}

.btn-clear:hover {
  background: #f8d7da;
  color: #c00;
}

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

.btn-save:hover {
  background: #1e8449;
}

@media (max-width: 480px) {
  h1 {
    font-size: 17px;
  }

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

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