:root { --blue: #2A68BC; --blue-d: #124080; --tint: #EAF1FA; --org: #F04A24; --org2: #FF7A1F; --ink: #1A1A1A; --soft: #5A6575; --nav: #3A4656; --faint: #7B8797; --line: #DDE5F0; --line2: #E6ECF4; --line3: #EEF2F8; --field: #C6D3E4; --bg: #F4F7FB; --card: #fff; --red: #C2410C; --green: #1B6B4A; --warnbg: #FFF1E6; --warnbd: #FFB98A; --warnfg: #9A3412; --r: 8px; }
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.65; }
a { color: var(--blue); } a:hover { color: var(--blue-d); } button, input, select, textarea { font: inherit; color: inherit; }
.num { font-family: Inter, "Noto Sans JP", system-ui, sans-serif; }
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

/* 左のメニュー：白地・青い字標・線のアイコン */
.side { background: #fff; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 4px 12px 20px; text-decoration: none; }
.brand b { font-size: 20px; font-weight: 700; color: var(--blue); letter-spacing: .04em; } .brand span { font-size: 11px; color: var(--soft); letter-spacing: .12em; }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 6px; font-size: 15px; font-weight: 500; color: var(--nav); text-decoration: none; }
.side nav a svg { flex: 0 0 auto; } .side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--tint); color: var(--blue-d); font-weight: 700; }
.side nav .sep { height: 1px; background: var(--line2); margin: 8px 6px; }
.count { margin-left: auto; font-family: Inter, sans-serif; font-size: 12px; font-weight: 700; min-width: 22px; text-align: center; padding: 2px 6px; border-radius: 10px; background: var(--org); color: #fff; } .count:empty { display: none; }
.me { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line2); font-size: 12px; line-height: 1.6; color: var(--soft); word-break: break-all; }

.view { padding: 32px clamp(1rem, 3vw, 2.5rem) 56px; min-width: 0; outline: none; max-width: 1320px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
h1 { font-size: 28px; line-height: 1.3; font-weight: 700; margin: 0 0 20px; } .pagehead h1 { margin: 0; } .pagehead p { margin: 4px 0 0; font-size: 14px; color: var(--soft); }
h2 { font-size: 16px; margin: 0 0 .8rem; font-weight: 700; } h3 { font-size: 14px; margin: 0 0 .5rem; font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2:first-child { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; } .g-6 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } .g-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* 件数のタイル */
.tile { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.tile:hover { border-color: var(--blue); } .tile .t { font-size: 14px; font-weight: 500; } .tile .n { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; } .tile .n b { font-family: Inter, sans-serif; font-size: 44px; line-height: 1; font-weight: 700; } .tile .n span { font-size: 14px; }
.tile.solid { background: var(--blue); border-color: var(--blue); color: #fff; } .tile.solid:hover { background: var(--blue-d); }
.tile.warn { background: var(--warnbg); border-color: var(--warnbd); color: var(--warnfg); }
.stat { display: block; text-decoration: none; color: inherit; }

/* 一覧（行がリンク） */
.listhead, .lrow { display: grid; gap: 0 14px; align-items: center; padding: 14px 22px; }
.listhead { background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--soft); padding-top: 11px; padding-bottom: 11px; }
.lrow { border-bottom: 1px solid var(--line3); text-decoration: none; color: var(--ink); font-size: 14px; cursor: pointer; } .lrow:last-child { border-bottom: 0; } .lrow:hover { background: #F8FAFD; }
.minw { min-width: 980px; }
.cols-log { grid-template-columns: 112px 84px minmax(0, 1.1fr) minmax(0, 1.5fr) 96px 170px; }
.cols-doc { grid-template-columns: 138px 96px minmax(0, 1fr) 100px 140px; }
.kvr { display: flex; gap: 12px; align-items: baseline; padding: 5px 0; font-size: 14px; } .kvr .k { color: var(--soft); font-size: 12px; min-width: 6.5rem; }
.cols-pr { grid-template-columns: minmax(0, 1.2fr) 150px minmax(0, 1.2fr) 96px 110px 170px; }
.cols { grid-template-columns: 128px 160px minmax(0, 1fr) 84px 124px 104px; }
.cols .kindcell .kind { display: block; } .lrow .no { font-size: 11.5px; letter-spacing: -.01em; }
.lrow .title { display: block; font-weight: 700; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lrow .sub { display: block; font-size: 13px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .no { font-family: Inter, sans-serif; font-size: 12.5px; font-weight: 500; color: var(--soft); } .lrow .sm { font-size: 13px; color: var(--nav); }
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 24px; border-bottom: 1px solid var(--line3); text-decoration: none; color: var(--ink); } .todo:last-child { border-bottom: 0; } .todo:hover { background: #F8FAFD; }
.todo .kind { flex: 0 0 150px; } .todo .main { flex: 1 1 280px; min-width: 0; } .todo .main b { display: block; font-size: 15px; line-height: 1.5; } .todo .main span { display: block; font-size: 13px; color: var(--soft); } .todo .who { font-size: 13px; color: var(--soft); }
.cardhead { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line2); } .cardhead h2 { margin: 0; font-size: 18px; } .cardhead a { font-size: 14px; font-weight: 500; }

/* 小さな印 */
.kind { display: inline-block; min-width: 76px; text-align: center; padding: 4px 8px; border-radius: 4px; background: var(--tint); color: var(--blue-d); font-size: 12px; font-weight: 700; white-space: nowrap; }
.st { display: inline-block; min-width: 76px; text-align: center; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1.5px solid var(--blue); color: var(--blue); }
.st.new { background: var(--blue); color: #fff; } .st.wait { background: var(--line3); border-color: var(--line3); color: var(--nav); } .st.done { border-color: transparent; color: var(--soft); font-weight: 500; }
.due { display: inline-block; min-width: 92px; text-align: center; padding: 5px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--line3); color: var(--nav); }
.due.late { background: var(--org); color: #fff; } .due.today { background: #FFE3CC; color: var(--warnfg); } .due.none, .due.past { background: none; color: var(--soft); font-weight: 500; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 4px; background: var(--tint); color: var(--blue-d); white-space: nowrap; }
.badge.type { background: var(--tint); color: var(--blue-d); } .badge.high { background: var(--org); color: #fff; } .badge.over { background: var(--org); color: #fff; } .badge.today { background: #FFE3CC; color: var(--warnfg); } .badge.done { background: #E3F2EA; color: var(--green); } .badge.warn { background: var(--warnbg); color: var(--warnfg); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; } .muted { color: var(--soft); } .faint { color: var(--faint); font-size: .8rem; }

/* 表（その他の画面） */
table { width: 100%; border-collapse: collapse; font-size: .9rem; } th { text-align: left; font-size: 12px; color: var(--soft); font-weight: 700; padding: .6rem .8rem; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem .8rem; border-bottom: 1px solid var(--line3); vertical-align: top; } tr.row { cursor: pointer; } tr.row:hover td { background: #F8FAFD; }
.tw { overflow-x: auto; }

/* 絞り込み */
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.utabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; } .utab { padding: 12px 16px; font-size: 15px; font-weight: 500; color: var(--nav); border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; cursor: pointer; } .utab.on { color: var(--blue); font-weight: 700; border-bottom-color: var(--org2); } .utab .n { font-family: Inter, sans-serif; font-size: 12px; margin-left: 6px; }
.chip { border: 1px solid var(--field); background: #fff; border-radius: 16px; padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--nav); } .chip.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.lbl { font-size: 13px; color: var(--soft); margin-right: 2px; }
input, select, textarea { border: 1px solid var(--field); border-radius: 6px; padding: .55rem .75rem; background: #fff; max-width: 100%; min-height: 40px; } textarea { width: 100%; resize: vertical; line-height: 1.9; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.btn { border: 1px solid var(--blue); background: var(--blue); color: #fff; padding: 0 22px; height: 48px; display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 15px; text-decoration: none; } .btn:hover { background: var(--blue-d); color: #fff; }
.btn.ghost { background: #fff; color: var(--blue); border-width: 1.5px; } .btn.ghost:hover { background: var(--tint); color: var(--blue-d); }
.btn.sm { height: 40px; padding: 0 14px; font-size: 13px; } .btn.go { background: var(--org2); border-color: var(--org2); color: var(--ink); } .btn.go:hover { background: #F06A00; color: var(--ink); } .btn:disabled { opacity: .5; cursor: default; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; } @media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; } .step { border: 1px solid var(--field); background: #fff; border-radius: 16px; padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--nav); } .step.cur { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; } .step.past { background: var(--tint); border-color: var(--tint); color: var(--blue-d); } .step.end { border-style: dashed; }
.kv { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .5rem .8rem; font-size: .9rem; } .kv dt { color: var(--soft); font-size: 12px; padding-top: .45rem; } .kv dd { margin: 0; word-break: break-word; } .kv dd input, .kv dd select { width: 100%; }
.pre { white-space: pre-wrap; background: var(--bg); border-radius: 6px; padding: .9rem 1.1rem; font-size: .9rem; line-height: 1.9; max-height: 22rem; overflow: auto; }

/* やりとり：メールは白、社内メモは薄いオレンジ */
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tl li { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 16px 20px; font-size: 14px; }
.tl li.note { background: #FFF6EC; border-color: #FFD2A8; } .tl li.status { background: var(--bg); border-color: var(--line); padding: 10px 16px; font-size: 13px; color: var(--soft); }
.tl .at { display: block; font-size: 12px; color: var(--soft); margin-bottom: 6px; } .tl .tx { white-space: pre-wrap; line-height: 1.9; display: block; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); } .tab { border: 0; background: none; padding: 8px 16px; cursor: pointer; font-size: 14px; color: var(--nav); border-bottom: 3px solid transparent; margin-bottom: -1px; } .tab.on { color: var(--blue); font-weight: 700; border-bottom-color: var(--org2); }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 20px); background: var(--blue-d); color: #fff; padding: .7rem 1.2rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: .25s; font-size: .9rem; z-index: 30; } .toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.err { background: var(--org); }
.hint { background: var(--warnbg); border: 1px solid var(--warnbd); border-radius: 6px; padding: .6rem .9rem; font-size: .82rem; color: var(--warnfg); margin-bottom: 1rem; }
.field { display: grid; gap: 4px; margin-bottom: .9rem; } .field label { font-size: 12px; font-weight: 700; color: var(--soft); } .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; } @media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }
.spark { width: 100%; height: 70px; } .bars { display: grid; gap: .5rem; font-size: .85rem; } .bars div { display: grid; grid-template-columns: 9rem 1fr 2.5rem; gap: .6rem; align-items: center; } .bars i { display: block; height: 12px; background: var(--blue); border-radius: 6px; opacity: .85; }
dialog { border: 0; border-radius: 10px; padding: 1.4rem; box-shadow: 0 20px 70px rgba(18,64,128,.3); width: min(26rem, 94vw); } dialog::backdrop { background: rgba(18,64,128,.45); }
.pager { display: flex; gap: .4rem; justify-content: center; margin: 1rem; } .pager button { border: 1px solid var(--field); background: #fff; border-radius: 6px; padding: .3rem .8rem; cursor: pointer; } .pager button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.empty { text-align: center; color: var(--faint); padding: 2.4rem 0; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; text-decoration: none; margin-bottom: 16px; }
.chead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; } .chead h1 { font-size: 26px; line-height: 1.4; margin: 0; } .chead .meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; } .chead p { margin: 6px 0 0; font-size: 14px; color: var(--soft); }
.pill { padding: 8px 14px; border: 1px solid var(--field); border-radius: 6px; background: #fff; font-size: 13px; line-height: 1.5; } .pill small { display: block; font-size: 11px; color: var(--soft); } .pill b { font-weight: 700; } .pill.warn { background: var(--warnbg); border-color: var(--warnbd); } .pill.warn small, .pill.warn b { color: var(--warnfg); }

@media (max-width: 860px) {
  .cols-log, .cols-pr, .cols-doc { grid-template-columns: 1fr; gap: 4px; padding: 14px 16px; }
  .app { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  .brand { padding: 0 8px 0 4px; } .side nav { display: flex; overflow-x: auto; width: 100%; gap: 4px; padding-bottom: 2px; } .side nav a { flex: 0 0 auto; height: 40px; font-size: 14px; padding: 0 12px; } .side nav a svg { display: none; } .side nav .sep { display: none; } .me { display: none; }
  .view { padding: 20px 14px 48px; } h1, .pagehead h1 { font-size: 24px; }
  .minw { min-width: 0; } .tw { overflow: visible; } .cols .kindcell .kind { display: inline-block; }
  .listhead { display: none; } .cols { grid-template-columns: 1fr auto; gap: 6px 10px; padding: 14px 16px; } .cols .no, .cols .via, .cols .who { display: none; } .cols .titlebox { grid-column: 1 / -1; order: 3; } .cols .kindcell { order: 1; } .cols .stcell { order: 2; justify-self: end; } .cols .duecell { order: 4; justify-self: start; }
  .todo { padding: 14px 16px; } .tile .n b { font-size: 36px; } .btn { height: 44px; }
}

input[type=checkbox] { min-height: 0; width: 16px; height: 16px; padding: 0; accent-color: var(--blue); } .check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }

/* 書類の状態チップ（ロゴの色だけ）：下書き＝橙、取消＝薄いグレー */
.st.draft { background: #FFF1E6; border-color: #FFB98A; color: #9A3412; } .st.void { background: var(--line3); border-color: var(--line3); color: var(--faint); text-decoration: line-through; font-weight: 500; }
.st.done { border-color: var(--line); } .st.wait { background: var(--tint); border-color: var(--tint); color: var(--blue-d); }
input[type=file] { padding: 8px 10px; background: #fff; font-size: 14px; } input[type=file]::file-selector-button { margin-right: 12px; border: 1.5px solid var(--blue); background: #fff; color: var(--blue); border-radius: 4px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.doc-lines td, .doc-lines th { vertical-align: top; } .btn { white-space: nowrap; } td .btn + .btn { margin-left: 6px; }
.burger { display: none; }
.cols-doc .amt { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .burger { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--nav); cursor: pointer; }
  .side { justify-content: flex-start; } .side nav, .side .me { display: none; } .side.open nav { display: grid; width: 100%; overflow: visible; padding: 6px 0 4px; } .side.open nav a { height: 46px; } .side.open nav a svg { display: block; } .side.open .me { display: block; width: 100%; padding: 8px 12px; }
  .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile { padding: 14px 16px; } .tile .n { margin-top: 2px; } .tile .n b { font-size: 32px; }
  .cols-doc { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "no date" "title title" "st amt"; align-items: center; gap: 6px 10px; }
  .cols-doc > :nth-child(1) { grid-area: no; } .cols-doc > :nth-child(2) { grid-area: date; justify-self: end; } .cols-doc > :nth-child(3) { grid-area: title; } .cols-doc > :nth-child(4) { grid-area: st; justify-self: start; } .cols-doc > :nth-child(5) { grid-area: amt; justify-self: end; }
  .doc-lines { min-width: 520px; } .tw { overflow-x: auto; } .minw .tw { overflow: visible; }
}
.split > * { min-width: 0; }
@media (max-width: 860px) {
  .listhead.cols-doc { display: none; }
  .menurow { flex-wrap: nowrap !important; padding: 8px 12px !important; gap: 6px !important; } .menurow .btn.sm { width: 38px; min-width: 0; padding: 0; height: 38px; } .menurow .check { min-width: 0 !important; white-space: nowrap; }
}

/* 請求・在庫（IKYU AI をそのまま中で動かす）：右の領域いっぱいに広げる */
.zhost { min-width: 0; height: 100vh; position: sticky; top: 0; background: #f5f5f5; } .zhost[hidden] { display: none; } .zhost iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 860px) { .zhost { height: calc(100dvh - 58px); position: static; } }
.zhost.warm { position: fixed !important; left: -4000px; top: 0; width: 1280px; height: 820px; visibility: hidden; pointer-events: none; }
.cols-d { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.5fr) 126px 96px 120px 92px 64px; }
.cols-d .amt { text-align: right; font-weight: 700; } .cols-d .dt { text-align: right; } .lrow .sbj, .lrow .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monthbar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 4px; scrollbar-width: thin; }
.mchip { flex: none; border: 1px solid var(--field); background: #fff; border-radius: 8px; padding: 6px 14px; cursor: pointer; text-align: left; color: var(--nav); display: grid; gap: 0; line-height: 1.4; } .mchip b { font-size: 14px; } .mchip span { font-size: 12px; color: var(--soft); font-family: Inter, "Noto Sans JP", sans-serif; }
.mchip:hover { border-color: var(--blue); } .mchip.on { background: var(--blue); border-color: var(--blue); color: #fff; } .mchip.on span { color: #DCE8F7; }
.pager { text-align: center; padding: 14px; } .pager:empty { display: none; }
@media (max-width: 860px) { .listhead.cols-d { display: none; } .cols-d { grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 16px; } .cols-d .sbj { grid-column: 1 / -1; order: 3; } .cols-d .no, .cols-d .who { display: none; } .cols-d .amt { text-align: left; order: 4; } .cols-d .dt { order: 5; } }
th.r, td.r { text-align: right; } .subrow td { background: var(--bg); } .num { font-variant-numeric: tabular-nums; }

/* ===== 書類の作成・編集 ===== */
.ed-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; margin-right: 8px; } .ed-total b { font-size: 24px; color: var(--blue-d); } .ed-total .muted { font-size: 12px; }
.card h2 { margin: 0 0 12px; font-size: 18px; } .card.flush .cardhead h2 { margin: 0; }
.field.wide { grid-column: 1 / -1; } .req { font-style: normal; font-size: 10px; background: var(--org); color: #fff; border-radius: 3px; padding: 1px 5px; margin-left: 6px; }
.field textarea { width: 100%; }
.segc { display: inline-flex; border: 1.5px solid var(--blue); border-radius: 6px; overflow: hidden; } .segc button { border: 0; background: #fff; color: var(--blue); height: 40px; padding: 0 16px; cursor: pointer; font-weight: 600; } .segc button.on { background: var(--blue); color: #fff; }
.fold { border-top: 1px solid var(--line2); margin-top: 10px; padding-top: 10px; } .fold > summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--blue-d); padding: 4px 0 10px; } .fold[open] > summary { margin-bottom: 4px; }
.opts { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.note { background: var(--tint); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; } .note.warn { background: #FFF6EC; border-color: #FFD2A8; }
table.edl { width: 100%; border-collapse: collapse; font-size: 14px; } table.edl th { text-align: left; font-size: 12px; color: var(--soft); padding: 8px 6px; border-bottom: 1px solid var(--line); background: var(--bg); white-space: nowrap; } table.edl th.r { text-align: right; }
table.edl td { padding: 4px 4px; border-bottom: 1px solid var(--line3); vertical-align: middle; } table.edl td.no { text-align: center; color: var(--faint); width: 32px; }
table.edl td input[type=text], table.edl td select { width: 100%; height: 38px; min-height: 0; padding: 0 8px; } table.edl td.nm { min-width: 220px; } table.edl .code { min-width: 90px; } table.edl .r { text-align: right; } table.edl td.amt { padding-right: 10px; font-weight: 600; white-space: nowrap; }
table.edl tr.k-s td, table.edl tr.k-t td { background: #FAFBFD; } table.edl td.acts { white-space: nowrap; text-align: right; }
.ib { border: 0; background: none; color: var(--soft); width: 30px; height: 30px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; } .ib:hover:not(:disabled) { background: var(--tint); color: var(--blue-d); } .ib:disabled { opacity: .3; cursor: default; }
.edfoot { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 14px 20px; flex-wrap: wrap; }
.totbox { min-width: 300px; margin-left: auto; } .totbox .tr { display: flex; justify-content: space-between; gap: 24px; padding: 4px 0; font-size: 14px; } .totbox .tr.big { border-top: 2px solid var(--blue); margin-top: 4px; padding-top: 8px; font-size: 18px; font-weight: 700; color: var(--blue-d); }
.cardhead .check { margin-left: auto; }
.row2 { align-items: start; } .field select { width: 100%; }
table.edl td:nth-child(2) { min-width: 78px; width: 78px; } table.edl td select { padding: 0 2px 0 6px; }
.cardhead h2 + .muted { margin-left: 12px; margin-right: auto; }

/* ===== レイアウト刷新：グループ分けしたメニュー・新規作成・スマホの下タブ ===== */
.app { grid-template-columns: 248px minmax(0, 1fr); }
.side { padding: 18px 12px 12px; gap: 0; }
.brand { padding: 2px 8px 14px; }
.side nav { gap: 1px; overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 8px; scrollbar-width: thin; }
.side nav a { height: 38px; gap: 11px; font-size: 14px; padding: 0 10px; border-radius: 6px; }
.side nav a svg { width: 18px; height: 18px; opacity: .85; } .side nav a.on svg { opacity: 1; }
.side nav a .count { margin-left: auto; }
.newwrap { padding: 0 2px 12px; } .newmenu { position: relative; } .newmenu > .btn { width: 100%; justify-content: center; height: 44px; background: var(--org2); border-color: var(--org2); color: var(--ink); font-weight: 700; } .newmenu > .btn:hover { background: #F06A00; border-color: #F06A00; }
.newmenu .pop { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(20, 40, 80, .16); padding: 6px; } .newmenu.open .pop { display: grid; }
.newmenu .pop a { display: block; padding: 11px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; height: auto; } .newmenu .pop a:hover { background: var(--tint); color: var(--blue-d); }
.ngrp { margin-top: 12px; } .nhead { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 4px 10px; font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--faint); cursor: pointer; border-radius: 6px; } .nhead:hover { color: var(--blue-d); }
.nhead .chev { display: inline-flex; transition: transform .15s; } .ngrp.closed .chev { transform: rotate(-90deg); } .ngrp.closed .nitems { display: none; } .nitems { display: grid; gap: 1px; margin-top: 2px; }
.side nav a.navmenu { margin-top: 12px; color: var(--soft); font-size: 13px; }
.side .me { margin-top: 0; padding: 12px 10px 0; }
.view { max-width: 1240px; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding-bottom: 68px; }
  .side { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; flex-wrap: nowrap; align-items: center; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; } .burger { display: none; }
  .side nav, .side .me { display: none; }
  .side.open { position: fixed; inset: 0; height: 100vh; z-index: 60; flex-direction: column; align-items: stretch; flex-wrap: nowrap; overflow-y: auto; padding: 12px 14px 90px; }
  .side.open nav { display: flex; flex-direction: column; overflow: visible; } .side.open .me { display: block; }
  .side.open nav a { height: 46px; font-size: 15px; } .side.open .newwrap { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(20, 40, 80, .06); }
  .tabbar > a, .tabbar > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 52px; border: 0; background: none; color: var(--soft); font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 8px; cursor: pointer; }
  .tabbar > a.on { color: var(--blue-d); background: var(--tint); }
  .tabnew { display: flex; justify-content: center; align-items: center; } .tabnew > .btn { width: 52px; height: 52px; min-width: 0; padding: 0; border-radius: 50%; font-size: 0; gap: 0; margin-top: -18px; box-shadow: 0 6px 16px rgba(240, 106, 0, .4); }
  .tabnew .pop { left: 50%; right: auto; transform: translateX(-50%); top: auto; bottom: calc(100% + 12px); width: 220px; }
  .toast { bottom: 84px; }
}

/* ===== Sansan 風・明るい配色（上書き） =====
   方針：白と淡い青灰の面、紺の文字、アクセントは小さく。線より面と淡い影で区切る。 */
:root { --ink: #14284B; --soft: #5B6B85; --nav: #2B3F63; --faint: #8593AB; --bg: #F3F7FC; --tint: #E8F0FA; --line: #DCE6F3; --line2: #E7EEF8; --line3: #EDF2F9; --field: #C9D6E8; --r: 14px; --shadow: 0 1px 2px rgba(20,40,75,.04), 0 6px 20px rgba(20,40,75,.05); }
body { background: var(--bg); color: var(--ink); }
.side { background: #fff; border-right: 0; box-shadow: 1px 0 0 var(--line2), 6px 0 24px rgba(20,40,75,.03); }
.brand b { color: var(--ink); } .brand b::first-letter { color: var(--blue); }
.side nav a { border-radius: 10px; color: var(--nav); }
.side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--tint); color: var(--blue); }
.count { background: var(--org); }
.newmenu > .btn { height: 44px; border-radius: 999px; background: var(--tint); border-color: var(--tint); color: var(--blue); box-shadow: none; }
.newmenu > .btn:hover { background: #DCE8F7; border-color: #DCE8F7; color: var(--blue-d); }
.newmenu > .btn svg { color: var(--org2); }
.newwrap .pop, .newmenu .pop { border-radius: 14px; border: 0; box-shadow: 0 12px 36px rgba(20,40,75,.16); }

h1 { color: var(--ink); letter-spacing: .01em; }
.card, .tile, .pill { border-color: transparent; box-shadow: var(--shadow); }
.card { border-radius: var(--r); padding: 20px 24px; }
.card.flush { border-radius: var(--r); }
.card h2 { color: var(--ink); }

/* 件数タイル：青のベタ塗りをやめ、淡い面＋青い数字 */
.tile { border-radius: var(--r); background: #fff; transition: box-shadow .15s, transform .15s; }
.tile:hover { border-color: transparent; box-shadow: 0 2px 4px rgba(20,40,75,.05), 0 12px 28px rgba(42,104,188,.12); transform: translateY(-1px); }
.tile .t { color: var(--soft); font-weight: 600; font-size: 13px; }
.tile .n b { color: var(--blue); }
.tile.solid { background: linear-gradient(135deg, #DCE9F9, #EAF2FC); border-color: transparent; color: var(--ink); }
.tile.solid:hover { background: linear-gradient(135deg, #D2E3F7, #E3EEFB); }
.tile.solid .t { color: var(--blue-d); } .tile.solid .n b { color: var(--blue); }
.tile.warn { background: #FFF4EA; border-color: transparent; color: var(--warnfg); }
.tile.warn .t, .tile.warn .n b { color: #C2410C; }

/* 一覧：罫線を薄く、見出し行は淡い面 */
.listhead { background: var(--bg); border-bottom: 0; color: var(--soft); }
.lrow { border-bottom: 1px solid var(--line3); } .lrow:hover { background: #F6F9FE; }
.lrow .no { color: var(--faint); }

/* ボタン・チップ */
.btn { border-radius: 999px; height: 46px; padding: 0 24px; box-shadow: none; }
.btn.sm { height: 38px; padding: 0 16px; }
.btn.ghost { border-width: 1px; border-color: var(--field); color: var(--blue); background: #fff; }
.btn.ghost:hover { background: var(--tint); border-color: var(--tint); }
.btn.go { background: var(--org2); border-color: var(--org2); color: #fff; } .btn.go:hover { background: #F06A00; color: #fff; }
.chip { border-radius: 999px; border-color: var(--line); background: #fff; color: var(--nav); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* 入力欄：角丸・淡い枠 */
input:not([type=checkbox]):not([type=radio]), select, textarea { border-color: var(--field); border-radius: 10px; background: #fff; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42,104,188,.12); }

/* 表（書類の明細など） */
table thead th { background: var(--bg); color: var(--soft); border-bottom: 0; }

/* 状態・期限・種別：塗りつぶしを避け、淡い胶囊に */
.st, .due, .badge { border-radius: 999px; }
.st { border: 0; background: var(--tint); color: var(--blue); padding: 4px 12px; }
.st.new { background: var(--blue); color: #fff; }
.st.wait { background: #EEF2F8; color: var(--nav); } .st.done { background: transparent; color: var(--faint); }
.st.draft { background: #FFF1E6; color: #9A3412; border: 0; } .st.void { background: #EEF2F8; color: var(--faint); border: 0; }
.due { padding: 5px 12px; background: #EEF2F8; }
.due.late { background: #FDE3DB; color: #C2410C; } .due.today { background: #FFE9D6; color: #B45309; }
.badge { padding: 3px 12px; } .badge.high, .badge.over { background: #FDE3DB; color: #C2410C; } .badge.today { background: #FFE9D6; color: #B45309; }
.brand b::first-letter { color: inherit; }

@media (max-width: 860px) {
  .side { box-shadow: 0 1px 0 var(--line2); }
  .tabbar { border-top: 0; box-shadow: 0 -6px 24px rgba(20,40,75,.08); }
  .tabbar > a.on { background: var(--tint); color: var(--blue); border-radius: 12px; }
  .card { padding: 16px 16px; }
}
