* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --accent: #00a0e9;        /* ドラえもんブルー */
  --accent-deep: #0087c8;   /* 濃い青(控えめ) */
  --accent-pale: #eaf6fd;   /* 淡い青 */
  --line: #dde6ec;
  --ink: #30363b;
  --sub: #8b98a3;
  --red: #d13c3c;
  --radius: 10px;
}
body { font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  background: #f5f9fb; color: var(--ink); font-size: 14px;
  -webkit-font-smoothing: antialiased; }
header { background: linear-gradient(135deg, #3db6f0, var(--accent-deep));
  color: #fff; padding: 14px 20px; display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap; }
header h1 { font-size: 17px; font-weight: 600; letter-spacing: .04em; }
.date-row { display: inline-flex; align-items: center; gap: 10px; }
.date-row input { padding: 5px 10px; border: none; border-radius: 6px;
  font-size: 14px; background: rgba(255,255,255,.94); color: var(--ink); }
.weekday { font-weight: 600; font-size: 15px; }
#status-badge .confirmed { background: #e0592f; padding: 3px 12px;
  border-radius: 999px; font-size: 12px; }
#status-badge .draft { background: rgba(255,255,255,.22); padding: 3px 12px;
  border-radius: 999px; font-size: 12px; }
main { padding: 16px; max-width: 1240px; margin: 0 auto; }
.panel { background: #fff; border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 14px; border: 1px solid var(--line); }
details summary { font-weight: 600; cursor: pointer; padding: 6px 0;
  color: var(--accent-deep); font-size: 13.5px; }
details summary::marker { color: var(--sub); }
#shift-sync-details { border-bottom: 1px solid var(--line);
  margin-bottom: 8px; padding-bottom: 8px; }
.shift-sync-row { display: flex; gap: 8px; padding: 6px 0; }
.shift-sync-row input { flex: 1; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13px; }
#staff-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 3px 14px; padding: 8px 0; }
.staff-row { display: flex; align-items: center; gap: 7px; padding: 3px 6px;
  border-radius: 6px; transition: background .15s; }
.staff-row:hover { background: var(--accent-pale); }
.staff-row.off { opacity: .38; }
.staff-row .name { flex: 1; white-space: nowrap; overflow: hidden; }
.staff-row select { font-size: 12px; padding: 2px 4px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; }
.staff-row input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.kind-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; color: #fff;
  white-space: nowrap; font-weight: 500; }
.kind-seiki { background: var(--accent-deep); } .kind-junshoku { background: #55b7e8; }
.kind-part_day { background: #a9b2ba; } .kind-part_short { background: #cd8a4b; }
.class-head { grid-column: 1 / -1; font-weight: 600; color: var(--accent-deep);
  border-bottom: 1px solid var(--line); margin-top: 8px; padding-bottom: 2px;
  font-size: 12.5px; letter-spacing: .05em; }
#kahai-inputs { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 0; }
.kahai-item { display: flex; align-items: center; gap: 7px; }
.kahai-item input { width: 54px; padding: 5px; font-size: 15px; text-align: center;
  border: 1px solid var(--line); border-radius: 7px; }
.actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }
button { padding: 9px 22px; border: 1px solid var(--accent); background: #fff;
  color: var(--accent-deep); border-radius: 8px; font-size: 14px; cursor: pointer;
  font-weight: 600; transition: all .15s; }
button:hover { background: var(--accent-pale); }
button.primary { background: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-deep); }
button:active { transform: scale(.97); }
#warnings { margin-bottom: 10px; }
.warn { background: #fff7ec; border-left: 3px solid #e8973c; padding: 7px 12px;
  margin-bottom: 5px; border-radius: 0 7px 7px 0; font-size: 13px; }
.warn.severe { background: #fdefef; border-left-color: var(--red); font-weight: 600; }
.hint { font-size: 12px; color: var(--sub); margin-bottom: 8px; }
#table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); }
table.haichi { border-collapse: collapse; width: 100%; min-width: 960px; }
.haichi th, .haichi td { border: 1px solid #efe9e1; padding: 4px 5px;
  vertical-align: top; }
.haichi thead th { background: var(--accent-pale); font-size: 13px;
  color: var(--accent-deep); font-weight: 600; padding: 8px 5px;
  position: sticky; top: 0; z-index: 2; }
.haichi thead th.sagyo-head { background: #f0f2f4; color: #77828c; }
.haichi .slot-label { background: var(--accent-pale); font-weight: 700;
  white-space: nowrap; width: 62px; text-align: center; color: var(--accent-deep);
  font-size: 14px; vertical-align: middle; }
.slot-total { font-size: 14px; color: var(--sub); font-weight: 600; margin-top: 2px; }
.sagyo-cell { background: #f8fafb; width: 110px; }
.cell-head { font-size: 11.5px; color: var(--sub); text-align: right;
  font-weight: 600; margin-bottom: 2px; }
.cell-head .short { color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
.chip { padding: 2px 9px; border-radius: 999px; background: #f0f4f7;
  cursor: grab; white-space: nowrap; border: 1px solid transparent;
  font-size: 13px; line-height: 1.5; transition: border-color .12s, background .12s;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.chip:hover { border-color: var(--accent); }
.chip.teacher { font-weight: 700; background: #e0f1fb; }
.chip.office { background: var(--red); color: #fff; }
.chip.selected { border: 2px solid #e0592f; background: #ffe9a8;
  box-shadow: 0 1px 5px rgba(224,89,47,.35); }
.chip.drag-src { opacity: .35; }
.drag-ghost { position: fixed; z-index: 99; pointer-events: none;
  padding: 3px 12px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  transform: translate(-50%, -120%); }
.cont { color: #c3ced6; font-size: 17px; text-align: center; display: block;
  line-height: 1.6; }
.reason { font-size: 10px; color: #b3bec7; margin-top: 3px; line-height: 1.35; }
td.droptarget { background: #f0f8fd; outline: 1.5px dashed #8fcdef; outline-offset: -3px; }
td.dragover { background: #dcf0fb; outline: 2px solid var(--accent); outline-offset: -3px; }
td.gone { background: #f3f5f6; }
#save-note { font-size: 12px; color: var(--sub); }

/* 休みの人サマリ */
#absent-summary { font-size: 13px; color: var(--ink); line-height: 1.6;
  background: var(--accent-pale); border: 1px solid #cfe8f7; border-radius: 8px;
  padding: 6px 12px; flex: 1; min-width: 240px; }
#absent-summary .absent-count { font-weight: 700; color: var(--accent-deep); }
#absent-summary .absent-kind { color: var(--sub); margin-left: 8px; }
#absent-summary .absent-names { font-weight: 600; }

/* 印刷タイトル(画面では非表示) */
#print-title { display: none; }

/* 印刷: 配置表だけをA4横に */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; font-size: 11px; }
  header, .panel, .actions, .hint { display: none !important; }
  main { padding: 0; max-width: none; }
  #print-title { display: block; font-size: 15px; font-weight: 700;
    margin-bottom: 4px; }
  #warnings .warn { padding: 2px 8px; font-size: 10px; margin-bottom: 2px; }
  #table-wrap { border: none; border-radius: 0; overflow: visible; }
  table.haichi { min-width: 0; width: 100%; }
  .haichi th, .haichi td { padding: 2px 3px; }
  .haichi thead th { position: static; }
  .chip { border: 1px solid #ccc; padding: 0 6px; font-size: 10.5px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .reason { display: none; }
  .cont { font-size: 14px; }
}

/* 確認モーダル */
#modal-overlay { position: fixed; inset: 0; background: rgba(30,40,50,.45);
  display: flex; align-items: center; justify-content: center; z-index: 200; }
#modal-overlay[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px 26px;
  min-width: 280px; max-width: 90vw; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
#modal-text { font-size: 15px; font-weight: 600; margin-bottom: 18px;
  text-align: center; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-actions button { min-width: 96px; padding: 10px 0; font-size: 15px; }
#btn-undo:disabled { opacity: .4; cursor: default; }
