/* ============================================================================
   ネクストコンサルティング様 助成金業務管理  app.css（cv-ui.css・cv-ink.css の後に読む）

   ・配色は御社のホームページに合わせた紺（#182B5D）と青（#2D55AD・#456FB7）。弊社の緑と弧は使わない
   ・弊社の基準（2026-10-05〜10-13 の浜田さんの指示）を当てた
     角の丸み＝面4px・部品3px・札2px／左の色の縦線・薄い色の四角のアイコン・見出しの短い下線は使わない
     メニューの選択中＝帯の端から端まで白22%／表の文字は12px より小さくしない・自動で縮めない
     良し悪しの色（赤・黄）は期日にだけ。案件の段階は段階の色
   ============================================================================ */
:root {
  --brand: #182B5D; --brand-dark: #0F1D42; --brand-soft: #E9EDF6;
  --blue: #2D55AD; --blue-2: #456FB7; --link: #3270B9;
  --nav: #182B5D; --nav-2: rgba(255, 255, 255, .10); --nav-text: #D7DEEE; --nav-text-dim: #9DAAC8;
  --radius: 4px; --radius-sm: 3px; --radius-xs: 2px;
  --alert: #D93025;
  --over-bg: #FCE8E6; --over-ink: #A50E0E;
  --soon-bg: #FEF1CC; --soon-ink: #6B4500;
  --open-bg: #E6EDFB; --open-ink: #1F3F8A;
  --head-bg: #F3F5F9;
  --cvx-struct: #182B5D; --cvx-mid: #2D55AD; --cvx-decor: #A9BCE6; --cvx-rule: #DDE2EC;
}
body { background: #F6F7FA; }
.num, .kpi-n, .nowrap { font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-3); font-size: 12px; }
.zero { color: #C3C8D2; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--ink-2); }

/* ---------- メニュー ---------- */
.nav { padding: 14px 0 16px; }
.nav-brand { padding: 4px 18px 14px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.nav-brand b { font-family: "Shippori Mincho", serif; font-size: 16px; letter-spacing: .04em; }
.nav-brand small { font-size: 12px; color: var(--nav-text-dim); margin-top: 3px; }
.nav-group { padding: 12px 0 4px; }
.nav-group-label { padding: 0 18px 4px; font-size: 12px; letter-spacing: .12em; }
.nav-item { border-left: 0; border-radius: 0; padding: 9px 18px; font-size: 13.5px; justify-content: space-between; }
.nav-item:hover { background: var(--nav-2); }
.nav-item.active { background: rgba(255, 255, 255, .22); color: #fff; font-weight: 700; }
.nav-badge { background: var(--alert); color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; display: inline-grid; place-items: center; font-family: Inter, sans-serif; }
.nav-foot { padding: 12px 18px 0; font-size: 12px; }

/* ---------- 上部の固定バー（戻る・最新にする） ---------- */
.header { height: 52px; gap: 10px; }
.bar-nav { display: flex; gap: 6px; }
.btn-bar { background: #fff; border: 1px solid var(--line-2); color: var(--ink); padding: 5px 12px; font-size: 13px; }
.btn-bar:hover { border-color: var(--brand); color: var(--brand); }
.who { font-size: 13px; color: var(--ink-2); }
.local-chip { font-size: 12px; font-weight: 700; color: #6B4500; background: var(--soon-bg); padding: 2px 8px; border-radius: var(--radius-xs); }

/* ---------- ページ ---------- */
.page { max-width: 1680px; }
.page-head h1 { font-family: "Shippori Mincho", serif; font-size: 23px; letter-spacing: .03em; font-weight: 700; }
.crumb { font-size: 12px; }
.page-lead { font-size: 12.5px; color: var(--ink-2); margin: -4px 0 14px; }
.block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.block-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.block-head h2 { font-family: "Shippori Mincho", serif; font-size: 16.5px; margin: 0; letter-spacing: .02em; }
.block-head .btn { margin-left: auto; }
.sub-h { font-size: 13px; color: var(--ink-2); margin: 18px 0 8px; font-weight: 700; }
.empty-line { color: var(--ink-3); font-size: 13px; padding: 10px 2px; }
.empty .big { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.pno { display: inline-block; color: var(--blue); font-weight: 700; margin-right: 6px; font-family: Inter, "Noto Sans JP", sans-serif; }

/* ---------- ボタン・入力 ---------- */
.btn { font: inherit; font-size: 13px; background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 6px 13px; cursor: pointer; line-height: 1.4; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-sm { font-size: 12px; padding: 3px 9px; }
.btn-ghost { background: none; border-color: transparent; }
.btn-danger { background: var(--alert); border-color: var(--alert); color: #fff; font-weight: 700; }
.btn-danger-ghost { color: var(--over-ink); }
.btn-block { width: 100%; padding: 10px; font-size: 14px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
.link-num { background: none; border: 0; font: inherit; font-weight: 700; color: var(--link); cursor: pointer; padding: 0 2px; }
.inp { font: inherit; font-size: 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 8px; background: #fff; color: var(--ink); min-width: 0; }
.inp:focus { outline: 2px solid rgba(45, 85, 173, .35); border-color: var(--blue); }
.inp-wide { min-width: 280px; }
.inp-date { width: 150px; flex: none; }
.inp-num { text-align: right; }
.inp-row { display: flex; gap: 6px; }
.inp-row .inp:first-child { flex: 1; }
textarea.inp { width: 100%; resize: vertical; line-height: 1.6; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg-btn { font: inherit; font-size: 12.5px; background: none; border: 0; border-right: 1px solid var(--line); padding: 6px 11px; cursor: pointer; color: var(--ink-2); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--brand); color: #fff; font-weight: 700; }

/* ---------- ホームの件数カード（色が満ちる＝御社の紺） ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-card { border-radius: var(--radius); margin: 0; }
.kpi-card .cv-ink-layer { padding: 18px 20px; gap: 14px; }
.kpi-card .cv-ink-num { width: 34px; font-size: 22px; }
.kpi-card .cv-ink-title { font-family: "Shippori Mincho", serif; font-size: 18px; }
.kpi-card .cv-ink-desc { font-size: 12px; }
.kpi-n { font-family: Inter, sans-serif; font-size: 44px; font-weight: 700; line-height: 1; min-width: 64px; text-align: right; }
.k-over { color: var(--alert); } .k-soon { color: #B26A00; } .k-open { color: var(--blue); }
.cv-ink-over .kpi-n { color: #fff; }
@media (max-width: 1080px) { .kpi-grid { grid-template-columns: 1fr; } }

/* ---------- 表 ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.tbl th { background: var(--head-bg); color: var(--ink-2); font-weight: 700; font-size: 12px; text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #F5F8FE; }
.tbl td small { display: block; color: var(--ink-3); font-size: 12px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn { margin-left: 4px; }
.n-over { color: var(--alert); font-weight: 700; }

/* 台帳の表（列が多いので横に送る。左の3列と見出しは固定） */
.ledger-wrap { max-height: calc(100vh - 250px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.ledger { font-size: 12.5px; }
.ledger th, .ledger td { white-space: nowrap; border-right: 1px solid #EEF0F4; }
.ledger thead th { position: sticky; top: 0; z-index: 2; }
.ledger thead tr.grp + tr th { top: 31px; }
.ledger tr.grp th { text-align: center; color: var(--ink-3); font-weight: 500; }
.ledger tr.grp th.grp-on { color: var(--brand); font-weight: 700; border-bottom: 1px solid var(--line-2); }
.ledger .stick { position: sticky; z-index: 1; background: #fff; }
.ledger thead .stick { z-index: 3; background: var(--head-bg); }
.ledger .s1 { left: 0; min-width: 96px; }
.ledger .s2 { left: 96px; min-width: 170px; max-width: 220px; }
.ledger .s3 { left: 266px; min-width: 110px; box-shadow: 1px 0 0 var(--line-2); }
.ledger td.s2 b { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; }
.ledger tr.click:hover td.stick { background: #F5F8FE; }
.th-calc { color: var(--blue-2) !important; }
.cell-over { background: var(--over-bg); color: var(--over-ink); font-weight: 700; }
.cell-soon { background: var(--soon-bg); color: var(--soon-ink); font-weight: 700; }
.cell-open { background: var(--open-bg); color: var(--open-ink); font-weight: 700; }
.cell-calc { color: #3A4F86; }
.cell-suggest { color: var(--ink-3); }
.cell-na { color: #C3C8D2; }
.cell-inferred { color: var(--ink-3); font-size: 12px; }
.due-hint { font-size: 12px; font-weight: 500; }
.tag-auto, .tag-req { display: inline-block; font-size: 12px; margin-left: 4px; padding: 0 4px; border-radius: var(--radius-xs); background: #EEF1F6; color: var(--ink-2); font-weight: 500; }
.tag-req { background: #E9EDF6; color: var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin: -4px 0 10px; }
.lg::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: var(--radius-xs); margin-right: 5px; vertical-align: -2px; border: 1px solid rgba(0, 0, 0, .06); }
.lg-over::before { background: var(--over-bg); } .lg-soon::before { background: var(--soon-bg); } .lg-open::before { background: var(--open-bg); }
/* 自動・目安は色の四角だと押せる箱に見えるため、文字の見本にする */
.lg-calc::before, .lg-suggest::before { width: auto; height: auto; border: 0; background: none; font-weight: 700; vertical-align: 0; }
.lg-calc::before { content: "青字"; color: #3A4F86; }
.lg-suggest::before { content: "灰字"; color: var(--ink-3); }

/* ---------- 状態の札（期日）と段階の札 ---------- */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-xs); white-space: nowrap; }
.st-over { background: var(--alert); color: #fff; }
.st-soon { background: #F9D97A; color: #4A3000; }
.st-open { background: var(--open-bg); color: var(--open-ink); }
.st-plan { background: #F0F2F6; color: var(--ink-2); font-weight: 500; }
.st-done { color: #46604F; border: 1px solid #CFD8D2; font-weight: 500; }
.st-nodue { color: var(--ink-3); border: 1px dashed #C9CED8; font-weight: 500; }
.st-na { color: #B0B6C2; font-weight: 500; }
.chip-date { font-family: Inter, sans-serif; font-weight: 600; }
.req { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--brand); border: 1px solid #C9D3EA; padding: 0 5px; border-radius: var(--radius-xs); white-space: nowrap; }
.sg { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-xs); border: 1px solid; white-space: nowrap; }
.sg-prep { color: #66708A; border-color: #C5CBD8; }
.sg-run { color: #22706E; border-color: #A9D2D0; }
.sg-open { color: #4C3FA6; border-color: #C4BDEB; background: #F4F2FC; }
.sg-sent { color: #2D55AD; border-color: #B5C6EA; }
.sg-done { color: #fff; border-color: var(--brand); background: var(--brand); }
.warn-dot { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--over-ink); border: 1px solid #F1B9B4; background: #FFF6F5; padding: 0 5px; border-radius: var(--radius-xs); }
.pchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 1px 7px; margin: 1px 4px 1px 0; background: #fff; white-space: nowrap; }
.pchip-n { font-family: Inter, sans-serif; font-weight: 700; color: var(--blue); }
.pchip-btn { cursor: pointer; font: inherit; font-size: 12.5px; }
.pchip-btn:hover { border-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- お客様・申請の詳細 ---------- */
.cust-head { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.cust-name { font-family: "Shippori Mincho", serif; font-size: 20px; margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--ink-3); }
.kv dd { margin: 1px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.kv-inline { margin-bottom: 12px; }
.memo { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.claim-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.claim-title { display: flex; flex-direction: column; gap: 3px; }
.claim-title b { font-family: "Shippori Mincho", serif; font-size: 19px; }
.claim-title span { font-size: 13px; color: var(--ink-2); }
.alert { background: #FFF6F5; border: 1px solid #F1B9B4; color: var(--over-ink); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; font-weight: 700; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #EEF0F4; flex-wrap: wrap; }
.step-l { font-weight: 700; font-size: 13.5px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 18px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full, label.full { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; }
.field-l { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field-l label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--ink-3); }
.auto { font-size: 12px; color: #3A4F86; border: 1px solid #C9D3EA; padding: 0 5px; border-radius: var(--radius-xs); }
.ro { padding: 6px 8px; border: 1px solid transparent; font-size: 13px; background: #F7F8FB; border-radius: var(--radius-sm); min-height: 33px; }
.ro-calc { color: #3A4F86; font-weight: 700; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.form-grid small { font-weight: 400; color: var(--ink-3); }
.btn-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 書類依頼 ---------- */
.req-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.req-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 64px; max-height: calc(100vh - 90px); overflow-y: auto; }
.req-list-h { padding: 10px 14px; font-size: 12.5px; font-weight: 700; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.req-cust { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-bottom: 1px solid #EEF0F4; background: #fff; font: inherit; font-size: 13px; padding: 9px 14px; cursor: pointer; text-align: left; }
.req-cust:hover { background: #F5F8FE; }
.req-cust.on { background: var(--brand); color: #fff; font-weight: 700; }
.req-cust.on .muted { color: #D7DEEE; }
.req-text { font-size: 13.5px; line-height: 1.75; font-family: "Noto Sans JP", sans-serif; }
.tbl-check td:first-child { width: 32px; }
@media (max-width: 900px) { .req-layout { grid-template-columns: 1fr; } .req-list { position: static; max-height: none; } }

/* ---------- 制度と工程 ---------- */
.tbl-rules td { vertical-align: top; font-size: 12.5px; }
.tbl-rules td:nth-child(2) { min-width: 9.5em; }
.tbl-rules td:nth-child(4) { min-width: 24em; }
.tbl-rules td:nth-child(5) { min-width: 14em; }
.tbl-rules td div + div { margin-top: 3px; }

/* ---------- 重ねて出す窓・お知らせ ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 29, 66, .38); z-index: 80; display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 640px; box-shadow: var(--shadow-3); }
.modal.wide { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-family: "Shippori Mincho", serif; font-size: 17px; }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--brand); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: var(--shadow-2); max-width: 420px; }
.toast.err { background: var(--alert); }

/* ---------- ログイン ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #182B5D 0%, #2D55AD 100%); padding: 16px; }
.login { background: #fff; width: 100%; max-width: 380px; border-radius: var(--radius); padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; }
.login-brand { font-size: 12px; color: var(--ink-3); letter-spacing: .08em; }
.login h1 { font-family: "Shippori Mincho", serif; font-size: 24px; margin: 0 0 6px; color: var(--brand); }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.login .inp { font-size: 15px; padding: 9px 10px; }
.login-note { font-size: 12px; color: #6B4500; background: var(--soon-bg); padding: 6px 10px; border-radius: var(--radius-sm); margin: 0; }
.login-err { color: var(--over-ink); font-size: 13px; min-height: 18px; margin: 0; }
.login-err.is-ok { color: var(--ink-2); }
.login-lead { font-size: 13px; color: var(--ink-2); margin: -4px 0 0; }
.login-link { align-self: flex-start; background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12.5px; color: var(--link, #3270B9); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (max-width: 900px) {
  .bar-nav .btn-bar { padding: 5px 9px; }
  .ledger-wrap { max-height: none; }
  .ledger .stick { position: static; }
  /* 見出し行のボタン（例：制度の確認項目を並べた札）は文字が長いので、狭い画面では中で折り返す（10/14 375px で27社はみ出し） */
  .block-head .btn { white-space: normal; max-width: 100%; text-align: left; }
}
@media print {
  .bar-nav, .kpi-grid, .row-actions, .filters, .legend { display: none !important; }
  .block { border: 0; padding: 0; }
  .ledger-wrap { max-height: none; overflow: visible; border: 0; }
}
