/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* --- 絆 基本スタイル(旧 public/stylesheets/style.css 準拠。
       方針: 旧システムから最大限変更しない。2026-08-23 吉野さん確定) --- */
:root {
  --ink: #333; --line: #000; --head: #EEF5FF; --accent: #2a5b8f;
  --flash-ok: #e6f2e9; --flash-ng: #f7e5e2;
}
body { margin: 8px; background-color: #fff; color: #333;
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 13px; line-height: 18px; }
main { padding: 0 0 40px; }

/* 旧: リンクは黒、hoverで黒地白文字 */
a { color: #333; }
a:visited { color: #666; }
a:hover { color: #fff; background-color: #000; }

/* 旧レイアウト: メニュータブ(menu_tabnav) */
.menu_tabnav { color: #000; border-bottom: 2px solid black; margin: 13px 0 0 0;
  padding: 0 0 0 10px; z-index: 1; }
.menu_tabnav ul { margin: 0; padding: 0; }
.menu_tabnav li { display: inline; overflow: hidden; list-style-type: none; }
.menu_tabnav a, .menu_tabnav a.active {
  color: #000; background: #EEEEEE; font-weight: bold;
  border: 2px solid black; border-bottom: none;
  padding: 2px 5px 0 5px; margin: 0; text-decoration: none; }
.menu_tabnav a.active { background: #FFFFFF; border-bottom: 3px solid #FFFFFF; }
.menu_tabnav a:hover { color: #FFFFFF; background: #CCCCCC; }
.menu_tabnav a:visited { color: #000000; }
.menu_tabnav a.active:hover { background: #FFFFFF; color: #000000; }

/* 旧レイアウト: サイドメニュー(#sidemenu) */
#sidemenu { width: 100%; float: left; margin: 10px 0; }
#sidemenu ul { width: 100%; margin: 0 0 10px 0; padding: 0; }
#sidemenu li { width: 155px; padding: 0 0 0 5px; margin: 0 0 0 5px;
  border-bottom: #AAA 1px solid; list-style: none; float: left; }
#sidemenu a { color: #666; text-decoration: none; background: none; }
#sidemenu a:visited { color: #333; text-decoration: none; }
#sidemenu a:hover { color: #f00; background-color: #fff; text-decoration: underline; }
#sidemenu .logout-link { background: none; border: none; color: #666; padding: 0;
  cursor: pointer; font: inherit; }
#sidemenu .logout-link:hover { color: #f00; text-decoration: underline; }

#contents { padding: 0; margin: 0 auto; clear: both; }
h1.head { font-size: 1.5em; margin: 8px 0 0 0; }
.flash-note { color: green; margin: 4px 0; }
.facility-name { font-size: 0.7em; margin-left: 8px; color: #666; }

/* 旧 #contents のテーブル: 薄青見出し・詰めたセル・上詰まり表示
   罫線は引かない(旧と同じ)。罫線が要る表には .basic_table 等を明示的に付ける。
   ここで全 td に罫線を引くと、レイアウト用の入れ子テーブルまで枠が出る(調理予定表など)。
   旧の指定は #contents th { text-align:left; padding:0 2px } と #contents td { padding:0 2px }
   の2つだけ。td には text-align も vertical-align も指定が無く、表側の text-align:center が
   セルに継承され、縦位置はブラウザ既定(middle)になる。ここで td に left/top を足すと
   帳票の中央寄せと rowspan セルの縦中央が崩れるので、旧と同じ指定に留める */
/* 旧は table に margin も border-collapse も指定していない(素の table は既定の
   separate / border-spacing 2px のまま)。collapse を指定しているのは .basic_table /
   .shift_table / .shift_table_for_edit / .plan_table table / .schedule_table だけ。
   新は全 table に margin:8px と collapse を掛けていたため、表を積む帳票(通所介護計画書など)で
   ブロックごとに下へずれ、本表で48ptずれていた。旧と同じく素の table は触らない(2026-10-06 是正)。
   罫線を引く表には下で個別に collapse を指定する(指定し忘れると罫線が二重に見える)。 */

/* 罫線を引いている表は旧と同じく collapse にする */
.emergency-sheet, .sign-boxes, .cook-print-grid, .shift_table, .shift_table_for_edit,
.calendar-table, .browse-sheet, .training-sheet table, .training-grid, .schedule_table,
.usage-records, .daily-report-sheet { border-collapse: collapse; border-spacing: 0; }
th, td { padding: 0 2px; }
th { background: var(--head); font-weight: 600; text-align: left; }
.even { background-color: #FFF5EE; }
.accent { color: #dd7777; }

/* 旧の状態色 */
.time0 { background-color: #cccccc; }
.time1 { background-color: #7bcdf3; }
.time2 { background-color: #a9dff7; }
.time3 { background-color: #d8f0fc; }
.time4 { background-color: #ffffff; }
.attention { background-color: #f3979d; }
td.saturday { background-color: #CDF; }
td.sunday { background-color: #FDD; }
.plan_over { background-color: #FAA; }
.plan_near { background-color: #FFA; }
.d_duty { background-color: #F99; }
.n1_duty { background-color: #FF9; }
.n2_duty { background-color: #9F9; }
.print_timing { background-color: #FAA; }

.field { margin: 6px 0; }
.field label { display: inline-block; min-width: 11em; }
fieldset { border: 1px solid var(--line); margin: 10px 0; }
.form-errors { background: var(--flash-ng); padding: 8px 12px; }

.flash { padding: 8px 12px; margin-bottom: 10px; border-radius: 3px; }
.flash-notice { background: var(--flash-ok); }
.flash-alert { background: var(--flash-ng); }

.filter-nav a, .room-nav a, .day-nav a { margin-right: 6px; }
.filter-nav a.current, .room-nav a.current { font-weight: 700; text-decoration: none; color: var(--ink); }
.room-nav { line-height: 1.9; }

.login-box { max-width: 320px; margin: 80px auto; }
.care-report-entry { margin-bottom: 24px; }

.table-scroll { overflow-x: auto; }
td.absence s { color: #a33; }
.car-name { font-weight: 700; background: var(--head); padding: 0 4px; margin-top: 4px; }
th.weekend, td.weekend { background: #f3e9e9; }

/* 調理予定表の「他の時点」リンク。印刷には出さない */
.period-links { margin: 2px 0 8px; font-size: 12px; }
@media print { .noprint { display: none !important; } }

/* --- 印刷ベース(Phase 3 HTML帳票の土台) ---
   旧 public/stylesheets/print.css に合わせる。旧が隠していたのは
   #sidemenu / #menu_tabnav / .head / .noprint の4つ。.head(ロール名の見出し)を
   隠し忘れていたため「システム管理者メニュー ―番館・二番館」が紙に出ていた。
   文字サイズも旧は body 14px / line-height 18px。 */
@media print {
  .head,
  .menu_tabnav, #sidemenu, .day-nav, .room-nav, .filter-nav, .pagy-nav, form input[type=submit],
  .flash, .flash-note, button, a[href]:not(.print-keep) { display: none !important; }
  body { font-size: 14px; line-height: 18px; }
  main { padding: 0; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
}

.assessment-field { display: inline-block; margin: 2px 6px 2px 0; }
.assessment-field label { font-size: 11px; color: #667; margin-right: 2px; }

/* 緊急医療対応表(旧A3縦帳票: 利用者1人=3段の枠構成) */
.emergency-sheet { width: 100%; }
.emergency-sheet th, .emergency-sheet td { border: 1px solid var(--line); }
.emergency-sheet th { text-align: center; }
.emergency-sheet .es-name { width: 8%; }
.emergency-sheet .es-contact { width: 24%; }
.emergency-sheet .es-mid { width: 20%; }
.emergency-sheet .es-illness-cell { font-size: 10px; }
/* 旧は利用者ごとに見出し3段+本体3段。6行の塊を途中で割らない */
@media print { .emergency-sheet tr { page-break-inside: avoid; } }

/* 機能訓練 実施実績表(旧 training_record 帳票: 上段=訓練内容枠、下段=日付×内容/時間) */
.training-sheet table { width: 100%; }
.training-header td { padding: 3px 6px; }
.training-header .training-title { width: 34%; }
.training-contents-head { width: 48px; }
.training-content-num { width: 16px; background: #fff; font-weight: 400; vertical-align: top; }
.training-content-cell { width: 28%; height: 52px; font-size: 11px; }
.training-grid th { text-align: center; }
.training-grid .training-num { width: 22px; font-size: 10px; font-weight: 400; }
.training-grid td { height: 1.4em; }
.training-num-row td.training-num { border-bottom: none; color: #555; font-size: 9px; height: auto; }
.training-write-row td { border-top: none; height: 1.6em; }
.training-eval { margin-top: 12px; }
.training-eval-box { height: 5em; }

/* 帳票共通: 承認欄(施設長/管理者/作成者)と改ページ */
.sign-header { display: flex; justify-content: space-between; align-items: flex-start; }
.sign-header h1 { flex: 1; }
.sign-boxes th, .sign-boxes td { border: 1px solid var(--line); }
.sign-boxes th { width: 70px; text-align: center; background: #fff; font-weight: 400; font-size: 11px; }
.sign-boxes td { height: 52px; }
.print-page-break { break-before: page; page-break-before: always; }
.usage-records .user-col { width: 110px; }
.usage-records td, .usage-records th { padding: 4px; }

/* 調理予定表(旧print_index A3縦・2カラム帳票のHTML版) */
.print-center-title { text-align: center; font-size: 18px; }
.cook-print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
.cook-print-grid h2 { text-align: center; font-size: 16px; margin: 14px 0 2px; }
.cook-print-grid table { width: 100%; }
.cook-print-grid th, .cook-print-grid td { border: 1px solid var(--line); }
.cook-print-grid .no-food-head, .cook-print-grid .no-food {
  width: 14px; font-size: 9px; text-align: center; background: #fff; }
.cook-print-grid .user-cell { width: 90px; font-size: 11px; }
.cook-print-grid .juukyo { display: block; font-size: 10px; color: #333; padding-left: 1em; }
.cook-print-grid .meal-info { font-size: 11px; }
.cook-print-grid .meal-note { display: block; font-size: 10px; }
.cook-print-grid .mark-col { width: 18px; text-align: center; }
.cook-print-grid .total-row td { background: var(--head); text-align: right; font-weight: 600; }
.cook-print-grid tr.away td, .cook-print-grid td.away { background: #ccc; }
.cook-print-grid tr.away td.no-food { background: #fff; }
@media print { .cook-print-grid tr { page-break-inside: avoid; } }

/* 連絡帳は旧 index.pdf.prawn の紙面を .pdf-page の絶対座標で写すので、専用のCSSは持たない。
   旧 style.css / print.css 由来の .contact_report_* (700x450のカード)は、PDF帳票基準に
   作り直した時点で使わなくなったので外した(2026-10-08)。
   .contact_report_name だけは並び順の確認用の目印としてマークアップに残してある。 */
/* 旧 print.css: 2枚ごとの改ページと、枚の間隔 */
.print_space { padding: 10px 0; }
.page_break { page-break-after: always; }

/* 台帳・記録シート */
th.tate { writing-mode: vertical-rl; min-height: 90px; height: 110px; font-weight: 400; }
/* せせらぎ台帳(旧レイアウト: 黒罫線・縦書き見出し175px・折り返しなしの横長グリッド) */
.seseragi-ledger { border-collapse: collapse; }
.seseragi-ledger td, .seseragi-ledger th { border: 1px #000 solid; white-space: nowrap; }
.seseragi-ledger .tate { writing-mode: vertical-rl; height: 175px; }
.seseragi-ledger .date-col { min-width: 90px; }

/* 見出し固定グリッド(旧superTablesの再現: スクロールしても見出し行と先頭列が残る)
   注意: border-collapse だと罫線がstickyセルに追従しない(見出し下の線が消える・
   行間に下の内容が透ける)ため、separate+セル自身の右下罫線で構成する */
.frozen-grid { overflow: auto; max-height: 78vh; }
.frozen-grid table { border-collapse: separate; border-spacing: 0; }
.frozen-grid th, .frozen-grid td { border: none; border-right: 1px #000 solid;
  border-bottom: 1px #000 solid; white-space: nowrap; text-align: center;
  box-sizing: border-box; }
.frozen-grid thead tr:first-child > * { position: sticky; top: 0; z-index: 2; background: #fff;
  border-top: 1px #000 solid; height: 27px; }
.frozen-grid thead tr:nth-child(2) > * { position: sticky; top: 27px; z-index: 2; background: #fff;
  height: 26px; }
/* 3段目(曜日)。食事予定の入力・利用予定日の入力・予定カレンダーは 月/日付/曜日 の3段で、
   ここを固定しないと曜日だけスクロールで流れる。top は上2段の高さの合計(27+26) */
.frozen-grid thead tr:nth-child(3) > * { position: sticky; top: 53px; z-index: 2; background: #fff;
  height: 20px; }
.frozen-grid thead tr:first-child > th[rowspan] { z-index: 4; height: 53px; }
/* 見出しの固定セルは td のこともある(旧に合わせて td にした画面)。
   z-index を上げておかないと、横スクロール時に日付セルが固定列の上に出てしまう */
.frozen-grid thead tr:first-child > td[rowspan] { z-index: 4; }
.frozen-grid .user-col { position: sticky; left: 0; z-index: 3; background: #fff;
  border-left: 1px #000 solid;
  /* 旧: 利用者列は幅220px固定・折り返しあり・左寄せ・縦センター */
  width: 220px; min-width: 220px; max-width: 220px; white-space: normal;
  text-align: left; vertical-align: middle; }
.frozen-grid .wday-sun { color: red; }
.frozen-grid .wday-sat { color: blue; }
.frozen-grid td.today { background-color: #DFD; }
.frozen-grid tbody td { text-align: left; vertical-align: middle; }  /* 旧: 左寄せ・縦センター */

/* 旧style.cssのタイトル/日付見出し */
.staff_shift_date { font-size: 20px; font-weight: bold; color: #666; }
.staff_shift_title { text-align: center; font-size: 24px; }

/* 旧 .basic_table と日報シート */
.basic_table, .basic_table tr td, .basic_table tr th { border: 1px #000 solid; }
/* 利用予定日カレンダー(旧 scheduled_dates/calendar_index の色分け) */
.schedule-calendar .user-col { width: 100px; min-width: 100px; max-width: 100px;
  vertical-align: top; }
.schedule-calendar .label-col { position: sticky; left: 100px; z-index: 3; background: #fff;
  width: 130px; min-width: 130px; max-width: 130px; text-align: left; }
.schedule-grid td, .schedule-grid th { height: 20px; }
.schedule-grid .sched-care { background-color: #DFD; }    /* 個別リハ・入浴・口腔・欠席 */
.schedule-grid .sched-yobou { background-color: #DFF; }   /* 予防給付 */
.schedule-grid .sched-meal { background-color: #FFD; }    /* 昼食・おやつ */
.schedule-grid .wday-sun { background-color: #FDD; }
.schedule-grid .wday-sat { background-color: #DDF; }

/* 旧 style.css の .shift_table / .schedule_table 相当(新は .calendar-table) */
.shift_table th, .shift_table td { border: 1px #000 solid; }
.calendar-table th, .calendar-table td { border: 1px #000 solid; }
.basic_table { border-collapse: collapse; border-spacing: 0; }
/* 通所介護計画書・ヘルパーステーション計画書の表。
   旧は style.css と print.css の両方で全セルに1px黒の罫線を引いていた。
   新はこの定義が無く、画面でも印刷でも罫線が1本も出ていなかった(2026-10-06 是正) */
.plan_table table { border-collapse: collapse; border-spacing: 0; }
.plan_table th,
.plan_table td { border: 1px #000 solid; }

.daily-report-sheet .c1 { width: 160px; }
.daily-report-sheet .c2 { width: 50px; }
.daily-report-sheet .c3 { width: 220px; }
.daily-report-sheet .c4 { width: 50px; }
.daily-report-sheet .c5 { width: 130px; }
.daily-report-sheet .mark-head { text-align: center; font-size: 0.8em; }
.daily-report-sheet .center, td.center, th.center { text-align: center; }
.daily-report-sheet .remarks-cell { vertical-align: top; }

/* 日誌の印刷。旧 print.pdf.prawn はA4縦(595x842pt)に絶対座標で組まれた帳票で、
   記録画面(_sheet)とは別様式。印刷ビューはその座標をそのまま写す(_print_page1/2)。
   pt で指定しているので、ブラウザの印刷でも紙面がそのまま再現される。 */
.pdf-page { position: relative; width: 595pt; height: 842pt; color: #000;
  page-break-after: always; overflow: hidden; }
.pdf-page:last-of-type { page-break-after: auto; }
.pdf-t { position: absolute; line-height: 1.15; white-space: pre-wrap; word-break: break-all; }
.pdf-r { position: absolute; border: 0.5pt solid #000; box-sizing: border-box; }
.pdf-h { position: absolute; border-top: 0.5pt solid #000; }
.pdf-v { position: absolute; border-left: 0.5pt solid #000; }
@media print {
  /* 紙面は pdf-page が持つので、本文の余白や見出しは出さない */
  .pdf-page { margin: 0; }
}

.daily-report-footer { margin: 8px 0 0; }
.work-type-note { margin: 4px 0 0; }

/* せせらぎ日誌 記録画面(旧 _form: 3時間帯の枠を横並び、枠内は黒罫線) */
.care-report-slots, .care-report-slots > tbody > tr > td.slot-cell { border: none; }
.care-report-slots .slot-cell { vertical-align: top; }
.slot-table { border-collapse: collapse; border: 1px #000 solid; }
.slot-table td, .slot-table th { border: none; }
.slot-table .slot-top > td, .slot-table .vital-row > td { border-top: 1px #000 solid; }
.slot-table .meal-cell { width: 140px; vertical-align: top; }
.slot-table .pack-cell, .slot-table .vital-side { vertical-align: top; }
.vital-delete { text-align: right; }
td.mark, td.attended { background: #eaf3ea; text-align: center; }
.ledger-room { margin-bottom: 28px; }
@media print { .ledger-room, .table-scroll { page-break-inside: avoid; } }

/* ログイン画面: ラベルを上置きにし、入力欄2つを同一幅に揃える */
.login-box h1 { text-align: center; font-size: 1.6rem; }
.login-box .field { margin: 12px 0; }
.login-box .field label { display: block; min-width: 0; margin-bottom: 4px; font-size: 13px; }
.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%; box-sizing: border-box;
  font-size: 15px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 3px;
}
.login-box input[type="submit"] {
  width: 100%; margin-top: 14px; padding: 9px 0;
  background: var(--accent); color: #fff; border: none; border-radius: 3px;
  font-size: 15px; cursor: pointer;
}
.login-box .facility-name { text-align: center; color: var(--muted, #5a6475); margin: -4px 0 16px; }

/* 内服詳細(旧 新様式チェックシート) */
.medicine-detail .user-name { width: 100px; text-align: left; vertical-align: top; }
.medicine-detail th, .medicine-detail td { text-align: center; }

/* リンク風ボタン(旧のconfirm付きリンクをbutton_toで再現する箇所) */
.link-like { background: none; border: none; padding: 0; color: #333;
  text-decoration: underline; cursor: pointer; font: inherit; }
.link-like:hover { color: #fff; background-color: #000; }
tr.right td { text-align: right; }

/* 利用予定日の入力(旧 dayservice_schedules): 行色と見出し */
.inline-heading { display: inline; }
.schedule-grid .row-green { background-color: #DFD; }
.schedule-grid .row-blue { background-color: #DFF; }
.schedule-grid .row-yellow { background-color: #FFD; }
.schedule-grid td.sunday { background-color: #FDD; }
.schedule-grid td.saturday { background-color: #CDF; }
/* 高専賃予定との重複/欠落マーカー。旧はinline styleなので土日色より優先される */
.schedule-grid td.meal-duplicated { background-color: #F00; }  /* 高専賃と二重 */
.schedule-grid td.meal-missing { background-color: #0F0; }     /* 両方とも無し */
.schedule-grid .user-col.user-head { border-top: 2px #000 solid; }
/* 高専賃食事予定: 契約中（再開）の入居者名セル(旧 #AFF) */
.schedule-grid .user-col.user-kousenchin { background-color: #AFF; }

/* 日誌閲覧シート(旧 browse): 黒罫線(バイタル行は行単位で上下罫線をinline指定)。
   旧はセル既定が上下中央揃え(パックサービス欄のみ valign=top) */
.browse-sheet { border: 1px #000 solid; }
.browse-sheet td, .browse-sheet th { border: 1px #000 solid; vertical-align: middle; }
.browse-sheet td[valign="top"] { vertical-align: top; }
.schedule-grid tbody td { text-align: center; }

/* 利用者記録(旧 service_users#record) */
.record_table .date-cell { height: 40px; width: 100px; }
.record_table .wday-sun { color: red; }
.record_table .wday-sat { color: blue; }

/* 状況報告書(旧 dayservice_reports/show・_form のインラインstyle) */
.report_table table { width: 1100px; border-collapse: collapse; }
.report_table td, .report_table th { border: 1px solid #000; padding: 10px; }
.report_table th.problem { width: 170px; }
.report_table th.goal { width: 150px; }
.report_table th.plan { width: 180px; }
.report_table th.status { width: 170px; }
.report_table th.future { width: 130px; }
.pre_table table { font-size: 1.2em; width: 800px; border-collapse: collapse;
  margin-bottom: 10px; }
.pre_table td, .pre_table th { padding: 5px; }
.pre_table td.service_user { width: 250px; border-bottom: 1px solid #000; }
.pre_table th.organization_name, .pre_table td.organization_name { width: 160px;
  border: 1px solid #000; }
.pre_table th.report_staff, .pre_table td.report_staff { width: 150px; border: 1px solid #000; }
.box_text { width: 790px; border: 1px solid #000; padding: 5px; }
