:root {
  --ink: #333; --sub: #757575; --blue: #347eec; --link: #006699; --pale: #e6eef6;
  --yellow: #fcc800; --cream: #fcf1d8; --dark: #404040; --line: #dcdcdc;
  --bg: #f5f7fa; --card: #fff; --red: #d92b2b; --green: #2e8b57;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 15px; line-height: 1.6;
}
a { color: var(--link); }
h1 { font-size: 22px; margin: 0 0 4px; display: inline-block; border-bottom: 3px solid var(--yellow); padding-bottom: 4px; }
.sub { color: var(--sub); font-size: 13px; margin: 8px 0 18px; }
.loading { color: var(--sub); padding: 20px; }
.error { color: var(--red); font-size: 13px; min-height: 1em; margin: 6px 0; }

/* ボタン */
.btn {
  display: inline-block; border: 0; border-radius: 50px; background: var(--yellow); color: var(--ink);
  font: inherit; font-weight: 700; padding: 10px 22px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sec { background: #fff; color: var(--dark); border: 1px solid var(--dark); }
.btn.small { padding: 4px 14px; font-size: 13px; }
.btn.wide { width: 100%; padding: 14px; font-size: 16px; }
.icon-btn { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--sub); }

/* ログイン */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; border-top: 4px solid var(--blue); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px 24px; text-align: center; }
.login-card .company { color: var(--sub); font-size: 13px; margin: 0 0 4px; }
.login-card h1 { margin-bottom: 24px; }
.login-form { text-align: left; }
.login-card .note { color: var(--sub); font-size: 12px; margin: 20px 0 0; }

/* 入力欄 */
.field { display: block; margin-bottom: 14px; }
.field .lbl { display: block; font-size: 13px; color: var(--sub); margin-bottom: 4px; }
.field .req { color: var(--red); font-size: 11px; }
.field .hint { display: block; font-size: 11px; color: var(--sub); margin-top: 2px; }
.field input:not([type=checkbox]), .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.field.check { display: flex; align-items: center; gap: 6px; }
.field.check input { width: 20px; height: 20px; }

/* 全体の枠 */
.top {
  background: #fff; border-top: 4px solid var(--blue); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; gap: 10px; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 16px; }
.who { font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role { background: var(--pale); color: var(--link); border-radius: 20px; padding: 2px 10px; font-weight: 700; font-size: 12px; }
.body { display: flex; min-height: calc(100vh - 60px); }
.side { width: 210px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 10px 0; }
.side .group { font-size: 11px; color: var(--sub); padding: 14px 20px 4px; letter-spacing: .05em; }
.side a { display: flex; justify-content: space-between; align-items: center; padding: 9px 20px; color: var(--ink); text-decoration: none; font-size: 14px; border-left: 4px solid transparent; }
.side a:hover { background: #f3f6fa; }
.side a.on { background: var(--pale); color: var(--link); font-weight: 700; border-left-color: var(--blue); }
.side a.soon { color: #aaa; }
.side small, .tile small { font-size: 10px; color: #aaa; font-weight: 400; }
.main { flex: 1; min-width: 0; padding: 24px 30px 40px; }

/* ホームのタイル */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; color: var(--ink); text-decoration: none; font-weight: 700; }
.tile:hover { border-color: var(--blue); }
.tile.soon { color: #aaa; }

/* 一覧の表 */
.title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.title-row > div { max-width: 760px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { background: var(--pale); text-align: left; padding: 10px; white-space: nowrap; font-size: 13px; }
table.grid td { padding: 10px; border-top: 1px solid #eee; }
table.grid .r { text-align: right; }
table.grid tr.inactive td { color: #aaa; }
table.grid td.empty { text-align: center; color: var(--sub); padding: 30px; }

/* 入力画面（モーダル） */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* お知らせ */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--dark); color: #fff; padding: 10px 20px; border-radius: 50px; font-size: 14px; z-index: 60; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ng { background: var(--red); }

/* スマホ */
@media (max-width: 760px) {
  .body { flex-direction: column; }
  .side { width: auto; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0; }
  .side .group { display: none; }
  .side a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; padding: 12px 14px; gap: 4px; }
  .side a.on { border-bottom-color: var(--blue); }
  .main { padding: 18px 16px 40px; }
  .top { padding: 10px 16px; }
}
