:root {
  --green: #173f35; --green2: #245a4b; --bg: #e8ece7; --card: #fff; --line: #e3e7e2;
  --text: #1d2a25; --muted: #6b7a73; --warn: #b7791f; --warnbg: #fdf3dc; --ok: #2f7a55; --okbg: #e3f3ea; --danger: #c0392b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar .btns { display: flex; gap: 8px; flex-wrap: wrap; }
body { margin: 0; display: flex; min-height: 100vh; font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; color: var(--text); background: var(--bg); }
.side { width: 220px; background: var(--green); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; flex-shrink: 0; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand small { display: block; opacity: .7; font-size: 11px; }
.logo { background: #f0a020; color: var(--green); font-weight: 700; border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a { color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
nav a.active { background: var(--green2); font-weight: 700; }
.side-note { margin-top: auto; font-size: 11px; opacity: .75; border: 1px solid #ffffff33; border-radius: 8px; padding: 10px; }
main { flex: 1; padding: 20px 28px 60px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.top h1 { margin: 0; font-size: 22px; }
.role { font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.role small { color: var(--muted); }
.card { background: var(--card); border: 1.5px solid #8a978f; border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 2fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
.muted { color: var(--muted); font-size: 13px; }
.big { font-size: 24px; font-weight: 700; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.b-review { background: var(--warnbg); color: var(--warn); } .b-ok { background: var(--okbg); color: var(--ok); }
button, .btn { font: inherit; font-size: 13px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; color: var(--text); text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; font-size: 13px; border: 1px solid #7d8a82; border-radius: 6px; padding: 6px 8px; background: #fff; width: 100%; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px; border-bottom: 1px solid var(--line); }
td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; white-space: nowrap; }
.lines td input, .lines td select { min-width: 60px; }
.drop { border: 2px dashed #7d8a82; border-radius: 12px; padding: 30px; text-align: center; }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.recent .card { margin: 0; display: flex; justify-content: space-between; gap: 8px; }
.save-state { font-size: 12px; color: var(--muted); }
.notice { background: #eef6f1; border: 1px solid #cfe5d8; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.warnbox { background: var(--warnbg); border: 1px solid #f0dca8; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.photo img { max-width: 100%; max-height: 420px; border-radius: 8px; border: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.list-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.list-item.active, .list-item:hover { background: #eef3ef; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; }
#toast.err { background: var(--danger); }
.total { font-size: 20px; font-weight: 700; }
@media (max-width: 800px) {
  body { flex-direction: column; } .side { width: auto; } .g2, .g3, .split { grid-template-columns: 1fr; }
  .lines { display: block; overflow-x: auto; }
}
/* 商品マスターの「業者ごと」表示の見出し行（商品の行と見分けやすく） */
tr.group-head td { background: var(--green); color: #fff; font-weight: 700; font-size: 15px; padding: 9px 12px; border-bottom: none; }
tr.group-head:not(:first-child) td { border-top: 14px solid #fff; }

/* ログイン画面・ログアウト・確認した人の選択 */
.login-page { align-items: center; justify-content: center; }
.login-box { flex: 0 1 380px; background: var(--card); border: 1.5px solid #8a978f; border-radius: 12px; padding: 28px; }
.login-box .brand { margin-bottom: 20px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-err { color: var(--danger); font-size: 13px; margin: 0; }
#logout { margin-left: 12px; }
.checker { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
