/* ── 리셋 & 변수 ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary:       #4AAFFF;
  --primary-dark:  #2196F3;
  --primary-light: #EBF5FF;
  --white:         #FFFFFF;
  --text:          #2D3748;
  --text-light:    #718096;
  --border:        #E2E8F0;
  --shadow:        0 4px 20px rgba(74,175,255,.10);
  --shadow-hover:  0 8px 30px rgba(74,175,255,.20);
  --radius:        16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #A8D8FF 0%, #C8E8FF 40%, #B0DAFF 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}

/* ── 앱 레이아웃 ── */
.app {
  display: flex;
  width: 100%; max-width: 1440px;
  height: 92vh; min-height: 680px;
  background: rgba(255,255,255,.25);
  border-radius: 26px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(33,150,243,.18);
  backdrop-filter: blur(8px);
}

/* ── 사이드바 ── */
.sidebar {
  width: 200px; background: #fff;
  display: flex; flex-direction: column;
  padding: 20px 12px; border-radius: 26px 0 0 26px;
  gap: 4px; flex-shrink: 0;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 16px; cursor: pointer;
}
.logo-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(135deg, #4AAFFF, #2196F3);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #fff;
  box-shadow: 0 3px 10px rgba(74,175,255,.4);
}
.logo-text { font-size: 16px; font-weight: 900; color: #2D3748; letter-spacing: -.3px; }

.nav-group { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 13px;
  cursor: pointer; font-size: 14px; font-weight: 600; color: #A0AEC0;
  transition: all .18s; position: relative; user-select: none;
}
.nav-item:hover  { background: #EBF5FF; color: #4AAFFF; }
.nav-item.active { background: #EBF5FF; color: #4AAFFF; }
.nav-item .nav-icon  { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-item .nav-label { font-size: 14px; }

.sidebar-divider { height: 1px; background: #F0F4F8; margin: 8px 4px; }
.sidebar-bottom  { display: flex; flex-direction: column; gap: 2px; }

/* ── 메인 ── */
.main { flex: 1; display: flex; flex-direction: column; background: #F5FAFF; overflow: hidden; min-width: 0; }

/* ── 탑바 ── */
.topbar {
  padding: 16px 24px;
  background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #EBF5FF; flex-shrink: 0;
}
.topbar-left h2 { font-size: 20px; font-weight: 800; color: #2D3748; }
.topbar-left p  { font-size: 12px; color: #A0AEC0; margin-top: 2px; }
.topbar-right   { display: flex; align-items: center; gap: 12px; }

.user-tabs { display: flex; background: #F0F7FF; border-radius: 50px; padding: 4px; gap: 3px; }
.user-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 50px;
  cursor: pointer; font-size: 13px; color: #718096;
  border: none; background: transparent; transition: all .2s;
}
.user-tab.active { background: #fff; color: #2D3748; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.10); }

.mini-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  overflow: hidden; flex-shrink: 0;
}
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }

.notif-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #F0F7FF; border: none; cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: background .2s;
}
.notif-btn:hover { background: #EBF5FF; }
.notif-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: #FC8181; border-radius: 50%; border: 2px solid #fff;
}

/* ── 콘텐츠 영역 ── */
.content { flex: 1; overflow-y: auto; padding: 22px 24px; }

/* ── 히어로 ── */
.hero {
  background: linear-gradient(135deg, #4AAFFF, #1A8CE0);
  border-radius: 20px; padding: 24px 28px; color: #fff;
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -40px; right: 120px;
  width: 130px; height: 130px; background: rgba(255,255,255,.12); border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute; bottom: -50px; right: 60px;
  width: 180px; height: 180px; background: rgba(255,255,255,.07); border-radius: 50%;
}
.hero-text h3  { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.hero-text p   { font-size: 13px; opacity: .85; margin-bottom: 16px; }
.hero-btn {
  padding: 8px 20px; background: #fff; color: #2196F3;
  border-radius: 50px; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.hero-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.16); }
.hero-emoji { font-size: 50px; z-index: 1; }

/* ── 통계 카드 ── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: #fff; border-radius: var(--radius);
  padding: 18px 20px; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
}
.stat-icon { width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-info h4 { font-size: 21px; font-weight: 800; color: #2D3748; }
.stat-info p  { font-size: 12px; color: #A0AEC0; margin-top: 2px; }

/* ── 섹션 헤더 ── */
.sec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sec-title  { font-size: 16px; font-weight: 800; color: #2D3748; }

.add-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 50px;
  background: linear-gradient(135deg, #4AAFFF, #2196F3);
  color: #fff; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 14px rgba(74,175,255,.32);
}
.add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(74,175,255,.42); }

/* ── 업무 카드 ── */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: #fff; border-radius: var(--radius);
  padding: 15px 18px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all .2s; box-shadow: var(--shadow);
  border: 2px solid transparent;
}
.task-card:hover { border-color: #4AAFFF; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.color-bar   { width: 5px; height: 50px; border-radius: 4px; flex-shrink: 0; }
.task-body   { flex: 1; min-width: 0; }
.task-row1   { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.task-name-txt { font-size: 15px; font-weight: 700; color: #2D3748; }
.price-badge { padding: 2px 9px; border-radius: 20px; background: #EBF5FF; color: #2196F3; font-size: 12px; font-weight: 700; }
.status-badge { padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.deposit-badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.deposit-badge.received { background: #C6F6D5; color: #276749; }
.deposit-badge.pending  { background: #EDF2F7; color: #718096; }
.deposit-toggle { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; border: none; cursor: pointer; white-space: nowrap; transition: opacity .15s; }
.deposit-toggle:hover { opacity: .75; }
.deposit-toggle.received { background: #C6F6D5; color: #276749; }
.deposit-toggle.pending  { background: #EDF2F7; color: #718096; }
.client-group-header { display: flex; align-items: center; gap: 8px; padding: 14px 0 6px; border-bottom: 1px solid #EDF2F7; margin: 4px 0 2px; }
.client-group-header:first-child { padding-top: 4px; }
.cg-name { font-size: 13px; font-weight: 800; color: #2D3748; }
.cg-count { font-size: 11px; font-weight: 600; color: #A0AEC0; }

.prog-bar-wrap { height: 6px; background: #EBF5FF; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.prog-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg,#4AAFFF,#2196F3); transition: width .4s ease; }

.task-row2   { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #A0AEC0; gap: 8px; }
.task-creator { display: flex; align-items: center; gap: 6px; }
.creator-av   { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; overflow: hidden; }
.creator-av img { width: 100%; height: 100%; object-fit: cover; }
.task-arrow  { font-size: 20px; color: #CBD5E0; flex-shrink: 0; }

.empty-state { text-align: center; padding: 48px 20px; color: #CBD5E0; }
.empty-state .ei { font-size: 50px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.7; }

/* ── 우측 패널 ── */
.panel {
  width: 300px; background: #fff;
  display: flex; flex-direction: column;
  border-left: 1px solid #EBF5FF;
  border-radius: 0 26px 26px 0;
  overflow: hidden; flex-shrink: 0;
}
.panel-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid #EBF5FF;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header h3 { font-size: 14px; font-weight: 800; color: #2D3748; }
.panel-content { flex: 1; overflow-y: auto; padding: 14px 16px; }

/* ── 미니 캘린더 ── */
.cal-card { background: #F8FBFF; border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head-title { font-size: 14px; font-weight: 800; color: #2D3748; }
.cal-nav-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid #E2E8F0; background: #fff;
  cursor: pointer; font-size: 14px; color: #718096;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.cal-nav-btn:hover { background: #EBF5FF; color: #4AAFFF; border-color: #4AAFFF; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.cal-dn { text-align: center; font-size: 10px; font-weight: 700; color: #A0AEC0; padding: 3px 0; }
.cal-d {
  text-align: center; padding: 4px 2px; font-size: 12px; color: #4A5568;
  border-radius: 7px; cursor: pointer; position: relative;
  transition: background .15s; min-height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.cal-d:hover { background: #EBF5FF; }
.cal-d.today { background: linear-gradient(135deg,#4AAFFF,#2196F3); color: #fff; font-weight: 800; }
.cal-d.other { color: #CBD5E0; }
.cal-d.has-task::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: #4AAFFF;
}
.cal-d.today.has-task::after { background: rgba(255,255,255,.8); }

/* ── 프로필 ── */
.profiles-title { font-size: 11px; font-weight: 700; color: #A0AEC0; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.profile-list { display: flex; flex-direction: column; gap: 8px; }
.profile-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #F8FBFF; border-radius: 12px; transition: background .2s; }
.profile-card:hover { background: #EBF5FF; }
.profile-av {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  overflow: hidden; position: relative; cursor: pointer; flex-shrink: 0;
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; }
.av-upload-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; opacity: 0; transition: opacity .2s; border-radius: 50%;
}
.profile-av:hover .av-upload-overlay { opacity: 1; }
.profile-info { flex: 1; min-width: 0; }
.profile-name-input {
  font-size: 13px; font-weight: 700; color: #2D3748;
  border: none; background: transparent; width: 100%; outline: none;
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.profile-name-input:focus { border-bottom-color: #4AAFFF; }
.profile-tasks { font-size: 11px; color: #A0AEC0; margin-top: 1px; }
.current-badge { font-size: 10px; padding: 2px 7px; border-radius: 20px; background: #EBF5FF; color: #4AAFFF; font-weight: 700; flex-shrink: 0; }

/* ── 모달 ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20,40,80,.28); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; z-index: 200;
}
.overlay.on { display: flex; }
.modal {
  background: #fff; border-radius: 22px;
  padding: 28px; width: 480px; max-width: 95vw;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  animation: popIn .22s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title { font-size: 18px; font-weight: 800; color: #2D3748; }
.close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: #F7FAFC; cursor: pointer;
  font-size: 20px; color: #718096;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.close-btn:hover { background: #FED7D7; color: #E53E3E; }

/* ── 폼 ── */
.form-label  { font-size: 13px; font-weight: 700; color: #4A5568; display: block; margin-bottom: 5px; }
.form-input  {
  width: 100%; padding: 10px 13px;
  border: 2px solid #E2E8F0; border-radius: 10px;
  font-size: 14px; color: #2D3748; outline: none;
  transition: border-color .2s; background: #F8FAFC;
}
.form-input:focus { border-color: #4AAFFF; background: #fff; }
.form-group { margin-bottom: 16px; }
.form-check-wrap { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; color: #4A5568; cursor: pointer; }
.form-check-wrap input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: #4AAFFF; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-select {
  width: 100%; padding: 10px 13px;
  border: 2px solid #E2E8F0; border-radius: 10px;
  font-size: 14px; color: #2D3748; outline: none;
  background: #F8FAFC; cursor: pointer; transition: border-color .2s;
}
.form-select:focus { border-color: #4AAFFF; }
.date-hint { margin-top: 6px; padding: 8px 12px; background: #EBF5FF; border-radius: 9px; font-size: 12px; color: #4A90D9; }

.submit-btn {
  width: 100%; padding: 13px; margin-top: 8px;
  background: linear-gradient(135deg,#4AAFFF,#2196F3);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  transition: all .2s; box-shadow: 0 5px 18px rgba(74,175,255,.36);
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(74,175,255,.46); }

/* ── 업무 상세 ── */
.detail-info {
  background: #F8FBFF; border-radius: 13px; padding: 14px;
  margin-bottom: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.detail-dot   { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.detail-name  { font-size: 16px; font-weight: 800; color: #2D3748; }
.detail-meta  { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; font-size: 12px; color: #A0AEC0; }
.detail-price { color: #2196F3; font-weight: 800; }

.prog-head     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.prog-label    { font-size: 14px; font-weight: 800; color: #2D3748; }
.prog-pct      { font-size: 24px; font-weight: 900; color: #4AAFFF; }
.prog-big-bar  { height: 10px; background: #EBF5FF; border-radius: 5px; overflow: hidden; margin-bottom: 18px; }
.prog-big-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg,#4AAFFF,#2196F3); transition: width .4s ease; }

.steps { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.step  {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: #F8FBFF; border-radius: 11px; transition: background .2s;
}
.step.done { background: #EBF5FF; }
.step-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid #CBD5E0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s; background: #fff; font-size: 13px;
}
.step-check.checked { background: linear-gradient(135deg,#4AAFFF,#2196F3); border-color: #4AAFFF; color: #fff; }
.step-text   { flex: 1; font-size: 14px; color: #2D3748; }
.step-text.done { text-decoration: line-through; color: #A0AEC0; }
.step-padj   { font-size: 11px; font-weight: 700; color: #48BB78; background: #F0FFF4; padding: 2px 8px; border-radius: 20px; }
.step-del    {
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  font-size: 16px; color: #CBD5E0;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.step-del:hover { color: #FC8181; background: #FFF5F5; }

.add-step-toggle {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 10px 14px;
  border: 2px dashed #CBD5E0; border-radius: 11px;
  background: transparent; color: #A0AEC0; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s; margin-bottom: 12px;
}
.add-step-toggle:hover { border-color: #4AAFFF; color: #4AAFFF; background: #EBF5FF; }

.add-step-box { background: #F8FBFF; border-radius: 12px; padding: 14px; margin-bottom: 12px; display: none; }
.add-step-box.on { display: block; }
.prefix-wrap  { position: relative; }
.prefix       { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #48BB78; font-weight: 800; }
.prefix-wrap .form-input { padding-left: 24px; }
.step-row-btns { display: flex; gap: 8px; margin-top: 10px; }
.sm-btn { padding: 7px 15px; border-radius: 9px; font-size: 13px; font-weight: 700; border: none; cursor: pointer; transition: all .2s; }
.sm-btn.primary   { background: linear-gradient(135deg,#4AAFFF,#2196F3); color: #fff; }
.sm-btn.secondary { background: #F0F4F8; color: #718096; }
.sm-btn:hover { opacity: .88; }

.total-row   { text-align: right; font-size: 13px; color: #A0AEC0; padding-top: 14px; border-top: 1px solid #EBF5FF; }
.total-price { font-size: 17px; font-weight: 900; color: #2196F3; }

/* ── 업무 목록 페이지 ── */
.page-tasks { display: flex; flex-direction: column; gap: 0; }
.tasks-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; }
.search-input {
  width: 100%; padding: 9px 13px 9px 36px;
  border: 2px solid #E2E8F0; border-radius: 50px;
  font-size: 14px; color: #2D3748; outline: none;
  background: #fff; transition: border-color .2s;
}
.search-input:focus { border-color: #4AAFFF; }
.filter-tabs { display: flex; gap: 4px; }
.ftab {
  padding: 7px 14px; border-radius: 50px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: #F0F4F8; color: #718096; transition: all .2s;
}
.ftab.active { background: #EBF5FF; color: #4AAFFF; }
.ftab:hover  { background: #EBF5FF; color: #4AAFFF; }

/* ── 캘린더 페이지 ── */
.page-calendar { display: flex; flex-direction: column; height: 100%; }
.cal-page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-shrink: 0;
}
.cal-page-nav { display: flex; align-items: center; gap: 10px; }
.cal-page-title { font-size: 20px; font-weight: 800; color: #2D3748; }
.cal-today-btn {
  padding: 6px 14px; border-radius: 50px; border: 1px solid #E2E8F0;
  font-size: 13px; font-weight: 600; color: #718096; cursor: pointer;
  background: #fff; transition: all .2s;
}
.cal-today-btn:hover { border-color: #4AAFFF; color: #4AAFFF; }

.cal-full-wrap {
  flex: 1; background: #fff; border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.cal-full-weekrow {
  display: grid; grid-template-columns: repeat(7,1fr);
  border-bottom: 1px solid #F0F4F8;
}
.cal-full-weekrow:last-child { border-bottom: none; }
.cal-full-header { background: #F8FBFF; flex-shrink: 0; }
.cal-full-dn { text-align: center; padding: 10px 0; font-size: 12px; font-weight: 700; color: #A0AEC0; }

/* 날짜 행과 이벤트 레이어 */
.cal-full-numrow {
  display: grid; grid-template-columns: repeat(7,1fr);
  position: absolute; top: 0; left: 0; right: 0;
}
.cal-full-cell {
  text-align: center; padding: 6px 0; font-size: 13px; color: #4A5568;
  border-right: 1px solid #F0F4F8; cursor: pointer;
}
.cal-full-cell:last-child { border-right: none; }
.cal-full-cell:hover { background: #F8FBFF; }
.cal-full-cell.today  {
  color: #fff; font-weight: 800;
}
.cal-full-cell.today::after {
  /* circle around today's number */
  content: attr(data-day);
}
.cal-full-cell.other  { color: #CBD5E0; }

/* Week body rows */
#cal-full-body > div {
  display: block; border-bottom: 1px solid #F0F4F8; position: relative;
}
#cal-full-body > div:last-child { border-bottom: none; }

.cal-ev-layer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
.cal-ev-bar {
  position: absolute; height: 18px;
  font-size: 11px; font-weight: 600; color: #fff;
  display: flex; align-items: center; padding: 0 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: pointer; pointer-events: all;
  transition: opacity .15s; z-index: 1;
}
.cal-ev-bar:hover { opacity: .85; }

/* today circle in full calendar */
.cal-full-cell.today { position: relative; }
.cal-full-cell.today .day-num-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: linear-gradient(135deg,#4AAFFF,#2196F3);
  border-radius: 50%; color: #fff; font-weight: 800;
}

/* ── 팀 페이지 ── */
.page-team { max-width: 800px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; margin-bottom: 24px; }
.team-card {
  background: #fff; border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 16px;
}
.team-av-wrap { flex-shrink: 0; }
.team-av {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff;
  overflow: hidden; position: relative; cursor: pointer;
}
.team-av img { width: 100%; height: 100%; object-fit: cover; }
.av-up-ov {
  position: absolute; inset: 0; background: rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; opacity: 0; transition: opacity .2s; border-radius: 50%;
}
.team-av:hover .av-up-ov { opacity: 1; }
.team-info { flex: 1; min-width: 0; }
.team-name-input {
  font-size: 17px; font-weight: 800; color: #2D3748;
  border: none; background: transparent; width: 100%; outline: none;
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.team-name-input:focus { border-bottom-color: #4AAFFF; }
.team-stats { display: flex; gap: 12px; font-size: 12px; color: #A0AEC0; margin-top: 10px; }
.team-notice {
  background: #EBF5FF; border-radius: 14px; padding: 18px 20px;
  display: flex; align-items: flex-start; gap: 14px;
}
.notice-icon  { font-size: 24px; flex-shrink: 0; }
.notice-title { font-size: 14px; font-weight: 700; color: #2D3748; margin-bottom: 4px; }
.notice-desc  { font-size: 13px; color: #718096; line-height: 1.6; }

/* ── 설정 페이지 ── */
.page-settings { max-width: 700px; display: flex; flex-direction: column; gap: 20px; }
.settings-header { margin-bottom: 4px; }
.settings-title  { font-size: 22px; font-weight: 800; color: #2D3748; }

.settings-card { background: #fff; border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.settings-card-title { font-size: 15px; font-weight: 800; color: #2D3748; margin-bottom: 4px; }
.settings-card-desc  { font-size: 13px; color: #A0AEC0; }
.settings-save-row   { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* 단계 에디터 */
.steps-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.step-edit-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #F8FBFF; border-radius: 12px;
}
.step-edit-handle { font-size: 16px; color: #CBD5E0; cursor: grab; user-select: none; }
.step-edit-num    { font-size: 13px; font-weight: 700; color: #A0AEC0; min-width: 20px; text-align: center; }
.step-edit-input  { flex: 1; height: 36px; }
.step-edit-btns   { display: flex; gap: 4px; }
.step-order-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid #E2E8F0;
  background: #fff; cursor: pointer; font-size: 14px; color: #718096;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.step-order-btn:hover:not(:disabled) { background: #EBF5FF; color: #4AAFFF; border-color: #4AAFFF; }
.step-order-btn:disabled { opacity: .35; cursor: default; }
.step-del-btn {
  width: 28px; height: 28px; border-radius: 7px; border: none;
  background: transparent; cursor: pointer; font-size: 18px; color: #CBD5E0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.step-del-btn:hover { color: #FC8181; background: #FFF5F5; }

/* Supabase 가이드 */
.supabase-guide { display: flex; flex-direction: column; gap: 10px; }
.guide-step { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #4A5568; }
.guide-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg,#4AAFFF,#2196F3); color: #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.guide-step a { color: #4AAFFF; font-weight: 700; }
.guide-step code { background: #F0F4F8; padding: 2px 6px; border-radius: 5px; font-size: 12px; }

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── 인증 화면 ── */
.auth-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #A8D8FF 0%, #C8E8FF 40%, #B0DAFF 100%);
  display: none; align-items: center; justify-content: center;
  z-index: 9999;
}
.auth-screen.on { display: flex; }
.auth-card {
  background: #fff; border-radius: 24px;
  padding: 40px 44px; width: 420px; max-width: 95vw;
  box-shadow: 0 24px 64px rgba(33,150,243,.22);
  animation: popIn .25s ease;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px; justify-content: center;
}
.auth-title {
  font-size: 22px; font-weight: 800; color: #2D3748;
  text-align: center; margin-bottom: 6px;
}
.auth-sub {
  font-size: 14px; color: #A0AEC0;
  text-align: center; margin-bottom: 28px;
}
.auth-error {
  background: #FFF5F5; color: #E53E3E; border: 1px solid #FED7D7;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 12px;
}
.auth-notice {
  background: #EBF5FF; color: #2B6CB0; border: 1px solid #BEE3F8;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 12px;
}
.auth-toggle {
  text-align: center; font-size: 13px; color: #A0AEC0;
  margin-top: 20px;
}
.auth-toggle a { color: #4AAFFF; font-weight: 700; text-decoration: none; }
.auth-toggle a:hover { text-decoration: underline; }

/* ── 탑바 유저 영역 (Supabase 모드) ── */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; background: #F0F7FF; border-radius: 50px;
}
.topbar-username {
  font-size: 13px; font-weight: 700; color: #2D3748;
}
.logout-btn {
  padding: 7px 16px; border-radius: 50px;
  border: 1px solid #E2E8F0; background: #fff;
  font-size: 13px; font-weight: 600; color: #718096;
  cursor: pointer; transition: all .2s;
}
.logout-btn:hover { border-color: #FC8181; color: #FC8181; background: #FFF5F5; }

/* ── 관리자 페이지 ── */
.page-admin { padding: 28px; max-width: 860px; }
.admin-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.admin-title { font-size: 22px; font-weight: 800; color: #2D3748; }
.admin-owner-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  background: #FFF3CD; color: #856404;
  border: 1px solid #FFE083; border-radius: 50px;
  padding: 3px 10px;
}
.admin-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 2px solid #EDF2F7; margin-bottom: 24px;
}
.atab {
  padding: 8px 16px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: #A0AEC0;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s; border-radius: 6px 6px 0 0;
}
.atab:hover { color: #4A5568; background: #F7FAFC; }
.atab.active { color: #3B82F6; border-bottom-color: #3B82F6; background: #EBF5FF; }
.admin-tab-content { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.admin-loading { color: #A0AEC0; font-size: 13px; padding: 20px 0; }
.admin-card {
  background: #fff; border: 1px solid #E2E8F0;
  border-radius: 16px; padding: 20px 24px; margin-bottom: 16px;
}
.admin-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.admin-card-title { font-size: 15px; font-weight: 700; color: #2D3748; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; font-weight: 700; color: #A0AEC0;
  font-size: 11px; letter-spacing: .5px; text-transform: uppercase;
  padding: 0 12px 10px; border-bottom: 1px solid #EDF2F7;
}
.admin-table td {
  padding: 11px 12px; border-bottom: 1px solid #F7FAFC;
  color: #4A5568; vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #F7FAFC; }
.admin-pill {
  display: inline-block; padding: 2px 9px; border-radius: 50px;
  font-size: 11px; font-weight: 700;
}
.admin-pill.active  { background: #C6F6D5; color: #276749; }
.admin-pill.inactive{ background: #FED7D7; color: #9B2C2C; }
.admin-pill.owner   { background: #EBF5FF; color: #2B6CB0; }
.admin-pill.member  { background: #F0FFF4; color: #276749; }
.admin-pill.used    { background: #EDF2F7; color: #718096; }
.admin-pill.ok      { background: #C6F6D5; color: #276749; }
.aact-btn {
  padding: 4px 12px; border-radius: 8px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.aact-btn.secondary { background: #EDF2F7; color: #4A5568; }
.aact-btn.secondary:hover { background: #E2E8F0; }
.aact-btn.danger    { background: #FFF5F5; color: #E53E3E; }
.aact-btn.danger:hover  { background: #FED7D7; }
.aact-btn.success   { background: #F0FFF4; color: #276749; }
.aact-btn.success:hover { background: #C6F6D5; }
.aact-btn.primary   { background: #3B82F6; color: #fff; }
.aact-btn.primary:hover { background: #2563EB; }
.aact-btn:disabled  { opacity: .5; cursor: not-allowed; }
.admin-notice {
  background: #EBF5FF; color: #2B6CB0; border: 1px solid #BEE3F8;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}
.admin-error-box {
  background: #FFF5F5; color: #C53030; border: 1px solid #FEB2B2;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 10px;
}
.admin-settings-form { display: flex; flex-direction: column; gap: 16px; }
.admin-settings-form .form-row { display: flex; gap: 16px; }
.admin-settings-form .form-group { flex: 1; }
.admin-settings-form .form-label { font-size: 12px; font-weight: 700; color: #718096; margin-bottom: 6px; display: block; }
.admin-settings-form .form-input,
.admin-settings-form .form-select {
  width: 100%; padding: 9px 13px; border: 1px solid #E2E8F0;
  border-radius: 10px; font-size: 14px; background: #fff; box-sizing: border-box;
}
.admin-settings-form .form-input:focus,
.admin-settings-form .form-select:focus { outline: none; border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.admin-inline-form {
  background: #F7FAFC; border: 1px solid #E2E8F0;
  border-radius: 12px; padding: 16px; margin-top: 12px;
}
.invite-code-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #EBF5FF; border: 1px solid #BEE3F8;
  border-radius: 8px; padding: 5px 12px;
}
.invite-code-text {
  font-family: monospace; font-size: 15px; font-weight: 700;
  color: #2B6CB0; letter-spacing: 2px;
}
.log-row td:first-child { color: #A0AEC0; font-size: 12px; white-space: nowrap; }
.export-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.export-btn {
  padding: 9px 20px; border-radius: 10px; border: 1px solid #E2E8F0;
  background: #fff; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.export-btn:hover { background: #EBF5FF; border-color: #BEE3F8; color: #2B6CB0; }

.telegram-link { color: #1674b8; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.form-help { margin-top: 7px; color: #707070; font-size: 12px; line-height: 1.6; }
