/* ============================================================
   print.css - 個別支援計画書 印刷レイアウト
   A4縦 / 画面プレビュー兼用
   ============================================================ */

/* ============ 印刷プレビューツールバー ============ */

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(47,58,54,0.06);
}

.print-toolbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.print-toolbar-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* ============ 印刷ボタン行（計画案画面） ============ */

.print-action-row {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
}

/* ============ A4シート（画面表示） ============ */

.print-page-wrapper {
  background: #E8E8E8;
  min-height: calc(100vh - 52px);
  padding: 32px 16px 48px;
  display: flex;
  justify-content: center;
}

.print-sheet {
  background: #fff;
  width: 210mm;
  min-height: 297mm;
  padding: 10mm 12mm;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  font-family: "Noto Sans JP", "Hiragino Sans", "Meiryo", sans-serif;
  font-size: 8pt;
  color: #111;
  line-height: 1.4;
}

/* ============ ヘッダー ============ */

.ps-header {
  margin-bottom: 2mm;
}

.ps-header-title {
  font-size: 12pt;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2mm;
  letter-spacing: 0.1em;
}

.ps-header-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5pt;
}

.ps-header-table th,
.ps-header-table td {
  border: 1px solid #555;
  padding: 1.5mm 2mm;
  white-space: nowrap;
}

.ps-header-table th {
  background: #E8EEE8;
  font-weight: 700;
  width: auto;
}

.ps-header-table td {
  min-width: 20mm;
}

/* ============ 本体テーブル共通 ============ */

.ps-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  table-layout: fixed;
}

.ps-table th,
.ps-table td {
  border: 1px solid #555;
  padding: 1.5mm 2mm;
  vertical-align: top;
  font-size: 7.5pt;
}

.ps-table th {
  background: #E8EEE8;
  font-weight: 700;
}

/* ラベル列の幅 */
.ps-th-label {
  width: 18mm;
  text-align: center;
  vertical-align: middle !important;
  font-size: 7pt;
  white-space: pre-line;
}

.ps-th-hoshin {
  width: 18mm;
}

.ps-hoshin-text {
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ============ 意向テーブル ============ */

.ps-needs-table th { width: 12mm; vertical-align: middle !important; }
.ps-needs-table td { width: calc(50% - 12mm); }

/* ============ 目標テーブル ============ */

.ps-goal-table .ps-th-label { width: 18mm; }

/* ============ 支援内容テーブル ============ */

.ps-support-table thead th {
  background: #E8EEE8;
  text-align: center;
  font-size: 7pt;
  vertical-align: middle;
  white-space: pre-line;
}

/* 列幅定義 */
.ps-col-item    { width: 12mm; }
.ps-col-goal    { width: 38mm; }
.ps-col-content { width: auto; }  /* 残り全部 */
.ps-col-period  { width: 12mm; }
.ps-col-staff   { width: 22mm; }
.ps-col-priority { width: 8mm; }
.ps-col-note    { width: 22mm; }

.ps-item-label {
  background: #EEF2EE;
  font-weight: 700;
  text-align: center;
  vertical-align: middle !important;
  font-size: 7pt;
  white-space: pre-line;
}

.ps-center { text-align: center; vertical-align: middle !important; }
.ps-small  { font-size: 6.5pt; white-space: pre-line; }

.ps-fixed-section td,
.ps-fixed-section th {
  color: #444;
}

.ps-ryouiki-tags {
  margin-top: 2mm;
  font-size: 6.5pt;
  color: #555;
  white-space: pre-line;
}

/* ============ 加算・特記事項テーブル ============ */

.ps-addon-label {
  background: #F5F5F5;
  text-align: center;
  font-size: 6.5pt;
  border-bottom: none;
  padding: 1mm 2mm;
}

.ps-addon-detail {
  font-size: 7pt;
  padding: 1.5mm 2mm;
}

.ps-special-note {
  font-size: 7pt;
  white-space: pre-wrap;
}

/* ============ 署名テーブル ============ */

.ps-sign-table .ps-sign-intro {
  font-size: 7pt;
  padding: 1.5mm 2mm;
  background: #F5F5F5;
}

.ps-sign-field {
  min-height: 10mm;
  vertical-align: top;
}

/* ============ 印刷時のスタイル ============ */

@media print {
  /* 印刷時には非表示 */
  .no-print,
  .global-nav,
  .print-toolbar,
  .print-action-row,
  .print-page-wrapper > *:not(.print-sheet) {
    display: none !important;
  }

  /* SPAの他のページも非表示 */
  .spa-page { display: none !important; }
  #page-print { display: block !important; }

  body {
    background: white;
    margin: 0;
    padding: 0;
  }

  .print-page-wrapper {
    background: white;
    padding: 0;
    display: block;
  }

  .print-sheet {
    width: 100%;
    min-height: auto;
    padding: 8mm 10mm;
    box-shadow: none;
    font-size: 7.5pt;
    page-break-after: avoid;
  }

  .ps-table,
  .ps-support-table,
  .ps-header-table {
    page-break-inside: avoid;
  }

  tr { page-break-inside: avoid; }

  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }
}
