:root {
  --accent: #e27f43;
  --red: #c83d35;
  --yellow: #e0b451;
  --text: #222;
  --muted: #777;
  --line: #e5e5e5;
  --bg: #f7f7f5;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
nav { margin-left: auto; display: flex; gap: 4px; }
nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
nav a.on { background: var(--bg); color: var(--text); font-weight: 600; }
main { max-width: 860px; margin: 0 auto; padding: 16px 16px 96px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.big { font-size: 28px; font-weight: 700; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
button, .btn {
  font: inherit; border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 10px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.danger { color: var(--red); }
button.small, .btn.small { padding: 4px 8px; font-size: 13px; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
form.stack { display: grid; gap: 8px; }
label { font-size: 14px; color: var(--muted); display: grid; gap: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.scroll { overflow-x: auto; }
.tag { font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--bg); white-space: nowrap; }
.tag.pending { background: #fff4e0; }
.tag.approved { background: #e8f5e9; }
.tag.rejected, .tag.cancelled { background: #fdecea; }
.warn { background: #fff4e0; border-color: var(--yellow); }
.alert { background: #fdecea; border-color: var(--red); }
.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal > div { min-height: 72px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; overflow: hidden; }
.cal .dow { min-height: 0; text-align: center; color: var(--muted); }
.cal .other { background: var(--bg); color: #bbb; }
.cal .today { outline: 2px solid var(--accent); outline-offset: -2px; }
.ev { display: block; margin-top: 2px; padding: 1px 4px; border-radius: 4px; background: #fdf0e7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; text-align: left; font-size: 12px; }
.ev.leave { background: #fbf3df; }
.agenda { display: none; margin: 12px 0 0; padding-left: 18px; }
.agenda li { margin: 4px 0; }
.qr svg { width: 260px; height: 260px; }

@media (max-width: 640px) {
  nav {
    position: fixed; bottom: 0; left: 0; right: 0; margin: 0; justify-content: space-around;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  nav a { font-size: 14px; }
  .cal > div { min-height: 56px; }
  .ev { white-space: normal; word-break: break-all; font-size: 11px; line-height: 1.2; }
  .cal .ev { font-size: 0; height: 5px; padding: 0; background: var(--accent); }
  .agenda { display: block; }
}
@media print {
  header, .noprint { display: none !important; }
  .card { border: 0; }
}
