body { margin: 0; font-family: -apple-system, "Malgun Gothic", sans-serif; background: #f3f4f6; color: #1f2937; }
a { color: inherit; }
label { display: block; font-size: 13px; color: #555; margin: 14px 0 4px; }
input, select { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 15px;
        border: 1px solid #ccc; border-radius: 8px; font-family: inherit; }
button { padding: 10px 16px; font-size: 14px; font-weight: 600; color: #fff; background: #16a34a;
         border: none; border-radius: 8px; cursor: pointer; }
button.secondary, a.secondary { background: #6b7280; }
button.danger { background: #dc2626; }
.msg { margin-top: 14px; font-size: 14px; }
.msg.error { color: #dc2626; }
.msg.ok { color: #16a34a; }

/* 로그인 */
.loginWrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.card { background: #fff; border-radius: 12px; padding: 32px; width: 100%; max-width: 360px;
        box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.card h1 { font-size: 20px; margin: 0 0 20px; }
.card button { width: 100%; margin-top: 20px; padding: 12px; }

/* 좌측 nav 토글(순수 CSS — 체크박스 트릭, JS 불필요) */
.navToggle { display: none; }

.shell {
  display: grid;
  grid-template-columns: 0 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "topbar topbar" "sidenav main";
  min-height: 100vh;
}
.topbar {
  grid-area: topbar;
  background: #fff; padding: 14px 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 30;
}
.hamburger { font-size: 22px; cursor: pointer; line-height: 1; user-select: none; }
.brand { font-size: 16px; font-weight: 700; flex: 1; }
.who { font-size: 13px; color: #666; white-space: nowrap; }

.sidenav {
  grid-area: sidenav;
  background: #fff; border-right: 1px solid #e5e7eb;
  width: 220px; position: fixed; top: 57px; bottom: 0; left: -220px;
  transition: left .2s ease; overflow-y: auto; z-index: 25;
  display: flex; flex-direction: column; gap: 2px; padding: 10px; box-sizing: border-box;
}
.navlink { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: #374151; font-size: 14px; font-weight: 600; }
.navlink.active { background: #16a34a; color: #fff; }
.navlink.disabled { color: #cbd5e1; padding: 10px 12px; font-size: 14px; }
.scrim { display: none; position: fixed; inset: 57px 0 0 0; background: rgba(0,0,0,.3); z-index: 20; }

.navToggle:checked ~ .shell .sidenav { left: 0; }
.navToggle:checked ~ .shell .scrim { display: block; }

.main { grid-area: main; padding: 16px; max-width: 1400px; box-sizing: border-box; }
.panel { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 16px; }
.panel h2 { margin: 0 0 16px; font-size: 17px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; }
th { color: #666; font-weight: 600; font-size: 12px; text-transform: uppercase; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
td.actions button { padding: 6px 10px; font-size: 12px; }
.empty { color: #999; padding: 20px 0; text-align: center; }
.listMeta { font-size: 13px; color: #666; margin-bottom: 6px; }

.formActions { margin-top: 16px; display: flex; gap: 8px; }
.filterRow { display: flex; gap: 8px; align-items: flex-end; margin: 10px 0; }
.filterRow input, .filterRow select { flex: 1; }
.filterRow button { flex: 0 0 auto; }
.linklike { display: inline-block; margin-top: 8px; font-size: 13px; color: #16a34a; }
.buttonlike { display: inline-block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #fff; }

.splitGrid { display: grid; gap: 16px; }

/* 체크박스 한 줄(응답수단 등) */
.checkRow { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.checkRow input[type="checkbox"] { width: auto; }
.checkRow label { margin: 0; font-size: 14px; color: #1f2937; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.on { background: #dcfce7; color: #15803d; }
.badge.off { background: #f3f4f6; color: #9ca3af; }
.badge.silent { background: #e0e7ff; color: #4338ca; }
.badge.miss { background: #fee2e2; color: #b91c1c; }

/* PC(넓은 화면): 사이드바 항상 고정 노출 + 본문 다단 분할 */
@media (min-width: 900px) {
  .shell { grid-template-columns: 220px 1fr; }
  .sidenav { position: sticky; left: 0; top: 57px; height: calc(100vh - 57px); }
  .scrim { display: none !important; }
  .hamburger { display: none; }
  .splitGrid { grid-template-columns: 380px 1fr; align-items: start; }
}
