:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --sidebar-bg: #1e2233;
  --sidebar-bg-active: #2a3050;
  --surface: #ffffff;
  --page-bg: #f4f5f9;
  --border: #e6e8f0;
  --text-muted: #6b7280;
}
html, body, button, input, select, textarea, .btn, .form-control, .form-select,
.modal, .card, .nav-link, table, .badge {
  font-family: "Pretendard", -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}
body {
  background: var(--page-bg);
  color: #1f2333;
  margin: 0;
}
.brand-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.app-navbar {
  background: var(--sidebar-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 54px;
  padding: 0 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.navbar-brand.brand-title { color: #fff; }
#navUserArea {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
  color: var(--brand);
  font-weight: 800;
  font-size: 16px;
  margin-right: 10px;
}
.brand-mark-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  margin-right: 10px;
  flex-shrink: 0;
}
.auth-brand .brand-mark-img { margin-right: 0; }
.app-layout {
  display: flex;
  height: calc(100vh - 54px);
}
.app-sidebar {
  width: 248px;
  background: var(--sidebar-bg);
  color: #e5e7ef;
  padding: 14px 10px;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-section-title {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8b90ab;
  margin: 10px 6px 6px;
}
.team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
  color: #d7d9e6;
  text-decoration: none;
  font-size: 14px;
  transition: background .12s;
}
.team-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.team-item.active {
  background: var(--sidebar-bg-active);
  color: #fff;
  font-weight: 600;
}
.team-item .badge {
  background: #ef4444;
}
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}
.channel-tabs .nav-link {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
}
.channel-tabs .nav-link.active {
  color: var(--brand-dark);
  font-weight: 700;
}
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.team-card {
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.team-card:hover {
  box-shadow: 0 6px 18px rgba(16,24,40,0.10);
  transform: translateY(-1px);
}
.team-stats {
  font-size: 12px;
  color: var(--text-muted);
}
.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
}
.btn-primary:hover {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
}
.nav-tabs .nav-link.active {
  border-color: var(--border) var(--border) #fff;
}
/* 게시물 카드 */
.post-card {
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
}
.post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.post-content {
  line-height: 1.55;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f2fb;
  color: var(--brand-dark) !important;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .12s;
}
.attachment-chip:hover {
  background: #e5e6fa;
}
.post-action-link {
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
}
.post-action-link:hover {
  background: #f1f2fb;
  color: var(--brand-dark);
}
.post-action-link.text-danger:hover {
  background: #fdecec;
  color: #dc2626 !important;
}

/* 댓글 */
.comment-block {
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}
.comment-bubble {
  background: #f6f7fb;
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 6px;
}
.comment-bubble .comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.note-item, .file-item, .schedule-item, .search-result-item {
  cursor: pointer;
}
.search-result-item:hover {
  background: #f8f9fc;
}
.type-badge {
  font-size: 11px;
  padding: 2px 8px;
}
.readonly-note-body {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fafbfe;
  min-height: 200px;
}

/* 입력 요소 공통 스타일 */
.form-control, .form-select, textarea.form-control {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fbfbfe;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
  background: #fff;
}
.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group .btn {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}
.btn {
  border-radius: 8px;
  font-weight: 600;
}

/* 대시보드 팀 카드 */
.team-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f2fb;
  color: #4b4f6b;
  margin: 0 4px 4px 0;
}

/* 로그인 / 부팅(권한확인) 화면 */
#authView, #bootView {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 10px 30px rgba(16,24,40,0.08);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.auth-brand .brand-mark { margin-right: 0; }
.auth-title { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.boot-box {
  text-align: center;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 30px;
  box-shadow: 0 10px 30px rgba(16,24,40,0.06);
}
