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

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

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

h1 {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 16px;
  color: #4a90d9;
}

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

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

.input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.input-row input,
.input-row select {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

.input-row button,
button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  white-space: nowrap;
}

.btn-primary {
  background: #4a90d9;
  color: #fff;
}

.btn-primary:hover {
  background: #357abd;
}

.btn-secondary {
  background: #eee;
  color: #333;
  margin-top: 10px;
}

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

/* スタッフリスト */
.staff-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.staff-list li {
  display: flex;
  align-items: center;
  background: #f0f4ff;
  border-radius: 20px;
  padding: 4px 12px;
  gap: 6px;
  font-size: 14px;
}

.staff-list li .del-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}

.staff-list li .del-btn:hover {
  color: #e55;
}

/* カレンダー入力 */
.calendar-input {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}

.calendar-input .day-header {
  text-align: center;
  font-size: 12px;
  color: #888;
  padding: 4px 0;
}

.calendar-input .day-cell {
  text-align: center;
}

.calendar-input .day-cell label {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 2px;
  font-size: 13px;
  border: 1px solid #e0e0e0;
  user-select: none;
}

.calendar-input .day-cell input[type="checkbox"] {
  display: none;
}

.calendar-input .day-cell label.off {
  background: #f8d7da;
  border-color: #e55;
  color: #c00;
  font-weight: bold;
}

.calendar-input .day-cell.empty label {
  visibility: hidden;
}

.calendar-input .day-cell .day-name {
  font-size: 10px;
  color: #aaa;
}

.calendar-input .day-cell label.off .day-name {
  color: #e55;
}

/* シフト表 */
.shift-table-wrap {
  overflow-x: auto;
}

.shift-table {
  border-collapse: collapse;
  min-width: 600px;
  width: 100%;
  font-size: 13px;
}

.shift-table th,
.shift-table td {
  border: 1px solid #ddd;
  padding: 6px 4px;
  text-align: center;
  white-space: nowrap;
}

.shift-table th {
  background: #4a90d9;
  color: #fff;
  font-weight: bold;
}

.shift-table th.weekend-sat {
  background: #5ba8e0;
}

.shift-table th.weekend-sun {
  background: #e07070;
}

.shift-table .staff-name {
  background: #f0f4ff;
  font-weight: bold;
  text-align: left;
  padding-left: 8px;
}

.shift-table .cell-work {
  background: #e8f5e9;
  color: #2e7d32;
}

.shift-table .cell-off {
  background: #fce4ec;
  color: #c62828;
  font-weight: bold;
}

@media (max-width: 480px) {
  h1 { font-size: 1.2rem; }
  .shift-table { font-size: 11px; }
  .shift-table th, .shift-table td { padding: 4px 2px; }
}

@media print {
  body { background: #fff; }
  .container { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; margin-bottom: 8px; }
  button, .input-row, section:not(:last-child) { display: none !important; }
  section:last-child .input-row { display: none !important; }
  #printBtn { display: none !important; }
}
