/* 試験表示専用。既存の表HTML・計算・0の表示はそのまま使う。 */
body.ui-preview table {
    --bs-table-striped-bg: transparent;
    --bs-table-striped-color: inherit;
    --bs-table-hover-bg: transparent;
    --bs-table-hover-color: inherit;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

body.ui-preview table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    padding: 6px 10px;
    line-height: 1.75;
    vertical-align: middle;
    border-bottom: 1px solid var(--u3-line-soft);
    font-variant-numeric: tabular-nums;
    /* Bootstrap のゼブラ・hover はセルの inset shadow で描かれる。 */
    box-shadow: none;
}

body.ui-preview table > thead,
body.ui-preview table > thead > tr,
body.ui-preview table > thead > tr > :is(th, td),
body.ui-preview table > tbody > tr > th:is(.bg-pink, .bg-blue) {
    --bs-table-bg: var(--u3-tint);
    --bs-table-color: var(--u3-ink);
    background-color: var(--u3-tint) !important;
    color: var(--u3-ink) !important;
    font-weight: 700;
    border-bottom: 1px solid var(--u3-line-strong);
}

/* 数字の目印があるセルと、既存の売上・加算・スタッフ集計の数値列。
   氏名・役職・サービス名などの文字列列は左寄せのままにする。 */
body.ui-preview table .text-end,
body.ui-preview table input[type="number"],
body.ui-preview table:has(> thead > tr > th.bg-pink) > tbody > tr > td:not(:first-child):not([colspan]),
body.ui-preview table:has(> thead > tr > th.bg-pink) > thead > tr:first-child > th:not(:first-child):not([colspan]),
body.ui-preview table:has(> thead > tr > th.bg-pink) > thead > tr:not(:first-child) > th,
body.ui-preview table:not(:has(> thead)) > tbody > tr > td:nth-child(2):last-child,
body.ui-preview table.table-striped.table-sm > tbody > tr > td:nth-child(n+3),
body.ui-preview table.table-striped.table-sm > thead > tr > th:nth-child(n+3),
body.ui-preview table:has(> thead > tr > th.bg-dark[colspan="2"]) > thead > tr > th:not(:first-child),
body.ui-preview .container:has(form[action$="/dashboard"]) table.table-sm:has(> thead > tr > th:nth-child(4):last-child) > :is(thead, tbody) > tr > :is(th, td):not(:first-child),
body.ui-preview table > tfoot > tr > td:not(:first-child):not([colspan]) {
    text-align: right !important;
}

/* 週次の集計表は、グループ見出しを除く数値見出しも右にそろえる。 */
body.ui-preview table.table-striped:not(.table-sm) > thead > tr:first-child > th:not(:first-child):not([colspan]),
body.ui-preview table.table-striped:not(.table-sm) > thead > tr:not(:first-child) > th {
    text-align: right !important;
}

/* 達成率（3列）・単価（2列）は先頭列も数値。売上表（複数行）は除外。 */
body.ui-preview table:has(> thead > tr > th.bg-pink:nth-child(2):last-child, > thead > tr > th.bg-pink:nth-child(3):last-child):has(> tbody > tr:only-child):not(:has(> thead > tr > th[rowspan])) > tbody > tr > td,
body.ui-preview table:has(> thead > tr > th.bg-pink:nth-child(2):last-child, > thead > tr > th.bg-pink:nth-child(3):last-child):has(> tbody > tr:only-child):not(:has(> thead > tr > th[rowspan])) > thead > tr > th {
    text-align: right !important;
}

/* 訪問実績・予定の明細では、日付・時刻・時間・金額だけを右寄せ。 */
body.ui-preview .container:has(form[action$="/visits"]) table > :is(thead, tbody) > tr > :is(th, td):is(:nth-child(1), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9)),
body.ui-preview .container:has(form[action$="/predicted-records"]) table > :is(thead, tbody) > tr > :is(th, td):is(:nth-child(1), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9)) {
    text-align: right !important;
}

/* 既存の小計・合計の目印を使い、塗りではなく線と太字で区切る。 */
body.ui-preview table > tbody > tr:is(.table-light.fw-bold, .table-secondary.fw-bold),
body.ui-preview table > tfoot > tr {
    --bs-table-bg: #fff;
    --bs-table-color: #1d2433;
    background-color: #fff !important;
}

body.ui-preview table > tbody > tr:is(.table-light.fw-bold, .table-secondary.fw-bold) > :is(th, td),
body.ui-preview table > tfoot > tr > :is(th, td),
body.ui-preview .mb-4 > table:has(> thead > tr > th.bg-pink) > tbody > tr:nth-child(4):last-child > td {
    background-color: #fff !important;
    color: #1d2433;
    border-top: 2px solid #1d2433;
    font-weight: 700;
}

/* リハビリ小計とスタッフ別小計。全スタッフ合計は太線を保つ。 */
body.ui-preview table > tbody > tr[data-rehab-subtotal] > td,
body.ui-preview table.table-striped > tfoot > tr > td {
    border-top: 1px solid #d9dee8;
}

/* 月次・週次の選択欄。フォームの送信内容は変えず1行に並べる。 */
body.ui-preview .ui-preview-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 10px 12px;
    border: 1px solid #d9dee8;
    border-radius: 6px;
    background: #fff;
}
body.ui-preview .ui-preview-filters form {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}
body.ui-preview .ui-preview-office-filter { flex: 0 1 360px; }
body.ui-preview .ui-preview-month-filter { flex: 0 1 200px; }
body.ui-preview .ui-preview-filters label { flex: 0 0 auto; margin: 0; }
body.ui-preview .ui-preview-filters select { min-width: 0; }
body.ui-preview .ui-preview-data-date { margin-left: auto; color: #555e6d; }
body.ui-preview .ui-preview-table :is(th, td) { white-space: nowrap; }
body.ui-preview .ui-preview-table .no-target { color: #555e6d; }
@media (max-width: 575.98px) {
    body.ui-preview .ui-preview-filters form { flex: 1 1 100%; }
    body.ui-preview .ui-preview-filters label { min-width: 3em; }
    body.ui-preview .ui-preview-data-date { margin-left: 0; }
}

/* 月次データのタブと統合スタッフ表（試験表示のみ）。 */
body.ui-preview .dashboard-tab-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-bottom: 2px solid #d9dee8;
}
body.ui-preview .dashboard-tab-list button {
    flex: 0 0 auto;
    padding: 10px 20px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: #fff;
    color: #1d2433;
    white-space: nowrap;
}
body.ui-preview .dashboard-tab-list button[aria-selected="true"] {
    background: var(--u3-tint);
    border-bottom-color: var(--u3-blue);
    color: var(--u3-ink);
    font-weight: 700;
}
body.ui-preview .dashboard-tab-list button:focus-visible {
    outline: 2px solid #3a5fc8;
    outline-offset: -3px;
}
body.ui-preview .dashboard-print-heading { display: none; }
body.ui-preview .dashboard-staff-table { min-width: 740px; }
body.ui-preview .dashboard-staff-table [data-staff-value] { white-space: nowrap; }
body.ui-preview [data-staff-mode="count"] [data-staff-value="time"],
body.ui-preview [data-staff-mode="time"] [data-staff-value="count"] { display: none; }
body.ui-preview .dashboard-staff-table > tbody > tr[data-staff-row="subtotal"] > :is(th, td) {
    font-weight: 700;
    border-top: 1px solid #d9dee8;
}
body.ui-preview .container:has([data-dashboard-tabs]) .d-flex:has(#dashboardRecalcBtn) { flex-wrap: wrap; }
body.ui-preview .dashboard-preview section { min-width: 0; }
/* 既存の幅広い保険別の表も、スマホでページ全体を押し広げない。 */
body.ui-preview .dashboard-preview section > .mb-4 { overflow-x: auto; }
@media print {
    body.ui-preview [data-dashboard-panel],
    body.ui-preview [data-dashboard-panel][hidden] { display: block !important; }
    body.ui-preview .dashboard-print-heading { display: block; }
    body.ui-preview .dashboard-tab-list,
    body.ui-preview .dashboard-staff-toggle { display: none !important; }
    body.ui-preview [data-staff-summary] [data-staff-value] { display: table-cell !important; }
    body.ui-preview .dashboard-staff-table { min-width: 0; font-size: 9px; }
    body.ui-preview .dashboard-staff-table > :is(thead, tbody, tfoot) > tr > :is(th, td) { padding: 3px; }
    body.ui-preview .dashboard-preview .table-responsive,
    body.ui-preview .dashboard-preview section > .mb-4 { overflow: visible; }
    body.ui-preview .dashboard-preview tr { break-inside: avoid; }
    body.ui-preview .dashboard-preview :is(h3, h4) { break-after: avoid; }
    body.ui-preview .dashboard-staff-table tfoot { display: table-row-group; }
}


/* ══════════════════════════════════════════════════════════════════
   U3「しっかり」：試験表示オンのときだけの見た目（2026-11）
   ・詰めた表、はっきりした線、強い見出し。色は控えめ（ごく薄い水色＋紺の文字）
   ・強い色は2種類だけ：コーラル＝注意と取り込みボタン／グラフの看護（青）とリハビリ（青緑）
   ・数字・並び・リンク先は変えない。試験表示オフの画面には何も効かない（全部 body.ui-preview の下）
   ══════════════════════════════════════════════════════════════════ */
body.ui-preview {
    --u3-ink: #1d2a44;          /* 文字（紺） */
    --u3-ink-2: #44516b;
    --u3-muted: #5d6980;        /* 補足。白の上で 5.5:1 */
    --u3-bg: #f3f5f9;           /* ページの地 */
    --u3-zebra: #fafbfd;        /* 1行おきの地（ほぼ白） */
    --u3-tint: #eef3fb;         /* ごく薄い水色：表の見出し・帯・選択中 */
    --u3-line: #c5d0e0;
    --u3-line-soft: #dde3ed;
    --u3-line-strong: #aebbd0;
    --u3-blue: #5b84c6;         /* 線・選択中の印・グラフの看護／実績 */
    --u3-primary: #3f6bb3;      /* 青い文字・ふつうの塗りボタン（白文字 5.3:1） */
    --u3-primary-hover: #2f5596;
    --u3-reha: #17a888;         /* グラフのリハビリ */
    --u3-coral: #C9481A;        /* 注意の塗り・取り込みボタン（白文字 4.7:1） */
    --u3-coral-text: #A8370C;
    --u3-coral-soft: #fdf0ea;
    --u3-coral-line: #f2b8a2;
    --u3-radius: 4px;
    /* 既存の画面が使っている色の変数も、同じ系統に寄せる */
    --primary-blue: var(--u3-tint);
    --secondary-blue: #dbe5f4;
    --accent-blue: var(--u3-primary);
    --dark-blue: var(--u3-primary-hover);
    --text-dark: var(--u3-ink);
    --bs-body-color: var(--u3-ink);
    --bs-link-color: var(--u3-primary);
    --bs-link-color-rgb: 63, 107, 179;
    --bs-link-hover-color-rgb: 47, 85, 150;
    --bs-border-color: var(--u3-line);
    --bs-secondary-color: var(--u3-muted);
    --bs-primary-rgb: 91, 132, 198;
    background-color: var(--u3-bg);
    color: var(--u3-ink);
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.65;
    word-break: auto-phrase;
}
body.ui-preview :is(.small, small) { font-size: 12px; }
body.ui-preview .text-muted { color: var(--u3-muted) !important; }
body.ui-preview a { text-underline-offset: 3px; }

/* 見出し：丸ゴシックの青をやめ、紺の太字で大きさの差をはっきり */
body.ui-preview :is(h1, h2, h3, h4, h5, h6, .page-title),
body.ui-preview .top-screen :is(h1, h2) {
    font-family: inherit;
    color: var(--u3-ink);
    font-weight: 700;
    letter-spacing: 0;
}
body.ui-preview :is(h1, h1[class], .h1, .page-title) { font-size: 20px; line-height: 1.4; }
body.ui-preview main :is(h1, .page-title):not(.report h1) { border-left: 4px solid var(--u3-blue); padding-left: 10px; }
body.ui-preview main :is(h1, .page-title) > i.bi { color: var(--u3-primary); font-size: .95em; }
body.ui-preview :is(h2, :is(h2, h3, h4, h5, p, div, span).h2, h2.h4) { font-size: 15px; }
body.ui-preview :is(h3, :is(h2, h3, h4, h5, p, div, span).h3, h2.h5) { font-size: 14px; }
body.ui-preview :is(h4, h5, h6, .h4, .h5, .h6) { font-size: 13.5px; }
body.ui-preview main h4 { margin-top: 1rem; }

/* カード：角4・はっきりした線・影なし。先頭の見出しは薄い水色の帯 */
body.ui-preview .card,
body.ui-preview :is(.top-metric, .top-section) {
    border: 1px solid var(--u3-line);
    border-radius: var(--u3-radius);
    box-shadow: none;
    margin-bottom: 12px;
}
body.ui-preview .card-body { padding: 14px 16px; }
body.ui-preview .card-header,
body.ui-preview .card-body > :is(h2, h3, h5):first-child,
body.ui-preview .top-section > h2:first-child,
body.ui-preview .top-section > .top-progress-head:first-child,
body.ui-preview .section-title {
    margin: -14px -16px 12px;
    padding: 8px 14px;
    background: var(--u3-tint);
    border: 0;
    border-bottom: 1px solid var(--u3-line);
    border-left: 3px solid var(--u3-blue);
    border-radius: var(--u3-radius) var(--u3-radius) 0 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--u3-ink);
}
body.ui-preview .card-header { margin: 0; }
body.ui-preview .section-title { margin: 0 0 10px; border: 1px solid var(--u3-line); border-left: 3px solid var(--u3-blue); border-radius: var(--u3-radius); }
body.ui-preview .card-header :is(h1, h2, h3, h4, h5) { font-size: 13.5px; margin: 0; }
body.ui-preview .top-section { padding: 14px 16px; margin-top: 12px; }
body.ui-preview .top-section > .top-progress-head:first-child h2 { font-size: 13.5px; }

/* ボタン・入力：角4・高さ32。塗りは落ち着いた青、取り込みだけコーラル */
body.ui-preview .btn {
    --bs-btn-border-radius: var(--u3-radius);
    --bs-btn-font-size: 13px;
    --bs-btn-padding-y: 5px;
    --bs-btn-padding-x: 12px;
    --bs-btn-font-weight: 700;
    border-radius: var(--u3-radius);
}
body.ui-preview .btn-lg { --bs-btn-font-size: 14px; --bs-btn-padding-y: 8px; --bs-btn-padding-x: 18px; }
body.ui-preview .btn-sm { --bs-btn-font-size: 12px; --bs-btn-padding-y: 3px; --bs-btn-padding-x: 9px; }
body.ui-preview .btn-primary {
    --bs-btn-bg: var(--u3-primary); --bs-btn-border-color: var(--u3-primary);
    --bs-btn-hover-bg: var(--u3-primary-hover); --bs-btn-hover-border-color: var(--u3-primary-hover);
    --bs-btn-active-bg: var(--u3-primary-hover); --bs-btn-active-border-color: var(--u3-primary-hover);
    --bs-btn-disabled-bg: var(--u3-primary); --bs-btn-disabled-border-color: var(--u3-primary);
    background-color: var(--bs-btn-bg); border-color: var(--bs-btn-border-color);
}
body.ui-preview :is(.btn-outline-primary, .btn-outline-dark, .btn-outline-secondary, .btn-outline-success) {
    --bs-btn-color: var(--u3-primary); --bs-btn-border-color: var(--u3-line-strong); --bs-btn-bg: #fff;
    --bs-btn-hover-bg: var(--u3-tint); --bs-btn-hover-color: var(--u3-primary-hover); --bs-btn-hover-border-color: var(--u3-blue);
    --bs-btn-active-bg: var(--u3-tint); --bs-btn-active-color: var(--u3-primary-hover); --bs-btn-active-border-color: var(--u3-blue);
    --bs-btn-disabled-color: var(--u3-muted); --bs-btn-disabled-border-color: var(--u3-line);
    color: var(--bs-btn-color); border-color: var(--bs-btn-border-color); background-color: var(--bs-btn-bg);
}
/* いちばん大事な操作（カイポケからの取り込み）だけコーラル */
body.ui-preview form[data-fetch-form] :is(button[type="submit"], input[type="submit"]).btn {
    --bs-btn-color: #fff; --bs-btn-bg: var(--u3-coral); --bs-btn-border-color: var(--u3-coral);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--u3-coral-text); --bs-btn-hover-border-color: var(--u3-coral-text);
    --bs-btn-active-bg: var(--u3-coral-text); --bs-btn-disabled-bg: var(--u3-coral); --bs-btn-disabled-border-color: var(--u3-coral);
    color: #fff; background-color: var(--bs-btn-bg); border-color: var(--bs-btn-border-color);
}
body.ui-preview :is(.form-control, .form-select) {
    border-radius: var(--u3-radius);
    border: 1px solid var(--u3-line-strong);
    font-size: 13px;
    min-height: 32px;
    padding-top: 4px; padding-bottom: 4px;
    color: var(--u3-ink);
}
body.ui-preview :is(.form-control, .form-select):focus { border-color: var(--u3-blue); box-shadow: 0 0 0 3px rgba(91, 132, 198, .25); }
body.ui-preview .form-label { font-size: 12px; font-weight: 700; color: var(--u3-ink-2); margin-bottom: 3px; }
body.ui-preview .form-text { font-size: 12px; color: var(--u3-muted); }

/* お知らせ：薄い地＋左の線。注意だけコーラル */
body.ui-preview .alert { border-radius: var(--u3-radius); padding: 9px 14px; font-size: 13px; color: var(--u3-ink); background: var(--u3-tint); border: 1px solid var(--u3-line); border-left: 3px solid var(--u3-blue); }
body.ui-preview :is(.alert-danger, .alert-warning) { background: var(--u3-coral-soft); border-color: var(--u3-coral-line); border-left-color: var(--u3-coral); }
body.ui-preview :is(.alert-danger, .alert-warning) :is(h1, h2, h3, h4, h5, strong, b, .alert-heading, i.bi) { color: var(--u3-coral-text); }
body.ui-preview .alert-light { background: #fff; }
body.ui-preview .badge { border-radius: var(--u3-radius); font-weight: 700; }
body.ui-preview .badge:is(.bg-primary, .text-bg-primary, .bg-info, .text-bg-info) { background-color: var(--u3-coral) !important; color: #fff !important; }
body.ui-preview .badge:is(.bg-secondary, .text-bg-secondary, .bg-light, .text-bg-light) { background-color: var(--u3-tint) !important; color: var(--u3-primary) !important; border: 1px solid var(--u3-line); }
body.ui-preview .text-primary { color: var(--u3-primary) !important; }
body.ui-preview .border-primary { border-color: var(--u3-blue) !important; }
body.ui-preview .spinner-border.text-primary { color: var(--u3-blue) !important; }

/* 表：詰めた行・1行おきにほぼ白の地・見出しは薄い水色に太字 */
body.ui-preview .table { border-radius: 0; font-size: 13px; margin-bottom: 10px; --bs-table-color: var(--u3-ink); --bs-table-border-color: var(--u3-line-soft); }
body.ui-preview table > :is(thead, tbody, tfoot) > tr > :is(th, td) { padding: 6px 10px; line-height: 1.6; }
body.ui-preview table > tbody > tr:nth-child(even) > :is(td, th):not([class*="bg-"]) { background-color: var(--u3-zebra); }
body.ui-preview table.table-bordered { border: 1px solid var(--u3-line-strong); }
body.ui-preview table.table-bordered > :is(thead, tbody, tfoot) > tr > :is(th, td) { border-color: var(--u3-line-soft); }
body.ui-preview table > tbody > tr > th:is(.bg-pink, .bg-blue) { border-bottom: 1px solid var(--u3-line-soft); }
body.ui-preview table > tbody > tr:is(.table-light.fw-bold, .table-secondary.fw-bold) > :is(th, td),
body.ui-preview table > tfoot > tr > :is(th, td),
body.ui-preview .mb-4 > table:has(> thead > tr > th.bg-pink) > tbody > tr:nth-child(4):last-child > td { border-top: 1.5px solid var(--u3-line-strong); background-color: #f3f5f9 !important; color: var(--u3-ink); }
body.ui-preview .table input.form-control { min-height: 28px; padding-top: 2px; padding-bottom: 2px; }

/* タブ：選択中はごく薄い水色＋青い下線 */
body.ui-preview .dashboard-tab-list { border-bottom: 1px solid var(--u3-line-strong); gap: 2px; }
body.ui-preview .dashboard-tab-list button { padding: 7px 16px; font-size: 13px; border-bottom-width: 2px; color: var(--u3-ink-2); }
body.ui-preview .nav-tabs .nav-link.active, body.ui-preview .nav-pills .nav-link.active { background: var(--u3-tint) !important; color: var(--u3-ink) !important; border-radius: var(--u3-radius) var(--u3-radius) 0 0; box-shadow: inset 0 -2px 0 var(--u3-blue); }
body.ui-preview .ui-preview-filters { border-color: var(--u3-line); border-radius: var(--u3-radius); padding: 8px 12px; }
body.ui-preview .ui-preview-filters label { font-size: 12px; font-weight: 700; color: var(--u3-ink-2); }
body.ui-preview .ui-preview-data-date { color: var(--u3-muted); font-size: 12px; }

/* 左メニュー（左メニュー表示のとき）：狭く・詰めて、選択中は左の青い線＋ごく薄い水色 */
body.layout-a.ui-preview .app-sidebar { width: 208px; background: #f8fafc; border-right: 1px solid var(--u3-line); }
body.layout-a.ui-preview .side-inner { padding: 14px 0 12px; }
body.layout-a.ui-preview .side-logo img { width: 132px; margin: 0 14px 8px; }
body.layout-a.ui-preview .side-grp { font-size: 11px; font-weight: 700; color: var(--u3-ink-2); letter-spacing: .04em; padding: 12px 14px 4px; }
body.layout-a.ui-preview .side-nav { gap: 0; }
body.layout-a.ui-preview .side-link { padding: 6px 14px 6px 11px; border-radius: 0; border-left: 3px solid transparent; font-size: 13px; color: var(--u3-ink-2); }
body.layout-a.ui-preview .side-link i { color: var(--u3-muted); font-size: 15px; }
body.layout-a.ui-preview .side-link:hover { background: var(--u3-tint); }
body.layout-a.ui-preview .side-link.active { background: var(--u3-tint); border-left-color: var(--u3-blue); color: var(--u3-ink); font-weight: 700; }
body.layout-a.ui-preview .side-link.active i { color: var(--u3-primary); }
body.layout-a.ui-preview .side-user { border-top-color: var(--u3-line); }
body.layout-a.ui-preview .side-inner > .navbar-nav { padding-left: 14px; padding-right: 14px; border-top-color: var(--u3-line) !important; }
body.layout-a.ui-preview .app-main > header { border-bottom: 1px solid var(--u3-line) !important; padding-top: 5px !important; padding-bottom: 5px !important; }
body.layout-a.ui-preview .app-main > header .nav-link { font-size: 13px; color: var(--u3-ink-2); }
body.layout-a.ui-preview .app-main > main { padding-top: 16px !important; }
body.layout-a.ui-preview .app-main > main > .container { max-width: 1320px; padding-left: 20px; padding-right: 20px; }
body.layout-a.ui-preview .mobile-bar { border-bottom-color: var(--u3-line); }
body.ui-preview .navbar { box-shadow: none; border-bottom: 1px solid var(--u3-line); }
body.ui-preview :is(.nav-link.active, .nav-item.show .nav-link) { background-color: var(--u3-tint) !important; color: var(--u3-ink) !important; border-radius: var(--u3-radius); }
body.ui-preview .dropdown-menu { border-radius: var(--u3-radius); border-color: var(--u3-line); font-size: 13px; box-shadow: 0 6px 18px -8px rgba(29, 42, 68, .3); }
body.ui-preview .page-header { border-bottom-color: var(--u3-line); box-shadow: none !important; margin-bottom: 12px; }

/* 取得中のお知らせ（共通レイアウトに直書きの色を上書き） */
body.ui-preview #processingOverlay { background: rgba(29, 42, 68, .45) !important; }
body.ui-preview #processingOverlay > div { border-radius: var(--u3-radius) !important; border: 1px solid var(--u3-line-strong); box-shadow: 0 16px 40px -12px rgba(29, 42, 68, .45) !important; }
body.ui-preview #processingOverlay > div > .mt-3 { background: var(--u3-coral-soft) !important; border: 1px solid var(--u3-coral-line) !important; border-left: 3px solid var(--u3-coral) !important; color: var(--u3-ink) !important; border-radius: var(--u3-radius) !important; }
body.ui-preview #processingOverlay > div > .mt-3 i { color: var(--u3-coral-text); }

/* ── トップ（標準）：4つの数字・進み具合 ── */
body.ui-preview .top-head { margin-bottom: 12px; align-items: flex-end; }
body.ui-preview .top-cards { gap: 12px; }
body.ui-preview .top-metric { border-top: 1px solid var(--u3-line); border-left: 3px solid var(--u3-blue); padding: 12px 14px; }
body.ui-preview .top-metric h2 { font-size: 12.5px; margin-bottom: 2px; }
body.ui-preview .top-number { font-size: 24px; line-height: 1.35; letter-spacing: -.01em; }
body.ui-preview .top-note { font-size: 12px; line-height: 1.6; color: var(--u3-muted); margin-top: 4px; }
body.ui-preview .top-empty { font-size: 15px; color: var(--u3-muted); }
body.ui-preview .top-pace { border-width: 1.5px; border-radius: var(--u3-radius); font-size: 12px; padding: 1px 8px; }
body.ui-preview .top-pace:is(.ahead, .ontrack) { color: var(--u3-primary); background: #fff; }
body.ui-preview .top-pace.behind { color: var(--u3-coral-text); background: #fff; }
body.ui-preview .top-progress-lead { font-size: 13.5px; }
body.ui-preview .top-progress-lead b { font-size: 18px; }
body.ui-preview .top-bar-track { height: 18px; border-radius: 2px; background: #eef1f6; }
body.ui-preview .top-bar { border-radius: 2px; }
body.ui-preview .top-bar.actual { background: var(--u3-blue); }
body.ui-preview .top-bar.plan { background: repeating-linear-gradient(135deg, #cfdcf1 0 5px, #e6edf8 5px 9px); border: 1px solid #b7c8e6; }
body.ui-preview .top-plan-marker { border-left-color: var(--u3-coral); }
body.ui-preview .top-plan-marker-label { color: var(--u3-coral-text); font-size: 12px; }
body.ui-preview .top-bar-label { font-size: 13px; }
body.ui-preview .top-dates { gap: 4px 16px; margin-top: 8px; }
body.ui-preview .top-dates dt { font-weight: 700; color: var(--u3-ink-2); }
/* いちばん下：レポートのカードと、よく使う画面のボタンの列 */
body.ui-preview .top-screen > .top-section:has(> a[href*="/reports/"]),
body.ui-preview .top-screen > .top-section:last-of-type:has(> h2 + :is(a.btn, p)) { padding-bottom: 6px; }
body.ui-preview .top-screen > .top-section > a.btn[href*="/reports/"],
body.ui-preview .home-report-link {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    border: 0; border-radius: 0; padding: 9px 4px; background: transparent; color: var(--u3-ink); font-weight: 700; font-size: 13.5px; text-decoration: none;
}
body.ui-preview .top-screen > .top-section > a.btn[href*="/reports/"]::before,
body.ui-preview .home-report-link::before { content: "\F38B"; font-family: "bootstrap-icons"; font-weight: 400; font-size: 17px; color: var(--u3-primary); }
body.ui-preview .top-screen > .top-section > a.btn[href*="/reports/"]::after,
body.ui-preview .home-report-link::after { content: "\F285"; font-family: "bootstrap-icons"; font-weight: 400; margin-left: auto; color: var(--u3-muted); }
body.ui-preview .top-screen > .top-section > a.btn[href*="/reports/"]:hover,
body.ui-preview .home-report-link:hover { background: var(--u3-tint); color: var(--u3-primary-hover); }
body.ui-preview .top-actions { gap: 8px; margin-top: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--u3-line); border-radius: var(--u3-radius); align-items: center; }
body.ui-preview .top-actions::before { content: "よく使う画面"; font-size: 12px; font-weight: 700; color: var(--u3-ink-2); margin-right: 4px; }

/* ── ホーム（標準の詳細・経営ノート・全事業所ボード）── */
body.ui-preview .home-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--u3-line-soft); border-radius: var(--u3-radius); margin-top: 10px; }
body.ui-preview .home-kpis > div { padding: 8px 12px; border-left: 1px solid var(--u3-line-soft); min-width: 0; }
body.ui-preview .home-kpis > div:first-child { border-left: 0; }
body.ui-preview .home-kpis h3 { font-size: 12px; color: var(--u3-ink-2); margin: 0; }
body.ui-preview .home-kpis p { margin: 0; }
body.ui-preview .home-kpis .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.4; }
body.ui-preview .home-sum { font-size: 14px; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
body.ui-preview .home-sum b { font-size: 16px; }
body.ui-preview .home-status { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 8px 0 0; color: var(--u3-muted); font-size: 12px; }
body.ui-preview .home-status .alert { margin: 0; flex: 1 1 100%; }
/* 週ごとの売上：縦の棒グラフ（軸は1本・円） */
body.ui-preview .home-weeks { max-width: 760px; }
body.ui-preview .home-weeks svg { display: block; width: 100%; height: auto; overflow: visible; }
body.ui-preview .home-weeks text { font-family: inherit; font-variant-numeric: tabular-nums; }
body.ui-preview .home-weeks .grid { stroke: #e6ebf3; }
body.ui-preview .home-weeks .base { stroke: var(--u3-line-strong); }
body.ui-preview .home-weeks .tick { fill: var(--u3-muted); font-size: 11px; }
body.ui-preview .home-weeks .wk { fill: var(--u3-ink-2); font-size: 11.5px; }
body.ui-preview .home-weeks .val { fill: var(--u3-ink); font-size: 11.5px; font-weight: 700; }
body.ui-preview .home-weeks .val.plan { fill: var(--u3-ink-2); font-weight: 500; }
body.ui-preview .home-weeks .bar-actual { fill: var(--u3-blue); }
body.ui-preview .home-weeks .bar-plan { stroke: #9fb6dd; stroke-width: 1; }
body.ui-preview .home-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--u3-ink-2); margin: 4px 0 6px; }
body.ui-preview .home-legend span { display: inline-flex; align-items: center; gap: 6px; }
body.ui-preview .home-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; background: var(--u3-blue); }
body.ui-preview .home-legend i.plan { background: repeating-linear-gradient(135deg, #cfdcf1 0 3px, #eef3fb 3px 6px); border: 1px solid #9fb6dd; }
body.ui-preview .home-legend i.reha { background: var(--u3-reha); }
body.ui-preview .home-legend i.line { width: 2px; height: 14px; border-radius: 0; background: var(--u3-coral); }
body.ui-preview .home-legend i.target { width: 2px; height: 14px; border-radius: 0; background: var(--u3-ink); }
/* スタッフ別の訪問件数：詰めた行・ほぼ白の1行おき・行の線なし */
body.ui-preview table.home-staff-table { width: 100%; margin-bottom: 6px; }
body.ui-preview table.home-staff-table > :is(thead, tbody) > tr > :is(th, td) { padding: 5px 10px; height: 34px; border-bottom: 0; white-space: nowrap; }
body.ui-preview table.home-staff-table > thead > tr > th { border-bottom: 1px solid var(--u3-line-strong); font-size: 12px; }
body.ui-preview table.home-staff-table :is(th, td).n { text-align: right !important; width: 76px; }
body.ui-preview table.home-staff-table th[scope="row"] { font-weight: 700; }
body.ui-preview table.home-staff-table td.b { width: 34%; min-width: 150px; }
body.ui-preview table.home-staff-table .unset { color: var(--u3-muted); font-size: 12px; }
body.ui-preview .home-bar { position: relative; display: block; height: 8px; border-radius: 2px; background: #e9edf4; }
body.ui-preview .home-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--u3-blue); }
body.ui-preview .home-bar > i.plan { background: repeating-linear-gradient(135deg, #cfdcf1 0 3px, #e6edf8 3px 6px); }
body.ui-preview .home-bar > b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--u3-ink); }
/* リハビリの割合：棒は青緑、50%の線はコーラル。50%以上は棒もコーラル */
body.ui-preview .home-rehab-bar { position: relative; height: 12px; min-width: 120px; border-radius: 2px; background: #e9edf4; margin: 6px 0 8px; }
body.ui-preview .home-rehab-bar > i { display: block; height: 100%; border-radius: 2px; background: var(--u3-reha); }
body.ui-preview .home-rehab-bar.over > i { background: var(--u3-coral); }
body.ui-preview .home-rehab-bar > b { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--u3-coral); }
body.ui-preview .home-rehab-num { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
body.ui-preview .home-flag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--u3-radius); font-size: 12px; font-weight: 700; white-space: nowrap; vertical-align: 2px; }
body.ui-preview .home-flag.near { color: var(--u3-coral-text); border: 1.5px solid var(--u3-coral); background: #fff; }
body.ui-preview .home-flag.over { color: #fff; background: var(--u3-coral); border: 1.5px solid var(--u3-coral); }
body.ui-preview .home-two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; align-items: start; }
body.ui-preview .home-two > .top-section { margin-top: 12px; height: 100%; }
/* 経営ノート */
body.ui-preview .home-note .card { margin-bottom: 12px; }
body.ui-preview .home-note .note-lead h2 { all: unset; display: block; font-size: 22px; font-weight: 700; line-height: 1.5; color: var(--u3-ink); margin-bottom: 6px; }
body.ui-preview .home-note .note-lead { border-left: 3px solid var(--u3-blue); }
body.ui-preview .home-note .note-lead p { font-size: 14px; margin-bottom: 4px; }
body.ui-preview .home-note ul.note-alerts { list-style: none; padding: 0; margin: 0; }
body.ui-preview .home-note ul.note-alerts > li { position: relative; padding: 8px 10px 8px 34px; margin: 0 0 6px !important; background: var(--u3-coral-soft); border: 1px solid var(--u3-coral-line); border-left: 3px solid var(--u3-coral); border-radius: var(--u3-radius); }
body.ui-preview .home-note ul.note-alerts > li::before { content: "\F33B"; font-family: "bootstrap-icons"; position: absolute; left: 10px; top: 7px; color: var(--u3-coral-text); }
body.ui-preview .home-note .note-moves p { margin: 0; padding: 6px 2px; border-bottom: 1px solid var(--u3-line-soft); }
body.ui-preview .home-note .note-moves p:last-child { border-bottom: 0; }
body.ui-preview .home-note table.table > tbody > tr > th { font-weight: 500; color: var(--u3-ink-2); }
body.ui-preview .home-note table.table > tbody > tr > td { text-align: right; font-weight: 700; }
body.ui-preview .home-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
/* 全事業所ボード */
body.ui-preview .home-board .card-body { padding: 10px 14px; }
body.ui-preview .home-board .card { border-left: 3px solid var(--u3-blue); }
body.ui-preview .home-board .card h2 { all: unset; display: block; font-size: 12.5px; font-weight: 700; color: var(--u3-ink); }
body.ui-preview .home-board .card strong { font-size: 22px; font-variant-numeric: tabular-nums; }
body.ui-preview .home-board-table > :is(thead, tbody) > tr > :is(th, td) { vertical-align: top; }
body.ui-preview .home-board-table td:last-child { min-width: 250px; }
body.ui-preview .home-board-table p { margin-bottom: 2px; }

/* ── データ取得 ── */
body.ui-preview .hub-card { border-radius: var(--u3-radius) !important; box-shadow: none !important; border: 1px solid var(--u3-line) !important; transition: none; }
body.ui-preview .hub-card:hover { box-shadow: none !important; transform: none; border-color: var(--u3-blue) !important; background: var(--u3-zebra); }
body.ui-preview .hub-card .card-body { padding: 10px 14px; }
body.ui-preview .hub-card i.bi { color: var(--u3-primary) !important; }
body.ui-preview .hub-sec { font-size: 12.5px; color: var(--u3-ink); border-left: 3px solid var(--u3-blue); padding-left: 8px; margin: 14px 0 8px; }

/* ── リハビリ減算の判定レポート：色の変数だけ差し替える（看護＝青／リハビリ＝青緑／注意＝コーラル）── */
body.ui-preview .report {
    --blue: var(--u3-blue); --orange: var(--u3-reha); --red: var(--u3-coral); --green: var(--u3-primary); --ink: var(--u3-ink); --sub: var(--u3-ink-2); --line: var(--u3-line);
    border-radius: var(--u3-radius); box-shadow: none; border: 1px solid var(--u3-line); padding: 22px 26px; max-width: 980px;
}
body.ui-preview .report h1 { font-size: 19px; }
body.ui-preview .report h2 { font-size: 14px; color: var(--u3-ink) !important; }
body.ui-preview .report :is(.verdict, .cond, .advice) { border-radius: var(--u3-radius); }
body.ui-preview .report .verdict { border-width: 1px 1px 1px 4px; }
body.ui-preview .report .verdict.applies { background: var(--u3-coral-soft); color: var(--u3-coral-text); }
body.ui-preview .report .verdict.not_applies { background: var(--u3-tint); color: var(--u3-ink); }
body.ui-preview .report .verdict.in_progress { background: var(--u3-tint); }
body.ui-preview .report .verdict.in_progress:is(.improve, .impossible) { background: var(--u3-coral-soft); border-color: var(--u3-coral); }
body.ui-preview .report .advice { border: 1px solid var(--u3-coral-line); border-left: 3px solid var(--u3-coral); }
body.ui-preview .report .mk { border-width: 1.5px; border-radius: var(--u3-radius); font-size: 12px; }
body.ui-preview .report .mk.hit, body.ui-preview .report .months tr.over .rate, body.ui-preview .report .months tr.missing td { color: var(--u3-coral-text); }
body.ui-preview .report .mk.hit { border-color: var(--u3-coral); }
body.ui-preview .report .c1 .pct .num { color: inherit; }
body.ui-preview .report .stack { height: 28px; }
body.ui-preview .report .stack :is(.n, .r) { border-radius: 2px; }
body.ui-preview .report .stack .n { background: #4a73b8; }
body.ui-preview .report .stack .r { background: #0f8a70 var(--hatch); text-shadow: none; }
body.ui-preview .report .adds div { border-radius: var(--u3-radius); }
body.ui-preview .report .months { font-size: 13px; border: 1px solid var(--u3-line-strong); }
body.ui-preview .report .months th { background: var(--u3-tint); color: var(--u3-ink); font-size: 12px; border-bottom: 1px solid var(--u3-line-strong); padding: 6px 10px; }
body.ui-preview .report .months td { padding: 5px 10px; border-bottom: 1px solid var(--u3-line-soft); }
body.ui-preview .report .months tbody th { background: transparent; color: var(--u3-ink); font-size: 13px; border-bottom: 1px solid var(--u3-line-soft); padding: 5px 10px; text-align: left; }
body.ui-preview .report .months tr.sum td { border-top: 1.5px solid var(--u3-line-strong); background: #f3f5f9; }

/* ── 売上目標 ── */
body.ui-preview .target-table input.form-control { min-width: 5rem !important; text-align: right; }

/* ── スマホ：文字は14px。表は押しつぶさず横に動かす ── */
@media (max-width: 991.98px) {
    body.ui-preview { font-size: 14px; }
    body.ui-preview :is(.btn, .form-control, .form-select) { font-size: 14px; min-height: 44px; }
    body.ui-preview .btn { --bs-btn-font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
    body.ui-preview .table, body.ui-preview .report .months { font-size: 13.5px; }
    /* 左メニュー表示のスマホ：上の帯（ロゴ）が本文の横に並んで本文が細くなるのを直す（縦に積む） */
    body.layout-a.ui-preview .app-shell { display: block; }
    body.layout-a.ui-preview .app-sidebar { width: min(300px, 86vw); }
    body.layout-a.ui-preview .side-link { font-size: 14.5px; padding-top: 11px; padding-bottom: 11px; }
    body.layout-a.ui-preview .app-main > main > .container { padding-left: 12px; padding-right: 12px; }
    body.ui-preview .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.ui-preview .home-kpis > div:nth-child(3) { border-left: 0; }
    body.ui-preview .home-kpis > div:nth-child(n+3) { border-top: 1px solid var(--u3-line-soft); }
    body.ui-preview .home-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
    body.ui-preview table.home-staff-table :is(th, td).n { width: 50px; padding-left: 2px; padding-right: 6px; }
    body.ui-preview table.home-staff-table td.b { min-width: 64px; width: 24%; }
    body.ui-preview table.home-staff-table > :is(thead, tbody) > tr > :is(th, td) { height: 36px; }
    /* 表の親に横スクロールを付け、文字が重ならないよう折り返さない */
    body.ui-preview main :is(div, section, form):has(> table:not(.home-board-table)) { overflow-x: auto; }
    body.ui-preview main table:not(.home-staff-table, .home-board-table) > :is(thead, tbody, tfoot) > tr > :is(th, td) { white-space: nowrap; }
    body.ui-preview main table:not(.home-board-table) > :is(thead, tbody, tfoot) > tr > :is(th, td) { padding-left: 7px; padding-right: 7px; }
    body.ui-preview main table:not(.home-staff-table, .home-board-table) { table-layout: auto !important; width: max-content; min-width: 100%; }
    body.ui-preview .report { overflow-x: auto; }
    body.ui-preview .report .c1 { flex-wrap: wrap; }
    body.ui-preview .report .adds { grid-template-columns: 1fr; }
    body.ui-preview .report { padding: 14px 12px; }
}
@media print {
    body.ui-preview { background: #fff; font-size: 12px; }
    body.ui-preview .top-actions::before { content: none; }
}
