:root {
  --bg: #f5f1ea;
  --card: #ffffff;
  --border: #e2ddd1;
  --ink: #2b2620;
  --muted: #8a8276;
  --accent: #1e1b17;
  --green: #2e6b3e;
  --red: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
header {
  background: var(--accent);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
header h1 { margin: 0; font-size: 18px; }
header .user-box { font-size: 13px; color: #d8d2c4; display: flex; gap: 10px; align-items: center; }
main { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.btn.outline { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.name-btn {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}
input[type=text], input[type=password], input[type=date], input[type=number], select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
label.field-label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.field-block { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 140px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}
.tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.msg { font-size: 13px; margin-top: 10px; }
.msg.err { color: var(--red); font-weight: 700; }
.msg.ok { color: var(--green); font-weight: 700; }
.canceled-row { opacity: .55; }
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  max-width: 720px;
  width: 100%;
}
.modal-box h2 { margin-top: 0; font-size: 16px; }
.note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.undecided { color: #8a6d2f; font-weight: 700; }
.pagination { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pagination button { padding: 6px 10px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; }
.pagination button.active { background: var(--accent); color: #fff; }
