/* シフト表作成ツール */

.tool-head { max-width: 48em; }
.privacy-note {
  margin-top: 16px; font-size: 0.875rem; color: var(--muted);
  border-left: 3px solid var(--rule); padding: 2px 0 2px 12px; max-width: 48em;
}

.setup {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 4px 20px 20px;
  min-width: 0;
}
.panel h2 { font-size: 1rem; margin: 16px 0 0; }
.panel .hint { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.panel-wide { grid-column: 1 / -1; }

.dow-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dow-checks label { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--rule-soft); border-radius: 3px; padding: 4px 8px; font-size: 0.875rem; cursor: pointer; }
.dow-checks input { width: 16px; height: 16px; margin: 0; accent-color: var(--shu); }

.pat-row, .staff-card {
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  background: #fafcfb;
  padding: 10px 12px 12px;
  margin-top: 10px;
}
.pat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 8px; align-items: end; }
.pat-grid > label:nth-child(1) { grid-column: span 4; }
.pat-grid > label:nth-child(2) { grid-column: span 2; }
.pat-grid > label:nth-child(n+3) { grid-column: span 2; }
.pat-grid label > span, .staff-grid label > span { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 2px; }
.pat-grid input, .staff-grid input, .staff-grid select, .need-table input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 3px; padding: 6px 8px; line-height: 1.4;
}
.pat-grid input:focus, .staff-grid input:focus, .staff-grid select:focus, .need-table input:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: -1px; }
.pat-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.8125rem; color: var(--muted); flex-wrap: wrap; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,0.15); }
.staff-grid .dow-checks label > span, .panel .dow-checks label > span { display: inline; font-size: 0.875rem; color: var(--ink); margin: 0; }

.need-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.875rem; }
.need-table th, .need-table td { border: 1px solid var(--rule-soft); padding: 4px; text-align: center; }
.need-table thead th { color: var(--muted); font-weight: 400; background: #f7faf9; }
.need-table tbody th { text-align: left; font-weight: 400; padding-left: 8px; white-space: nowrap; }
.need-table input { padding: 4px 2px; text-align: center; min-width: 2.2em; }
.need-wrap { overflow-x: auto; }

.staff-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; color: var(--muted); }
.staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 4px; }
.staff-grid .wide { grid-column: 1 / -1; }
.staff-grid .sub { font-size: 0.75rem; color: var(--muted); }

.actions {
  margin-top: 24px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.actions .spacer { flex: 1; }
.status { margin-top: 10px; font-size: 0.875rem; color: var(--muted); min-height: 1.5em; }
.status.warn { color: var(--shu-dark); }

/* シフト表本体 */
.sheet {
  margin-top: 14px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 20px 20px 16px;
}
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.sheet-head h2 { margin: 0; font-family: var(--mincho); font-size: 1.375rem; letter-spacing: 0.08em; }
.sheet-head .shop { font-weight: 700; }
.legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.8125rem; color: var(--ink); }
.grid-wrap { overflow-x: auto; margin-top: 12px; -webkit-overflow-scrolling: touch; }
.shift-grid { border-collapse: collapse; font-size: 12px; width: 100%; table-layout: fixed; min-width: 900px; }
.shift-grid th, .shift-grid td { border: 1px solid #9aabb5; padding: 0; text-align: center; height: 30px; }
.shift-grid thead th { background: #eef3f1; font-weight: 400; line-height: 1.2; padding: 3px 0; height: auto; }
.shift-grid thead th small { display: block; font-size: 10px; }
.shift-grid .sun { color: #b3261e; }
.shift-grid .sat { color: #1f5fa8; }
.shift-grid .closed { background: #e4e8e6; }
.shift-grid .c-name { width: 96px; text-align: left; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #f7faf9; font-weight: 700; }
.shift-grid .c-sum { width: 46px; background: #f7faf9; font-variant-numeric: tabular-nums; }
.shift-grid td.cell { position: relative; }
.shift-grid td.cell button {
  display: block; width: 100%; height: 100%; min-height: 30px;
  border: 0; margin: 0; padding: 0; background: transparent;
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
}
.shift-grid td.cell button:hover { outline: 2px solid var(--focus); outline-offset: -2px; }
.shift-grid td.off button { color: #7a868c; font-weight: 400; }
.shift-grid tfoot th, .shift-grid tfoot td { background: #f7faf9; font-size: 11px; height: 24px; }
.shift-grid tfoot th { text-align: left; padding: 0 6px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-grid tfoot td.short { background: #f8d7d3; color: var(--shu-dark); font-weight: 700; }
.grid-note { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }

.payroll-links { margin-top: 12px; font-size: 0.875rem; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

.guide { margin-top: 56px; }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; }
  .site-header, .site-footer, .crumbs, .tool-head, .privacy-note, .setup, .actions, .status,
  .guide, .pr-box, .skip, .grid-note, .payroll-links { display: none !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .sheet { border: 0; padding: 0; margin: 0; }
  .grid-wrap { overflow: visible; }
  .shift-grid { min-width: 0; font-size: 10.5px; }
  .shift-grid th, .shift-grid td { height: 24px; }
  .shift-grid td.cell button { min-height: 24px; }
  .shift-grid .c-name { width: 84px; }
  .shift-grid .c-sum { width: 40px; }
  .shift-grid td, .shift-grid th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
