* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #e5e9f0;
  color: #1f2937;
}

.app {
  max-width: 1150px;
  margin: 0 auto;
  padding: 18px;
}

/* 상단바 */
.top-bar {
  background: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #cdd6e1;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  background: #3b82f6;
  border-radius: 6px;
  color:#fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.right-box {
  display:flex;
  align-items:center;
  gap:10px;
}

.online-pill {
  background: #f0f6ff;
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border:1px solid #c5ddff;
  font-size: 13px;
}

.online-dot {
  width:8px;
  height:8px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 6px #22c55e;
}

/* 버튼 */
.btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #90a4c0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  transition: 0.15s;
}

.btn:hover {
  background: #eef2f7;
}

#loginBtn {
  background: #3b82f6;
  border-color: #2563eb;
  color: white;
  font-weight: 600;
}

#logoutBtn {
  background:#f8fafc;
}

#userInfo {
  font-size: 12px;
  color:#475569;
  max-width:200px;
  word-break: break-all;
  text-align:right;
}

/* 레이아웃 */
.main-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  align-items: start;
}

/* 카드 공통 */
.card {
  background: #ffffff;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #cdd6e1;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  display:flex;
  align-items:center;
  gap:6px;
}

.pill {
  font-size: 10px;
  padding: 2px 6px;
  background:#e0e7ff;
  color:#3b82f6;
  border-radius:6px;
  border:1px solid #c7d2fe;
}

/* 대기열 상태 표시 */
.queue-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  border: 1px solid transparent;
}

.queue-status.on {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.queue-status.off {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* 닉네임 박스 */
.nickname-box {
  background:#f4f7fb;
  border:1px solid #d2dae5;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.input-group {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

#nicknameInput {
  flex:1;
  min-width:150px;
  padding: 9px 12px;
  border-radius: 6px;
  border:1px solid #94a3b8;
  background:#ffffff;
  font-size: 13px;
  outline:none;
}

#joinBtn {
  background:#3b82f6;
  border-color:#2563eb;
  color:white;
  font-weight:600;
}

#joinBtn[disabled] {
  opacity: 0.6;
  cursor: default;
}

#cancelMyQueueBtn {
  background:#ef4444;
  border-color:#dc2626;
  color:white;
  font-weight:600;
}

/* 대기열 리스트 */
.queue-list {
  margin-top: 8px;
  max-height: 420px;
  overflow-y:auto;
  border:1px solid #d5dce7;
  border-radius:10px;
  background:white;
}

.queue-item {
  padding: 10px 12px;
  border-bottom:1px solid #e2e8f0;
  display: flex;
  align-items:center;
  gap: 10px;
  font-size: 14px;
}

.queue-index {
  width: 26px;
  height: 26px;
  border-radius:6px;
  background:#e5edff;
  border:1px solid #c7d7ff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  color:#2563eb;
  font-weight:600;
}

.empty {
  padding:10px;
  font-size:13px;
  color:#888;
}

/* 관리자 */
.admin-card {
  position: sticky;
  top: 18px;
}

.admin-buttons {
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-bottom:12px;
}

#queueToggleBtn {
  background:#3b82f6;
  border-color:#2563eb;
  color:white;
  font-weight:600;
}

#queueToggleBtn.off {
  background:#94a3b8;
  border-color:#64748b;
  color:white;
}

#clearAllBtn {
  background:#ef4444;
  border-color:#dc2626;
  color:white;
  font-weight:600;
}

.admin-list {
  border:1px solid #d5dce7;
  background:white;
  border-radius:10px;
  max-height: 350px;
  overflow-y:auto;
}

.admin-item {
  padding: 10px 12px;
  border-bottom:1px solid #e2e8f0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.btn-done {
  background:#22c55e;
  border:none;
  padding: 6px 8px;
  border-radius:6px;
  color:white;
  font-size:12px;
  cursor:pointer;
}

/* 모바일 */
@media (max-width: 800px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .admin-card {
    position: static;
    top: unset;
  }
}
