:root {
  --bg: #faf6f4; --card: #fff; --ink: #2b2523; --sub: #7a6e6a; --line: #ece3df;
  --accent: #b5657a; --accent-soft: #f6e6ea; --red: #c0392b; --red-soft: #fdecea;
  --yellow: #a86b00; --yellow-soft: #fff5e0; --ok: #2e7d4f; --ok-soft: #e7f5ec;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 16px; line-height: 1.6; padding-bottom: 80px;
}
header { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; align-items: center; position: sticky; top: 0; z-index: 5; }
header .brand { font-weight: 700; flex: 1; }
header .brand small { color: var(--sub); font-weight: 400; margin-left: 6px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav a { flex: 1; text-align: center; padding: 10px 0; color: var(--sub); text-decoration: none; font-size: 13px; }
nav a.on { color: var(--accent); font-weight: 700; }
nav a b { display: block; font-size: 15px; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  nav { position: sticky; top: 53px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; }
  nav a { flex: 0 0 120px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
}
main > *, .grid2 > * { min-width: 0; }
.card { overflow-x: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.grid2 { display: grid; gap: 14px; }
.muted { color: var(--sub); font-size: 13px; }
.big { font-size: 34px; font-weight: 700; letter-spacing: .5px; }
.goal { background: linear-gradient(135deg, #b5657a, #d48a9b); color: #fff; border: 0; }
.goal .muted { color: #fbe9ee; }
.bar { height: 10px; background: rgba(255,255,255,.35); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: #fff; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.kpi .v { font-size: 22px; font-weight: 700; }
.up { color: var(--ok); } .down { color: var(--red); }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=url], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; color: var(--ink);
}
textarea { min-height: 90px; }
.seg { display: flex; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 11px 4px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; cursor: pointer; background: #fff; }
.seg label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { display: inline-block; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
.btn.sub { background: #fff; color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.wide { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.err { color: var(--red); font-size: 13px; margin-top: 4px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
.task .t { font-weight: 700; width: 46px; flex: none; color: var(--accent); }
.task .body { flex: 1; }
.task .hint { font-size: 12px; color: var(--sub); }
.task button { flex: none; min-width: 72px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; margin-left: 4px; }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.yellow { background: var(--yellow-soft); color: var(--yellow); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.new { background: var(--accent-soft); color: var(--accent); }
.alert { padding: 10px 12px; border-radius: 10px; margin-top: 8px; font-size: 14px; }
.alert.red { background: var(--red-soft); color: var(--red); }
.alert.yellow { background: var(--yellow-soft); color: var(--yellow); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.rec { padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.rec:first-child { border-top: 0; }
.rec .row { display: flex; justify-content: space-between; gap: 8px; }
.rec .note { font-size: 13px; color: var(--sub); white-space: pre-wrap; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
.scroll { overflow-x: auto; }
.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-flex > * { flex: 1; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10; }
#toast.show { opacity: 1; }
[hidden] { display: none !important; }
select.inline { width: auto; padding: 6px 8px; font-size: 14px; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap label { flex: 1 1 30%; }
.rec.canceled { opacity: .6; }
.rec.canceled b { text-decoration: line-through; }
.past { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 14px; display: grid; gap: 6px; }
.rules h3 { font-size: 15px; margin: 14px 0 4px; }
.rules ul { margin: 0; padding-left: 1.2em; }
.rules td, .rules th { white-space: normal; text-align: left; }
.login { max-width: 420px; margin: 40px auto; }
dialog.ask { border: 0; border-radius: var(--radius); padding: 20px; width: min(92vw, 420px); color: var(--ink); }
dialog.ask::backdrop { background: rgba(0, 0, 0, .45); }
dialog.ask p { margin: 0 0 14px; }
dialog.ask textarea { margin-bottom: 14px; min-height: 70px; }
.row-flex > .btn { flex: 1; }
table.daily tr.sum td { font-weight: 700; background: var(--accent-soft); }
tr.zero td { color: var(--sub); }

/* 月次実績レポート（A4） */
.report { background: #fff; color: #222; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 12px; overflow-x: auto; }
.report h3 { font-size: 12px; margin: 10px 0 4px; border-left: 3px solid var(--accent); padding-left: 6px; }
.report table { font-size: 11px; }
.report th, .report td { padding: 3px 4px; }
.report ol { margin: 0; padding-left: 1.4em; }
.report li { margin-bottom: 3px; }
.rhead { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid var(--accent); padding-bottom: 6px; font-size: 14px; }
.rkpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.rkpis > div { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: grid; }
.rkpis span, .rkpis small { color: var(--sub); font-size: 11px; }
.rkpis b { font-size: 18px; }
.rbody { display: grid; gap: 12px; }
.rcols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (min-width: 700px) {
  .rkpis { grid-template-columns: repeat(4, 1fr); }
  .rbody { grid-template-columns: 1.15fr 1fr; }
}
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  header, nav, #toast, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  main { padding: 0; max-width: none; display: block; }
  .report { border: 0; padding: 0; font-size: 9pt; overflow: visible; }
  .report table { font-size: 8pt; }
  .report th, .report td { padding: 1px 3px; }
  .rkpis { grid-template-columns: repeat(4, 1fr); }
  .rbody { grid-template-columns: 1.15fr 1fr; }
  .rkpis b { font-size: 14pt; }
}
.login .btn { width: 100%; margin-top: 10px; }
