/* Extracted from app.css for route-specific maintainability. */
/* 업무 달력 — 모바일 달력+목록(컴팩트 그리드 + 시간순 리스트) */
.cal-m-root {
    width: 100%;
    box-sizing: border-box;
    padding: 0 0 24px;
}
.cal-page-root {
    padding-top: 0;
    margin-top: 0;
    box-sizing: border-box;
}
/* Prevent refresh flicker on /cal before page body mounts */
html.route-cal .app-top-header,
html.route-cal .metric-header-fixed {
    display: none !important;
}
html.route-cal #dashboard-stack.content-area,
html.route-cal #dashboard-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.content-area:has(.cal-page-root.cal-page) {
    margin-left: 180px !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
html.force-mobile .content-area:has(.cal-page-root.cal-page) {
    margin-left: 0 !important;
}
@media (max-width: 900px) {
    .content-area:has(.cal-page-root.cal-page) {
        margin-left: 0 !important;
    }
}
body:has(#dashboard-stack .cal-page-root.cal-page) .app-top-header,
body:has(#dashboard-stack .cal-page-root.cal-page) .metric-header-fixed {
    display: none !important;
}

/* stat 페이지: 상단 공백 최종 보정 (하단 규칙 덮어쓰기용) */
body:has(#dashboard-content .stat-page-marker) .metric-header-fixed.hidden-metric ~ #dashboard-stack.content-area {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
body:has(#dashboard-content .stat-page-marker) .stat-page .technote-topbar {
    margin-left: -10px !important;
}
body:has(#dashboard-content .stat-page-marker) #admin-top7-wrap {
    margin-top: 0 !important;
    padding: 0 !important;
}
body:has(#dashboard-content .stat-page-marker) #admin-top7-wrap .technote-topbar {
    margin: 0 -10px 0 !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
}
/* carlog 페이지: 상단 여백/사이드바-상단바 사이 틈 제거 */
body:has(#dashboard-stack .carlog-page) .app-top-header,
body:has(#dashboard-stack .carlog-page) .metric-header-fixed {
    display: none !important;
}
body:has(#dashboard-stack .carlog-page) .sidebar {
    border-right: none !important;
}
body:has(#dashboard-stack .carlog-page) #dashboard-stack.content-area,
body:has(#dashboard-stack .carlog-page) #dashboard-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body:has(#dashboard-stack .carlog-page) .carlog-page {
    margin: 0 !important;
    padding: 0 8px 24px !important;
}
body:has(#dashboard-stack .carlog-page) .carlog-page .technote-topbar {
    margin: 0 -10px 0 !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
}
/* hipass 페이지: carlog와 동일하게 상단/좌측 틈 제거 + 햄버거 숨김 */
body:has(#dashboard-stack .hipass-page) .app-top-header,
body:has(#dashboard-stack .hipass-page) .metric-header-fixed {
    display: none !important;
}
body:has(#dashboard-stack .hipass-page) .sidebar {
    border-right: none !important;
}
body:has(#dashboard-stack .hipass-page) #dashboard-stack.content-area,
body:has(#dashboard-stack .hipass-page) #dashboard-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body:has(#dashboard-stack .hipass-page) .hipass-page {
    margin: 0 !important;
    padding: 0 8px 24px !important;
}
body:has(#dashboard-stack .hipass-page) .hipass-page .technote-topbar {
    margin: 0 -10px 0 !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
}
/* settings 페이지: carlog/hipass와 동일하게 상단/좌측 틈 제거 + 햄버거 숨김 */
body:has(#settings-forms-root[style*="display: block"]) .app-top-header,
body:has(#settings-forms-root[style*="display: block"]) .metric-header-fixed {
    display: none !important;
}
body:has(#settings-forms-root[style*="display: block"]) .sidebar {
    border-right: none !important;
}
body:has(#settings-forms-root[style*="display: block"]) #dashboard-stack.content-area,
body:has(#settings-forms-root[style*="display: block"]) #dashboard-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body:has(#settings-forms-root[style*="display: block"]) #settings-forms-root {
    margin: 0 !important;
    padding-top: 0 !important;
}
body:has(#settings-forms-root[style*="display: block"]) #settings-forms-root .technote-topbar {
    margin: 0 -12px 12px !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
}
body:has(#dashboard-stack .cal-page-root.cal-page) #dashboard-stack.content-area,
body:has(#dashboard-stack .cal-page-root.cal-page) #dashboard-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.cal-page-root .technote-topbar {
    position: sticky;
    top: 0;
    z-index: 10125;
}
@media (min-width: 801px) {
    /* PC /cal only: hide back + hamburger, center topbar content */
    body:has(#dashboard-stack .cal-page-root.cal-page) .cal-page-root.cal-page .technote-back-btn,
    body:has(#dashboard-stack .cal-page-root.cal-page) .cal-page-root.cal-page .technote-hamburger {
        display: none !important;
    }
    body:has(#dashboard-stack .cal-page-root.cal-page) .cal-page-root.cal-page .technote-topbar {
        padding: 8px 12px !important;
    }
    body:has(#dashboard-stack .cal-page-root.cal-page) .cal-page-root.cal-page .technote-top-head {
        margin-bottom: 0 !important;
        min-height: 28px;
        display: flex;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    body:has(#dashboard-stack .cal-page-root.cal-page) .cal-page-root.cal-page .technote-top-left {
        width: 100%;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0 !important;
    }
    body:has(#dashboard-stack .cal-page-root.cal-page) .cal-page-root.cal-page .technote-top-titles {
        display: flex;
        align-items: center;
    }
    body:has(#dashboard-stack .cal-page-root.cal-page) .cal-page-root.cal-page .technote-top-title {
        margin-top: 0 !important;
        line-height: 1.2 !important;
    }
}
/* 모바일 달력 카드 — 참고 목업(cal-header / cal-grid) 톤 */
.cal-m-calwrap {
    background: #ffffff;
    border: none;
    border-bottom: 0.5px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    padding: 0 12px 0;
    box-sizing: border-box;
}
.cal-m-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    width: 100%;
    border-bottom: none;
    box-sizing: border-box;
    column-gap: 0;
    padding: 0;
}
.cal-m-week:last-child {
    padding-bottom: 12px;
}
.cal-m-week--hdr {
    background: #fff;
    border-bottom: none;
    padding-top: 0;
    padding-bottom: 4px;
    margin-bottom: 4px;
}
.cal-m-hdr-cell {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    padding: 4px 0;
    box-sizing: border-box;
}
.cal-m-hdr-cell--sun {
    color: #ef4444;
}
.cal-m-hdr-cell--sat {
    color: #3b82f6;
}
.cal-m-cell {
    min-width: 0;
    min-height: 40px;
    box-sizing: border-box;
}
.cal-m-cell--empty {
    background: transparent;
}
.cal-m-cell--day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 5px 0 4px;
    cursor: pointer;
    box-sizing: border-box;
}
.cal-m-daynum {
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    height: 28px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
    border-radius: 50%;
    color: #374151;
}
.cal-m-cell--sun .cal-m-daynum:not(.cal-m-daynum--today):not(.cal-m-daynum--selected) {
    color: #ef4444;
}
.cal-m-cell--sat .cal-m-daynum:not(.cal-m-daynum--today):not(.cal-m-daynum--selected) {
    color: #3b82f6;
}
.cal-m-cell--holiday .cal-m-daynum:not(.cal-m-daynum--today):not(.cal-m-daynum--selected) {
    color: #ef4444;
}
.cal-m-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
    min-height: 6px;
    width: 100%;
    box-sizing: border-box;
}
.cal-m-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
/* 업무 달력 — 오늘 날짜 숫자에 동그라미 강조 */
.cal-day-today-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    aspect-ratio: 1;
    border: none;
    background-color: #1e3a8a;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}
.cal-m-daynum--today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    height: 28px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    aspect-ratio: 1;
    background-color: #1a2744;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
}
.cal-m-daynum--selected {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    height: 28px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    aspect-ratio: 1;
    background-color: #1a56db;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
}
.cal-m-listwrap {
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px 16px;
}
.cal-m-list-date-group {
    margin-top: 10px;
}
.cal-m-list-date-group:first-child {
    margin-top: 0;
}
.cal-m-list-datehdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 2px 6px;
    box-sizing: border-box;
}
.cal-m-list-datehdr-line {
    flex: 1;
    height: 0.5px;
    min-width: 8px;
    background: #e5e7eb;
}
.cal-m-list-datehdr-date {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}
.cal-m-list-datehdr-wd {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
}
.cal-m-list-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    background: #ffffff;
    border-radius: 10px;
    border: 0.5px solid #e5e7eb;
    padding: 10px 12px;
    box-sizing: border-box;
}
.cal-m-list-row:last-child {
    margin-bottom: 0;
}
.cal-m-list-colorbar {
    width: 3px;
    height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: center;
}
.cal-m-list-row-inner {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
}
.cal-m-list-textcol {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 4px;
}
.cal-m-list-meta {
    font-size: 10px;
    font-weight: 400;
    color: #9ca3af;
    line-height: 1.3;
}
.cal-m-list-title {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    line-height: 1.35;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-m-list-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.cal-m-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 5px;
    line-height: 1.2;
    white-space: nowrap;
    border: none;
}
.cal-m-badge--plan {
    background: #dbeafe;
    color: #1d4ed8;
}
.cal-m-badge--duty {
    background: #ffedd5;
    color: #c2410c;
}
.cal-m-badge--common {
    background: #e0e7ff;
    color: #4338ca;
}
.cal-m-badge--personal {
    background: #ede9fe;
    color: #6d28d9;
}
.cal-m-badge--google {
    background: #ecfdf3;
    color: #166534;
}
.cal-m-badge--local {
    background: #f3f4f6;
    color: #475569;
}
.cal-m-list-time {
    font-size: 12px;
    color: #94a3b8;
    width: 36px;
    flex-shrink: 0;
}
.cal-m-complete-btn {
    flex-shrink: 0;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 20px;
    border: none;
    background: #ecfdf5;
    color: #065f46;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.25;
}
.cal-m-complete-btn:active {
    opacity: 0.88;
}
.cal-m-edit-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    border: none;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cal-m-edit-btn:active {
    opacity: 0.88;
}
.cal-m-list-empty {
    text-align: center;
    color: #94a3b8;
    padding: 24px 8px;
    margin: 0;
}
/* 업무 달력: 연·월 + 참고 목업 cal-nav (SVG 화살표) */
.cal-month-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 0;
    margin-bottom: 14px;
    padding: 14px 12px 0;
    box-sizing: border-box;
    gap: 0;
    flex-wrap: nowrap;
}
.cal-month-title {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    gap: 4px;
    margin: 0;
    line-height: 1.2;
    font-family: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
.cal-month-title-year {
    font-size: 18px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #111827;
    letter-spacing: -0.02em;
}
.cal-month-title-unit {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    letter-spacing: 0;
}
.cal-month-title-monthnum {
    font-size: 24px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #1a56db;
    letter-spacing: -0.02em;
}
.cal-month-nav-icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    border: 0.5px solid #e5e7eb;
    background: #f4f5f7;
    color: #374151;
    line-height: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.cal-month-nav-icon-btn:active {
    background: #e5e7eb;
}
.cal-month-nav-chevron {
    display: block;
    vertical-align: middle;
}
.cal-month-nav-btn {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.cal-month-nav-btn:active {
    background: #f8fafc;
}
.cal-view-mode-bar {
    display: none !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}
.cal-view-tb-btn {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
}
.cal-view-tb-btn--active {
    background: #1e3a8a !important;
    border-color: #1e3a8a !important;
    color: #fff !important;
}
/* PC: 월간 벽보기만 표시 */
@media screen and (min-width: 801px) {
    .cal-mode-compact { display: none !important; }
    .cal-mode-wall { display: block !important; }
}
/* 모바일: 전환 버튼 없음 · 컴팩트(달력+목록)만 */
@media screen and (max-width: 800px) {
    .cal-view-mode-bar { display: none !important; }
    #cal-wall-wrap.cal-mode-wall { display: none !important; }
    .cal-pc-shell {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }
    #cal-compact-wrap.cal-mode-compact {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
    }
}
