:root {
  --ink: #23262b; --muted: #6b7078; --line: #e3e5e8; --bg: #f6f7f8; --card: #fff;
  --navy: #1f3864; --navy2: #2f5496; --accent: #b4532a; --ok: #2f7a4a; --warn: #c26a00; --err: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.6; }
header.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: var(--navy); color: #fff; }
body.admin header.top { background: #3a3f47; }
.brand { font-weight: 700; letter-spacing: .04em; }
.brand span { font-weight: 400; margin-left: 8px; opacity: .85; font-size: 14px; }
.logout { display: flex; gap: 12px; align-items: center; margin: 0; font-size: 13px; }
.logout .who { opacity: .85; }
button.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
nav.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs a { padding: 12px 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
nav.tabs a.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
main { max-width: 1440px; margin: 0 auto; padding: 24px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 32px 0; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
p.lead { color: var(--muted); margin-top: -8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.flash { background: #e8f3ec; border: 1px solid #b9dcc6; color: var(--ok); padding: 10px 14px; border-radius: 6px; }
.errors { background: #fdecea; border: 1px solid #f3c1bd; color: var(--err); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.errors p { margin: 2px 0; }
.note { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--navy); color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-wrap td:first-child { min-width: 150px; }
td.c, th.c { text-align: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], select, textarea {
  font: inherit; padding: 7px 9px; border: 1px solid #c9ccd1; border-radius: 6px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy2); outline-offset: 0; border-color: var(--navy2); }
textarea { min-height: 80px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; border-radius: 6px; padding: 10px 22px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.sub { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { background: var(--err); }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eceef1; color: var(--muted); white-space: nowrap; }
.badge.pending { background: #fff1de; color: var(--warn); }
.badge.accepted, .badge.scheduled { background: #e3ebf7; color: var(--navy2); }
.badge.shipped { background: #e8f3ec; color: var(--ok); }
.badge.cancelled { background: #eceef1; color: var(--muted); }
.badge.err { background: #fdecea; color: var(--err); }
.order-table td { padding: 6px 6px; }
.order-table input[type=date] { min-width: 128px; padding: 6px; }
.order-table td.price { white-space: nowrap; }
.order-table input.lot { width: 90px; }
.order-table input.memo { min-width: 120px; }
.order-table input.qty { width: 90px; text-align: right; }
.order-table td.name { min-width: 180px; }
.order-table .spec { color: var(--muted); font-size: 12px; }
.totals { margin-left: auto; max-width: 320px; }
.totals td { border: 0; padding: 4px 0; }
.totals tr.grand td { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); padding-top: 8px; }
.login { max-width: 400px; margin: 40px auto; }
dl.spec { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; margin: 0; }
dl.spec dt { color: var(--muted); font-size: 13px; }
dl.spec dd { margin: 0; }
.password-box { font-family: ui-monospace, Menlo, monospace; font-size: 18px; background: #fff7e6; border: 1px dashed var(--warn); padding: 10px 14px; border-radius: 6px; display: inline-block; }
@media (max-width: 640px) {
  header.top, nav.tabs { padding-left: 16px; padding-right: 16px; }
  main { padding: 16px; }
  dl.spec { grid-template-columns: 1fr; }
  .brand span, .logout .who { display: none; }
}

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 20px; }
.field.wide { grid-column: 1 / -1; }
.req { display: inline-block; font-size: 11px; color: #fff; background: var(--accent); border-radius: 3px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; margin: 6px 12px 0 0; cursor: pointer; }
label.inline input { width: auto; }
ol.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
ol.steps li { padding: 6px 14px; border-radius: 999px; background: #eceef1; color: var(--muted); font-size: 13px; }
ol.steps li.on { background: var(--navy); color: #fff; font-weight: 600; }
ol.steps li.done { background: #e3ebf7; color: var(--navy2); }
details.specbox { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
details.specbox summary { cursor: pointer; color: var(--navy2); font-size: 13px; }
details.specbox dl { margin-top: 10px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare .changed { background: #fff6e0; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }

ul.files { list-style: none; padding: 0; margin: 6px 0 0; }
ul.files li { padding: 4px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hidden-form { display: none; }
button.danger-link { color: var(--err); font-size: 13px; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-row select { width: auto; }
.upload-row input[type=file] { border: 1px dashed #c9ccd1; padding: 8px; border-radius: 6px; background: #fafbfc; flex: 1; min-width: 240px; }
details.addfile { display: inline-block; }
details.addfile[open] { display: block; width: 100%; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfc; }
details.addfile summary { list-style: none; }
details.addfile summary::-webkit-details-marker { display: none; }

.card h3 { font-size: 13px; color: var(--navy2); margin: 14px 0 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.card h2 + h3 { border-top: 0; padding-top: 0; }
.arrival { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.arrival input[type=date] { width: auto; flex: 1; min-width: 130px; }
.arrival select { width: auto; }

.card.together { background: #f4f7fc; border-color: #c9d6ec; }

.card.materials { background: #fbfaf6; border-color: #e6dfc8; }
.material { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.material.spare { opacity: .75; }
.mtitle { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
p.groupsum { background: #f4f7fc; border: 1px solid #c9d6ec; border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.card.change { border-color: #e2b26b; background: #fffaf1; }
.compare li.changed { background: #fff0cc; }

.notice { background: #fff4e0; border: 1px solid #f0c27a; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.notice ul { margin: 6px 0; padding-left: 20px; }
.notice form { display: flex; gap: 12px; align-items: center; margin: 0; }
details.guide summary { cursor: pointer; color: var(--navy2); }
details.guide table { margin-top: 10px; }
details.guide th { background: #eef2f8; color: var(--ink); }
