/*
 * 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 のテーブル: 薄青見出し・詰めたセル・上詰まり表示 */
table { border-collapse: collapse; margin: 8px 0; }
th, td { border: 1px solid var(--line); padding: 0 2px; text-align: left; vertical-align: top; }
th { background: var(--head); font-weight: 600; }
.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; }

/* --- 印刷ベース(Phase 3 HTML帳票の土台) --- */
@media print {
  .menu_tabnav, #sidemenu, .day-nav, .room-nav, .filter-nav, .pagy-nav, form input[type=submit],
  .flash, button, a[href]:not(.print-keep) { display: none !important; }
  body { font-size: 11px; }
  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 { 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 { width: 48%; }
.emergency-sheet .es-sub { font-size: 11px; }
.emergency-sheet .es-illness-cell { font-size: 10px; }
@media print { .emergency-sheet tbody 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 { 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 .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; } }

/* 連絡帳カード(旧PDF様式: A4に2枚。太枠+施設から/ご家庭からの2部構成) */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 16px; }
.contact-card { border: 2px solid var(--line); padding: 12px 20px; page-break-inside: avoid; }
.contact-head { display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.contact-name { font-size: 18px; }
.contact-date { font-size: 15px; }
.contact-section-row { margin-top: 10px; display: flex; align-items: baseline; gap: 16px; }
.contact-section-head { background: var(--head); font-size: 15px; padding: 2px 10px; }
.contact-sub-head { color: #3333ff; font-weight: 700; }
.contact-vitals { margin: 8px 0 4px; }
.contact-write-box { border: 1px solid var(--line); height: 5.5em; margin: 4px 0; }
.contact-writer { text-align: right; margin: 4px 30px 4px 0; font-size: 15px; }
@media print { .contact-cards { display: block; } .contact-card { margin-bottom: 16px; } }

/* 台帳・記録シート */
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; }
.frozen-grid thead tr:first-child > th[rowspan] { z-index: 4; height: 53px; }
.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; }
.basic_table { border-collapse: collapse; border-spacing: 0; }
.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; }

/* せせらぎ日誌 記録画面(旧 _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; }
.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; }
