:root {
  --bg: #F2F5F0;
  --surface: #FFFFFF;
  --ink: #262521;
  --ink-muted: #6B6A62;
  --pine: #2F5D50;
  --pine-dark: #234840;
  --pine-soft: #E4ECE6;
  --amber: #B5762E;
  --amber-soft: #F6EEDD;
  --rust: #A6503A;
  --rust-soft: #F3E4DF;
  --line: #DEDACD;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 8px;
}
.brand { font-weight: 700; font-size: 18px; color: var(--pine-dark); text-decoration: none; }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
}
.topbar nav a:hover, .nav-logout:hover { background: var(--pine-soft); color: var(--pine-dark); }
.nav-logout {
  background: none; border: none; cursor: pointer;
  color: var(--ink-muted); font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 6px;
}

.page { max-width: 640px; margin: 0 auto; padding: 24px 20px 60px; }

.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.msg { padding: 10px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 8px; }
.msg-success { background: var(--pine-soft); color: var(--pine-dark); }
.msg-error { background: var(--rust-soft); color: var(--rust); }
.msg-warning { background: var(--amber-soft); color: var(--amber); }

h1 { font-size: 21px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 30px 0 12px; }
.sub { color: var(--ink-muted); font-size: 14px; margin: 0 0 22px; }

.stat-hero { border-left: 3px solid var(--pine); padding: 2px 0 2px 16px; margin-bottom: 22px; }
.stat-hero .value { font-size: 40px; font-weight: 700; color: var(--pine-dark); line-height: 1.15; }
.stat-hero .label { color: var(--ink-muted); font-size: 14px; }

.stat-row { display: flex; gap: 28px; margin-bottom: 26px; flex-wrap: wrap; }
.stat-row .value { font-size: 21px; font-weight: 700; }
.stat-row .label { font-size: 13px; color: var(--ink-muted); }

.actions { display: flex; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--pine-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--pine); }
.btn-block { width: 100%; text-align: center; }

.btn-text, .btn-danger-text {
  background: none; border: none; font: inherit; cursor: pointer; padding: 10px 6px; text-decoration: none;
}
.btn-text { color: var(--pine-dark); }
.btn-danger-text { color: var(--rust); }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap;
}
.list-row:last-child { border-bottom: none; }
.list-row .info strong { font-size: 15px; margin-right: 6px; }
.list-row .info .meta { color: var(--ink-muted); font-size: 13px; margin-top: 3px; }
.list-row .row-actions { display: flex; gap: 2px; align-items: center; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-on { background: var(--pine-soft); color: var(--pine-dark); }
.badge-off { background: #EDEBE4; color: var(--ink-muted); }
.text-warn { color: var(--rust); font-weight: 500; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field-error { color: var(--rust); font-size: 12px; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row label { margin-bottom: 0; }

input[type=text], input[type=number], input[type=time], input[type=tel], .input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}
input:focus { outline: 2px solid var(--pine); outline-offset: 1px; border-color: var(--pine); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--pine); }
.help { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

table.check-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
table.check-table th {
  text-align: left; font-size: 13px; color: var(--ink-muted); font-weight: 500;
  padding: 8px 4px; border-bottom: 1px solid var(--line);
}
table.check-table td { padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }

.vehicle-card {
  border: 1px solid var(--line); border-left: 3px solid var(--pine); border-radius: 6px;
  padding: 14px 16px; margin-bottom: 14px; background: var(--surface);
}
.vehicle-card h3 { margin: 0 0 4px; font-size: 15px; }
.vehicle-card .meta { color: var(--ink-muted); font-size: 13px; margin-bottom: 8px; }
.vehicle-card ol { margin: 0; padding-left: 20px; }
.vehicle-card li { padding: 3px 0; }

.empty-state { padding: 36px 0; text-align: center; color: var(--ink-muted); }

.badge-chair { background: var(--amber-soft); color: var(--amber); }

/* 출결 체크 - 터치하기 쉬운 토글 스위치 */
.attend-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.attend-row:last-child { border-bottom: none; }
.attend-row .name { font-size: 15px; display: flex; align-items: center; gap: 8px; }

.toggle { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle .track {
  position: absolute; inset: 0; background: #DEDACD; border-radius: 999px;
  transition: background .15s ease;
}
.toggle .thumb {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; transition: transform .15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle input:checked ~ .track { background: var(--pine); }
.toggle input:checked ~ .track .thumb { transform: translateX(20px); }
.toggle input:focus-visible ~ .track { outline: 2px solid var(--pine); outline-offset: 2px; }

.live-count { display: flex; gap: 16px; padding: 12px 14px; background: var(--pine-soft); border-radius: 8px; margin-bottom: 4px; }
.live-count .n { font-size: 18px; font-weight: 700; color: var(--pine-dark); }
.live-count .l { font-size: 12px; color: var(--ink-muted); display: block; }
.live-count .n.warn { color: var(--rust); }

.sticky-bar {
  position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 65%, transparent);
  padding: 18px 0 6px; margin-top: 4px;
}

/* 경로 결과 - 좌석 사용률 */
.capacity-bar { height: 5px; background: var(--pine-soft); border-radius: 3px; margin: 8px 0 10px; overflow: hidden; }
.capacity-bar .fill { height: 100%; background: var(--pine); border-radius: 3px; }
.vehicle-card .stop {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 0;
}
.vehicle-card .stop .n { color: var(--ink-muted); font-size: 13px; min-width: 16px; }

@media (max-width: 480px) {
  .page { padding: 18px 14px 50px; }
  .stat-hero .value { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .toggle .track, .toggle .thumb { transition: none; }
}
