/* =============================================================================
   세컨드브레인 웹UI — 커스텀 스타일
   =============================================================================

   ── 캘린더 컬러 팔레트 (디자인 시스템) ───────────────────────────────────────
   구분   짙은컬러   배경컬러   H°    S%   L%   배경L%
   빨강   #c67980   #fff1f1   355   35   63    97.3
   주황   #d27937   #fff1e8    25   58   52    95.5
   노랑   #c8b246   #fffbeb    50   54   53    96.0
   초록   #6bbe86   #f1fff2   139   39   58    97.3
   파랑   #6fc2df   #d7f3ff   197   63   65    92.2
   보라   #a0a8e6   #f1f3ff   234   57   76    97.3
   ──────────────────────────────────────────────────────────────────────────── */

:root {
    --cal-red-dark:    #c67980;  --cal-red-bg:    #fff1f1;
    --cal-orange-dark: #d27937;  --cal-orange-bg: #fff1e8;
    --cal-yellow-dark: #c8b246;  --cal-yellow-bg: #fffbeb;
    --cal-green-dark:  #6bbe86;  --cal-green-bg:  #f1fff2;
    --cal-blue-dark:   #6fc2df;  --cal-blue-bg:   #d7f3ff;
    --cal-purple-dark: #a0a8e6;  --cal-purple-bg: #f1f3ff;
}

/* =============================================================================
   기본 배경 & 레이아웃 (다크모드 대응)
   ============================================================================= */
.body-bg { background: #F8FAFC; }
.dark .body-bg { background: #111827; }

.header-bg {
    background: white;
    border-bottom: 1px solid #F3F4F6;
}
.dark .header-bg {
    background: #1F2937;
    border-bottom-color: #374151;
}

.logo-link {
    font-weight: 700;
    font-size: 15px;
    color: #6366F1;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle-btn {
    padding: 6px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    transition: background 0.15s;
}
.theme-toggle-btn:hover { background: #F3F4F6; }
.dark .theme-toggle-btn:hover { background: #374151; }

.logout-btn {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: background 0.15s;
}
.logout-btn:hover { background: #F9FAFB; }
.dark .logout-btn {
    background: #374151;
    border-color: #4B5563;
    color: #D1D5DB;
}
.dark .logout-btn:hover { background: #4B5563; }

.footer-bar {
    margin-top: 4rem;
    border-top: 1px solid #F3F4F6;
    padding: 1.5rem 0;
}
.dark .footer-bar { border-top-color: #374151; }

/* =============================================================================
   모바일 하단 네비게이션
   ============================================================================= */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: white;
    border-top: 1px solid #E5E7EB;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.dark .mobile-bottom-nav {
    background: #1F2937;
    border-top-color: #374151;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 4px;
    text-decoration: none;
    color: #9CA3AF;
    transition: color 0.15s;
    gap: 2px;
}
.mobile-nav-item:hover { color: #6B7280; }
.dark .mobile-nav-item:hover { color: #D1D5DB; }

.mobile-nav-active {
    color: #6366F1 !important;
}
.dark .mobile-nav-active {
    color: #818CF8 !important;
}

.mobile-nav-icon {
    font-size: 20px;
    line-height: 1;
}

.mobile-nav-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .mobile-bottom-nav { display: none !important; }
}

/* =============================================================================
   데스크탑 네비게이션 링크
   ============================================================================= */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: #F3F4F6; color: #111827; }
.dark .nav-link { color: #9CA3AF; }
.dark .nav-link:hover { background: #374151; color: #F9FAFB; }

.nav-active { background: #EEF2FF; color: #6366F1; }
.dark .nav-active { background: rgba(99,102,241,0.15); color: #818CF8; }

/* =============================================================================
   섹션 카드 (공통 컨테이너)
   ============================================================================= */
.section-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #F0F0F5;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 20px 24px;
}
.dark .section-card { background: #1F2937; border-color: #374151; }

.section-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dark .section-card-header { border-color: #374151; }

.section-card-body { padding: 24px; }

/* 섹션 타이틀 & 카운트 (대시보드) */
.section-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}
.dark .section-title { color: #E5E7EB; }

.section-count {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.section-empty {
    text-align: center;
    padding: 28px 0;
    color: #D1D5DB;
    font-size: 13px;
}
.dark .section-empty { color: #6B7280; }

/* =============================================================================
   통계 카드 (대시보드)
   ============================================================================= */
.stat-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dark .stat-card { background: #1F2937; border-color: #374151; }

.stat-card-flex {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: default;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-icon-purple { background: #f0f0ff; }
.stat-icon-green  { background: #f0fdf4; }
.stat-icon-yellow { background: #fffbeb; }
.stat-icon-blue   { background: #f0f9ff; }
.dark .stat-icon-purple { background: rgba(99,102,241,0.15); }
.dark .stat-icon-green  { background: rgba(34,197,94,0.15); }
.dark .stat-icon-yellow { background: rgba(200,178,70,0.15); }
.dark .stat-icon-blue   { background: rgba(2,132,199,0.15); }

.stat-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}
.stat-num-purple { color: #6366F1; }
.stat-num-green  { color: #16a34a; }
.stat-num-yellow { color: #c8b246; }
.stat-num-blue   { color: #0284c7; }

.stat-label {
    font-size: 13px;
    color: #9CA3AF;
    margin-top: 3px;
    font-weight: 500;
}

/* =============================================================================
   대시보드 태스크 행 (JS 렌더링)
   ============================================================================= */
.dash-task-row {
    background: white;
    border: 1px solid #F0F0F5;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.dash-task-row:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #E0E0EB;
}
.dark .dash-task-row {
    background: #283040;
    border-color: #374151;
}
.dark .dash-task-row:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-color: #4B5563;
}

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-task-title {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .dash-task-title { color: #F3F4F6; }

.dash-priority-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.dark .dash-priority-badge { opacity: 0.85; }

.dash-task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dash-task-path {
    font-size: 11px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.dark .dash-task-path { color: #9CA3AF; }

.dash-task-dates {
    font-size: 11px;
    color: #9CA3AF;
    white-space: nowrap;
}
.dark .dash-task-dates { color: #6B7280; }

.dash-diff-label {
    font-size: 12px;
    font-weight: 700;
}

.task-tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #F3F4F6;
    color: #6B7280;
}
.dark .task-tag {
    background: #374151;
    color: #9CA3AF;
}

/* =============================================================================
   칸반 그리드
   ============================================================================= */
.kanban-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 768px) {
    .kanban-grid { grid-template-columns: 1fr; }
}

.kanban-column {
    background: #F8FAFC;
    border-radius: 14px;
    padding: 16px;
    min-height: 200px;
    border: 1px solid #F0F1F4;
}
.dark .kanban-column { background: #1F2937; border-color: #374151; }

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.kanban-col-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}
.dark .kanban-col-label { color: #D1D5DB; }

.kanban-col-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.kanban-count {
    font-size: 11px;
    font-weight: 600;
    background: #E5E7EB;
    color: #6B7280;
    padding: 2px 8px;
    border-radius: 20px;
}
.dark .kanban-count { background: #374151; color: #9CA3AF; }
.kanban-count-active { background: #f1fff2 !important; color: #6bbe86 !important; }
.kanban-count-done   { background: #f1f3ff !important; color: #a0a8e6 !important; }

/* 태스크 카드 */
.task-card {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.12s;
    border: 1px solid #F3F4F6;
    border-left: 4px solid #E5E7EB;
}
.task-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.dark .task-card { background: #283040; border-color: #374151; border-left-color: #4B5563; }
.dark .task-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.3); }

/* Priority 좌측 보더 (팔레트) */
.priority-urgent { border-left-color: #c67980 !important; }
.priority-high   { border-left-color: #d27937 !important; }
.priority-normal { border-left-color: #6fc2df !important; }
.priority-low    { border-left-color: #a0a8e6 !important; }

/* Priority 배지 (팔레트) */
.badge-urgent, .badge-high, .badge-normal, .badge-low {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-urgent { background: #fff1f1; color: #c67980; }
.badge-high   { background: #fff1e8; color: #d27937; }
.badge-normal { background: #d7f3ff; color: #6fc2df; }
.badge-low    { background: #f1f3ff; color: #a0a8e6; }
.dark .badge-urgent { background: rgba(198,121,128,0.15); }
.dark .badge-high   { background: rgba(210,121,55,0.15); }
.dark .badge-normal { background: rgba(111,194,223,0.15); }
.dark .badge-low    { background: rgba(160,168,230,0.15); }

/* =============================================================================
   캘린더 — 페이지 헤더
   ============================================================================= */
.cal-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.cal-filter-group {
    display: flex;
    gap: 4px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 12px;
}

.dark .cal-filter-group {
    background: #374151;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    color: #9CA3AF;
    background: transparent;
    border: none;
}

.filter-btn.active {
    background: white;
    color: #111827;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.dark .filter-btn.active {
    background: #4B5563;
    color: #F9FAFB;
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-task  { background-color: #60A5FA; }
.dot-event { background-color: #34D399; }

.cal-month-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cal-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    min-width: 110px;
    text-align: center;
}

.dark .cal-month-title { color: #F9FAFB; }

.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #6B7280;
    font-size: 1.375rem;
    line-height: 1;
    text-decoration: none;
    transition: all 0.15s;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
}

.cal-nav-btn:hover { background: #F3F4F6; color: #111827; }

.dark .cal-nav-btn {
    background: #374151;
    border-color: #4B5563;
    color: #9CA3AF;
}

.dark .cal-nav-btn:hover { background: #4B5563; color: #F9FAFB; }

.cal-today-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6366F1;
    border: 1.5px solid #6366F1;
    text-decoration: none;
    transition: all 0.15s;
    background: white;
}

.cal-today-btn:hover { background: #EEF2FF; }

.dark .cal-today-btn {
    background: transparent;
    color: #818CF8;
    border-color: #818CF8;
}

/* =============================================================================
   캘린더 — 컨테이너 & 그리드
   ============================================================================= */
.cal-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.dark .cal-container {
    background: #1F2937;
    border-color: #374151;
    box-shadow: none;
}

.cal-weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #F3F4F6;
}

.dark .cal-weekday-header { border-color: #374151; }

.cal-weekday {
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: center;
    color: #9CA3AF;
}

.cal-weekday.sun { color: #F87171; }
.cal-weekday.sat { color: #60A5FA; }
.dark .cal-weekday { color: #6B7280; }
.dark .cal-weekday.sun { color: #FCA5A5; }
.dark .cal-weekday.sat { color: #93C5FD; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #F3F4F6;
}

.dark .calendar-grid { background-color: #374151; }

/* =============================================================================
   캘린더 — 날짜 셀
   ============================================================================= */
.calendar-day {
    background: white;
    padding: 8px 6px 6px;
    min-height: 130px;
    transition: background 0.12s;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.dark .calendar-day { background: #1F2937; }
.calendar-day:hover { background: #FAFBFC; }
.dark .calendar-day:hover { background: #263040; }

.calendar-day.today { background: #FAFAFF; }
.dark .calendar-day.today { background: #1E2637; }

.calendar-day.other-month { opacity: 0.3; }
.calendar-day.selected { box-shadow: inset 0 0 0 2px #6366F1; }

/* 날짜 번호 행 */
.cal-header-row {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.cal-daynum {
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
}

.dark .cal-daynum { color: #6B7280; }
.cal-daynum.sun { color: #F87171; }
.cal-daynum.sat { color: #60A5FA; }
.dark .cal-daynum.sun { color: #FCA5A5; }
.dark .cal-daynum.sat { color: #93C5FD; }

.cal-today-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: #6366F1;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

/* =============================================================================
   캘린더 — 아이템 카드
   ============================================================================= */
.cal-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cal-item {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    padding: 2px 5px;
    border-radius: 4px;
    border-left: 2.5px solid transparent;
    box-sizing: border-box;
}

/* 일정 카드 (초록 팔레트, 텍스트는 짙은 회색) */
.cal-item-event-new {
    background: var(--cal-green-bg);
    color: #374151;
    border-left-color: var(--cal-green-dark);
}

.dark .cal-item-event-new {
    background: rgba(107,190,134,0.15);
    color: #D1D5DB;
    border-left-color: #6bbe86;
}

.cal-time {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.65;
    margin-right: 2px;
}

/* 더보기 / 접기 */
.cal-more-btn,
.cal-collapse-btn {
    font-size: 11px;
    font-weight: 500;
    color: #6366F1;
    cursor: pointer;
    padding: 1px 4px;
    display: block;
    margin-top: 1px;
    border: none;
    background: none;
    text-align: left;
}

.dark .cal-more-btn,
.dark .cal-collapse-btn { color: #818CF8; }

.cal-more-btn:hover,
.cal-collapse-btn:hover { text-decoration: underline; }

/* 도트 (구 호환) */
.event-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin: 1px;
}

/* =============================================================================
   모달
   ============================================================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
}

.dark .modal-box { background: #1F2937; }

/* =============================================================================
   진행률 바
   ============================================================================= */
.progress-bar-track {
    width: 100%;
    background: #E5E7EB;
    border-radius: 100px;
    height: 6px;
}
.dark .progress-bar-track { background: #374151; }

.progress-bar-fill {
    background: #6366F1;
    height: 6px;
    border-radius: 100px;
    transition: width 0.3s ease;
}

/* =============================================================================
   로딩 스피너
   ============================================================================= */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E5E7EB;
    border-top-color: #6366F1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* =============================================================================
   캘린더 모바일 뷰
   ============================================================================= */
@media (max-width: 767px) {
    .calendar-desktop { display: none; }
    .calendar-mobile  { display: block; }
}

@media (min-width: 768px) {
    .calendar-desktop { display: block; }
    .calendar-mobile  { display: none; }
}

/* =============================================================================
   사이드 패널 (캘린더 날짜 클릭)
   ============================================================================= */
.side-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 320px;
    background: white;
    box-shadow: -4px 0 24px rgba(0,0,0,0.10);
    border-left: 1px solid #E5E7EB;
    transition: transform 0.3s ease;
    z-index: 40;
    overflow: hidden;
}

.dark .side-panel {
    background: #1F2937;
    border-left-color: #374151;
}

.side-panel.open   { transform: translateX(0); }
.side-panel.closed { transform: translateX(100%); }

/* =============================================================================
   스크롤바 커스텀
   ============================================================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4B5563;
}

/* =============================================================================
   모바일 그룹핑 탭 (캘린더)
   ============================================================================= */
.mobile-group-tabs {
    display: flex;
    gap: 4px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
}
.dark .mobile-group-tabs { background: #374151; }

.mobile-group-tab {
    flex: 1;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #9CA3AF;
    transition: all 0.15s;
}
.mobile-group-tab:hover { color: #6B7280; }
.dark .mobile-group-tab:hover { color: #D1D5DB; }

.mobile-group-tab-active {
    background: white;
    color: #6366F1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dark .mobile-group-tab-active {
    background: #4B5563;
    color: #818CF8;
}

/* =============================================================================
   모바일 리스트 아이템 (캘린더)
   ============================================================================= */
.mobile-group-section {
    margin-bottom: 20px;
}

.mobile-group-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    padding: 8px 0 6px;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 8px;
}
.dark .mobile-group-title {
    color: #E5E7EB;
    border-bottom-color: #374151;
}

.mobile-task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}
.mobile-task-row:hover { background: #F9FAFB; }
.dark .mobile-task-row:hover { background: #283040; }

.mobile-task-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mobile-task-body {
    flex: 1;
    min-width: 0;
}

.mobile-task-title {
    font-size: 13px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
    line-height: 1.4;
}
.dark .mobile-task-title { color: #F3F4F6; }

.mobile-task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.mobile-task-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
}
.dark .mobile-task-badge { opacity: 0.85; }

.mobile-task-path {
    font-size: 11px;
    color: #9CA3AF;
    font-weight: 500;
}

.mobile-task-date {
    font-size: 11px;
    color: #9CA3AF;
    flex-shrink: 0;
    font-weight: 500;
}

.mobile-event-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 10px;
}

.mobile-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34D399;
    flex-shrink: 0;
}

/* =============================================================================
   태스크 페이지 — 뷰 모드 탭
   ============================================================================= */
.tasks-view-tabs {
    display: flex;
    gap: 4px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 12px;
}
.dark .tasks-view-tabs { background: #374151; }

.tasks-view-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #9CA3AF;
    transition: all 0.15s;
    white-space: nowrap;
}
.tasks-view-tab:hover { color: #6B7280; }
.dark .tasks-view-tab:hover { color: #D1D5DB; }

.tasks-view-tab-active {
    background: white;
    color: #6366F1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.dark .tasks-view-tab-active {
    background: #4B5563;
    color: #818CF8;
}

/* =============================================================================
   태스크 페이지 — 칸반 프로젝트 필터 배지
   ============================================================================= */
.kanban-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 4px 0;
}

.kanban-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #E5E7EB;
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.kanban-filter-badge:hover {
    border-color: #C7D2FE;
    color: #6366F1;
    background: #F5F3FF;
}
.dark .kanban-filter-badge {
    background: #1F2937;
    border-color: #374151;
    color: #9CA3AF;
}
.dark .kanban-filter-badge:hover {
    border-color: #6366F1;
    color: #818CF8;
    background: #2D2250;
}

.kanban-filter-active {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
}
.dark .kanban-filter-active {
    background: #6366F1 !important;
    color: white !important;
    border-color: #6366F1 !important;
}

.kanban-filter-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(0,0,0,0.1);
    padding: 1px 6px;
    border-radius: 10px;
}
.kanban-filter-active .kanban-filter-count {
    background: rgba(255,255,255,0.25);
}

.kanban-filter-sub {
    margin-top: -8px;
    padding-left: 12px;
    border-left: 3px solid #C7D2FE;
}
.dark .kanban-filter-sub {
    border-left-color: #4338CA;
}

.kanban-filter-sub .kanban-project-badge {
    font-size: 11px;
    padding: 4px 12px;
}

/* =============================================================================
   칸반 드래그앤드롭
   ============================================================================= */
.kanban-drop-zone {
    min-height: 60px;
    transition: background 0.15s, border-color 0.15s;
    border-radius: 10px;
    border: 2px dashed transparent;
}

.kanban-drop-zone.drop-ready {
    border-color: #D1D5DB;
}
.dark .kanban-drop-zone.drop-ready {
    border-color: #4B5563;
}

.kanban-drop-zone.drop-hover {
    background: #EEF2FF;
    border-color: #6366F1;
}
.dark .kanban-drop-zone.drop-hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #818CF8;
}

.task-card.dragging {
    opacity: 0.4;
    transform: rotate(2deg);
}

.task-card[draggable] {
    cursor: grab;
}
.task-card[draggable]:active {
    cursor: grabbing;
}

/* =============================================================================
   태스크 페이지 — 공통 태스크 행
   ============================================================================= */
.tasks-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}
.tasks-row:hover { background: #F9FAFB; }
.dark .tasks-row:hover { background: #283040; }

.tasks-row-body {
    flex: 1;
    min-width: 0;
}

.tasks-row-title {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .tasks-row-title { color: #F3F4F6; }

.tasks-row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tasks-row-path {
    font-size: 11px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.dark .tasks-row-path { color: #9CA3AF; }

.tasks-row-dates {
    font-size: 11px;
    color: #9CA3AF;
    white-space: nowrap;
}
.dark .tasks-row-dates { color: #6B7280; }

/* =============================================================================
   태스크 페이지 — 프로젝트별 뷰
   ============================================================================= */
.tasks-group-section {
    margin-bottom: 28px;
}

.tasks-group-title {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
    padding-left: 4px;
    border-left: 4px solid #6366F1;
    padding-left: 10px;
}
.dark .tasks-group-title { color: #E5E7EB; }

.tasks-project-card {
    background: white;
    border: 1px solid #F0F0F5;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}
.dark .tasks-project-card { background: #1F2937; border-color: #374151; }

.tasks-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #F3F4F6;
}
.dark .tasks-project-header { border-color: #374151; }

.tasks-project-name {
    font-size: 14px;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
}
.dark .tasks-project-name { color: #F3F4F6; }

.tasks-project-count {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 2px;
    display: block;
}

.tasks-kanban-link {
    font-size: 12px;
    font-weight: 600;
    color: #6366F1;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.tasks-kanban-link:hover { text-decoration: underline; }
.dark .tasks-kanban-link { color: #818CF8; }

.tasks-project-list {
    padding: 6px 4px;
}

.tasks-completed-divider {
    text-align: center;
    font-size: 11px;
    color: #9CA3AF;
    padding: 8px 0;
    border-top: 1px dashed #E5E7EB;
    margin-top: 4px;
}
.dark .tasks-completed-divider { border-color: #374151; }

/* =============================================================================
   태스크 페이지 — 날짜별 뷰
   ============================================================================= */
.tasks-date-section {
    margin-bottom: 20px;
}

.tasks-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 6px;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 4px;
}
.dark .tasks-date-header { border-color: #374151; }

.tasks-date-overdue {
    border-bottom-color: #FCA5A5;
}
.dark .tasks-date-overdue { border-bottom-color: rgba(252,165,165,0.3); }

.tasks-date-label {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}
.dark .tasks-date-label { color: #E5E7EB; }

.tasks-date-diff {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 500;
}

.tasks-date-list {
    padding: 2px 0;
}

/* ── 지식 페이지 카테고리 필터 버튼 ─────────────────────────────────────── */
.cat-btn {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}
.cat-btn:hover {
    border-color: #6fc2df;
    color: #6fc2df;
}
.cat-btn.active {
    background: #6fc2df;
    border-color: #6fc2df;
    color: #fff;
}
.dark .cat-btn {
    background: #1f2937;
    border-color: #374151;
    color: #9ca3af;
}
.dark .cat-btn.active {
    background: #6fc2df;
    border-color: #6fc2df;
    color: #fff;
}

/* ── 지식 카드 (단일 레이어) ───────────────────────────────────────────── */
.know-card {
    display: block;
    background: transparent;
    border: none;
    border-bottom: 1px solid #F0F0F5;
    border-radius: 0;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}
.know-card:hover { box-shadow: none; }
.dark .know-card { background: transparent; border-color: #374151; }
.dark .know-card:hover { box-shadow: none; }

.know-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.know-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.dark .know-card-title { color: #F3F4F6; }

.know-card-date {
    font-size: 11px;
    color: #9CA3AF;
    white-space: nowrap;
    flex-shrink: 0;
}

.know-card-summary {
    font-size: 12px;
    color: #6B7280;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.dark .know-card-summary { color: #9CA3AF; }

.know-card-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 6px;
}

.know-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.know-card-cat {
    font-size: 11px;
    color: #6366F1;
}
.dark .know-card-cat { color: #818CF8; }

.know-card-source {
    font-size: 11px;
    color: #9CA3AF;
}

/* 카드 래퍼 (즐겨찾기 버튼 포함) */
.know-card-wrap {
    position: relative;
}

/* 썸네일 + 텍스트 레이아웃 */
.know-card-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.know-card-text {
    flex: 1;
    min-width: 0;
}
.know-card-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* 즐겨찾기 버튼 */
.know-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: none;
    border: none;
    font-size: 18px;
    color: #D1D5DB;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
}
.know-fav-btn:hover { color: #F59E0B; transform: scale(1.2); }
.know-fav-active { color: #F59E0B !important; }
.dark .know-fav-btn { color: #4B5563; }
.dark .know-fav-btn:hover { color: #F59E0B; }
.dark .know-fav-active { color: #F59E0B !important; }

/* 읽기 상태 토글 버튼 */
.know-status-btn {
    position: absolute;
    top: 8px;
    right: 40px;
    z-index: 2;
    border: none;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    opacity: 0.85;
    line-height: 1.4;
}
.know-status-btn:hover {
    transform: scale(1.08);
    opacity: 1;
}

/* 즐겨찾기 필터 버튼 */
.cat-btn-fav { border-color: #FCD34D; color: #D97706; }
.dark .cat-btn-fav { border-color: #92400E; color: #FCD34D; }
.cat-btn-fav-active {
    background: #F59E0B !important;
    border-color: #F59E0B !important;
    color: white !important;
}

/* (모바일 지식 스타일은 아래 통합 블록에서 처리) */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =============================================================================
   모바일 최적화 — 리스트형 컴팩트 UI (네이버 카페 스타일)
   ============================================================================= */
@media (max-width: 640px) {

    /* 전체 페이지 패딩 */
    .max-w-6xl { padding-left: 10px !important; padding-right: 10px !important; }

    /* ── 지식 페이지 — 리스트형 ── */
    #knowledge-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .know-card {
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #F0F0F5;
        padding: 10px 4px;
        box-shadow: none;
        background: transparent;
    }
    .dark .know-card { border-bottom-color: #2D3748; background: transparent; }
    .know-card:hover { box-shadow: none; }

    .know-card-title { font-size: 14px; -webkit-line-clamp: 1; }
    .know-card-summary { font-size: 11px; margin-bottom: 3px; -webkit-line-clamp: 1; }
    .know-card-keywords { margin-bottom: 3px; }
    .know-card-keywords .badge-normal { font-size: 10px !important; padding: 0px 5px !important; }
    .know-card-footer { font-size: 10px; }
    .know-card-cat { font-size: 10px; }
    .know-card-source { font-size: 10px; }
    .know-card-date { font-size: 10px; }

    .know-card-thumb { width: 56px; height: 56px; border-radius: 6px; }
    .know-card-main { gap: 8px; }

    .know-fav-btn { top: 50%; right: -2px; transform: translateY(-50%); font-size: 16px; }
    .know-status-btn { top: auto; bottom: 6px; right: 6px; font-size: 10px; padding: 1px 6px; }
    .know-fav-btn:hover { transform: translateY(-50%) scale(1.2); }
    .know-card-wrap { padding-right: 22px; }

    .cat-btn { padding: 3px 10px; font-size: 11px; }
    #search-input { padding: 8px 12px; font-size: 13px; }

    /* ── 태스크 페이지 ── */
    .tasks-view-tabs { padding: 3px; gap: 2px; }
    .tasks-view-tab { padding: 6px 10px; font-size: 12px; }

    /* 칸반 컬럼 */
    .kanban-column { padding: 8px; min-height: 80px; border-radius: 8px; }
    .kanban-col-header { margin-bottom: 6px; }
    .kanban-grid { gap: 6px !important; }

    /* 태스크 카드 — 리스트형 */
    .task-card {
        padding: 8px 10px;
        margin-bottom: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #F0F0F5;
        border-left: 3px solid #E5E7EB;
    }
    .task-card:hover { box-shadow: none; transform: none; }
    .dark .task-card { border-bottom-color: #2D3748; }
    .task-card p { font-size: 13px !important; }
    .task-card .text-xs { font-size: 10px !important; }
    .task-card .mt-2 { margin-top: 4px !important; }
    .task-card .mt-1 { margin-top: 2px !important; }
    .task-card .gap-1\.5 { gap: 3px !important; }

    /* 필터 배지 */
    .kanban-filter-bar { gap: 4px; margin-bottom: 8px; }
    .kanban-filter-badge { padding: 4px 10px; font-size: 11px; }
    .kanban-filter-count { font-size: 9px; padding: 0px 5px; }

    /* 태스크 행 (프로젝트별/날짜별) — 리스트형 */
    .tasks-row {
        padding: 8px 4px;
        gap: 8px;
        border-bottom: 1px solid #F0F0F5;
        border-radius: 0;
    }
    .dark .tasks-row { border-bottom-color: #2D3748; }
    .tasks-row:hover { background: transparent; }
    .tasks-row-title { font-size: 13px !important; }
    .tasks-row-meta { gap: 4px; }
    .dash-priority-badge { font-size: 10px !important; padding: 1px 6px !important; }
    .tasks-row-path { font-size: 10px !important; max-width: 150px; }
    .tasks-row-dates { font-size: 10px !important; }

    /* 프로젝트별 뷰 */
    .tasks-group-title { font-size: 14px; margin-bottom: 6px; padding-left: 8px; }
    .tasks-project-card { margin-bottom: 4px; border-radius: 8px; }
    .tasks-project-header { padding: 8px 10px; }
    .tasks-project-name { font-size: 13px; }
    .tasks-project-count { font-size: 10px; }
    .tasks-project-list { padding: 0 2px; }

    /* 날짜별 뷰 */
    .tasks-date-section { margin-bottom: 10px; }
    .tasks-date-header { padding: 4px 2px; }
    .tasks-date-label { font-size: 13px; }
    .tasks-date-list { padding: 0; }

    /* 대시보드 요약 카드 */
    .stat-card { padding: 10px !important; }
    .stat-num { font-size: 18px !important; }
    .stat-label { font-size: 11px !important; }

    /* 대시보드 태스크 행 */
    .dash-task-row { padding: 8px 4px !important; border-bottom: 1px solid #F0F0F5; border-radius: 0 !important; }
    .dark .dash-task-row { border-bottom-color: #2D3748; }
    .dash-task-title { font-size: 13px !important; }

    /* 섹션 제목 */
    .section-title { font-size: 14px !important; }
}

/* =============================================================================
   토큰 사용량 페이지
   ============================================================================= */

/* 탭 바 */
.token-tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 24px;
}
.dark .token-tab-bar { border-bottom-color: #374151; }

.tab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: #111827; }
.dark .tab-btn { color: #9CA3AF; }
.dark .tab-btn:hover { color: #F9FAFB; }
.tab-btn.tab-active { color: #6366F1; border-bottom-color: #6366F1; }
.dark .tab-btn.tab-active { color: #818CF8; border-bottom-color: #818CF8; }

/* 히트맵 */
.heatmap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heatmap-grid {
    display: grid;
    gap: 2px;
    min-width: 700px;
}
.heatmap-cell {
    border-radius: 3px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #374151;
    transition: opacity 0.15s;
}
.dark .heatmap-cell { color: #D1D5DB; }
.heatmap-label {
    font-size: 11px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    padding-right: 4px;
}
.dark .heatmap-label { color: #9CA3AF; }
.heatmap-hour-label {
    font-size: 10px;
    color: #9CA3AF;
    text-align: center;
}
.dark .heatmap-hour-label { color: #6B7280; }

/* 캘린더 히트맵 */
.cal-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-heatmap-cell {
    padding: 6px 4px;
    border-radius: 8px;
    text-align: center;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.cal-heatmap-day {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}
.dark .cal-heatmap-day { color: #E5E7EB; }
.cal-heatmap-val {
    font-size: 10px;
    color: #6B7280;
}
.dark .cal-heatmap-val { color: #9CA3AF; }
.cal-heatmap-weekday {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-align: center;
    padding: 4px 0;
}
.dark .cal-heatmap-weekday { color: #6B7280; }

/* 증감 표시 */
.change-up { color: #EF4444; }
.change-down { color: #10B981; }

/* 에이전트 비율 바 */
.agent-bar-track {
    height: 8px;
    border-radius: 4px;
    background: #E5E7EB;
    overflow: hidden;
}
.dark .agent-bar-track { background: #374151; }
.agent-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* 토큰 요약 카드 */
.token-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

/* 비교 카드 */
.compare-card {
    padding: 16px;
    border-radius: 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
}
.dark .compare-card {
    background: #1F2937;
    border-color: #374151;
}

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}
.chart-container-wide {
    position: relative;
    width: 100%;
}

/* 히스토리 마크다운 렌더링 */
.history-markdown h1 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; color: #111827; }
.dark .history-markdown h1 { color: #F9FAFB; }
.history-markdown h2 { font-size: 1rem; font-weight: 600; margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #E5E7EB; color: #374151; }
.dark .history-markdown h2 { border-bottom-color: #374151; color: #D1D5DB; }
.history-markdown h3 { font-size: 0.875rem; font-weight: 600; margin: 12px 0 6px; color: #6B7280; }
.dark .history-markdown h3 { color: #9CA3AF; }
.history-markdown ul { list-style: disc; padding-left: 20px; margin: 6px 0; }
.history-markdown li { font-size: 0.875rem; line-height: 1.6; color: #374151; margin: 2px 0; }
.dark .history-markdown li { color: #D1D5DB; }
.history-markdown p { font-size: 0.875rem; line-height: 1.6; color: #374151; margin: 4px 0; }
.dark .history-markdown p { color: #D1D5DB; }

/* 워크로그 레이아웃 */
.worklog-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
.worklog-left { min-width: 0; }
.worklog-right { min-width: 0; }
@media (max-width: 900px) {
    .worklog-layout { grid-template-columns: 1fr; }
}

/* 워크로그 타임라인 */
.worklog-timeline { display: flex; flex-direction: column; gap: 0; }
.worklog-item {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}
.dark .worklog-item { border-bottom-color: #1F2937; }
.worklog-item:last-child { border-bottom: none; }
.worklog-time {
    display: flex; flex-direction: column; align-items: flex-end;
    min-width: 48px; font-size: 12px; font-weight: 600; line-height: 1.4;
    color: #6B7280;
}
.dark .worklog-time { color: #9CA3AF; }
.worklog-end { font-size: 11px; font-weight: 400; color: #9CA3AF; }
.dark .worklog-end { color: #6B7280; }
.worklog-bar { width: 4px; border-radius: 2px; flex-shrink: 0; min-height: 36px; }
.worklog-detail { flex: 1; min-width: 0; }
.worklog-title { font-size: 14px; font-weight: 500; color: #111827; line-height: 1.4; }
.dark .worklog-title { color: #F3F4F6; }
.worklog-meta { display: flex; gap: 8px; margin-top: 2px; font-size: 12px; }
.worklog-type { font-weight: 600; }
.worklog-dur { color: #9CA3AF; }
.worklog-project {
    font-size: 11px; font-weight: 600;
    padding: 0 6px; border-radius: 8px;
    background: #EEF2FF; color: #4F46E5;
}
.dark .worklog-project { background: #312E81; color: #A5B4FC; }
.worklog-memo { font-size: 12px; color: #6B7280; margin-top: 4px; }
.dark .worklog-memo { color: #9CA3AF; }

/* 업무 분해 테이블 */
.breakdown-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.breakdown-table th {
    text-align: left; padding: 8px 10px;
    border-bottom: 2px solid #E5E7EB;
    font-weight: 600; color: #374151;
}
.dark .breakdown-table th { border-bottom-color: #4B5563; color: #D1D5DB; }
.breakdown-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #F3F4F6;
}
.dark .breakdown-table td { border-bottom-color: #374151; }
.breakdown-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Pretendard', monospace;
}
.breakdown-table tr:hover td { background: rgba(99,102,241,0.04); }
.dark .breakdown-table tr:hover td { background: rgba(99,102,241,0.08); }
.agent-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; margin-right: 6px; vertical-align: middle;
}

/* ── 뷰 토글 버튼 ─────────────────────────────────────────────── */
.view-toggle-btn {
    background: #F3F4F6; color: #6B7280; border: none; cursor: pointer;
}
.view-toggle-btn:hover { background: #E5E7EB; }
.view-toggle-btn.active { background: #6366F1; color: #fff; }
.dark .view-toggle-btn { background: #374151; color: #9CA3AF; }
.dark .view-toggle-btn:hover { background: #4B5563; }
.dark .view-toggle-btn.active { background: #6366F1; color: #fff; }

/* ── 간트차트 ─────────────────────────────────────────────────── */
.gantt-container {
    background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
    overflow-x: auto; position: relative;
}
.dark .gantt-container { background: #1F2937; border-color: #374151; }

.gantt-table { border-collapse: collapse; min-width: 100%; }

.gantt-header-cell {
    padding: 8px 0; font-size: 11px; font-weight: 500;
    color: #9CA3AF; text-align: center; border-bottom: 1px solid #E5E7EB;
    position: sticky; top: 0; background: #F9FAFB; z-index: 2;
    min-width: 36px;
}
.dark .gantt-header-cell { background: #283040; border-bottom-color: #374151; color: #6B7280; }
.gantt-header-cell.today { color: #6366F1; font-weight: 700; }
.dark .gantt-header-cell.today { color: #818CF8; }
.gantt-header-cell.weekend { color: #D1D5DB; }
.dark .gantt-header-cell.weekend { color: #4B5563; }

.gantt-month-cell {
    padding: 6px 0; font-size: 12px; font-weight: 600;
    color: #374151; text-align: left; border-bottom: 1px solid #E5E7EB;
    position: sticky; top: 0; background: #F9FAFB; z-index: 3;
    white-space: nowrap;
}
.dark .gantt-month-cell { background: #283040; border-bottom-color: #374151; color: #D1D5DB; }

.gantt-label-cell {
    padding: 6px 12px; font-size: 13px; font-weight: 500;
    color: #111827; white-space: nowrap; border-bottom: 1px solid #F3F4F6;
    position: sticky; left: 0; background: #fff; z-index: 1;
    min-width: 160px; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.dark .gantt-label-cell { background: #1F2937; color: #E5E7EB; border-bottom-color: #374151; }

.gantt-group-cell {
    padding: 8px 12px; font-size: 12px; font-weight: 700;
    color: #6B7280; text-transform: uppercase; letter-spacing: 0.05em;
    background: #F9FAFB; border-bottom: 1px solid #E5E7EB;
    position: sticky; left: 0; z-index: 1;
}
.dark .gantt-group-cell { background: #283040; color: #9CA3AF; border-bottom-color: #374151; }

.gantt-cell {
    padding: 0; height: 36px; border-bottom: 1px solid #F3F4F6;
    position: relative; min-width: 36px;
}
.dark .gantt-cell { border-bottom-color: #374151; }
.gantt-cell.today-col { background: rgba(99,102,241,0.06); }
.dark .gantt-cell.today-col { background: rgba(99,102,241,0.1); }
.gantt-cell.weekend-col { background: rgba(0,0,0,0.015); }
.dark .gantt-cell.weekend-col { background: rgba(255,255,255,0.015); }

.gantt-bar {
    position: absolute; top: 8px; height: 20px; border-radius: 4px;
    cursor: pointer; transition: opacity .15s;
    min-width: 6px;
}
.gantt-bar:hover { opacity: 0.8; }

.gantt-bar-active { background: #6366F1; }
.gantt-bar-inactive { background: #9CA3AF; }
.gantt-bar-completed { background: #10B981; }

.gantt-bar-label {
    font-size: 10px; color: #fff; padding: 0 6px;
    line-height: 20px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-today-line {
    position: absolute; top: 0; bottom: 0; width: 2px;
    background: #EF4444; z-index: 5; pointer-events: none;
}

.gantt-legend {
    display: flex; gap: 16px; padding: 12px 16px;
    font-size: 12px; color: #6B7280; border-top: 1px solid #E5E7EB;
}
.dark .gantt-legend { border-top-color: #374151; color: #9CA3AF; }
.gantt-legend-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 3px; margin-right: 4px; vertical-align: middle;
}

.gantt-nav {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; border-bottom: 1px solid #E5E7EB;
}
.dark .gantt-nav { border-bottom-color: #374151; }
.gantt-nav-btn {
    padding: 4px 10px; font-size: 13px; border-radius: 6px;
    background: #F3F4F6; color: #374151; border: none; cursor: pointer;
}
.gantt-nav-btn:hover { background: #E5E7EB; }
.dark .gantt-nav-btn { background: #374151; color: #D1D5DB; }
.dark .gantt-nav-btn:hover { background: #4B5563; }
.gantt-nav-title {
    font-size: 14px; font-weight: 600; color: #111827;
    min-width: 120px; text-align: center;
}
.dark .gantt-nav-title { color: #E5E7EB; }

@media (max-width: 767px) {
    .token-stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .cal-heatmap-grid { gap: 2px; }
    .cal-heatmap-cell { min-height: 44px; padding: 4px 2px; }
    .cal-heatmap-day { font-size: 11px; }
    .cal-heatmap-val { font-size: 9px; }
    .breakdown-table { font-size: 12px; }
    .breakdown-table th, .breakdown-table td { padding: 5px 6px; }
    .gantt-label-cell { min-width: 120px; font-size: 12px; padding: 6px 8px; }
    .gantt-header-cell { min-width: 28px; font-size: 10px; }
    .gantt-cell { min-width: 28px; height: 32px; }
    .gantt-bar { top: 6px; height: 18px; }
    .gantt-bar-label { font-size: 9px; line-height: 18px; }
}
