:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #475569;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* 로그인 페이지 */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 20px;
}

.login-container h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.login-container p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.btn-slack {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: #4a154b;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-slack:hover {
  background: #611f69;
}

.btn-slack img {
  width: 24px;
  height: 24px;
}

.btn-logout {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
}

/* 헤더 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-left h1 {
  font-size: 1.25rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.btn-logout-small {
  padding: 6px 12px;
  background: var(--surface-hover);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* 탭 */
.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: nowrap;
}

.tab:hover {
  background: var(--surface-hover);
}

.tab.active {
  background: var(--primary);
  color: white;
}

/* 메인 */
main {
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

#week-select {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.875rem;
}

.btn-refresh {
  padding: 8px 16px;
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

/* 카드 */
.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: var(--danger);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-hover);
  border-radius: 8px;
}

.list-item-name {
  font-weight: 500;
}

.list-item-detail {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.summary {
  text-align: center;
}

.summary #normal-count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--success);
}

/* 관리자 섹션 */
.admin-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

.admin-section h2 {
  margin-bottom: 16px;
}

.admin-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-form input {
  flex: 1;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
}

.admin-form button {
  padding: 10px 20px;
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

#admin-list {
  list-style: none;
}

#admin-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 8px;
}

#admin-list button {
  padding: 4px 12px;
  background: var(--danger);
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

/* 반응형 */
@media (max-width: 600px) {
  main {
    padding: 16px;
  }
  
  header {
    flex-direction: column;
    gap: 12px;
  }
}
/*  ũ */
.slack-link {
  color: #4a9eff;
  text-decoration: none;
  margin-right: 1rem;
  font-size: 0.85rem;
}

.slack-link:hover {
  text-decoration: underline;
}

.btn-sync {
  background: #17a2b8;
  margin-left: 1rem;
}

.btn-sync:hover {
  background: #138496;
}

/* ε  */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #333;
  border-top-color: #4a9eff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: white;
  margin-top: 1rem;
  font-size: 1.1rem;
}
