:root {
  --bg: #f5f6f8; --card: #fff; --line: #dde1e7; --text: #1f2933; --muted: #6b7682;
  --brand: #1d5fa8; --ok: #1f7a3d; --ok-bg: #e6f4ea; --ng: #b42318; --ng-bg: #fdecea; --warn: #8a5a00; --warn-bg: #fff4d6;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
header { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 20px 0; position: sticky; top: 0; z-index: 5; }
h1 { font-size: 18px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
h1 small { align-self: flex-end; margin-bottom: 4px; }
h1 img.logo { height: 44px; width: auto; }
h1 small { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 8px; }
nav button { background: none; border: none; border-bottom: 3px solid transparent; padding: 8px 14px; font: inherit; cursor: pointer; color: var(--muted); }
nav button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: bold; }
main { padding: 18px 20px 60px; max-width: 1500px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); font-size: 12px; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
th { background: #f0f3f7; font-weight: 600; font-size: 12px; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: bold; background: #f7f9fb; }
.scroll { overflow: auto; max-height: 70vh; }
input, select, textarea { font: inherit; padding: 5px 7px; border: 1px solid #c5ccd5; border-radius: 5px; background: #fff; }
input.num { text-align: right; width: 110px; }
input.cell { width: 92px; text-align: right; padding: 3px 5px; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
a.btn.primary { color: #fff; }
.btn { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid #c5ccd5; background: #fff; cursor: pointer; }
.btn:hover { background: #f0f3f7; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: #164d8a; }
.btn.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.alert { background: var(--ng-bg); color: var(--ng); }
.badge.missing { background: var(--warn-bg); color: var(--warn); }
nav { display: flex; }
nav button.minor { margin-left: auto; font-size: 12px; }
.searchbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.searchbar .presets { display: flex; gap: 4px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0 8px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fafbfc; }
.tile .tl { font-size: 12px; color: var(--muted); }
.tile .tv { font-size: 22px; font-weight: bold; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile .tv small { font-size: 12px; font-weight: normal; color: var(--muted); margin-left: 2px; }
.tile.sys { border-top: 3px solid var(--brand); }
.tile.cost { border-top: 3px solid #b26b00; }
.tile.profit { border-top: 3px solid var(--ok); }
.mtable th.sys, .mtable td.sys { background: #f2f6fc; }
.mtable th.cost, .mtable td.cost { background: #fdf7ee; }
.mtable th.profit, .mtable td.profit { background: #f1f8f3; font-weight: 600; }
.mtable tr.sel td { outline: 2px solid var(--brand); outline-offset: -2px; }
details > summary { list-style: none; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }
ul.zure { margin: 6px 0 10px 18px; padding: 0; }
ul.zure li { margin: 2px 0; }
ul.zure li b { color: var(--ng); }
.plus { color: var(--ok); } .minus { color: var(--ng); }
tr.alert td { background: #fff7f6; }
.big { font-size: 22px; font-weight: bold; }
.log { background: #111827; color: #d1fae5; font-family: Consolas, monospace; font-size: 12px; padding: 10px; border-radius: 6px; white-space: pre-wrap; max-height: 220px; overflow: auto; margin-top: 10px; }
#toast { position: fixed; bottom: 20px; right: 20px; background: #1f2933; color: #fff; padding: 10px 16px; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 480px; }
#toast.show { opacity: .95; }
#toast.err { background: var(--ng); }
.src-crevation { color: var(--brand); } .src-manual { color: #8a5a00; } .src-csv { color: #6b21a8; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.note { background: var(--warn-bg); border: 1px solid #f0d58c; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
