:root{
  --bg:#fff; --fg:#222; --mut:#777; --line:#ccc; --acc2:#2f6bd8;
  --side:#17418f; --ln:#e3e8f0; --mut2:#8a93a3;
}
*{box-sizing:border-box}
body { font-family: "Yu Gothic", "Meiryo", sans-serif; margin: 0; color: var(--fg); background: var(--bg); }
main { max-width: 900px; margin: 1.5rem auto; padding: 0 1.5rem; }
h1 { font-size: 1.4rem; }
table.grid { border-collapse: collapse; width: 100%; margin: .8rem 0; }
table.grid th, table.grid td { border: 1px solid #ccc; padding: .4rem .6rem; text-align: left; }
table.grid th { background: #f2f4f6; }
table.grid td.num, table.grid th.num { text-align: right; }
.form-row { margin-bottom: .7rem; }
.form-row label { display: inline-block; width: 7rem; }
input[type=text], input[type=date], input[type=number], select, textarea {
  padding: .3rem .5rem; border: 1px solid #bbb; border-radius: 3px;
}
button, .btn {
  background: var(--acc2); color: #fff; border: none; padding: .5rem 1rem;
  border-radius: 4px; cursor: pointer; font-size: .95rem; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { opacity: .88; }
.btn.ghost { background: #fff; color: var(--acc2); border: 1px solid var(--acc2); }
.hint { color: var(--mut); font-size: .85rem; }
.print-only { display: none; }
@media print {
  nav, .no-print { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; margin: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── パンくず（他システム＝hanbai-web等と共通の視覚言語） ── */
.crumb{display:flex;gap:9px;align-items:center;flex-wrap:wrap;
 max-width:900px;margin:0 auto;padding:14px 1.5rem 10px;border-bottom:1px solid var(--ln);
 font-size:12.5px;color:var(--mut2)}
.crumb a{display:inline-flex;align-items:center;gap:6px;color:var(--acc2);text-decoration:none;
 font-weight:700;padding:4px 12px;border:1px solid var(--ln);border-radius:99px;line-height:1.5}
.crumb a:hover{border-color:var(--acc2);background:rgba(47,107,216,.06)}
.crumb b{color:var(--fg);font-size:13px}
.crumb .sep{color:var(--mut2)}
.badge{display:inline-block;padding:1px 8px;border-radius:99px;font-size:11px;border:1px solid var(--line);color:var(--mut)}
.b-entry{border-color:var(--acc2);color:var(--acc2)}
.b-master{border-color:#8a63d2;color:#8a63d2}
.b-inquiry{border-color:#0a7d32;color:#0a7d32}
.b-report{border-color:#c77d00;color:#c77d00}
.b-opt{border-color:var(--mut);color:var(--mut)}

/* ── ホーム（ポータル） ── */
.layout{display:flex;min-height:100vh}
.side{flex:0 0 218px;width:218px;background:var(--side);color:#fff;
 position:sticky;top:0;height:100vh;overflow-y:auto;
 padding:16px 10px 20px;display:flex;flex-direction:column;gap:16px}
.s-brand{display:flex;align-items:center;gap:10px;padding:0 8px}
.s-mark{width:32px;height:32px;border-radius:8px;background:rgba(255,255,255,.16);color:#fff;
 display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.s-name{font-weight:700;font-size:15px;line-height:1.3;letter-spacing:.02em}
.s-sub{display:block;font-size:10px;color:rgba(255,255,255,.62);font-weight:500;letter-spacing:.02em}
.s-nav{display:flex;flex-direction:column;gap:2px}
.nav-i{display:flex;align-items:center;gap:9px;width:100%;text-align:left;
 background:transparent;border:0;color:rgba(255,255,255,.85);font:inherit;font-size:13px;
 padding:8px 11px;border-radius:8px;cursor:pointer;line-height:1.5;text-decoration:none}
.nav-i svg{flex:0 0 auto;opacity:.9}
.nav-i:hover{background:rgba(255,255,255,.10)}
.nav-i.active{background:#fff;color:var(--side);font-weight:700}
.nav-i.active svg{opacity:1}
.nav-i .badge{margin-left:auto;border-color:rgba(255,255,255,.4);color:rgba(255,255,255,.85)}
.nav-i.active .badge{border-color:var(--mut);color:var(--mut)}

.main{flex:1;min-width:0}
.content{padding:28px 30px 64px;max-width:1000px}
.content .lead{color:var(--mut2);font-size:13px;margin:4px 0 22px}

.flow{margin:2px 0 26px}
.flow[data-flow=sell]{--fc:#2f6bd8;--fcs:rgba(47,107,216,.09)}
.flow[data-flow=cash]{--fc:#b7791f;--fcs:rgba(183,121,31,.10)}
.flow-t{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;color:var(--fg);
 border:0;padding:0;margin:0 0 10px}
.flow-t .dot{width:9px;height:9px;border-radius:99px;background:var(--fc)}
.flow-n{font-size:11.5px;color:var(--mut2);font-weight:500;margin-left:2px}
.cards{display:flex;align-items:stretch;gap:6px;overflow-x:auto;padding:2px 2px 6px}
.nx{align-self:center;color:var(--mut2);opacity:.55;flex:0 0 auto}
.card{flex:1 1 150px;min-width:150px;max-width:230px;display:flex;flex-direction:column;gap:5px;position:relative;
 padding:15px 16px 13px;border:1px solid var(--ln);border-radius:12px;background:var(--bg);
 color:var(--fg);text-decoration:none;
 box-shadow:0 1px 2px rgba(16,24,40,.05);transition:border-color .15s,box-shadow .15s,transform .15s}
.card:hover{border-color:var(--fc);box-shadow:0 4px 14px rgba(16,24,40,.10);transform:translateY(-1px)}
.card:focus-visible{outline:2px solid var(--fc);outline-offset:2px}
.ico{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;
 color:var(--fc);background:var(--fcs)}
.step{position:absolute;top:14px;right:14px;width:19px;height:19px;font-size:10.5px;color:var(--mut2);
 border:1px solid var(--ln);border-radius:99px;display:flex;align-items:center;justify-content:center;
 font-variant-numeric:tabular-nums}
.card-l{font-size:14.5px;font-weight:700;margin-top:3px}
.card-c{font-size:11.5px;color:var(--mut2);line-height:1.55}

@media(max-width:780px){
 .layout{flex-direction:column}
 .side{position:static;width:auto;height:auto;flex-direction:column;padding:12px 10px}
 .s-nav{flex-direction:row;overflow-x:auto;gap:4px;padding-bottom:2px}
 .nav-i{white-space:nowrap;flex:0 0 auto}
 .s-sub{display:none}
 .content{padding:18px 14px 48px}
 .cards{flex-wrap:wrap;overflow:visible}
 .card{flex:1 1 44%;max-width:none}
 .nx{display:none}
}
@media(prefers-reduced-motion:reduce){.card{transition:none}.card:hover{transform:none}}

/* ── ログイン・お知らせ・帳票の追加部品（マル運送版） ── */
.login-wrap{display:flex;align-items:center;justify-content:center;min-height:100vh;background:#f4f6fa}
.login-card{background:#fff;border:1px solid var(--ln);border-radius:10px;padding:28px 28px 24px;width:min(360px,92vw)}
.login-card h1{font-size:1.15rem;margin:0 0 6px}
.login-card .fld{margin-bottom:12px}
.login-card .fld label{display:block;font-size:.85rem;margin-bottom:4px}
.login-card .fld input{width:100%}
.flash{padding:.55rem .8rem;border-radius:4px;margin:.6rem 0;font-size:.9rem}
.flash.ng{background:#fdecea;color:#a12a1f;border:1px solid #f3b9b3}
.flash.ok{background:#e8f5ec;color:#1f6b3a;border:1px solid #b6dfc3}
.crumb .out{margin-left:auto}
.crumb .who{font-size:12.5px;color:var(--mut2)}
.crumb .who + a{margin-left:0}
.hakkosha{text-align:right;font-size:.85rem;line-height:1.6;margin:.2rem 0 .8rem}
.hakkosha b{font-size:1rem}
table.zei{width:auto;margin-left:auto;border-collapse:collapse;margin-top:.4rem}
table.zei th,table.zei td{border:1px solid #ccc;padding:.3rem .8rem}
table.zei th{background:#f2f4f6;text-align:left;font-weight:normal}
table.zei td{text-align:right}
.anken{font-size:.9rem;margin:.4rem 0}
.anken span{margin-right:1.2rem;white-space:nowrap}
.nbox{border:1px solid #ddd;border-radius:4px;padding:.4rem .8rem;margin:.6rem 0;background:#fafbfc}

.kv th{white-space:nowrap}
.kv td{min-width:6rem}

/* 業務フロー図（templates/_flowchart.html ← scripts/gen_flowchart.py） */
.flowwrap{overflow-x:auto;margin:14px 0 6px;border:1px solid var(--ln);border-radius:10px;background:#fff}
.flowchart{display:block;min-width:820px;width:100%;height:auto;font-family:inherit}
.flowchart .fc-lane.l0{fill:#f7f8fb}.flowchart .fc-lane.l1{fill:#fff}.flowchart .fc-lane.l2{fill:#f7f8fb}
.flowchart .fc-div{stroke:var(--ln);stroke-width:1}
.flowchart .fc-ln{font-size:17px;font-weight:700;fill:var(--fg)}
.flowchart .fc-lns{font-size:12px;fill:var(--mut2)}
.flowchart .fc-b{stroke-width:1.5}
.flowchart .fc-b.sell{fill:rgba(47,107,216,.09);stroke:#2f6bd8}
.flowchart .fc-b.cash{fill:rgba(183,121,31,.11);stroke:#b7791f}
.flowchart .fc-n.sell{fill:#2f6bd8}.flowchart .fc-n.cash{fill:#b7791f}
.flowchart .fc-nt{font-size:13px;font-weight:700;fill:#fff}
.flowchart .fc-t{font-size:16px;font-weight:700;fill:var(--fg)}
.flowchart .fc-s{font-size:13px;fill:#555}
.flowchart .fc-c{fill:#fff;stroke:#9aa3b2;stroke-width:1.2;stroke-dasharray:5 4}
.flowchart .fc-ct{font-size:14px;font-weight:700;fill:#444}
.flowchart .fc-cs{font-size:12.5px;fill:#666}
.flowchart .fc-lb{font-size:12.5px;fill:#555}
.flowchart .fc-ar{fill:none;stroke:#6b7385;stroke-width:1.8}
.flowchart .fc-ar.dash{stroke-dasharray:5 4;stroke:#9aa3b2}
.flowchart .fc-ah{fill:#6b7385}
.flowchart a{cursor:pointer}
.flowchart a:hover .fc-b{stroke-width:2.6}
.flowchart a:focus-visible .fc-b{stroke-width:3}
