/* ============================================================
   PMTool — Linear 풍 디자인 토큰
   라이트(:root) / 다크([data-bs-theme="dark"]) 양쪽 정의
   ============================================================ */
:root {
    /* 그레이 스케일 */
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gray-950: #020617;

    /* 액센트 — BRILS CI 컬러 (https://www.brils.co.kr/company/corporate-identity/) */
    --brils-blue:       #0078c5;  /* 메인 (Pantone 2935C) */
    --brils-navy:       #13345a;  /* 진한 강조 */
    --brils-light-blue: #0095ce;  /* 보조 */
    --brils-mint-blue:  #55bdda;  /* 부드러운 강조 */

    --accent:       var(--brils-blue);
    --accent-hover: var(--brils-navy);
    --accent-soft:  #e6f3fb;  /* BRILS Blue 12% tint */

    /* 상태 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger:  #ef4444;
    --info:    var(--brils-light-blue);

    /* 시맨틱 — 라이트 */
    --bg:          #ffffff;
    --bg-elevated: #ffffff;
    --bg-muted:    var(--gray-50);
    --bg-subtle:   var(--gray-100);
    --text:        var(--gray-900);
    --text-muted:  var(--gray-500);
    --text-faint:  var(--gray-400);
    --border:      var(--gray-200);
    --border-strong: var(--gray-300);

    /* 사이드바 — 항상 다크 (라이트 모드에서도) */
    --sidebar-bg:     var(--gray-900);
    --sidebar-text:   var(--gray-300);
    --sidebar-muted:  var(--gray-500);
    --sidebar-hover-bg: var(--gray-800);
    --sidebar-hover-text: #ffffff;
    --sidebar-active-bg: var(--accent);
    --sidebar-active-text: #ffffff;
    --sidebar-border: var(--gray-800);

    /* 타이포 */
    --fs-xs:   0.75rem;
    --fs-sm:   0.8125rem;
    --fs-base: 0.875rem;
    --fs-md:   1rem;
    --fs-lg:   1.125rem;
    --fs-xl:   1.5rem;

    /* 간격 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;

    /* 라운드 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    /* 그림자 — Linear 풍 미세 */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 20px -5px rgba(15, 23, 42, 0.1), 0 4px 8px -4px rgba(15, 23, 42, 0.05);

    /* 레이아웃 */
    --sidebar-w: 240px;
    --sidebar-w-collapsed: 64px;
    --topbar-h: 56px;
}

/* 다크 모드 — Bootstrap 5.3의 data-bs-theme 활용 */
[data-bs-theme="dark"] {
    --accent-soft: rgba(0, 120, 197, 0.18);  /* BRILS Blue tint */

    --bg:          var(--gray-950);
    --bg-elevated: var(--gray-900);
    --bg-muted:    var(--gray-900);
    --bg-subtle:   var(--gray-800);
    --text:        var(--gray-100);
    --text-muted:  var(--gray-400);
    --text-faint:  var(--gray-500);
    --border:      var(--gray-800);
    --border-strong: var(--gray-700);

    /* 다크모드에서 사이드바는 본문(--bg: #020617)보다 살짝 밝게 두어 경계 가시화 */
    --sidebar-bg: var(--gray-900);
    --sidebar-border: var(--gray-800);
    --sidebar-hover-bg: var(--gray-800);
}

/* ============================================================
   기본 타이포 / 바디
   ============================================================ */
html, body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: var(--fs-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { transition: background-color 0.08s ease, color 0.08s ease; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

h1, .h1 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.01em; }
h2, .h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h3, .h3 { font-size: var(--fs-lg); font-weight: 600; }
h4, .h4 { font-size: var(--fs-md); font-weight: 600; }

.small, small { font-size: var(--fs-sm); }
.text-muted { color: var(--text-muted) !important; }

/* Blazor FocusOnNavigate가 h1에 자동 포커스 → 마우스 사용자에게는 outline 숨김 */
h1:focus, h2:focus, h3:focus { outline: none; }
h1:focus-visible, h2:focus-visible, h3:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ============================================================
   사이드바
   ============================================================ */
.sidebar {
    background: var(--sidebar-bg) !important;
    color: var(--sidebar-text);
    min-height: 100vh;
    padding: var(--space-2) 0;
    border-right: 1px solid var(--sidebar-border);
    transition: width 0.18s ease;
}
.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1px 0.5rem;
    transition: none;
}
.sidebar .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}
.sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}
.sidebar .nav-link i { width: 1.2rem; text-align: center; font-size: var(--fs-md); flex-shrink: 0; }

/* 사이드바 헤더 (브랜드 영역) */
.sidebar-brand {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
}

/* 관리자 섹션 라벨 */
.sidebar .nav-section {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-4) var(--space-4) var(--space-1);
}

/* 사이드바 푸터 (접기 버튼 등) */
.sidebar-footer {
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--sidebar-border);
    margin-top: var(--space-3);
}

/* offcanvas-md 모바일 변환 시 다크 배경 보장 */
.sidebar.offcanvas-md { background: var(--sidebar-bg); }
.sidebar .offcanvas-header { border-bottom: 1px solid var(--sidebar-border); }

/* Bootstrap의 .offcanvas-md는 데스크톱에서 display:flex (row)로 계산되어
   자식 brand+nav가 가로 배치되며 brand가 좁아져 한글이 세로로 깨진다.
   사이드바 내부 offcanvas-body는 강제로 column으로 둔다. */
.sidebar .offcanvas-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
}

/* === 사이드바 접기 (Icon-only 모드, md 이상에서만 동작) === */
@media (min-width: 768px) {
    .sidebar-collapsed .sidebar {
        width: var(--sidebar-w-collapsed) !important;
        max-width: var(--sidebar-w-collapsed);
        flex: 0 0 var(--sidebar-w-collapsed);
        overflow: hidden;
    }
    .sidebar-collapsed .sidebar .nav-link { justify-content: center; padding: 0.55rem 0; }
    .sidebar-collapsed .sidebar .nav-link-label,
    .sidebar-collapsed .sidebar .nav-section,
    .sidebar-collapsed .sidebar-brand-label,
    .sidebar-collapsed .sidebar-footer .footer-label { display: none; }

    .sidebar-collapsed main.main-content {
        flex: 0 0 calc(100% - var(--sidebar-w-collapsed));
        max-width: calc(100% - var(--sidebar-w-collapsed));
    }
}

/* ============================================================
   메인 콘텐츠
   ============================================================ */
.main-content {
    padding: var(--space-5) var(--space-5);
    min-width: 0;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* 카드 — Linear 풍 절제된 보더 + 미세 그림자 */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
/* color는 부모 .card에서 상속받아 text-bg-* 강조 카드의 글자색을 깨뜨리지 않음 */
.card-body { color: inherit; padding: var(--space-4); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
}

/* 테이블 */
.table {
    color: var(--text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border);
    font-size: var(--fs-sm);
}
.table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text);
    border-bottom-color: var(--border);
}
.table thead th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-muted);
}
.table-hover > tbody > tr:hover > * { background-color: var(--bg-muted); color: var(--text); }

/* 버튼 — Linear 풍 작고 또렷 */
.btn { font-size: var(--fs-sm); font-weight: 500; border-radius: var(--radius-md); }
.btn-sm { font-size: var(--fs-xs); }
.btn-primary {
    background: var(--accent); border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-hover); border-color: var(--accent-hover);
}
.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-outline-secondary:hover {
    background: var(--bg-muted); border-color: var(--border-strong); color: var(--text);
}

/* 폼 컨트롤 */
.form-control, .form-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: var(--fs-sm);
    border-radius: var(--radius-md);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-label { color: var(--text); font-size: var(--fs-sm); font-weight: 500; }

/* 배지 */
.badge { font-weight: 500; font-size: var(--fs-xs); }

/* 알림 박스 */
.alert {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: var(--fs-sm);
}
.alert-info { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--text); }

/* ============================================================
   프로젝트 색 점
   ============================================================ */
.project-color-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem;
}

/* ============================================================
   캘린더 타임라인
   ============================================================ */
.day-cell-today { background: rgba(91, 108, 255, 0.12) !important; }
.day-cell-holiday { background: rgba(239, 68, 68, 0.10) !important; }
.day-cell-weekend { background: var(--bg-muted) !important; }
.bg-holiday-row { background: rgba(245, 158, 11, 0.06); }

.cal-proj-col { width: 240px; flex-shrink: 0; }
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-scroll-inner { min-width: 720px; }

/* ============================================================
   구글/네이버 풍 그리드 캘린더
   ============================================================ */
/* 캘린더 툴바: h1 + 뷰 모드 + 계획 토글 + 네비 가로 배치. 모바일은 자동 wrap */
.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    justify-content: space-between;
}
.cal-toolbar > .cal-view-group,
.cal-toolbar > .cal-view-select,
.cal-toolbar > .cal-toggle-plans,
.cal-toolbar > .cal-nav { flex-shrink: 0; }
.cal-toolbar .cal-nav { display: flex; align-items: center; gap: var(--space-2); }

@media (max-width: 768px) {
    .cal-toolbar { gap: var(--space-2); }
    .cal-toolbar > h1 { width: 100%; font-size: 1.1rem; }
    .cal-view-select { flex: 1 1 auto; min-width: 0; }
    .cal-nav { flex: 1 1 auto; justify-content: space-between; }
    .cal-nav input[type="date"], .cal-nav input[type="month"] {
        flex: 1; min-width: 0;
    }
}

/* 일(Day) 뷰: 어제·오늘·내일 카드 세로 스택, 오늘 포커스 */
.cal-day-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.cal-day-card { padding: 0; overflow: hidden; transition: opacity 0.12s ease, transform 0.12s ease; }
.cal-day-card.is-faded { opacity: 0.55; }
.cal-day-card.is-faded:hover { opacity: 0.85; }
.cal-day-card.is-focused {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.cal-day-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}
.cal-day-card.is-faded .cal-day-header { padding: var(--space-2) var(--space-3); }
.cal-day-header.is-sun .cal-day-date-num { color: var(--danger); }
.cal-day-header.is-sat .cal-day-date-num { color: var(--info); }
.cal-day-date-num {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    min-width: 56px;
    text-align: center;
}
.cal-day-card.is-focused .cal-day-date-num { font-size: 3.25rem; min-width: 72px; }
.cal-day-card.is-faded .cal-day-date-num { font-size: 1.75rem; min-width: 44px; }
.cal-day-date-meta { flex: 1; min-width: 0; }
.cal-day-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.cal-day-card.is-focused .cal-day-label { color: var(--accent); }
.cal-day-body { padding: var(--space-2); max-height: 50vh; overflow-y: auto; }
.cal-day-card.is-faded .cal-day-body { max-height: 200px; }

.cal-grid-card { padding: 0; overflow: hidden; }
/* 요일 헤더는 단일 grid 행 — 그 아래는 주(week) wrapper들이 세로 스택 */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--border);
    gap: 1px;
}
/* 한 주: 7컬럼 grid + 절대 위치 막대 컨테이너 */
.cal-grid-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: var(--border);
    gap: 1px;
    border-top: 1px solid var(--border);
    position: relative;
    /* --track-count: 인라인으로 설정됨 */
}
.cal-grid-weekday {
    background: var(--bg-elevated);
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-2) 0;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cal-grid-weekday.is-sun { color: var(--danger); }
.cal-grid-weekday.is-sat { color: var(--info); }

.cal-grid-cell {
    background: var(--bg-elevated);
    padding: 26px var(--space-2) var(--space-2);  /* 상단은 date(absolute)용 26px */
    min-height: 110px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    transition: none;
    position: relative;
}
/* 주 wrapper 안의 셀: padding-top에 date(28px) + 트랙(20px씩) + 여백(8px) 통합
   막대 top은 28+track*20, events는 padding 끝(=28+trackCount*20+8)에서 시작 → 항상 일정 간격 */
.cal-grid-week .cal-grid-cell {
    padding-top: calc(28px + var(--track-count, 0) * 20px + 8px);
    min-height: calc(110px + var(--track-count, 0) * 20px);
}
.cal-grid-week .cal-grid-cell .cal-grid-events { margin-top: 0; }

/* 주(Week) 뷰 — 셀을 월 보기 4주분(≈440px) 높이로 늘려 한 셀에 더 많은 일일보고/휴가 표시 */
.cal-grid-week.is-week-view .cal-grid-cell {
    min-height: calc(440px + var(--track-count, 0) * 20px);
}
.cal-grid-week.is-week-view .cal-grid-cell .cal-grid-events {
    overflow-y: auto;
    max-height: calc(440px + var(--track-count, 0) * 20px - 28px);
}
.cal-grid-cell:hover { background: var(--bg-muted); }
.cal-grid-cell.is-other-month { background: var(--bg-muted); color: var(--text-faint); }
.cal-grid-cell.is-other-month .cal-grid-date-num { color: var(--text-faint); }
.cal-grid-cell.is-sun .cal-grid-date-num { color: var(--danger); }
.cal-grid-cell.is-sat .cal-grid-date-num { color: var(--info); }
.cal-grid-cell.is-holiday { background: rgba(239, 68, 68, 0.05); }

.cal-grid-date {
    position: absolute;
    top: 4px;
    left: 6px;
    right: 6px;
    z-index: 3;  /* 막대(z=2) 위에 항상 노출 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    pointer-events: none;  /* 막대 클릭 가능하도록 */
}
.cal-grid-date .cal-grid-date-num,
.cal-grid-date .cal-grid-holiday-name { pointer-events: auto; }
.cal-grid-date-num {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}
.cal-grid-date-num.is-today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    background: var(--accent);
    color: #ffffff;
    border-radius: 50%;
    font-size: var(--fs-xs);
}
.cal-grid-holiday-name {
    font-size: 10px;
    color: var(--danger);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.cal-grid-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    overflow: hidden;
}
.cal-grid-event {
    color: #ffffff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.3;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: none;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.cal-grid-event:hover { filter: brightness(1.15); }
.cal-grid-event i { font-size: 10px; opacity: 0.95; flex-shrink: 0; }
/* 프로젝트 막대: 안쪽 윤곽선 + 좀 더 굵은 글자로 시인성 보강 */
.cal-grid-event-project {
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), inset 3px 0 0 rgba(0, 0, 0, 0.35);
    padding-left: 8px;
}
/* 휴가 표시 — 배경은 옅고 좌측 컬러 보더 + 이모지 */
.cal-grid-event.cal-grid-leave {
    background: var(--bg-muted);
    color: var(--text);
    text-shadow: none;
    box-shadow: none;
    font-weight: 600;
    padding-left: 6px;
}
[data-bs-theme="dark"] .cal-grid-event.cal-grid-leave { background: var(--bg-subtle); }
/* 계획(미래 날짜) 항목 — 점선 테두리 + 옅게 */
.cal-grid-event.cal-grid-event-plan {
    opacity: 0.65;
    border: 1px dashed currentColor;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.15) 4px,
        rgba(255,255,255,0.15) 8px
    );
}
.cal-grid-event-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-grid-more {
    font-size: 11px;
    color: var(--text-muted);
    padding: 1px 4px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.06s ease, color 0.06s ease;
}
.cal-grid-more:hover { color: var(--accent); background: var(--bg-muted); }

/* 주 단위 연속 프로젝트 막대 — 한 주를 가로지르거나 셀 사이를 잇는 absolute bar */
.cal-week-bar {
    position: absolute;
    height: 18px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    z-index: 2;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.12);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: none;
}
.cal-week-bar:hover {
    filter: brightness(1.12);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 4px 8px rgba(0, 0, 0, 0.2);
}
.cal-week-bar i { font-size: 10px; opacity: 0.95; flex-shrink: 0; }
.cal-week-bar-label {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: #ffffff;
}
.cal-week-bar-arrow { font-size: 14px; opacity: 0.9; flex-shrink: 0; }

/* 그 날 상세 모달 — CommandPalette 백드롭/모달 클래스 재사용 + day-detail-* 확장 */
.day-detail-modal {
    max-width: min(900px, 92vw);
    width: 92vw;
}
.day-detail-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    gap: var(--space-3);
}
.day-detail-date {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--text);
}
.day-detail-body {
    padding: var(--space-2);
    overflow-y: auto;
    max-height: 70vh;
}
.day-detail-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: background 0.06s ease;
}
.day-detail-item:hover {
    background: var(--bg-muted);
    color: var(--text);
}
.day-detail-item-title {
    font-size: var(--fs-sm);
    line-height: 1.4;
    word-break: break-all;
}
.day-detail-item-meta {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* 모바일: 그리드 셀 더 작게, 이벤트 라벨 축소 */
@media (max-width: 768px) {
    .cal-grid { grid-auto-rows: minmax(72px, 1fr); }
    .cal-grid-cell { padding: 4px; min-height: 72px; }
    .cal-grid-date-num { font-size: var(--fs-xs); }
    .cal-grid-date-num.is-today { width: 20px; height: 20px; }
    .cal-grid-event { font-size: 10px; padding: 1px 4px; }
    .cal-grid-event-label { font-size: 10px; }
    .cal-grid-holiday-name { display: none; }
}

.timeline-row { position: relative; height: 48px; border-bottom: 1px solid var(--border); }
/* 라이트/다크 모드별 계획 막대 색 - 라이트에서 너무 연해 안 보이는 문제 보강 */
.timeline-plan { position: absolute; height: 14px; top: 6px; background: var(--gray-300); border-radius: 4px; }
[data-bs-theme="dark"] .timeline-plan { background: var(--gray-700); }
.timeline-actual { position: absolute; height: 8px; top: 12px; border-radius: 4px; }
.timeline-marker {
    position: absolute; top: 28px; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--bg-elevated); box-shadow: 0 0 0 1px rgba(0,0,0,.2);
    cursor: pointer; transition: transform .15s ease;
}
.timeline-marker:hover {
    transform: scale(1.6);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   Bento 그리드 (대시보드)
   ============================================================ */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-3);
    grid-auto-rows: minmax(120px, auto);
}
.bento-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-xs);
    color: var(--text);
    display: flex; flex-direction: column;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    min-width: 0;
}
.bento-card-clickable { cursor: pointer; }
.bento-card { transition: none; }
.bento-card-clickable:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.bento-card h3 { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); margin: 0 0 var(--space-2); display: flex; align-items: center; gap: 0.4rem; }
.bento-card h3 i { color: var(--accent); }
.bento-card .bento-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.bento-card .bento-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 0.25rem; }

.col-span-3  { grid-column: span 3; }
.col-span-4  { grid-column: span 4; }
.col-span-6  { grid-column: span 6; }
.col-span-8  { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }
.row-span-2  { grid-row: span 2; }

@media (max-width: 992px) {
    .col-span-3 { grid-column: span 6; }
    .col-span-4 { grid-column: span 6; }
    .col-span-6 { grid-column: span 12; }
    .col-span-8 { grid-column: span 12; }
    .row-span-2 { grid-row: auto; }
}
@media (max-width: 576px) {
    .col-span-3 { grid-column: span 12; }
    .bento-grid { gap: var(--space-2); }
}

/* Bento 카드 안의 list-group: 카드 배경에 맞춰 투명화 */
.bento-card .list-group,
.bento-card .list-group-item {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text);
}
.bento-card .list-group-item-action:hover,
.bento-card .list-group-item-action:focus {
    background-color: var(--bg-muted);
    color: var(--text);
}

/* Bootstrap text-bg-light / bg-light는 다크 모드에서 흰 배경이 유지되어 콘트라스트 손실.
   다크 모드에서 시맨틱 토큰으로 오버라이드. */
[data-bs-theme="dark"] .text-bg-light {
    background-color: var(--bg-elevated) !important;
    color: var(--text) !important;
}
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bg-muted) !important;
    color: var(--text) !important;
}
[data-bs-theme="dark"] .table-light {
    --bs-table-bg: var(--bg-muted);
    --bs-table-color: var(--text);
    color: var(--text);
}

/* 프로젝트 진척 막대 (Bento에서 재사용) */
.progress-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; }
.progress-row .progress-label { font-size: var(--fs-sm); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-row .progress-bar-track { flex: 0 0 120px; height: 6px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; }
.progress-row .progress-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.progress-row .progress-pct { font-size: var(--fs-xs); color: var(--text-muted); width: 36px; text-align: right; }

/* ============================================================
   Command Palette (Ctrl+K)
   ============================================================ */
.cmdk-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1080;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 15vh;
    animation: cmdk-fade-in 0.12s ease;
}
@keyframes cmdk-fade-in { from { opacity: 0; } to { opacity: 1; } }

.cmdk-modal {
    width: 600px; max-width: 90vw; max-height: 70vh;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
}

.cmdk-search {
    width: 100%; border: 0; outline: 0;
    background: transparent; color: var(--text);
    font-size: var(--fs-md);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}
.cmdk-search::placeholder { color: var(--text-faint); }

.cmdk-list { overflow-y: auto; padding: var(--space-2); }

.cmdk-group-label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-2) var(--space-1);
}

.cmdk-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: var(--fs-sm);
    user-select: none;
}
.cmdk-item.is-active { background: var(--accent-soft); color: var(--text); }
.cmdk-item-icon { width: 1.2rem; text-align: center; color: var(--text-muted); }
.cmdk-item.is-active .cmdk-item-icon { color: var(--accent); }
.cmdk-item-label { flex: 1; min-width: 0; }
.cmdk-item-shortcut { font-size: var(--fs-xs); color: var(--text-faint); }

.cmdk-empty { padding: var(--space-5); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }

/* ============================================================
   Blazor 오류 UI
   ============================================================ */
#blazor-error-ui {
    background: var(--warning); color: #ffffff; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* 프로젝트 목록: 긴 이름 한 줄로 잘라서 표시.
   td를 flex container로 만들어 색 점 + 이름이 한 줄에 들어가며 이름만 ellipsis */
.pm-projects-table td.pm-cell-truncate {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.pm-projects-table .pm-cell-truncate-inner {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-projects-table td.pm-cell-truncate .project-color-dot { margin-right: 0; flex-shrink: 0; }

/* ============================================================
   모바일 (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { min-height: auto; border-right: 0; }
    .main-content { padding: var(--space-3); }

    .cal-proj-col { width: 160px; }
    .cal-scroll-inner { min-width: 760px; }

    .btn-group .btn, .btn-group-sm .btn { white-space: nowrap; }

    .card-body { padding: var(--space-3); }

    h1, .h1 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1rem; }
}

/* ============================================================
   Bootstrap primary/info 오버라이드 — BRILS CI 적용
   ============================================================ */
:root {
    --bs-primary:       var(--brils-blue);
    --bs-primary-rgb:   0, 120, 197;
    --bs-link-color:    var(--brils-blue);
    --bs-link-hover-color: var(--brils-navy);
}

.btn-primary {
    --bs-btn-bg:           var(--brils-blue);
    --bs-btn-border-color: var(--brils-blue);
    --bs-btn-hover-bg:           var(--brils-navy);
    --bs-btn-hover-border-color: var(--brils-navy);
    --bs-btn-active-bg:           var(--brils-navy);
    --bs-btn-active-border-color: var(--brils-navy);
}

.btn-outline-primary {
    --bs-btn-color:        var(--brils-blue);
    --bs-btn-border-color: var(--brils-blue);
    --bs-btn-hover-bg:           var(--brils-blue);
    --bs-btn-hover-border-color: var(--brils-blue);
}

.bg-primary { background-color: var(--brils-blue) !important; }
.text-primary { color: var(--brils-blue) !important; }
.border-primary { border-color: var(--brils-blue) !important; }

.bg-info { background-color: var(--brils-light-blue) !important; }
.text-info { color: var(--brils-light-blue) !important; }

/* 진행률 막대 기본색 (특정 색 지정 없는 경우) */
.progress-bar:not([style*="background"]) { background-color: var(--brils-blue); }

/* Alert info — BRILS mint blue 톤 */
.alert-info {
    --bs-alert-bg: #eaf6fb;
    --bs-alert-border-color: var(--brils-mint-blue);
    --bs-alert-color: var(--brils-navy);
}

/* ============================================================
   BRILS 스플래시 (첫 페이지 로드 시 짧게 표시)
   ============================================================ */
.brils-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0078c5 0%, #13345a 100%);
    color: #ffffff;
    transition: opacity 0.5s ease;
    opacity: 1;
}
.brils-splash-inner {
    text-align: center;
    animation: brils-fade-in 0.6s ease both;
}
.brils-splash-mark {
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    animation: brils-pulse 2.4s ease-in-out infinite;
}
.brils-splash-wordmark {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.35em;
    padding-left: 0.35em;  /* 자간 보정 — 우측 여백 */
    line-height: 1;
    color: #ffffff;
}
.brils-splash-divider {
    width: 56px;
    height: 2px;
    background: rgba(255, 255, 255, 0.55);
    margin: 16px auto 14px;
}
.brils-splash-tagline {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 6px;
}
.brils-splash-product {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    padding-left: 0.4em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

@keyframes brils-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes brils-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

/* ============================================================
   BRILS 워드마크 (사이드바 / 로그인 페이지 인라인)
   ============================================================ */
.brils-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: 0.18em;
    padding-left: 0.18em;
    color: var(--brils-blue);
    user-select: none;
}
.brils-wordmark-mark {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brils-blue);
    box-shadow: 0 0 0 2px rgba(0, 120, 197, 0.18);
    flex-shrink: 0;
}
.brils-wordmark-text {
    font-size: 1.05rem;
}
.brils-wordmark-suffix {
    font-weight: 500;
    letter-spacing: 0.05em;
    padding-left: 0;
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 사이드바 안에서는 흰 글자 */
.sidebar .brils-wordmark { color: #ffffff; }
.sidebar .brils-wordmark-mark { background: var(--brils-light-blue); box-shadow: 0 0 0 2px rgba(0, 149, 206, 0.25); }
.sidebar .brils-wordmark-suffix { color: var(--sidebar-muted); }


