/* ============================================
   새롬프라자 1차 스마트 버틀러 - 스타일시트 v2
   사이드바 레이아웃 버전
   ============================================ */

:root {
    --primary: #3182F6; 
    --primary-light: #E8F3FF;
    --primary-hover: #1b64da;
    --bg: #F2F4F6; 
    --surface: #FFFFFF; 
    --text-main: #191F28;
    --text-sub: #8B95A1;
    --text-label: #4E5968;
    --border: #E5E8EB; 
    --danger: #F04452;
    --danger-light: #FEECEF;
    --success: #04C062;
    --warning: #F5A623;

    /* ----------------------------------------
       Design System 토큰 (단지ON 시안 — 신규 컴포넌트 전용)
       기존 --primary/--bg 등은 유지. 새로 만드는 화면에서만 --ds-* 사용.
       ---------------------------------------- */
    --ds-bg:           #f4f5f7;
    --ds-surface:      #ffffff;
    --ds-surface-hov:  #f9fafb;
    --ds-border:       rgba(0,0,0,0.08);
    --ds-divider:      rgba(0,0,0,0.05);
    --ds-accent:       #2563eb;
    --ds-accent-soft:  rgba(37,99,235,0.08);
    --ds-text:         #0f172a;
    --ds-text-sub:     #64748b;
    --ds-text-muted:   #94a3b8;
    --ds-urgent:       #dc2626;
    --ds-urgent-soft:  rgba(220,38,38,0.07);
    --ds-chip:         #f1f3f7;
    --ds-chip-text:    #64748b;
    --ds-radius-card:  10px;
    --ds-radius-input: 7px;
    --ds-radius-pill:  5px;
}

/* 다크 테마 토큰 (사용자가 .dark 클래스를 body에 토글하면 적용) */
.dark {
    --ds-bg:           #0d1117;
    --ds-surface:      #161b22;
    --ds-surface-hov:  #1d2330;
    --ds-border:       rgba(255,255,255,0.08);
    --ds-divider:      rgba(255,255,255,0.04);
    --ds-accent:       #4493f8;
    --ds-accent-soft:  rgba(68,147,248,0.10);
    --ds-text:         #e2e8f0;
    --ds-text-sub:     #7d8fa3;
    --ds-text-muted:   #475569;
    --ds-urgent:       #ef4444;
    --ds-urgent-soft:  rgba(239,68,68,0.10);
    --ds-chip:         #1e2736;
    --ds-chip-text:    #94a3b8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Pretendard', 'Malgun Gothic', '맑은 고딕', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    letter-spacing: -0.3px;
    height: 100vh;
    overflow: hidden;
}
/* 실폰 브라우저 툴바 대응: 100vh는 툴바 포함 높이라 하단(탭바)이 가려짐 → 동적 뷰포트 사용 */
@supports (height: 100dvh) {
    body { height: 100dvh; }
}

/* ============================================
   로그인 화면 — 단지ON 스플릿 스크린
   ============================================ */
#loginScreen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #EEF2F7;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

/* 로그인 쉘 */
.login-shell {
    display: flex;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 28px 72px rgba(0,0,0,0.16);
    width: 100%;
    max-width: 1020px;
    height: 680px;
    animation: loginFadeUp 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* ── 좌측 브랜드 패널 ── */
.brand-panel {
    width: 44%; flex-shrink: 0;
    background: linear-gradient(150deg, #0B1120 0%, #162033 55%, #0D2D56 100%);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px 48px;
    position: relative; overflow: hidden;
}
.brand-panel::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
    background-size: 26px 26px;
}
.brand-panel::after {
    content: '';
    position: absolute; top: -140px; right: -140px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(56,120,220,0.2) 0%, transparent 65%);
    border-radius: 50%;
}
.glow-bl {
    position: absolute; bottom: -80px; left: -80px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 65%);
    border-radius: 50%; z-index: 0;
}
.brand-top { position: relative; z-index: 1; }
.brand-logo {
    display: inline-flex; align-items: center; gap: 10px;
    margin-bottom: 44px;
}
.brand-logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
.brand-logo-mark svg { width: 20px; height: 20px; }
.brand-wordmark {
    font-size: 20px; font-weight: 900;
    color: white; letter-spacing: -0.5px;
}
.brand-wordmark span { color: #60A5FA; }
.brand-headline {
    font-size: 36px; font-weight: 900;
    color: white; line-height: 1.18;
    letter-spacing: -1.2px; margin-bottom: 16px;
}
.brand-headline em { font-style: normal; color: #60A5FA; }
.brand-desc {
    font-size: 13.5px; color: rgba(255,255,255,0.45);
    line-height: 1.75; font-weight: 400;
}
.brand-badges {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px;
}
.brand-badge {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 999px; padding: 7px 13px;
    font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,0.65);
    backdrop-filter: blur(4px);
}
.brand-badge-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #34D399; flex-shrink: 0;
}
.brand-bottom {
    position: relative; z-index: 1;
    display: flex; justify-content: space-between; align-items: center;
}
.brand-copy { font-size: 11px; color: rgba(255,255,255,0.22); }
.brand-ver {
    font-size: 10px; font-weight: 700;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px; padding: 3px 9px;
    color: rgba(255,255,255,0.3); letter-spacing: 0.5px;
}

/* ── 우측 로그인 패널 ── */
.login-panel {
    flex: 1; background: #FAFBFD;
    display: flex; flex-direction: column;
    padding: 44px 44px 36px;
    overflow-y: auto;  /* 데모 영역 펼칠 때 비번이 화면 밖으로 밀리지 않도록 내부 스크롤 */
}
.login-greeting {
    font-size: 26px; font-weight: 900;
    color: #0F172A; letter-spacing: -0.7px; margin-bottom: 4px;
}
.login-sub {
    font-size: 14px; color: #94A3B8;
    font-weight: 500; margin-bottom: 22px;
}
.login-field-label {
    font-size: 11px; font-weight: 700;
    color: #64748B; text-transform: uppercase;
    letter-spacing: 0.7px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.login-count-badge {
    font-size: 10px; font-weight: 700;
    background: #F1F5F9; color: #94A3B8;
    border-radius: 999px; padding: 2px 8px;
    text-transform: none; letter-spacing: 0;
}

/* 단지ON 직접 체험해보기 — 눈에 띄는 CTA 버튼 (영업용 데모 진입) */
.login-demo-cta {
    width: 100%;
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    border: none; border-radius: 14px;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #fff; cursor: pointer; font-family: inherit;
    text-align: left;
    box-shadow: 0 6px 16px rgba(37,99,235,0.28);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.login-demo-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(37,99,235,0.36);
    filter: brightness(1.04);
}
.login-demo-cta:active { transform: translateY(0); }
.login-demo-cta-icon {
    flex: 0 0 auto;
    width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255,255,255,0.22);
    display: flex; align-items: center; justify-content: center;
}
.login-demo-cta-icon svg { width: 16px; height: 16px; }
.login-demo-cta-text { display: flex; flex-direction: column; line-height: 1.25; }
.login-demo-cta-title { font-size: 14.5px; font-weight: 800; letter-spacing: -0.2px; }
.login-demo-cta-sub { font-size: 11.5px; font-weight: 500; opacity: 0.92; margin-top: 2px; }
.login-demo-cta-arrow { margin-left: auto; font-size: 18px; font-weight: 700; opacity: 0.9; }

/* 프로필 카드 그리드 */
.login-profile-grid { display: grid; gap: 8px; margin-bottom: 18px; }
.login-profile-grid.g1 { grid-template-columns: 1fr 1fr; }
.login-profile-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.login-profile-grid.g2 { grid-template-columns: repeat(2, 1fr); }

/* 프로필 리스트 (5명+) */
.login-profile-list {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 18px; max-height: 220px; overflow-y: auto;
}
.login-profile-list::-webkit-scrollbar { width: 3px; }
.login-profile-list::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 3px; }

.lp-card {
    border: 1.5px solid #E2E8F0;
    border-radius: 14px; padding: 20px 12px 16px;
    text-align: center; cursor: pointer; background: white;
    position: relative;
    transition: all 0.18s cubic-bezier(0.34,1.4,0.64,1);
}
.lp-card:hover {
    border-color: #3B82F6; background: #F8FBFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.1);
}
.lp-card.selected {
    border-color: #3B82F6; background: #F0F7FF;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.13);
}
.lp-card.selected .lp-check { opacity: 1; }
.lp-check {
    position: absolute; top: 10px; right: 10px;
    width: 18px; height: 18px;
    background: #3B82F6; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s;
}
.lp-check svg { width: 10px; height: 10px; }

/* 리스트 아이템 */
.lp-list-item {
    display: flex; align-items: center; gap: 12px;
    border: 1.5px solid #E9ECF0;
    border-radius: 12px; padding: 11px 14px;
    cursor: pointer; background: white; position: relative;
    transition: all 0.15s;
}
.lp-list-item:hover { border-color: #3B82F6; background: #F8FBFF; }
.lp-list-item.selected {
    border-color: #3B82F6; background: #F0F7FF;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.lp-list-item.selected .lp-list-check { opacity: 1; }
.lp-list-info { flex: 1; }
.lp-list-role { font-size: 13px; font-weight: 700; color: #0F172A; }
.lp-list-org  { font-size: 11px; color: #94A3B8; margin-top: 1px; }
.lp-list-check {
    width: 20px; height: 20px;
    background: #3B82F6; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s; flex-shrink: 0;
}
.lp-list-check svg { width: 10px; height: 10px; }

/* 이니셜 아바타 */
.lp-avatar {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-size: 11px; font-weight: 800; letter-spacing: -0.3px;
}
.lp-avatar-sm {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; flex-shrink: 0; letter-spacing: -0.3px;
}
.lp-av-blue   { background: #DBEAFE; color: #1D4ED8; }
.lp-av-teal   { background: #CCFBF1; color: #0F766E; }

.lp-card-role {
    font-size: 13px; font-weight: 800;
    color: #0F172A; display: block; letter-spacing: -0.3px;
}
.lp-card-org {
    font-size: 11px; color: #94A3B8;
    font-weight: 500; margin-top: 3px; display: block;
}

/* 비밀번호 입력 */
.lp-pw-wrap { position: relative; margin-bottom: 12px; }
.lp-pw-input {
    width: 100%; padding: 14px 48px 14px 18px;
    border: 1.5px solid #E2E8F0; border-radius: 12px;
    font-size: 15px; font-family: inherit; color: #0F172A;
    background: white; outline: none; transition: all 0.18s; font-weight: 600;
    /* type=text + CSS 마스킹: Chrome 유출 비밀번호 경고 회피용
       (브라우저 자동완성/저장 기능은 포기) */
    -webkit-text-security: disc;
    text-security: disc;
}
.lp-pw-input.show-text {
    -webkit-text-security: none;
    text-security: none;
}
.lp-pw-input:focus {
    border-color: #3B82F6; background: white;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.lp-pw-toggle {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: #CBD5E1; transition: color 0.15s; padding: 4px;
}
.lp-pw-toggle:hover { color: #64748B; }
.lp-pw-toggle svg { width: 18px; height: 18px; }

/* 로그인 버튼 */
.lp-btn {
    width: 100%; padding: 15px;
    background: #0F172A; color: white; border: none;
    border-radius: 13px; font-size: 15px; font-weight: 800;
    cursor: pointer; transition: all 0.18s;
    letter-spacing: -0.3px; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.lp-btn:hover {
    background: #1E293B;
    box-shadow: 0 8px 28px rgba(15,23,42,0.22);
    transform: translateY(-1px);
}
.lp-btn svg { width: 16px; height: 16px; }

/* 현재 단지 */
.lp-complex-row {
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid #F1F5F9;
    display: flex; align-items: center; justify-content: space-between;
}
.lp-complex-lbl { font-size: 11px; color: #CBD5E1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.lp-complex-chip {
    display: flex; align-items: center; gap: 6px;
    background: #F8FAFC; border: 1px solid #E9ECF0;
    border-radius: 8px; padding: 6px 12px;
    font-size: 12px; font-weight: 700; color: #334155;
}
.lp-online-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 2px rgba(16,185,129,0.2);
    animation: breathe 2.4s ease infinite;
}
@keyframes breathe { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ============================================
   메인 대시보드 - 사이드바 레이아웃
   ============================================ */
#mainDashboard { 
    display: none; 
    height: 100vh;
}

#mainDashboard.show {
    display: flex;
}

/* ── 사이드바 ── */
.sidebar {
    width: 200px;
    min-width: 200px;
    background-color: #FFFFFF;
    border-right: 1px solid #E9ECF0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 0; }

/* 로고 영역 */
.sb-logo-area {
    display: flex; align-items: center; gap: 9px;
    padding: 18px 16px 14px;
    border-bottom: 1px solid #F1F5F9;
    flex-shrink: 0;
}
.sb-logo-mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.sb-logo-mark svg { width: 14px; height: 14px; }
.sb-logo-name { font-size: 15px; font-weight: 900; color: #0F172A; letter-spacing: -0.3px; }
.sb-logo-name span { color: #3B82F6; }
.sb-logo-sub { font-size: 10px; color: #94A3B8; font-weight: 600; margin-top: 1px; }

/* 유저 영역 */
.sb-user-area {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #F1F5F9;
    flex-shrink: 0;
}
.sb-user-av {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; flex-shrink: 0;
}
.sb-user-role { font-size: 12px; font-weight: 700; color: #0F172A; }
.sb-user-complex { font-size: 10px; color: #94A3B8; font-weight: 500; }

/* 내비게이션 */
.nav-section { padding: 0 10px; margin-bottom: 4px; }

.nav-label {
    font-size: 9.5px; font-weight: 700;
    color: #CBD5E1; text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 12px 8px 5px;
}

.nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px; border-radius: 9px;
    cursor: pointer; transition: all 0.15s;
    font-size: 13px; font-weight: 600; color: #64748B;
    margin-bottom: 1px;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: #F8FAFC; color: #334155; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: #EFF6FF; color: #2563EB; }
.nav-item.active svg { opacity: 1; }

.nav-bottom {
    margin-top: auto;
    padding: 8px 10px 12px;
    border-top: 1px solid #F1F5F9;
    flex-shrink: 0;
}

.logout-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; background: none;
    color: #94A3B8; border: none;
    padding: 9px 10px; border-radius: 9px;
    cursor: pointer; font-weight: 600;
    font-size: 13px; transition: all 0.15s;
    font-family: inherit; text-align: left;
}
.logout-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.logout-btn:hover { background: #FFF1F2; color: #E11D48; }

/* ── 글자 크기 토글 (사이드바 하단) ── */
.sb-fontsize-row {
    display: flex; gap: 4px;
    padding: 4px 0 10px;
    border-bottom: 1px dashed #F1F5F9;
    margin-bottom: 6px;
}
.sb-fs-btn {
    flex: 1; height: 32px;
    border: 1px solid #E5E8EB; background: transparent;
    border-radius: 8px; cursor: pointer;
    color: #64748B; font-family: inherit; font-weight: 700;
    line-height: 1; padding: 0;
    transition: all 0.15s;
}
.sb-fs-btn:nth-child(1) { font-size: 12px; }
.sb-fs-btn:nth-child(2) { font-size: 15px; }
.sb-fs-btn:nth-child(3) { font-size: 18px; }
.sb-fs-btn:hover { background: #F8FAFC; color: var(--text-main); }
.sb-fs-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* zoom은 .main-content 에만 적용 — body 전체에 zoom 걸면 #mainDashboard
   가 1.25배 커지면서 body의 100vh + overflow:hidden 때문에 잘림.
   메인 영역은 자체 overflow-y:auto 라 콘텐츠 커져도 내부 스크롤로 처리됨.
   사이드바는 그대로 — 메뉴 글자는 본문보다 작아도 자연스러움.
   height 보정: zoom 컨텍스트에서 100vh는 zoom배로 확대 렌더됨(실측) —
   보정 없으면 실높이가 뷰포트를 초과해 하단 (1-1/zoom)만큼 잘리고 스크롤로도 도달 불가.
   height를 /zoom 하면 확대 후 실높이 = 뷰포트. zoom 배율 바꾸면 여기도 같이 바꿀 것. */
html[data-fontsize="large"]  .main-content { zoom: 1.13; height: calc(100vh / 1.13); }
html[data-fontsize="xlarge"] .main-content { zoom: 1.25; height: calc(100vh / 1.25); }

/* ── 메인 컨텐츠 영역 ── */
.main-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    height: 100vh;
    background: #F1F5F9;
}

/* 탭 페인 — 탑바 아래로 padding 이전 (탑바는 main-content 최상단 차지) */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    padding: 16px 32px 28px;
    animation: tabSlideIn 0.22s ease;
}
/* 대시보드는 토스 인사 블록을 가지므로 기존 28px 유지 */
#tabDash.active { padding-top: 28px; }

@keyframes tabSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes loginFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 페이지 헤더 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
/* 페이지 헤더 아이콘 박스 + h2 제목은 전 메뉴에서 숨김 — 탑바 라벨로 대체 */
.page-title-icon { display: none !important; }
.page-title { display: none !important; }
/* 서브타이틀도 전 메뉴 숨김 — 탑바로 충분 */
.page-subtitle { display: none !important; }
/* 좌측 page-header-left는 안의 title/subtitle/icon이 다 숨겨졌으므로 자체도 숨김 */
.page-header-left { display: none !important; }
.page-header { margin: 0 0 12px; min-height: 0; }
/* 좌측 숨겨도 우측 액션(월 네비, 다운로드 버튼 등)은 보존 — flex 정렬은 자동으로 우측 정렬 */
.page-header-left { display: flex; align-items: center; gap: 12px; }
.page-title-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: #EFF6FF;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.page-title-icon svg { width: 18px; height: 18px; }
.page-title {
    font-size: 20px;
    font-weight: 900;
    color: #0F172A;
    letter-spacing: -0.5px;
    margin: 0;
}
.page-subtitle {
    font-size: 12px; color: #94A3B8;
    font-weight: 500; margin-top: 2px;
}
.page-date-badge {
    font-size: 12px; color: #94A3B8; font-weight: 600;
    background: white; border: 1px solid #E9ECF0;
    border-radius: 8px; padding: 7px 14px;
    white-space: nowrap;
}

/* ============================================
   카드 UI
   ============================================ */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #F1F5F9;
    margin-bottom: 18px;
}

.card h4 {
    font-size: 14px;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 7px;
}

/* 대시보드 컨텐츠 카드 헤더 */
.dash-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.dash-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 16px; font-weight: 800; color: #0F172A;
    margin-bottom: 16px;
}
/* 소제목 앞 색깔 점 제거 — 가독성 위해 글씨만 강조 */
.dash-card-dot {
    display: none;
}
.dot-red   { background: #EF4444; }
.dot-blue  { background: #3B82F6; }
.dot-green { background: #10B981; }
.dash-card-badge {
    font-size: 10px; font-weight: 700;
    border-radius: 999px; padding: 2px 8px;
}
.badge-red   { background: #FFF1F2; color: #E11D48; }
.badge-blue  { background: #EFF6FF; color: #2563EB; }
.dash-card-action {
    font-size: 11px; font-weight: 600; color: #94A3B8;
    cursor: pointer; padding: 4px 10px;
    border-radius: 6px; border: 1px solid #E9ECF0;
    background: #F8FAFC; transition: all 0.15s;
}
.dash-card-action:hover { color: #3B82F6; border-color: #BFDBFE; background: #EFF6FF; }

/* 빈 상태 */
.empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 140px; gap: 10px;
    color: #CBD5E1;
}
.empty-icon {
    width: 44px; height: 44px; border-radius: 14px;
    background: #F8FAFC; border: 1px solid #F1F5F9;
    display: flex; align-items: center; justify-content: center;
}
.empty-icon svg { width: 20px; height: 20px; }
.empty-text { font-size: 13px; font-weight: 600; color: #CBD5E1; }
.empty-sub  { font-size: 11px; font-weight: 500; color: #E2E8F0; }

/* ============================================
   버튼 스타일
   ============================================ */
.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.btn:hover { background-color: var(--primary-hover); }

.btn.outline {
    background-color: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn.outline:hover { background-color: var(--bg); }

/* 주요 작성/액션 버튼 공통 강조색 — 보수이력 "+ 새 작업 기록"과 동일 톤(#2563eb, 흰 글씨) */
.btn-accent {
    background: var(--ds-accent) !important;
    color: #fff !important;
    border: none !important;
    transition: filter .12s;
}
.btn-accent:hover { filter: brightness(0.92); }

.action-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 24px;
    transition: 0.2s;
}
.action-btn:hover { filter: brightness(0.95); }

/* ── 폼 필드 레이블 (공통) ── */
.wl-label {
    font-size: 16px; font-weight: 800; color: #0F172A;
    margin-bottom: 8px; margin-top: 0;
    display: flex; align-items: center; gap: 6px;
}
.wl-label-dot { display: none; }
.wl-label-hint { font-size: 12px; color: #CBD5E1; font-weight: 500; }

/* ── 캘린더 연동 버튼 ── */
.wl-cal-btn {
    width: 100%; padding: 13px 20px;
    background: #FFFBEB; border: 1.5px solid #FDE68A;
    border-radius: 12px; cursor: pointer;
    font-size: 13px; font-weight: 700; color: #92400E;
    font-family: inherit; transition: all 0.18s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.wl-cal-btn:hover { background: #FEF3C7; border-color: #F59E0B; }
.wl-cal-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── 사진 버튼 ── */
.wl-photo-row { display: flex; align-items: center; gap: 10px; }
.wl-photo-add {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 18px;
    background: #F8FAFC; border: 1.5px solid #E2E8F0;
    border-radius: 10px; cursor: pointer;
    font-size: 13px; font-weight: 700; color: #334155;
    font-family: inherit; transition: all 0.18s;
}
.wl-photo-add:hover { background: #EFF6FF; border-color: #BFDBFE; color: #2563EB; }
.wl-photo-add svg { width: 14px; height: 14px; }
.wl-photo-clear {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    background: none; border: 1.5px solid #E2E8F0;
    border-radius: 10px; cursor: pointer;
    font-size: 13px; font-weight: 600; color: #94A3B8;
    font-family: inherit; transition: all 0.18s;
}
.wl-photo-clear:hover { background: #FFF1F2; border-color: #FECDD3; color: #E11D48; }
.wl-photo-clear svg { width: 14px; height: 14px; }

/* ── 섹션 구분선 ── */
.wl-divider { height: 1px; background: #F1F5F9; margin: 20px 0; }

/* ── 저장 버튼 영역 ── */
.wl-action-row {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 12px; margin-top: 24px; padding-top: 18px;
    border-top: 1px solid #F1F5F9;
}
.wl-save-hint { font-size: 11px; color: #CBD5E1; font-weight: 500; }
.wl-save-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 13px 28px;
    background: #0F172A; color: white; border: none;
    border-radius: 12px; font-size: 14px; font-weight: 800;
    cursor: pointer; transition: all 0.18s;
    letter-spacing: -0.2px; font-family: inherit;
}
.wl-save-btn:hover { background: #1E293B; box-shadow: 0 6px 20px rgba(15,23,42,0.2); transform: translateY(-1px); }
.wl-save-btn svg { width: 15px; height: 15px; }

.btn-ai { 
    background: var(--primary-light); 
    color: var(--primary); 
    border: none; 
    padding: 10px 18px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600; 
    margin-top: 10px; 
    font-size: 13px; 
    transition: 0.2s; 
}
.btn-ai:hover { background: #d1e4fb; }

.btn-sub { 
    background: var(--bg); 
    color: var(--text-label); 
    border: none; 
    padding: 10px 18px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 13px; 
    transition: 0.2s; 
    white-space: nowrap; 
}
.btn-sub:hover { background: #E5E8EB; color: var(--text-main); }

/* ============================================
   폼 요소
   ============================================ */
label { 
    display: block; 
    font-weight: 700; 
    margin-top: 20px; 
    margin-bottom: 8px; 
    color: var(--text-label); 
    font-size: 15px; 
}

input[type="date"], input[type="time"], input[type="month"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator { cursor: pointer; }

input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="month"], textarea, select {
    width: 100%; 
    padding: 14px 16px; 
    border: 1.5px solid var(--border); 
    background: #FAFAFA; 
    border-radius: 10px; 
    font-size: 16px; 
    font-family: inherit; 
    color: var(--text-main); 
    outline: none; 
    transition: 0.2s; 
}
input:focus, textarea:focus, select:focus { 
    border-color: var(--primary); 
    background: var(--surface); 
    box-shadow: 0 0 0 3px var(--primary-light); 
}
textarea { resize: vertical; line-height: 1.6; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

/* ============================================
   캘린더
   ============================================ */
.calendar-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
}

.calendar-grid { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    text-align: center; 
    border-radius: 12px; 
    overflow: hidden; 
    background: var(--bg); 
    gap: 1px; 
    border: 1px solid var(--border); 
}

.cal-day-name { 
    background: var(--surface); 
    padding: 12px 8px; 
    font-weight: bold; 
    color: var(--text-sub); 
    font-size: 13px; 
}

.cal-cell { 
    min-height: 90px; 
    padding: 8px; 
    background: var(--surface); 
    cursor: pointer; 
    transition: 0.2s; 
}
.cal-cell:hover { filter: brightness(0.97); }
.cal-cell.today { background: #F9FAFB; }
.cal-cell.selected { 
    background: var(--primary-light); 
    box-shadow: inset 0 0 0 2px var(--primary); 
}

.cal-event { 
    background: #FFF4E6; 
    color: #E67700; 
    font-size: 11px; 
    font-weight: bold; 
    padding: 5px 6px; 
    border-radius: 5px; 
    display: block; 
    margin-top: 4px; 
    cursor: pointer; 
    white-space: normal; 
    word-break: break-all; 
    line-height: 1.3; 
    text-align: left; 
    transition: 0.2s; 
}
.cal-event:hover { 
    background: #FFE8CC; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

/* ============================================
   업무 로그 / 민원
   ============================================ */
.log-item {
    padding: 20px;
    background: var(--surface);
    margin-bottom: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    position: relative;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.log-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}

.log-item:last-child {
    margin-bottom: 0;
}

/* 모아보기 카드 — 좌측 색 액센트 제거(요청). 컬럼 구분은 제목/위치로 충분 */

.log-complaint-item { 
    padding: 20px; 
    background: transparent; 
    margin-bottom: 0; 
    border-bottom: 1px solid rgba(240, 68, 82, 0.2);
    position: relative;
}

.log-complaint-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.log-date {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
}

.log-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn-small { 
    position: absolute; 
    top: 16px; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 12px; 
    font-weight: bold; 
    transition: 0.2s; 
}
.btn-delete { right: 16px; background: var(--bg); color: var(--danger); }
.btn-delete:hover { background: #E5E8EB; }
.btn-modify { right: 70px; background: var(--primary-light); color: var(--primary); }
.btn-modify:hover { background: #d1e4fb; }

/* ============================================
   통합 액션 버튼 (법정점검/보수이력 등 카드 내부)
   ============================================ */
.act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.act-btn--success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.act-btn--success:hover { background: #D1FAE5; }
.act-btn--neutral { background: #F8FAFC; color: #475569; border-color: #E2E8F0; }
.act-btn--neutral:hover { background: #F1F5F9; }
.act-btn--modify { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.act-btn--modify:hover { background: #DBEAFE; }
.act-btn--danger { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.act-btn--danger:hover { background: #FEE2E2; }

.act-group { display: inline-flex; gap: 6px; align-items: center; }

/* ============================================
   사진 미리보기
   ============================================ */
.photo-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.photo-wrap { 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    overflow: hidden; 
    background: #FAFAFA; 
}
.photo-wrap img { 
    width: 100px; 
    height: 100px; 
    object-fit: cover; 
    cursor: pointer; 
    transition: 0.2s; 
    border-bottom: 1px solid var(--border); 
}
.photo-wrap img:hover { filter: brightness(0.9); }

.photo-remove { 
    position: absolute; 
    top: 4px; 
    right: 4px; 
    background: rgba(25, 31, 40, 0.8); 
    color: white; 
    border: none; 
    border-radius: 50%; 
    width: 20px; 
    height: 20px; 
    font-size: 10px; 
    font-weight: bold; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.photo-controls { display: flex; width: 100%; }
.photo-controls button { 
    flex: 1; 
    background: transparent; 
    border: none; 
    font-size: 11px; 
    padding: 5px 0; 
    cursor: pointer; 
    color: var(--text-sub); 
    transition: 0.2s; 
}
.photo-controls button:hover { background: #E5E8EB; color: var(--text-main); }
.photo-controls button:first-child { border-right: 1px solid var(--border); }

/* ============================================
   HWP 미리보기
   ============================================ */
.hwp-preview { 
    border: none; 
    padding: 0; 
    background: #fff; 
}

/* ============================================
   모달 / 로딩
   ============================================ */
#uiModal, #loadingOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

/* 모달 배경 페이드인 */
#uiModal { animation: backdropIn 0.18s ease; }

@keyframes backdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* 모달 본체 — 스프링 팝업 */
.modal-inner {
    background: var(--surface);
    padding: 36px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* 로딩 오버레이 — 부드러운 스피너 */
.spinner {
    border: 3px solid rgba(255,255,255,0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 44px; height: 44px;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 로딩 메시지 뒤에 점점점 자동 재생 */
#loadingMsg::after {
    content: '';
    animation: loadingDots 1.4s steps(4, end) infinite;
}
@keyframes loadingDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

/* 이미지 뷰어 */
#imageViewerModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    animation: backdropIn 0.15s ease;
}
#imageViewerModal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    animation: imgZoomIn 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes imgZoomIn {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1); }
}

.viewer-close {
    position: absolute;
    top: 30px; right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.viewer-close:hover { opacity: 1; }

/* ============================================
   스켈레톤 UI (데이터 로딩 중 shimmer 효과)
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--border) 25%,
        #e8eaed 50%,
        var(--border) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}
.skeleton-card {
    padding: 20px;
    background: var(--surface);
    margin-bottom: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
}
.skeleton-line {
    height: 13px;
    margin-bottom: 10px;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.s-short  { width: 35%; }
.skeleton-line.s-medium { width: 65%; }
.skeleton-line.s-full   { width: 100%; }

/* ============================================
   태그 (preview2 스타일)
   ============================================ */
.tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 8px;
    display: inline-block;
}
.tag.bg-blue { background: var(--primary-light); color: var(--primary); }
.tag.bg-red { background: var(--danger-light); color: var(--danger); }
.tag.bg-gray { background: var(--bg); color: var(--text-sub); }
.tag.bg-green { background: #E5F6EB; color: var(--success); }
.tag.bg-orange { background: #FFF4E6; color: #E67700; }

/* ============================================
   반응형 (모바일)
   ============================================ */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        z-index: 1000;
        transition: left 0.3s;
    }
    .sidebar.open {
        left: 0;
    }
    .main-content {
        padding: 20px;
    }
    .calendar-layout {
        grid-template-columns: 1fr;
    }
    .grid-2, .grid-4 {
        grid-template-columns: 1fr;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 16px;
    }
    .card {
        padding: 20px;
    }
    .page-title {
        font-size: 20px;
    }
}

/* 폰(≤640px): 안 접히던 데스크톱 그리드 붕괴 방지 */
@media (max-width: 640px) {
    /* 로그인 — 스플릿 스크린을 세로 스택, 마케팅 패널 축소 */
    #loginScreen { align-items: flex-start; overflow-y: auto; padding: 0; }
    .login-shell {
        flex-direction: column;
        height: auto; min-height: 100%;
        max-width: 100%;
        border-radius: 0; box-shadow: none;
    }
    .brand-panel { width: 100%; flex-shrink: 1; padding: 26px 22px 20px; }
    .brand-logo { margin-bottom: 16px; }
    .brand-headline { font-size: 23px; margin-bottom: 8px; }
    .brand-desc, .brand-badges, .brand-bottom { display: none; } /* 마케팅 문구는 폰에서 숨김 */
    .login-panel { padding: 24px 20px 30px; }
}

/* ============================================
   태그 시스템
   ============================================ */
.tag-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    padding: 14px;
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 6px;
}
.tag-category {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.tag-category-label {
    font-size: 10px;
    font-weight: 700;
    color: #94A3B8;
    background: #F8FAFC;
    border: 1px solid #E9ECF0;
    border-radius: 6px;
    padding: 3px 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tag-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tag-chip:hover {
    background: #EEF2FF;
    border-color: var(--primary);
}
.tag-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.tag-chip-sm {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.tag-chip-sm:hover { border-color: var(--primary); }
.tag-chip-sm.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.tag-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.tag-chip-ro {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-label);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
}

/* ============================================
   민원 카드 및 상태 배지
   ============================================ */
.complaint-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s;
}
.complaint-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.status-badge.status-new { background: #FFF4E6; color: #F5A623; }
.status-badge.status-wip { background: #EEF2FF; color: var(--primary); }
.status-badge.status-done { background: #E5F6EB; color: #04C062; }
.status-badge.status-hold { background: #F4F4F5; color: #71717A; }

.filter-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1.5px solid #E2E8F0;
    background: white;
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--primary); }
.filter-btn.active {
    background: #0F172A;
    color: white;
    border-color: #0F172A;
}

.quick-status-btn {
    padding: 5px 11px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.quick-status-btn:hover { background: #EEF2FF; color: var(--primary); }
.quick-status-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   민원 카드 공통 - 토스 스타일 원형 체크박스 (18px 기준)
   ============================================ */
.c-check {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.c-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #CBD3DC;
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    margin: 0;
}
.c-check input[type="checkbox"]:hover { border-color: var(--primary); }
.c-check input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.c-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-mini {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-sub);
    cursor: pointer;
    transition: 0.15s;
}
.btn-mini:hover { background: var(--bg); color: var(--text-main); }
.btn-mini.btn-mini-del { color: var(--danger); }
.btn-mini.btn-mini-del:hover { background: var(--danger-light); }

/* ============================================
   현황판 / 시설 관리 (stat card, item-row, badge)
   ============================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    background: white;
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: relative; overflow: hidden;
    transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.stat-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.accent-red::before   { background: linear-gradient(90deg, #EF4444, #F87171); }
.stat-card.accent-blue::before  { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.stat-card.accent-green::before { background: linear-gradient(90deg, #10B981, #34D399); }
.stat-label {
    font-size: 11px; font-weight: 700;
    color: #94A3B8; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 10px;
}
.stat-value {
    font-size: 28px; font-weight: 900;
    color: #0F172A; letter-spacing: -1px;
}
.stat-value.color-red  { color: #EF4444; }
.stat-value.color-blue { color: #3B82F6; }
.stat-sub {
    font-size: 11px; color: #CBD5E1;
    font-weight: 500; margin-top: 4px;
}
.stat-icon {
    position: absolute; right: 16px; top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.1;
}
.stat-card.accent-red   .stat-icon { background: #EF4444; }
.stat-card.accent-blue  .stat-icon { background: #3B82F6; }
.stat-card.accent-green .stat-icon { background: #10B981; }
.stat-icon svg { width: 22px; height: 22px; }

.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: box-shadow 0.15s;
}
.item-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.item-info b {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}
.item-info span {
    font-size: 13px;
    color: var(--text-sub);
}

.badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge.red { background: var(--danger-light); color: var(--danger); }
.badge.orange { background: #FFF4E6; color: #E67700; }
.badge.gray { background: var(--bg); color: var(--text-sub); }
.badge.green { background: #D1FAE5; color: #065F46; }

.dash-complaint-card {
    background: var(--danger-light);
    border: 1px solid rgba(240, 68, 82, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.dash-complaint-card:hover {
    background: #FEDCE1;
    box-shadow: 0 2px 8px rgba(240, 68, 82, 0.15);
}

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

/* ============================================
   민원 카드 공통 (업무일지 .log-item 스타일 재사용)
   모아보기 민원 패널 + 민원탭 칸반 모두 동일
   ============================================ */
.kanban-body .log-item {
    margin-bottom: 0;
    padding: 20px;
}
.card-complaint {
    padding-right: 100px; /* 우상단 액션 버튼 공간 확보 */
}
.card-action-row {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 6px;
    white-space: nowrap;
    z-index: 1;
}
.card-action-row .btn-mini {
    white-space: nowrap;
}
.cl-lines {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cl-row {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.6;
}
.cl-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-main);
    word-break: break-word;
}
.cl-done .cl-text {
    color: var(--text-sub);
    text-decoration: line-through;
    text-decoration-color: var(--text-sub);
}
/* 텍스트 baseline에 가까운 작은 원형 토글 (체크박스 대체) */
.cl-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #CBD3DC;
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
}
.cl-dot:hover { border-color: var(--primary); }
.cl-dot.done {
    background: var(--primary);
    border-color: var(--primary);
}
.cl-dot.done::after {
    content: '';
    position: absolute;
    left: 2px;
    top: -1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.card-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.card-memo {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.5;
}

/* ============================================
   칸반 뷰 (민원 처리중/완료)
   ============================================ */
.kanban {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.kanban-col {
    background: white;
    border: 1px solid #F1F5F9;
    border-radius: 14px;
    padding: 14px;
    min-height: 200px;
}
.kanban-pending { border-top: 3px solid #F59E0B; }
.kanban-done    { border-top: 3px solid #10B981; }
.kanban-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 4px 6px;
}
.kanban-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 800; color: #0F172A;
}
.kanban-title-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kanban-pending .kanban-title-dot { background: #F59E0B; }
.kanban-done    .kanban-title-dot { background: #10B981; }
.kanban-count {
    font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid #E9ECF0; background: #F8FAFC; color: #64748B;
}
.kanban-body { display: flex; flex-direction: column; gap: 8px; }
.kanban-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 120px; gap: 8px;
    color: #CBD5E1; font-size: 13px; font-weight: 600;
}

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

/* ============================================
   토스트 알림 (성공/정보 메시지)
   ============================================ */
#toastContainer {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    pointer-events: auto;
    animation: toastIn 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
    max-width: 320px;
    line-height: 1.4;
}
.toast.toast-success { background: #1a1a2e; }
.toast.toast-info    { background: var(--primary); }
.toast.toast-error   { background: var(--danger); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast.hide {
    animation: toastOut 0.22s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.92); }
    to   { opacity: 1; transform: translateX(0)    scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

/* ============================================
   모바일 햄버거 버튼 + 사이드바 오버레이
   ============================================ */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.15s;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn svg { width: 20px; height: 20px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: backdropIn 0.18s ease;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 900px) {
    .hamburger-btn { display: flex; }
    .main-content  { padding-top: 72px; } /* 햄버거 버튼 높이 확보 */
}

/* ============================================
   인쇄 스타일
   ============================================ */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    @page { size: A4; margin: 10mm; }
    .sidebar { display: none; }
    .main-content { padding: 0; overflow: visible; }
}

/* ============================================
   모아보기 탭 개선
   ============================================ */

/* 월 탐색 네비게이션 */
.month-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    padding: 4px 6px;
    position: relative;
}
.month-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 6px;
    color: #64748B;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}
.month-nav-btn:hover { background: #F1F5F9; color: #0F172A; }
.month-nav-btn svg { width: 16px; height: 16px; }
.month-nav-label {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    min-width: 90px;
    text-align: center;
    padding: 0 4px;
}

/* 월간 요약 바 */
.moa-summary-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-radius: 12px;
    border: 1.5px solid #E2E8F0;
    margin-bottom: 16px;
    font-size: 13px;
    color: #475569;
}
.moa-stat { font-weight: 600; }
.moa-stat b { color: #0F172A; font-weight: 800; }
.moa-divider { color: #CBD5E1; font-weight: 400; }
.moa-stat-sub {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 500;
    padding: 3px 8px;
    background: #F8FAFC;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
}

/* 더 보기 버튼 */
.log-expand-btn {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    font-family: inherit;
    transition: color 0.15s;
}
.log-expand-btn:hover { color: #3B82F6; }

/* 완료 민원 이전 기록 더 보기 버튼 */
.done-toggle-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 4px;
    padding: 10px;
    background: none;
    border: 1.5px dashed #E2E8F0;
    border-radius: 10px;
    color: #94A3B8;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.done-toggle-btn:hover { border-color: #94A3B8; color: #64748B; }

/* 민원 카드 완료 비율 뱃지 */
.card-progress-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}
.card-progress-badge.done {
    background: #D1FAE5;
    color: #065F46;
    border-color: #A7F3D0;
}

/* 완료된 민원 카드 — 흐림 대신 은은한 배경으로 '처리됨' 표시 (내용은 또렷하게) */
.card-complaint-done {
    background: var(--bg);
    border-color: var(--border);
}

/* ============================================
   인라인 onmouseover/onmouseout 이전용 호버 클래스
   ============================================ */
.card-hover-shadow {
    transition: box-shadow 0.15s;
}
.card-hover-shadow:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.circle-close-btn {
    transition: background 0.15s, color 0.15s;
}
.circle-close-btn:hover {
    background: #E2E8F0 !important;
    color: #0F172A !important;
}
.event-delete-hover {
    transition: background 0.15s;
}
.event-delete-hover:hover {
    background: var(--danger-light, #FEE2E2) !important;
}

/* 전역 모달 수정/삭제/확인/취소 버튼 호버 */
#modalCancel, #modalConfirm {
    transition: background 0.15s, filter 0.15s;
}
#modalCancel:hover {
    background: #E5E8EB !important;
}
#modalConfirm:hover {
    filter: brightness(0.92);
}

/* ============================================
   대시보드 — 단지ON 디자인 핸드오프 (Linear/Stripe 스타일)
   ============================================ */
#tabDash.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
#tabDash .dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
#tabDash .dash-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--ds-text);
    margin: 0;
    letter-spacing: -0.4px;
}
#tabDash .dash-sub {
    font-size: 14px;
    color: var(--ds-text-sub);
    margin-top: 4px;
}
#tabDash .dash-pending-emph {
    color: var(--ds-urgent);
    font-weight: 600;
}
#tabDash .dash-cta {
    background: var(--ds-accent);
    color: #fff;
    border: none;
    border-radius: var(--ds-radius-input);
    padding: 0 16px;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: filter .12s;
}
#tabDash .dash-cta:hover { filter: brightness(0.92); }

#tabDash .dash-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
#tabDash .dash-metric {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-card);
    padding: 18px 20px;
    cursor: pointer;
    transition: border-color .15s;
}
#tabDash .dash-metric:hover { border-color: rgba(37, 99, 235, 0.5); }
#tabDash .dash-metric.urgent { border-color: rgba(220, 38, 38, 0.16); }
#tabDash .dash-metric.urgent:hover { border-color: rgba(220, 38, 38, 0.6); }
#tabDash .dash-metric-label {
    font-size: 12px;
    color: var(--ds-text-muted);
    margin-bottom: 10px;
}
#tabDash .dash-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--ds-text);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}
#tabDash .dash-metric.urgent .dash-metric-value { color: var(--ds-urgent); }
#tabDash .dash-metric-sub {
    font-size: 12px;
    color: var(--ds-text-muted);
}

#tabDash .dash-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}
/* 폰(≤640px): 통계 4칸→2x2, 좌우 카드 1열. 기본 정의 뒤에 둬야 소스순서로 이김 */
@media (max-width: 640px) {
    #tabDash .dash-metrics { grid-template-columns: 1fr 1fr; }
    #tabDash .dash-grid { grid-template-columns: 1fr; }
    /* grid 아이템 min-width:auto → 0. 없으면 내부 긴 텍스트 min-content가 트랙을 벌려 가로 넘침 */
    #tabDash .dash-metrics > *, #tabDash .dash-grid > * { min-width: 0; }
    /* 인사말+버튼 가로배치 → 세로 스택. 안 그러면 인사말이 절반 폭에 3줄로 눌림 */
    #tabDash .dash-header { flex-direction: column; align-items: flex-start; gap: 14px; }
    #tabDash .dash-cta { width: 100%; justify-content: center; }
}
#tabDash .dash-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#tabDash .dash-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-card);
    padding: 0;
    box-shadow: none;
}
#tabDash .dash-card-tight { padding: 16px 20px; }
#tabDash .dash-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ds-divider);
    margin: 0;
}
#tabDash .dash-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ds-text);
    display: block;
}
#tabDash .dash-card-action {
    color: var(--ds-accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
#tabDash .dash-card-action:hover { text-decoration: underline; }

/* 법정 점검 row */
#tabDash .dash-insp-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--ds-divider);
}
#tabDash .dash-insp-row:last-child { border-bottom: none; }
#tabDash .dash-insp-dday {
    font-size: 16px;
    font-weight: 700;
    color: var(--ds-text-sub);
    width: 48px;
    flex-shrink: 0;
}
#tabDash .dash-insp-dday.urgent { color: var(--ds-urgent); }
#tabDash .dash-insp-info { flex: 1; min-width: 0; }
#tabDash .dash-insp-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--ds-text);
}
#tabDash .dash-insp-date {
    font-size: 13px;
    color: var(--ds-text-muted);
    margin-top: 2px;
}

/* 민원 row */
#tabDash .dash-comp-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--ds-divider);
    cursor: pointer;
    transition: background .12s;
}
#tabDash .dash-comp-row:last-child { border-bottom: none; }
#tabDash .dash-comp-row:hover { background: var(--ds-surface-hov); }
#tabDash .dash-comp-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ds-text-muted);
    flex-shrink: 0;
}
#tabDash .dash-comp-dot.urgent { background: var(--ds-urgent); }
#tabDash .dash-comp-text {
    font-size: 13px;
    color: var(--ds-text);
}
#tabDash .dash-comp-meta {
    font-size: 11px;
    color: var(--ds-text-muted);
    margin-top: 1px;
}

/* 오늘 일정 */
#tabDash .dash-today-head {
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}
#tabDash .dash-today-head svg { color: var(--ds-text-sub); }
#tabDash .dash-today-row {
    display: flex;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid var(--ds-divider);
    align-items: center;
}
#tabDash .dash-today-row:last-child { border-bottom: none; }
#tabDash .dash-today-time {
    font-size: 13px;
    color: var(--ds-accent);
    font-weight: 600;
    width: 44px;
    flex-shrink: 0;
}
#tabDash .dash-today-text {
    font-size: 13px;
    color: var(--ds-text-sub);
}

/* 긴급 pill (법정 점검) */
#tabDash .dash-pill-urgent {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-urgent-soft);
    color: var(--ds-urgent);
    white-space: nowrap;
}

/* 빈 상태 */
#tabDash .dash-empty {
    padding: 32px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--ds-text-muted);
}

/* ============================================
   탑바
   ============================================ */
.app-topbar {
    height: 52px;
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 10px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--ds-text);
}
.topbar-date {
    font-size: 13px;
    color: var(--ds-text-muted);
    white-space: nowrap;
}
.topbar-icon-btn {
    width: 32px; height: 32px;
    border-radius: var(--ds-radius-input);
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-text-sub);
    position: relative;
    transition: border-color .12s;
}
.topbar-icon-btn:hover { border-color: var(--ds-accent); }
.topbar-user-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 5px;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-input);
}
.topbar-user-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.topbar-user-name {
    font-size: 13px;
    color: var(--ds-text);
    font-weight: 500;
}

/* ============================================
   사이드바 — Linear 스타일 정돈
   ============================================ */
.sidebar { background: var(--ds-surface); border-right: 1px solid var(--ds-border); }
.sb-logo-area {
    height: 52px;
    padding: 0 16px;
    border-bottom: 1px solid var(--ds-border);
    gap: 10px;
}
.sb-logo-mark {
    width: 28px; height: 28px;
    border-radius: 7px;
    box-shadow: none;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
.sb-logo-mark-text {
    color: #fff; font-weight: 800; font-size: 12px; line-height: 1;
}
.sb-logo-name { font-size: 14px; font-weight: 700; color: var(--ds-text); letter-spacing: -0.2px; line-height: 1.2; }
.sb-logo-name span { color: var(--ds-text); }
.sb-logo-sub { font-size: 10px; color: var(--ds-text-muted); font-weight: 500; margin-top: 1px; }
/* 기존 사용자 영역은 탑바로 이전 — 시각적으로 숨김 (마크업은 보존) */
.sidebar .sb-user-area { display: none; }

.nav-label {
    color: var(--ds-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 600;
}
.nav-item {
    color: var(--ds-text-sub);
    border-radius: var(--ds-radius-input);
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--ds-surface-hov); color: var(--ds-text); }
.nav-item.active {
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    font-weight: 600;
}
.nav-item.active svg { stroke: var(--ds-accent); }

/* ============================================
   업무일지 (tab2) — 핸드오프 디자인
   ============================================ */
.journal-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}
.journal-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-card);
    padding: 22px 24px;
    box-shadow: none;
}
.journal-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ds-text);
    margin: 0 0 18px;
}
.journal-field { margin-bottom: 14px; }
.journal-field-label {
    display: block;
    font-size: 13px;
    color: var(--ds-text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.journal-req { color: var(--ds-urgent); }
.journal-input,
.journal-textarea {
    width: 100%;
    padding: 11px 13px;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-input);
    color: var(--ds-text);
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}
.journal-input:focus,
.journal-textarea:focus { border-color: var(--ds-accent); }
.journal-textarea { resize: vertical; min-height: 140px; line-height: 1.5; }

.journal-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    border: 1px dashed var(--ds-border);
    border-radius: var(--ds-radius-input);
    background: var(--ds-bg);
    color: var(--ds-text-muted);
    cursor: pointer;
    transition: border-color .12s, color .12s;
}
.journal-dropzone:hover {
    border-color: var(--ds-accent);
    color: var(--ds-accent);
}
.journal-dropzone-plus {
    font-size: 22px;
    line-height: 1;
    font-weight: 300;
}
.journal-dropzone-text { font-size: 13px; }

.journal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.journal-btn-link {
    align-self: flex-end;
    padding: 4px 10px;
    background: transparent;
    border: none;
    color: var(--ds-text-sub);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.journal-btn-link:hover { color: var(--ds-accent); text-decoration: underline; }
.journal-btn-primary {
    width: 100%;
    padding: 14px 18px;
    background: var(--ds-accent);
    border: none;
    border-radius: var(--ds-radius-input);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter .12s;
}
.journal-btn-primary:hover { filter: brightness(0.92); }

/* 최근 업무일지 헤더 + 펼치기 chevron */
.journal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.journal-chevron {
    width: 28px; height: 28px;
    border-radius: var(--ds-radius-input);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-sub);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .12s, transform .18s;
}
.journal-chevron:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.journal-chevron[data-expanded="true"] { transform: rotate(180deg); }

/* 태그 선택 — Linear 스타일 정돈 */
#tab2 .tag-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    padding: 0;
    border: none;
    margin-top: 0;
}
#tab2 .tag-category {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
#tab2 .tag-category-label {
    font-size: 11px;
    color: var(--ds-text-muted);
    background: transparent;
    border: none;
    padding: 0 4px 0 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}
#tab2 .tag-chip {
    padding: 5px 11px;
    border-radius: var(--ds-radius-pill);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-sub);
    font-size: 12px;
    font-weight: 500;
}
#tab2 .tag-chip:hover {
    border-color: var(--ds-accent);
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
}
#tab2 .tag-chip.active {
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    border-color: var(--ds-accent);
}

.journal-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.journal-empty {
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: var(--ds-text-muted);
}
.journal-recent-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--ds-divider);
}
.journal-recent-row:last-child { border-bottom: none; }
.journal-recent-date {
    font-size: 12px;
    color: var(--ds-text-muted);
    font-weight: 500;
}
.journal-recent-summary {
    font-size: 14px;
    color: var(--ds-text);
    margin-top: 4px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.journal-recent-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.journal-recent-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-chip);
    color: var(--ds-chip-text);
}
.journal-info-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-text);
    margin-bottom: 8px;
}
.journal-info-head svg { color: var(--ds-accent); }
.journal-info-body {
    font-size: 13px;
    color: var(--ds-text-sub);
    line-height: 1.6;
}
.journal-info-body b { color: var(--ds-text); }

/* (구) tab2 tag-selector 룰은 위 새 룰로 대체됨 */

/* ============================================
   보수 이력 (tabMaint) — Linear 테이블 스타일
   ============================================ */
#tabMaint .maint-top-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
}
#tabMaint .maint-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 220px));
    gap: 12px;
}
#tabMaint .maint-stat-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-card);
    padding: 16px 20px;
}
#tabMaint .maint-stat-label {
    font-size: 12px;
    color: var(--ds-text-muted);
    margin-bottom: 8px;
}
#tabMaint .maint-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--ds-text);
    letter-spacing: -0.5px;
}
#tabMaint .maint-new-btn-v2 {
    align-self: center;
    padding: 0 18px;
    height: 40px;
    background: var(--ds-accent);
    color: #fff;
    border: none;
    border-radius: var(--ds-radius-input);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: filter .12s;
}
#tabMaint .maint-new-btn-v2:hover { filter: brightness(0.92); }

/* 테이블 */
#tabMaint #maintRecordPane {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-card);
    overflow: hidden;
}
#tabMaint .maint-table-head {
    display: grid;
    grid-template-columns: 110px 1fr 140px 120px;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--ds-divider);
    font-size: 12px;
    color: var(--ds-text-muted);
    font-weight: 500;
    background: var(--ds-bg);
}
#tabMaint .maint-record-list {
    display: block !important;
    gap: 0 !important;
}
#tabMaint .maint-record-item {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
    border-bottom: 1px solid var(--ds-divider) !important;
}
#tabMaint .maint-record-item:last-child { border-bottom: none !important; }
#tabMaint .maint-record-row {
    display: grid !important;
    grid-template-columns: 110px 1fr 140px 120px;
    gap: 16px;
    align-items: center;
    padding: 14px 20px !important;
}
#tabMaint .maint-row-date {
    font-size: 13px;
    color: var(--ds-text-muted);
}
#tabMaint .maint-row-info { min-width: 0; }
#tabMaint .maint-row-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#tabMaint .maint-row-company {
    font-size: 12px;
    color: var(--ds-text-muted);
    margin-top: 2px;
}
#tabMaint .maint-row-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
#tabMaint .maint-row-cat {
    display: flex;
    align-items: center;
    gap: 6px;
}
#tabMaint .maint-row-cat-chip {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-chip);
    color: var(--ds-chip-text);
    font-weight: 500;
}
#tabMaint .maint-row-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    opacity: 0;
    transition: opacity .12s;
}
#tabMaint .maint-record-row:hover .maint-row-actions { opacity: 1; }
#tabMaint .maint-row-act-btn {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-sub);
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}
#tabMaint .maint-row-act-btn:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
#tabMaint .maint-row-act-btn.danger:hover { border-color: var(--ds-urgent); color: var(--ds-urgent); }
#tabMaint #maintHistoryList .maint-empty-state {
    border: none;
    background: transparent;
    padding: 48px 20px;
}

/* 사이드바 하단 — 컴팩트 */
.sidebar .nav-bottom { padding: 6px 8px 10px; border-top: 1px solid var(--ds-border); }
.sidebar .sb-fontsize-row { padding: 0 0 6px; border-bottom: 1px dashed var(--ds-divider); margin-bottom: 4px; gap: 3px; }
.sidebar .sb-fs-btn {
    height: 26px;
    border-radius: 6px;
    border-color: var(--ds-border);
    color: var(--ds-text-muted);
    font-weight: 600;
}
.sidebar .sb-fs-btn:nth-child(1) { font-size: 11px; }
.sidebar .sb-fs-btn:nth-child(2) { font-size: 13px; }
.sidebar .sb-fs-btn:nth-child(3) { font-size: 15px; }
.sidebar .sb-fs-btn.active {
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    border-color: var(--ds-accent);
}
.sidebar .logout-btn {
    color: var(--ds-text-muted);
    font-size: 12px;
    padding: 6px 8px;
    border-radius: var(--ds-radius-input);
    font-weight: 500;
}
.sidebar .logout-btn svg { width: 12px; height: 12px; }
.sidebar .logout-btn:hover { background: var(--ds-urgent-soft); color: var(--ds-urgent); }

/* ============================================
   오늘의 기록 (#tab2) — 업무일지 + 민원 통합
   ============================================ */
#tab2.active { display: flex; flex-direction: column; gap: 16px; padding: 16px 32px 28px; }

.record-dateheader {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-card);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.record-date-nav {
    width: 36px; height: 36px;
    border-radius: var(--ds-radius-input);
    border: 1px solid var(--ds-border);
    background: var(--ds-bg);
    color: var(--ds-text-sub);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s, color .12s;
}
.record-date-nav:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.record-date-main { flex: 1; display: flex; align-items: center; gap: 10px; }
.record-date-icon { color: var(--ds-accent); flex-shrink: 0; }
.record-date-title { font-size: 20px; font-weight: 700; color: var(--ds-text); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.record-date-weekday { font-size: 14px; font-weight: 500; color: var(--ds-text-sub); }
.record-date-sub { font-size: 13px; color: var(--ds-text-muted); margin-top: 2px; }
.record-today-btn {
    padding: 9px 14px;
    border-radius: var(--ds-radius-input);
    border: 1px solid var(--ds-border);
    background: var(--ds-bg);
    font-size: 13px;
    color: var(--ds-text-sub);
    cursor: pointer;
    font-family: inherit;
    transition: border-color .12s, color .12s;
}
.record-today-btn:hover { border-color: var(--ds-accent); color: var(--ds-accent); }

.record-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
}
.record-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-card);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.record-card-head {
    padding: 14px 20px;
    border-bottom: 1px solid var(--ds-divider);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.record-card-head-icon { color: var(--ds-accent); flex-shrink: 0; }
.record-complaint .record-card-head-icon { color: var(--ds-text); }
.record-card-head-title { font-size: 16px; font-weight: 700; color: var(--ds-text); }
.record-card-head-meta { font-size: 12px; color: var(--ds-text-muted); margin-left: auto; }

/* 좌측: 업무일지 */
.record-journal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.record-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 13px;
    background: var(--ds-accent-soft);
    border-radius: var(--ds-radius-input);
    border: 1px solid rgba(37,99,235,0.13);
}
.record-info-banner svg { color: var(--ds-accent); flex-shrink: 0; margin-top: 1px; }
.record-info-title { font-size: 13px; font-weight: 600; color: var(--ds-accent); }
.record-info-body { font-size: 12px; color: var(--ds-text-sub); margin-top: 2px; line-height: 1.5; }

.record-hyphen-wrap { position: relative; }
.record-hyphen-overlay {
    position: absolute;
    top: 12px; left: 14px;
    width: 18px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--ds-text-muted);
    pointer-events: none;
    user-select: none;
    font-family: inherit;
    overflow: hidden;
    white-space: pre;
}
.record-hyphen-textarea {
    width: 100%;
    padding: 12px 14px 12px 38px;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-input);
    font-size: 14px;
    outline: none;
    line-height: 1.65;
    font-family: inherit;
    color: var(--ds-text);
    resize: vertical;
    min-height: 160px;
    box-sizing: border-box;
}
.record-hyphen-textarea:focus { border-color: var(--ds-accent); }

.record-field-group { display: flex; flex-direction: column; gap: 7px; }
/* display:flex가 UA의 [hidden]{display:none}을 이기므로 명시적으로 되살림 (태그 숨김용) */
.record-field-group[hidden] { display: none; }
.record-field-label { font-size: 12px; color: var(--ds-text-muted); }
.record-tag-row { display: flex; gap: 6px; flex-wrap: wrap; flex-direction: row !important; }
#tab2 .record-tag-row .tag-category { display: contents; }
#tab2 .record-tag-row .tag-category-label { display: none; }
.record-tag-row .tag-chip {
    padding: 7px 12px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-sub);
    font-weight: 400;
    transition: all .12s;
}
.record-tag-row .tag-chip.active {
    border-color: rgba(37,99,235,0.4);
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    font-weight: 600;
}

.record-journal-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--ds-divider);
}
.record-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-input);
    font-size: 13px;
    color: var(--ds-text-sub);
    cursor: pointer;
    font-family: inherit;
    transition: border-color .12s, color .12s;
}
.record-attach-btn:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.record-btn-ghost {
    padding: 9px 18px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-input);
    font-size: 14px;
    color: var(--ds-text-sub);
    cursor: pointer;
    font-family: inherit;
    transition: border-color .12s, color .12s;
}
.record-btn-ghost:hover { border-color: var(--ds-accent); color: var(--ds-accent); }
.record-btn-primary {
    padding: 9px 20px;
    background: var(--ds-accent);
    border: none;
    border-radius: var(--ds-radius-input);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter .12s;
}
.record-btn-primary:hover { filter: brightness(0.92); }

.record-recent-head {
    border-top: 1px solid var(--ds-divider);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-text-sub);
}
.record-recent-action {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: var(--ds-text-muted);
    cursor: pointer;
}
.record-recent-action:hover { color: var(--ds-accent); }
.record-recent-empty { padding: 14px 20px; font-size: 12px; color: var(--ds-text-muted); }
.record-recent-row {
    padding: 11px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    border-top: 1px solid var(--ds-divider);
}
.record-recent-row:hover { background: var(--ds-surface-hov); }
.record-recent-date { font-size: 12px; color: var(--ds-text-muted); width: 60px; flex-shrink: 0; padding-top: 1px; }
.record-recent-summary { flex: 1; font-size: 13px; color: var(--ds-text); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-recent-chip { font-size: 11px; color: var(--ds-accent); background: var(--ds-accent-soft); padding: 2px 7px; border-radius: 12px; white-space: nowrap; }

/* 우측: 민원 */
.record-complaint-form {
    padding: 18px;
    background: var(--ds-surface-hov);
    border-bottom: 1px solid var(--ds-divider);
}
.record-subj-row { display: flex; gap: 6px; margin-bottom: 11px; margin-top: 6px; }
.record-subj-btn {
    flex: 1;
    padding: 9px 6px;
    border-radius: var(--ds-radius-input);
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    color: var(--ds-text-sub);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .12s;
}
.record-subj-btn svg { color: var(--ds-text-muted); }
.record-subj-btn.active {
    border-color: var(--ds-accent);
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    font-weight: 600;
}
.record-subj-btn.active svg { color: var(--ds-accent); }

.record-subj-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-bottom: 9px;
}
.record-input {
    padding: 10px 12px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-input);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    color: var(--ds-text);
    box-sizing: border-box;
    width: 100%;
}
.record-input:focus { border-color: var(--ds-accent); }
.record-complaint-textarea {
    line-height: 1.5;
    margin-bottom: 11px;
    resize: vertical;
    min-height: 56px;
}
.record-complaint-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.record-complaint-more { margin-top: 12px; }
.record-complaint-more summary {
    cursor: pointer;
    color: var(--ds-text-muted);
    font-size: 12px;
    font-weight: 500;
    list-style: none;
}
.record-complaint-more summary::-webkit-details-marker { display: none; }
.record-complaint-extra { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }

.record-complaint-tabs {
    padding: 12px 20px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.record-complaint-tab {
    padding: 7px 14px;
    border-radius: var(--ds-radius-input);
    border: 1px solid var(--ds-border);
    background: transparent;
    color: var(--ds-text-sub);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .12s;
}
.record-complaint-tab.active {
    border-color: var(--ds-accent);
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    font-weight: 600;
}
.record-tab-count { font-size: 12px; opacity: 0.85; }
.record-complaint-meta { margin-left: auto; font-size: 12px; color: var(--ds-text-muted); }

.record-complaint-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 0;
}
.record-complaint-row {
    padding: 12px 20px;
    border-bottom: 1px solid var(--ds-divider);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background .12s;
}
.record-complaint-row:last-child { border-bottom: none; }
.record-complaint-row:hover { background: var(--ds-surface-hov); }
.record-row-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ds-text-muted);
    flex-shrink: 0;
}
.record-row-dot.urgent { background: var(--ds-urgent); }
.record-row-body { flex: 1; min-width: 0; }
.record-row-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.record-row-meta {
    font-size: 12px;
    color: var(--ds-text-muted);
    margin-top: 2px;
}
.record-row-meta svg { color: var(--ds-text-muted); }
.record-complaint-list .record-row-status {
    width: auto;
    flex-shrink: 0;
    padding: 5px 22px 5px 8px;
    border: 1px solid var(--ds-border);
    background: var(--ds-surface);
    border-radius: var(--ds-radius-pill);
    font-size: 12px;
    color: var(--ds-text-sub);
    outline: none;
    cursor: pointer;
    font-family: inherit;
    min-height: 0;
}
.record-row-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.record-row-status.status-new { color: var(--ds-urgent); }
.record-complaint-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--ds-text-muted);
    font-size: 13px;
}

@media (max-width: 1024px) {
    .record-layout { grid-template-columns: 1fr; }
    /* grid 아이템 min-width:auto → 0. 없으면 내부 긴 내용/태그칩 min-content가 트랙을 벌려 카드가 화면 밖으로 넘침 */
    .record-layout > * { min-width: 0; }
}

.card-subject-line {
    font-size: 12.5px;
    color: var(--text-sub);
    margin-top: 3px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* ============================================
   폰(≤640px) 화면별 다단 레이아웃 정리 — 파일 최후미(소스순서로 override 보장)
   데스크톱 무영향. calendar-grid(7열)·월별보고 히트맵은 의도적으로 제외
   ============================================ */
@media (max-width: 640px) {
    /* 보수이력: 통계 2칸은 폭 맞춰 축소, 표는 가로 스크롤(데이터 표라 스택 대신 스와이프) */
    #tabMaint .maint-top-row { flex-direction: column; align-items: stretch; gap: 12px; }
    #tabMaint .maint-stats { grid-template-columns: 1fr 1fr; }
    #tabMaint .maint-new-btn-v2 { align-self: stretch; }
    #tabMaint #maintRecordPane { overflow-x: auto; }
    #tabMaint .maint-table-head,
    #tabMaint .maint-record-row { min-width: 560px; } /* 고정칼럼 418px + 작업명 1fr 최소 확보. ponytail: 가로스크롤 표. 상한=좁은폰 스와이프 불편, 업그레이드=행별 카드 스택 */

    /* 모아보기: 업무기록/민원사항 2단 → 1단 (인라인 style 이기려 !important) */
    .moa-2pane { grid-template-columns: 1fr !important; }

    /* 법정점검 등록폼(점검명/날짜/버튼) → 세로 스택 */
    .safety-add-row { grid-template-columns: 1fr !important; }

    /* 회의록 관리외수익/비용 2단 → 1단 (안쪽 회계표는 폭 넓어져 자동 정상화) */
    .meet-acc-2col { grid-template-columns: 1fr !important; }

    /* 공문 항목 입력행 → 세로 스택(입력 편의) / 비교견적 표 → 가로 스크롤(정렬 유지) */
    #tab4 .doc-item-row { grid-template-columns: 1fr !important; }
    #tab4 .doc-cmp-table { overflow-x: auto; }
    #tab4 #docTableHeader, #tab4 .doc-table-row { min-width: 420px; }

    /* 업무기록 날짜바: 업무일지 카드와 같은 폭·테두리(카드 스타일 유지), 내용만 슬림 */
    #tab2 .record-dateheader {
        padding: 8px 12px;
        gap: 6px;
    }
    /* 방향키·오늘 버튼 축소 */
    #tab2 .record-date-nav { width: 30px; height: 30px; min-width: 30px; }
    #tab2 .record-date-nav svg { width: 14px; height: 14px; }
    #tab2 .record-today-btn { height: 30px; padding: 0 10px; font-size: 12px; display: flex; align-items: center; }
    /* "업무일지 0건 · 민원 0건" 요약은 모바일에서 불필요 */
    #tab2 .record-date-sub { display: none; }
    #tab2 .record-date-icon { display: none; }
    #tab2 .record-date-title { font-size: 15px; flex-wrap: nowrap; }
    #tab2 #recordDateLabel, #tab2 .record-date-weekday { white-space: nowrap; }
    #tab2 .record-today-btn { white-space: nowrap; padding: 9px 10px; }
    /* 하단 액션 버튼(사진/파일·임시저장·저장) 글자 세로 깨짐 방지 */
    #tab2 .record-journal-footer button { white-space: nowrap; }
}

/* ============================================
   모바일 UX 레이어 (≤640px) — 하단 탭바 + 터치/입력 기준
   데스크톱 무영향: .m-tabbar는 기본 숨김, 나머지는 전부 미디어 블록 안
   ============================================ */
.m-tabbar { display: none; }

/* 알림 벨 — 미구현 자리표시자(눌러도 무반응)라 숨김. 알림 기능 붙일 때 이 줄 제거 */
#topbarBellBtn { display: none; }

@media (max-width: 640px) {
    /* ── 하단 탭바 ── */
    .m-tabbar {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 950; /* 사이드바(1000)·햄버거(1100)보다 아래, 콘텐츠보다 위 */
        display: flex;
        background: var(--surface, #fff);
        border-top: 1px solid var(--border, #E9ECF0);
        padding-bottom: env(safe-area-inset-bottom); /* 아이폰 홈바 회피 */
        box-shadow: 0 -2px 12px rgba(15,23,42,0.06);
    }
    .m-tabbar button {
        flex: 1;
        min-height: 56px;
        display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 3px;
        background: none; border: none; cursor: pointer;
        font-family: inherit; font-size: 11px; font-weight: 600;
        color: #94A3B8;
        -webkit-tap-highlight-color: transparent;
    }
    .m-tabbar svg { width: 22px; height: 22px; }
    /* 활성 하이라이트 — JS 없이 현재 탭 pane 상태로 판정 */
    body:has(#tabToday.tab-pane.active) .m-tabbar [data-tab="tabToday"],
    body:has(#tab2.tab-pane.active)    .m-tabbar [data-tab="tab2"],
    body:has(#tab3.tab-pane.active)    .m-tabbar [data-tab="tab3"] { color: var(--primary, #3182F6); }

    /* 탭바에 가리지 않게 본문 들어올림 + 상단바가 화면 최상단에 붙도록 상단 패딩 0 */
    .main-content { padding: 0 14px 92px; }
    /* tab-pane 자체 좌우 32px 패딩 제거 — main-content 14px만 단일 여백으로 (좌우 46px→14px)
       #mainDashboard 접두 = #tab2.active 같은 ID 규칙(특이도 1-1-0)을 이기기 위함 */
    #mainDashboard .tab-pane.active { padding: 12px 0 24px; }
    #scrollTopBtn { bottom: 76px; }

    /* 탭바의 "전체"가 햄버거를 대체 → 플로팅 햄버거 숨김 */
    .hamburger-btn { display: none; }

    /* 상단바: 본문 패딩 상쇄해 전폭·최상단 부착 (sticky 유지) */
    .app-topbar { margin: 0 -14px 14px; padding: 0 14px; }
    /* 사용자 칩: 네모 배경 제거, 원 배지만 우측 끝에 */
    .topbar-user-pill { background: none; border: none; padding: 0; }
    .topbar-user-avatar { width: 28px; height: 28px; font-size: 11px; }
    /* 카드 헤더(법정점검·최근민원): 제목-밑줄 간격 축소 + 제목·전체보기 같은 줄 정렬
       (기본 .dash-card-title의 margin-bottom:16px이 flex 안에서 제목만 위로 밀어 두 줄처럼 보임) */
    #tabDash .dash-card-head { padding: 12px 16px; gap: 8px; }
    #tabDash .dash-card-head .dash-card-title { margin-bottom: 0; }
    #tabDash .dash-card-action { white-space: nowrap; flex-shrink: 0; }

    /* ── 터치 타겟 44px (실측 25~36px였던 버튼들) ── */
    .btn,
    .record-btn-ghost, .record-btn-primary, .record-attach-btn,
    .record-complaint-tab,
    .month-nav-btn { min-height: 44px; } /* dash-card-action(전체보기)·날짜바 방향키·오늘 버튼은 원래 크기 유지 — 사용자 요청 */
    /* 사이드바 서랍 메뉴 항목 (실측 34px) */
    .sidebar .nav-item { min-height: 48px; display: flex; align-items: center; }

    /* ── 입력 16px — iOS가 16px 미만 입력 포커스 시 화면을 강제 확대하는 것 방지 ── */
    input[type="text"], input[type="password"], input[type="date"],
    input[type="number"], input[type="month"], textarea, select {
        font-size: 16px !important; /* 인라인 style 이기려 !important (모바일 한정) */
    }

    /* ── 한글 낱자 꺾임 방지: 단어 단위 줄바꿈 ("업무일/지" 같은 중간 꺾임 제거) ── */
    #mainDashboard { word-break: keep-all; }
    .moa-stat { white-space: nowrap; }

    /* ── 상단바 사용자 칩: "소장"+"관리소장" 중복 → 아바타 배지만 (역할 표시는 유지) ── */
    .topbar-user-name { display: none; }
}

/* ============================================
   분쟁 도우미 — 우측 하단 플로팅 챗 (FAB + 패널)
   .main-content 밖 fixed 오버레이라 글자확대 zoom(1.13/1.25)의 영향을 안 받음.
   글자 확대 모드는 --dsp-fs 변수로 패널 내부 폰트만 키운다.
   ============================================ */
.dsp-fab {
    position: fixed; right: 24px; bottom: 24px; z-index: 900;
    width: 56px; height: 56px; border-radius: 50%;
    border: none; cursor: pointer;
    background: var(--primary); color: #fff;
    box-shadow: 0 6px 20px rgba(49, 130, 246, 0.42);
    display: flex; align-items: center; justify-content: center;
}
.dsp-fab:hover { background: var(--primary-hover); }
/* 챗 FAB가 코너를 차지 → 기존 "맨 위로" 버튼은 그 위로.
   (index.html 인라인 <style>의 #scrollTopBtn 규칙보다 특이도 높은 button# 선택자로 이김) */
button#scrollTopBtn { bottom: 92px; }

.dsp-panel {
    position: fixed; right: 24px; bottom: 24px; z-index: 980; /* uiModal(10000) 아래, 모바일 탭바(950) 위 */
    width: min(420px, calc(100vw - 48px));
    height: min(660px, calc(100vh - 48px));
    height: min(660px, calc(100dvh - 48px));
    display: flex; flex-direction: column;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border); border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    --dsp-fs: 15px;
}
.dsp-panel[hidden] { display: none; } /* display:flex가 hidden 속성을 무력화하는 것 방지 */
html[data-fontsize="large"]  .dsp-panel { --dsp-fs: 17px; }
html[data-fontsize="xlarge"] .dsp-panel { --dsp-fs: 19px; }

.dsp-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px; flex-shrink: 0;
    background: var(--ds-surface); border-bottom: 1px solid var(--ds-border);
}
.dsp-head-title { font-size: 15px; font-weight: 800; color: var(--ds-text); margin-right: auto; }
.dsp-new-btn {
    flex-shrink: 0; min-height: 30px; padding: 4px 12px;
    background: var(--ds-surface); color: var(--ds-text-sub);
    border: 1px solid var(--ds-border); border-radius: 15px;
    font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.dsp-new-btn:hover { background: var(--ds-surface-hov); color: var(--ds-text); }
.dsp-close-btn {
    width: 32px; height: 32px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 8px; background: none; cursor: pointer;
    color: var(--ds-text-sub);
}
.dsp-close-btn:hover { background: var(--ds-surface-hov); color: var(--ds-text); }

.dsp-disclaimer {
    padding: 7px 14px; flex-shrink: 0;
    background: var(--ds-chip); color: var(--ds-chip-text);
    font-size: 12px; font-weight: 600;
}

.dsp-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px; overflow-anchor: none; /* 타자기 중 브라우저가 자라는 꼬리를 따라가는 것 방지 */ }

/* 첫 화면 — 안내 + 예시 질문 */
.dsp-empty { text-align: center; padding: 22px 8px 8px; color: var(--ds-text-sub); }
.dsp-empty-title { font-size: 18px; font-weight: 800; color: var(--ds-text); margin-bottom: 6px; }
.dsp-empty p { font-size: 13px; line-height: 1.5; }
.dsp-examples { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.dsp-examples button {
    text-align: left; padding: 11px 13px;
    background: var(--ds-surface); color: var(--ds-text-label, #4E5968);
    border: 1px solid var(--ds-border); border-radius: 10px;
    font-family: inherit; font-size: 13.5px; line-height: 1.4; cursor: pointer;
}
.dsp-examples button:hover { background: var(--ds-surface-hov); border-color: var(--ds-accent); }

/* 말풍선 */
.dsp-bubble {
    width: fit-content; max-width: 88%;
    padding: 9px 13px; margin-bottom: 10px;
    border-radius: 14px;
    font-size: var(--dsp-fs); line-height: 1.55; word-break: break-word;
}
.dsp-bubble.user { margin-left: auto; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.dsp-bubble.assistant { margin-right: auto; background: var(--ds-surface); color: var(--ds-text); border: 1px solid var(--ds-border); border-bottom-left-radius: 4px; }
.dsp-bubble.dsp-error { background: var(--danger-light); color: var(--danger); border-color: transparent; }
.dsp-bubble.dsp-thinking { color: var(--ds-text-sub); animation: dspPulse 1.2s ease-in-out infinite; }
@keyframes dspPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* 참고 자료 접기 */
.dsp-refs { margin-top: 10px; font-size: 12.5px; color: var(--ds-text-sub); }
.dsp-refs summary { cursor: pointer; font-weight: 600; }
.dsp-refs ul { margin: 6px 0 0 18px; }

/* 입력줄 */
.dsp-composer {
    display: flex; gap: 8px; align-items: flex-end;
    padding: 10px; flex-shrink: 0;
    background: var(--ds-surface); border-top: 1px solid var(--ds-border);
}
.dsp-composer textarea {
    flex: 1; border: none; outline: none; resize: none;
    background: transparent; color: var(--ds-text);
    font-family: inherit; font-size: max(16px, var(--dsp-fs)); line-height: 1.45; /* 16px 미만이면 iOS가 포커스 시 화면 자동확대 */
    padding: 8px 6px; max-height: 132px;
}
.dsp-send {
    width: 40px; height: 40px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff;
    border: none; border-radius: 10px; cursor: pointer;
}
.dsp-send:hover { background: var(--primary-hover); }
.dsp-send:disabled { opacity: .45; cursor: default; }

@media (max-width: 640px) {
    /* FAB는 하단 탭바(56px+홈바) 위로 */
    .dsp-fab { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    button#scrollTopBtn { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); } /* FAB 위 */
    /* 패널은 풀스크린 (탭바까지 덮음 — 닫기는 우상단 X) */
    .dsp-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; border: none; }
}
@media print { .dsp-fab, .dsp-panel { display: none !important; } }

/* ============================================
   오늘 (tabToday, 간편 화면) — 기록·알림
   데스크톱: 두 패널 나란히 / 모바일: 상단 세그먼트로 전환
   색 절제: 흰 카드 + 회색 점, 긴급만 빨강, 포인트는 파랑
   ============================================ */
.nav-badge-simple {
    font-size: 10.5px; font-weight: 700; color: #fff;
    background: var(--primary); border-radius: 5px;
    padding: 2px 6px; margin-left: 6px; vertical-align: 1px;
}

/* 세그먼트 — 기본(데스크톱) 숨김, 모바일에서만 */
.today-seg { display: none; }
.today-seg-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger); margin-left: 6px; vertical-align: 6px;
}

/* 화면 높이에 딱 맞춰 두 패널이 각자 내부 스크롤 — 페이지가 스크롤되면 입력창이 화면 밖으로 밀린다.
   52px=탑바, 44px=.tab-pane.active 위아래 패딩 */
#tabToday.active {
    display: flex; flex-direction: column;
    height: calc(100dvh - 96px);
    min-height: 460px;
}
/* 글자 확대 시 zoom 컨텍스트 안에서 100dvh가 배율만큼 커져 하단이 잘리는 앱 전역 특성 보정(§4.12) */
html[data-fontsize="large"]  #tabToday.active { height: calc((100dvh - 96px) / 1.13); }
html[data-fontsize="xlarge"] #tabToday.active { height: calc((100dvh - 96px) / 1.25); }

.today-grid {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px;
    max-width: 1180px; margin: 0 auto;
    flex: 1; min-height: 0; width: 100%;
}
/* 두 패널은 그리드 stretch로 같은 높이가 된다. 내부를 flex 컬럼으로 둬야 남는 높이를
   대화 영역이 먹고 입력창이 패널 바닥에 붙는다. (안 하면 입력창 아래가 통째로 빈다) */
.today-panel {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border); border-radius: 16px;
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0;
}
.today-panel-hd {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 16px; font-weight: 800; color: var(--ds-text);
    flex-shrink: 0;
}
.today-panel-hd span { font-size: 13px; font-weight: 600; color: var(--ds-text-sub); margin-left: auto; }
.today-panel-hd .today-count { color: var(--ds-accent); font-size: 15px; font-weight: 800; margin-left: 0; }

/* ── 기록: 챗 ── */
.today-chat {
    background: var(--ds-bg);
    padding: 16px 14px;
    display: flex; flex-direction: column; gap: 12px;
    flex: 1; min-height: 300px;
    overflow-y: auto;
}
#todayThread { display: flex; flex-direction: column; gap: 12px; }
.tdy-b {
    width: fit-content; max-width: 86%;
    padding: 11px 14px; border-radius: 15px;
    font-size: 15.5px; line-height: 1.55; word-break: break-word;
}
.tdy-b.ai { background: var(--ds-surface); color: var(--ds-text); border: 1px solid var(--ds-border); border-bottom-left-radius: 5px; }
.tdy-b.me { background: var(--primary); color: #fff; margin-left: auto; border-bottom-right-radius: 5px; }
.tdy-thinking { color: var(--ds-text-sub); animation: dspPulse 1.2s ease-in-out infinite; }

/* 초안 카드 */
.tdy-draft {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 15px; border-bottom-left-radius: 5px;
    padding: 14px 15px; max-width: 94%;
}
.tdy-draft-hd { font-size: 14px; font-weight: 800; color: var(--ds-text-sub); margin-bottom: 10px; }
/* 여러 건일 때 항목 카드 — 두 번째부터 구분선 */
.tdy-item { position: relative; }
.tdy-item + .tdy-item { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--ds-border); }
.tdy-item-acts { position: absolute; top: 2px; right: 0; z-index: 1; display: flex; gap: 6px; }
/* 테두리 있는 둥근 사각 버튼 + 모노톤 선 아이콘 (이모지 금지) */
.tdy-item-x, .tdy-item-edit {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--ds-border); border-radius: 9px;
    background: var(--ds-surface); color: var(--ds-text-sub); cursor: pointer;
}
.tdy-item-x:hover { background: var(--ds-chip); color: var(--danger); }
.tdy-item-edit:hover { background: var(--ds-chip); color: var(--ds-text); }
/* 초안 항목 인라인 편집 */
.tdy-item-editta {
    width: 100%; box-sizing: border-box; resize: none;
    font-family: inherit; font-size: 15.5px; line-height: 1.45;
    padding: 8px 10px;
    border: 1.5px solid var(--primary); border-radius: 8px;
    background: var(--ds-bg); color: var(--ds-text);
}
/* 중의성 확인 힌트 — 비차단, 무시해도 됨 */
.tdy-ask {
    margin-top: 7px; padding: 7px 10px;
    background: var(--ds-chip); border-radius: 8px;
    font-size: 13.5px; line-height: 1.5; color: var(--ds-text-sub);
}
.tdy-item-ok {
    margin-top: 6px; min-height: 38px; padding: 0 16px;
    border: none; border-radius: 8px;
    background: var(--primary); color: #fff;
    font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.tdy-draft table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.tdy-draft th { text-align: left; color: var(--ds-text-sub); font-weight: 600; padding: 5px 0; width: 60px; }
.tdy-draft td { color: var(--ds-text); font-weight: 600; padding: 5px 0; }
.tdy-draft td.tdy-date-past { color: var(--primary); }
.tdy-chip {
    display: inline-block; background: var(--ds-chip); color: var(--ds-chip-text);
    font-size: 13.5px; font-weight: 700; border-radius: 6px; padding: 2px 8px;
}
.tdy-draft-btns { display: flex; gap: 8px; margin-top: 12px; }
.tdy-save {
    flex: 2; min-height: 46px; border: none; border-radius: 10px;
    background: var(--primary); color: #fff;
    font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
}
.tdy-save:hover { background: var(--primary-hover); }
.tdy-fix {
    flex: 1; min-height: 46px;
    border: 1px solid var(--ds-border); border-radius: 10px;
    background: var(--ds-surface); color: var(--ds-text-sub);
    font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.tdy-fix:hover { background: var(--ds-surface-hov); color: var(--ds-text); }

/* ============================================================
   멀티빌딩 로그인 — claude.ai/design "로그인 멀티빌딩" 구현
   (brand-/lp-/login- 클래스는 기존 styles.css에 이미 존재. 아래는 추가분)
   ============================================================ */
.login-panel { overflow: hidden; }
.bld-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: -0.1px; border-radius: 999px; padding: 3px 9px; white-space: nowrap; background: #F1F5F9; color: #64748B; }
.bld-badge .dot { width: 5px; height: 5px; border-radius: 50%; }
.bld-badge.live { color: #334155; }
.bld-badge.live .dot { background: #3B82F6; box-shadow: 0 0 0 2px rgba(59,130,246,0.22); }
.bld-badge.demo { color: #94A3B8; }
.bld-badge.demo .dot { background: #fff; border: 1.5px solid #CBD5E1; width: 6px; height: 6px; box-sizing: border-box; }
.bld-row { display: flex; align-items: center; gap: 13px; cursor: pointer; border: 1.5px solid #E2E8F0; background: #fff; border-radius: 14px; padding: 13px 15px; transition: all 0.16s; position: relative; }
.bld-row:hover { border-color: #3B82F6; background: #F8FBFF; }
.bld-row.compact { padding: 10px 13px; gap: 11px; }
.bld-thumb { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; background: repeating-linear-gradient(135deg, #EEF3F9 0 6px, #E2EAF4 6px 12px); border: 1px solid #E2E8F0; display: flex; align-items: center; justify-content: center; font-size: 7px; font-family: ui-monospace, monospace; color: #94A3B8; text-align: center; line-height: 1.15; }
.bld-row.compact .bld-thumb { width: 34px; height: 34px; border-radius: 9px; }
.bld-thumb.demo { background: repeating-linear-gradient(135deg, #F4F6F9 0 6px, #ECF0F4 6px 12px); }
.bld-thumb svg { width: 18px; height: 18px; }
.bld-main { flex: 1; min-width: 0; }
.bld-name { display: flex; align-items: center; gap: 8px; }
.bld-name b { font-size: 14.5px; font-weight: 800; color: #0F172A; letter-spacing: -0.3px; }
.bld-row.compact .bld-name b { font-size: 13.5px; }
.bld-sub { font-size: 11.5px; color: #94A3B8; font-weight: 500; margin-top: 3px; }
.bld-row.compact .bld-sub { font-size: 10.5px; margin-top: 2px; }
.bld-chev { color: #CBD5E1; flex-shrink: 0; }
.bld-chev svg { width: 18px; height: 18px; display: block; }
.bld-group-h { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.6px; margin: 16px 0 9px; }
.bld-group-h:first-child { margin-top: 0; }
.bld-group-h .line { flex: 1; height: 1px; background: #ECF0F4; }
.user-pick-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 11px; font-size: 13px; font-weight: 800; color: #0F172A; }
.user-pick-head .who { color: #3B82F6; }
.user-pick-head .back { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #64748B; cursor: pointer; border: 1.5px solid #E2E8F0; border-radius: 8px; padding: 5px 10px; background: #F8FAFC; }
.user-pick-head .back:hover { border-color: #CBD5E1; color: #334155; }
.demo-enter-note { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; background: #F8FAFC; border: 1.5px solid #E9EEF3; border-radius: 12px; padding: 11px 14px; font-size: 12.5px; font-weight: 600; color: #64748B; }
.demo-enter-note svg { width: 16px; height: 16px; flex-shrink: 0; color: #94A3B8; }
.site-search { position: relative; margin-bottom: 14px; }
.site-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #CBD5E1; pointer-events: none; }
.site-search input { width: 100%; box-sizing: border-box; padding: 12px 15px 12px 42px; border: 1.5px solid #E2E8F0; border-radius: 12px; font-size: 14px; font-family: inherit; font-weight: 600; color: #0F172A; background: #fff; outline: none; transition: all .16s; }
.site-search input::placeholder { color: #B6C0CE; font-weight: 500; }
.site-search input:focus { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.fav-star { flex-shrink: 0; color: #F59E0B; cursor: pointer; }
.fav-star svg { width: 15px; height: 15px; display: block; }
.fav-star.off { color: #D8DEE6; }
.site-list-scroll { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; padding-right: 4px; margin-right: -4px; flex: 1; min-height: 0; }
.site-list-scroll::-webkit-scrollbar { width: 5px; }
.site-list-scroll::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px; }
.site-count-note { font-size: 11px; color: #94A3B8; font-weight: 600; margin: 2px 0 10px; }
#loginPanel { display: flex; flex-direction: column; }

/* ── 본사(HQ) 화면 — claude.ai/design "건물데일리 본사 대시보드" 시안 구현 ──
   소장 앱과 분리된 별도 서피스라 Toss 팔레트·Pretendard를 하드코딩(다크모드 미적용, 시안이 라이트 전용).
   색 상수: 배경 #E9ECEF / 카드 #fff / 테두리 #E5E8EB / 구분선 #F2F4F6
   텍스트 #191F28·#333D4B·#4E5968 / muted #8B95A1 / light #B0B8C1·#C4CBD4 / primary #3182F6 / badge #EAF2FE */
#hqScreen {
    flex-direction: column; height: 100dvh; background: #E9ECEF;
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
    color: #191F28;
}
.hq-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* 헤더 */
.hq-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 24px; flex-shrink: 0;
    background: #fff; border-bottom: 1px solid #E5E8EB;
}
.hq-head-l { display: flex; align-items: center; gap: 11px; }
.hq-logo { width: 26px; height: 26px; border-radius: 7px; background: #3182F6; flex-shrink: 0; }
.hq-brandname { font-size: 16px; font-weight: 800; color: #191F28; }
.hq-badge { font-size: 11.5px; font-weight: 700; color: #3182F6; background: #EAF2FE; padding: 3px 9px; border-radius: 6px; }
.hq-head-r { display: flex; align-items: center; gap: 16px; }
.hq-date { font-size: 13px; color: #8B95A1; }
.hq-org { font-size: 13px; color: #4E5968; font-weight: 600; }
.hq-logout {
    padding: 7px 13px; border: 1px solid #E5E8EB; border-radius: 8px;
    background: #fff; color: #8B95A1; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hq-logout:hover { background: #F2F4F6; color: #4E5968; }
/* 본문 */
.hq-body { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 24px 48px; max-width: 900px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.hq-summary { font-size: 17px; color: #4E5968; line-height: 1.6; margin-bottom: 30px; }
.hq-sec-t { font-size: 15px; font-weight: 800; color: #191F28; margin: 0 0 13px; }
/* 살펴보면 좋은 현장 — 2열 카드 */
.hq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 30px; }
.hq-card {
    background: #fff; border: 1px solid #E5E8EB; border-radius: 14px;
    padding: 17px 18px; cursor: pointer; transition: box-shadow .12s, border-color .12s;
}
.hq-card:hover { border-color: #C9D2DC; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.hq-card-top { display: flex; align-items: center; justify-content: space-between; }
.hq-card-name { font-size: 16px; font-weight: 800; color: #191F28; }
.hq-card-type { font-size: 12px; color: #8B95A1; margin-top: 3px; }
.hq-card-note { font-size: 13.5px; color: #4E5968; font-weight: 600; margin-top: 11px; line-height: 1.5; }
.hq-arr { font-size: 16px; color: #B0B8C1; flex-shrink: 0; }
/* 오늘 있었던 일 — 한 줄 목록 */
.hq-feed { background: #fff; border: 1px solid #E5E8EB; border-radius: 14px; overflow: hidden; }
.hq-row { display: flex; gap: 13px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #F2F4F6; cursor: pointer; }
.hq-row:last-child { border-bottom: none; }
.hq-row:hover { background: #FAFBFC; }
.hq-row-when { font-size: 11px; font-weight: 700; color: #8B95A1; min-width: 26px; flex-shrink: 0; }
.hq-row-name { font-size: 14px; font-weight: 700; color: #191F28; min-width: 150px; flex-shrink: 0; }
.hq-row-sum { font-size: 13.5px; color: #4E5968; flex: 1; min-width: 0; }
.hq-feed-more { padding: 14px 18px; font-size: 13px; color: #8B95A1; text-align: center; }
/* ── 현장 상세 ── */
.hq-detail { background: #fff; border: 1px solid #E5E8EB; border-radius: 16px; overflow: hidden; }
.hq-dt-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 20px 24px 16px; border-bottom: 1px solid #E5E8EB;
}
.hq-dt-name { font-size: 19px; font-weight: 800; color: #191F28; }
.hq-dt-meta { font-size: 12.5px; color: #8B95A1; margin-top: 5px; }
.hq-back {
    flex-shrink: 0; padding: 7px 12px; border: 1px solid #E5E8EB; border-radius: 8px;
    background: #fff; color: #4E5968; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hq-back:hover { background: #F2F4F6; }
.hq-tabs { display: flex; gap: 22px; padding: 14px 24px 0; border-bottom: 1px solid #E5E8EB; }
.hq-tab {
    position: relative; border: none; background: none; padding: 6px 2px 13px;
    font-family: inherit; font-size: 14.5px; font-weight: 700; color: #8B95A1; cursor: pointer;
}
.hq-tab.on { color: #191F28; }
.hq-tab.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: #3182F6; border-radius: 3px; }
.hq-dt-body { padding: 6px 24px 20px; max-height: 620px; overflow-y: auto; }
/* 일지 — 날짜 그룹 + 항목 */
.hq-grp { display: flex; align-items: center; gap: 10px; padding: 18px 0 10px; }
.hq-grp-date { font-size: 13px; font-weight: 800; color: #191F28; }
.hq-grp-cnt { font-size: 11.5px; color: #8B95A1; }
.hq-grp-line { flex: 1; height: 1px; background: #F2F4F6; }
.hq-logitem { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #F2F4F6; }
.hq-dot { width: 5px; height: 5px; border-radius: 50%; background: #C4CBD4; margin-top: 8px; flex-shrink: 0; }
.hq-logtext { font-size: 14px; line-height: 1.55; color: #333D4B; word-break: break-word; }
/* 민원 */
.hq-comp { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid #F2F4F6; }
.hq-comp-date { min-width: 60px; flex-shrink: 0; font-size: 13px; font-weight: 700; color: #8B95A1; padding-top: 1px; }
.hq-comp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hq-comp-text { font-size: 14.5px; line-height: 1.65; color: #333D4B; word-break: break-word; }
.hq-comp-foot { display: flex; align-items: center; gap: 10px; }
.hq-chip { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.hq-chip.open { color: #3182F6; background: #EAF2FE; }
.hq-chip.done { color: #8B95A1; background: #F2F4F6; }
.hq-comp-photo { font-size: 12px; color: #8B95A1; }
.hq-empty { padding: 48px 20px; text-align: center; color: #8B95A1; font-size: 15px; line-height: 1.6; }

/* 저장 카드 — 항목별 [수정]/[삭제] */
.tdy-sv-row { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 600; color: var(--ds-text); }
.tdy-sv-row + .tdy-sv-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--ds-border); }
.tdy-sv-row.del .tdy-sv-line { text-decoration: line-through; color: var(--ds-text-muted); }
.tdy-sv-line { flex: 1; min-width: 0; line-height: 1.45; word-break: break-word; }
.tdy-sv-gone { flex-shrink: 0; font-size: 13.5px; font-weight: 700; color: var(--ds-text-muted); }
.tdy-sv-btns { display: flex; gap: 6px; flex-shrink: 0; }
.tdy-sv-btns button {
    min-height: 38px; padding: 0 12px;
    border: 1px solid var(--ds-border); border-radius: 9px;
    background: var(--ds-surface); color: var(--ds-text-sub);
    font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.tdy-sv-btns button:hover { background: var(--ds-surface-hov); color: var(--ds-text); }

/* 후보 선택 버튼 (2건+ 자동선택 금지 — 탭으로만) */
.tdy-choose-btn {
    display: block; width: 100%; text-align: left;
    min-height: 46px; padding: 10px 12px; margin-top: 8px;
    border: 1px solid var(--ds-border); border-radius: 10px;
    background: var(--ds-bg); color: var(--ds-text);
    font-family: inherit; font-size: 15.5px; font-weight: 600; line-height: 1.45; cursor: pointer;
}
.tdy-choose-btn:hover { border-color: var(--primary); background: var(--ds-surface-hov); }

.tdy-donemsg { color: var(--ds-text-muted); font-size: 13.5px; }

/* 수정 대기 배너 */
.tdy-pending {
    max-width: 94%;
    background: var(--ds-surface);
    border: 1.5px solid var(--primary); border-radius: 15px; border-bottom-left-radius: 5px;
    padding: 12px 14px;
    font-size: 15px; color: var(--ds-text); line-height: 1.5; word-break: break-word;
}
.tdy-pending-hint { margin-top: 6px; font-size: 13.5px; color: var(--ds-text-sub); }
.tdy-pending-hint button {
    min-height: 34px; padding: 0 12px; margin-left: 6px;
    border: 1px solid var(--ds-border); border-radius: 8px;
    background: var(--ds-surface); color: var(--ds-text-sub);
    font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}

/* 입력줄 */
.today-inbar {
    display: flex; gap: 8px; align-items: flex-end;
    padding: 10px 12px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-surface);
    flex-shrink: 0;
}
.today-inbar textarea {
    flex: 1; border: none; outline: none; resize: none;
    background: var(--ds-bg); border-radius: 12px;
    color: var(--ds-text);
    font-family: inherit; font-size: 16px; line-height: 1.45;
    padding: 12px 14px; max-height: 132px;
}
.today-send {
    width: 46px; height: 46px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff;
    border: none; border-radius: 12px; cursor: pointer;
}
.today-send:hover { background: var(--primary-hover); }
.today-send:disabled { opacity: .45; cursor: default; }

/* ── 알림 피드 ── */
.today-feed {
    background: var(--ds-bg);
    padding: 14px;
    display: flex; flex-direction: column; gap: 11px;
    flex: 1; min-height: 300px;
    overflow-y: auto;
}
.tdy-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border); border-radius: 14px;
    padding: 14px 16px; cursor: pointer;
}
.tdy-card:hover { background: var(--ds-surface-hov); }
.tdy-card.tdy-quiet { cursor: default; }
.tdy-card.tdy-quiet:hover { background: var(--ds-surface); }
/* 탭하면 완료되는 민원 카드 — hover 시 초록 테두리로 "완료" 어포던스 */
.tdy-card-tap:hover { border-color: var(--success); }
.tdy-tap-hint { color: var(--ds-text-muted); font-weight: 600; }
.tdy-tag {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--ds-text-sub);
    margin-bottom: 5px;
}
.tdy-dot { width: 7px; height: 7px; border-radius: 50%; background: #CBD5E1; }
.tdy-dot.urgent { background: var(--danger); }
.tdy-dot.done { background: var(--success); }
.tdy-tt { font-size: 16.5px; font-weight: 700; color: var(--ds-text); line-height: 1.4; }
.tdy-ds { font-size: 14px; color: var(--ds-text-sub); margin-top: 4px; line-height: 1.45; }
.tdy-dday { float: right; color: var(--danger); font-size: 14px; font-weight: 800; margin-left: 8px; }
.tdy-more {
    text-align: center; padding: 10px;
    font-size: 14px; font-weight: 700; color: var(--ds-accent); cursor: pointer;
}

@media (max-width: 640px) {
    /* 세그먼트 표시 + 패널 전환 */
    .today-seg {
        display: flex; gap: 4px;
        background: var(--ds-chip); border-radius: 12px; padding: 4px;
        margin-bottom: 12px;
    }
    .today-seg button {
        flex: 1; min-height: 46px; border: none; border-radius: 9px;
        background: none; font-family: inherit;
        font-size: 16.5px; font-weight: 700; color: var(--ds-text-sub); cursor: pointer;
    }
    .today-seg button.on { background: var(--ds-surface); color: var(--ds-text); box-shadow: 0 2px 8px rgba(15,23,42,.10); }
    /* 모바일: 한 패널만 보이되 화면(탑바~탭바)을 채운다 → 기록칸 입력창이 바닥에 붙고 알림은 내부 스크롤.
       main-content의 하단 패딩 92px(탭바 회피용)가 이 탭에선 패널을 위로 밀어 빈공간을 만들므로 제거하고,
       패널이 직접 탭바 위까지 채운다. 117 = 탑바(52)+탭바(57)+여유(8), 실측 튜닝 */
    body:has(#tabToday.tab-pane.active) .main-content { padding-bottom: 0; }
    #tabToday.active { display: flex; flex-direction: column; height: calc(100dvh - 117px); min-height: 360px; }
    html[data-fontsize="large"]  #tabToday.active { height: calc((100dvh - 117px) / 1.13); }
    html[data-fontsize="xlarge"] #tabToday.active { height: calc((100dvh - 117px) / 1.25); }
    .today-grid { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    .today-panel { border-radius: 14px; flex: 1; min-height: 0; } /* 보이는 패널이 남는 높이 채움 */
    .today-panel-hd { display: none; } /* 세그먼트가 제목 역할 */
    #tabToday[data-ttab="record"] .today-not { display: none; }
    #tabToday[data-ttab="notice"] .today-rec { display: none; }
    .today-chat, .today-feed { min-height: 0; } /* flex 안에서 내부 스크롤 허용 */
    /* 기록 하위탭은 입력창이 우하단에 있어 분쟁 FAB와 전송버튼이 겹친다 → 기록 화면에서만 FAB 숨김
       (알림 하위탭·다른 탭에선 FAB 유지) */
    body:has(#tabToday.tab-pane.active[data-ttab="record"]) #dspFab { display: none; }
}

/* ── 사이드바 '전체 메뉴' 서랍 ─────────────────────────────
   상시 4줄(오늘·업무 기록·모아보기·전자결재함) 외 나머지를 접는다.
   되돌리기: index.html의 <details class="nav-fold">에 open 속성을 주면 항상 펼침,
             태그 두 줄을 지우면 예전처럼 12개 상시 노출. */
.nav-fold { padding: 0 10px; margin-bottom: 4px; }
.nav-fold > summary {
    display: flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 9px 10px;
    border-radius: 9px; cursor: pointer; list-style: none;
    font-size: 13.5px; font-weight: 700; color: var(--ds-text-sub, #64748B);
}
.nav-fold > summary::-webkit-details-marker { display: none; }
.nav-fold > summary::after { content: '▾'; margin-left: auto; transition: transform .15s; }
.nav-fold[open] > summary::after { transform: rotate(180deg); }
.nav-fold > summary:hover { background: var(--ds-surface-hov, #F8FAFC); color: var(--ds-text); }
/* 접힌 상태에서도 현재 보고 있는 화면이 이 안에 있으면 표시 */
.nav-fold:has(.nav-item.active) > summary { color: var(--ds-accent); }
/* 서랍 안 그룹 라벨은 분류 단서라 읽혀야 함 — 기존 9.5px/연회색은 노안에 판독 불가 */
.nav-fold .nav-label { font-size: 11.5px; letter-spacing: 0; text-transform: none; color: var(--ds-text-sub, #64748B); }

/* 알림 패널 헤더의 현황판 진입로 */
.today-panel-hd .tdy-hd-link { color: var(--ds-accent); cursor: pointer; font-weight: 700; }
.today-panel-hd .tdy-hd-link:hover { text-decoration: underline; }
