/* ── CSS 변수 (오렌지 테마) ── */
:root {
    /* ── Surface (Zinc 기반 neutral) ── */
    --bg-primary: #f4f4f6;      /* 페이지 배경 — zinc-100 */
    --bg-secondary: #ffffff;    /* 카드/컴포넌트 표면 */
    --bg-tertiary: #efefef;     /* 테이블 헤더, 인라인 강조 */
    --bg-hover: #eaeaec;        /* hover 상태 */

    /* ── Border ── */
    --border: #e4e4e7;          /* zinc-200 — subtle, SaaS-standard */

    /* ── Text ── */
    --text-primary: #18181b;    /* zinc-900 */
    --text-secondary: #52525b;  /* zinc-600 */
    --text-muted: #a1a1aa;      /* zinc-400 */

    /* ── Accent (orange 유지) ── */
    --accent: #f97316;
    --accent-hover: #ea6c0a;
    --accent-light: rgba(249, 115, 22, 0.1);
    --accent-light2: rgba(249, 115, 22, 0.06);

    /* ── Semantic colors ── */
    --danger: #dc2626;          /* red-600 */
    --danger-hover: #b91c1c;    /* red-700 */
    --success: #16a34a;         /* green-600 */
    --warning: #d97706;         /* amber-600 — accent orange와 구분 */
    --info: #2563eb;            /* blue-600 */
    --radius: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);

    /* ── Spacing (4pt grid) ── */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-5:  20px;
    --sp-6:  24px;
    --sp-8:  32px;
    --sp-10: 40px;

    /* ── Typography scale ── */
    --text-xs:   11px;
    --text-sm:   12px;
    --text-base: 13px;
    --text-md:   14px;
    --text-lg:   16px;
    --text-xl:   18px;
    --text-2xl:  22px;
    --text-3xl:  28px;

    --leading-tight:   1.3;
    --leading-base:    1.5;
    --leading-relaxed: 1.7;

    --fw-normal:   400;
    --fw-medium:   500;
    --fw-semibold: 600;
    --fw-bold:     700;

    /* ── Elevation (shadow 4단계) ── */
    --shadow-0: none;
    --shadow-1: 0 1px 3px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-3: 0 4px 12px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-4: 0 8px 28px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.08);

    /* ── Transition ── */
    --t-fast: 0.1s ease;
    --t-base: 0.15s ease;
    --t-slow: 0.25s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--leading-base);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--t-base); }
a:hover { color: var(--accent-hover); }

/* ── Typography hierarchy ── */
h1 {
    font-size: var(--text-2xl);
    font-weight: var(--fw-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
}
h2 {
    font-size: var(--text-xl);
    font-weight: var(--fw-bold);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}
h3 {
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    line-height: var(--leading-base);
}

/* ── 네비게이션 ── */
.navbar {
    background: var(--accent);
    border-bottom: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
}
.navbar-inner {
    width: 100%;
    padding: 0 var(--sp-6);
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.navbar-logo {
    height: 22px;
    width: auto;
}
.navbar-brand:hover { color: rgba(255,255,255,0.88); }
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

/* collapse 드롭다운 */
.nav-item {
    position: relative;
}
.nav-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.88);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav-toggle:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.nav-toggle.active {
    background: rgba(0,0,0,0.16);
    color: #fff;
}
.nav-arrow {
    font-size: 10px;
    transition: transform 0.2s;
    color: rgba(255,255,255,0.6);
}
.nav-toggle.active .nav-arrow {
    transform: rotate(180deg);
}
.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-3);
    min-width: 160px;
    z-index: 400;
    padding: 4px 0;
    animation: fadeInDown 0.15s ease;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu.align-right {
    left: auto;
    right: 0;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.nav-dropdown-menu a,
.nav-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.nav-dropdown-menu a.danger { color: var(--danger); }
.nav-dropdown-menu a.danger:hover { background: rgba(220,53,69,0.06); }
.nav-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.nav-admin-badge {
    font-size: 10px;
    background: rgba(255,255,255,0.22);
    color: #fff;
    border-radius: 3px;
    padding: 1px 5px;
    font-weight: 600;
}

/* ── 아바타 ── */
.avatar {
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
}
.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }
.avatar-initials {
    background: #b0b0b8;
    color: transparent;
    font-size: 0 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255%2C255%2C255%2C0.9)'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E");
    background-size: 65%;
    background-repeat: no-repeat;
    background-position: center 55%;
}

/* ── 전체 레이아웃 ── */
.layout-wrapper {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 52px);
    padding-top: 52px;
}
.app-sidebar {
    width: 270px;
    flex-shrink: 0;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    padding: 14px 12px;
    transition: width 0.22s ease, padding 0.22s ease, border-color 0.22s ease;
    overflow-x: hidden;
}
/* 사이드바 접힌 상태 (데스크탑 전용) */
.sidebar-collapsed .app-sidebar {
    width: 0;
    padding: 0;
    border-right-color: transparent;
    overflow: hidden;
}
.sidebar-collapsed .container {
    max-width: calc(100vw - 40px);
}
.sidebar-collapsed.has-right-sidebar .container {
    max-width: calc(100vw - 340px); /* 우측 사이드바만 */
}
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.main-content.logged-out {
    align-items: center;
}
.main-content.logged-out .container {
    max-width: 1000px;
    width: 100%;
}
.app-sidebar-right {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.8);
    border-left: 1px solid var(--border);
    padding: 14px 12px;
    transition: width 0.22s ease, padding 0.22s ease, border-color 0.22s ease;
    overflow-x: hidden;
}
/* 우측 사이드바 닫기 버튼 */
.sidebar-right-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 2px 4px;
    margin-top: -6px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color var(--t-base), background var(--t-base);
}
.sidebar-right-close-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
/* 트윗 패널(모바일 팝업) 안에서는 닫기 버튼 숨김 */
.tweet-panel .sidebar-right-close-btn { display: none; }
/* 페이지 로드 시 transition 억제 */
.no-sidebar-transition .app-sidebar,
.no-sidebar-transition .app-sidebar-right { transition: none !important; }
/* 우측 사이드바 접힌 상태 */
.right-sidebar-collapsed .app-sidebar-right {
    width: 0;
    padding: 0;
    border-left-color: transparent;
    overflow: hidden;
}
.right-sidebar-collapsed.has-right-sidebar .container {
    max-width: calc(100vw - 310px);
}
.sidebar-collapsed.right-sidebar-collapsed .container {
    max-width: calc(100vw - 40px);
}
/* 데스크탑에서 우측 사이드바 접혔을 때 FAB 표시 (body 클래스 기준) */
body.right-sidebar-collapsed .tweet-fab { display: flex !important; }

/* ── 우측 사이드바: 트윗 피드 ── */
.tweet-feed-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 4px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
}
.tweet-feed-title span { display: flex; align-items: center; gap: 6px; }
/* 트윗 작성 입력 */
.tweet-compose {
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
}
.tweet-compose-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.tweet-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    line-height: 1.5;
    font-family: inherit;
    min-height: 52px;
}
.tweet-input:focus {
    border-color: var(--accent);
}
.tweet-input::placeholder {
    color: var(--text-muted);
}
.tweet-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    margin-top: 4px;
}
.tweet-submit-btn:hover {
    background: var(--accent-hover);
}
/* 트윗 카드 */
.tweet-card {
    display: flex;
    gap: 8px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.tweet-card:last-child { border-bottom: none; }
.tweet-avatar {
    flex-shrink: 0;
    padding-top: 1px;
}
.tweet-content {
    flex: 1;
    min-width: 0;
}
.tweet-meta {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 3px;
}
.tweet-meta .tweet-date {
    margin-left: auto;
}
.tweet-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
    flex-shrink: 0;
}
.tweet-date {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}
.tweet-del-form {
    margin: 0;
    line-height: 1;
}
.tweet-del-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.tweet-card:hover .tweet-del-btn {
    opacity: 1;
}
.tweet-del-btn:hover {
    color: var(--danger);
}
.tweet-body {
    color: var(--text-secondary);
    line-height: 1.55;
    word-break: break-word;
}
.tweet-body a {
    color: var(--accent);
    word-break: break-all;
    font-size: 11px;
}
.tweet-empty {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

/* ── 컨테이너 ── */
.container {
    width: 100%;
    max-width: calc(100vw - 310px); /* 좌측 사이드바만 */
    padding: var(--sp-5);
}
/* 우측 사이드바가 있는 페이지(시작 페이지)에서만 축소 */
.has-right-sidebar .container {
    max-width: calc(100vw - 570px); /* 270px 좌측 + 300px 우측 */
}
.container-sm {
    width: 400px;
    margin: 0 auto;
    padding: var(--sp-5);
}

/* ── Flash 메시지 ── */
.flash {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid;
}
.flash-success { background: rgba(22,163,74,0.08);  border-color: rgba(22,163,74,0.25);  color: #15803d; }
.flash-danger  { background: rgba(220,38,38,0.08);  border-color: rgba(220,38,38,0.25);  color: #b91c1c; }
.flash-warning { background: rgba(217,119,6,0.08);  border-color: rgba(217,119,6,0.25);  color: #92400e; }
.flash-info    { background: rgba(37,99,235,0.08);  border-color: rgba(37,99,235,0.25);  color: #1d4ed8; }

/* ── 버튼 ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 34px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--t-base), color var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
    box-sizing: border-box;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: middle;
}
/* post-actions 내 form 요소가 flex 레이아웃을 방해하지 않도록 */
.post-actions form { display: contents; }
.btn:hover { background: var(--bg-hover); color: var(--text-primary); box-shadow: var(--shadow-1); }
.btn:active { transform: scale(0.97); box-shadow: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* 숫자 컬럼 우측 정렬 */
.num-col { text-align: right !important; }

/* 관리자 휴가 테이블 짝홀수 행 배경 */
#hday-table tbody tr:nth-child(odd) td { background: var(--bg-primary); }
#hday-table tbody tr:nth-child(even) td { background: var(--bg-secondary); }

/* 관리자 휴가 테이블 컬럼 그룹 간격 (입사일 / 연차휴가 / 정산유급) */
#hday-table th:nth-child(3),
#hday-table td:nth-child(3),
#hday-table th:nth-child(7),
#hday-table td:nth-child(7),
#hday-table th:nth-child(11),
#hday-table td:nth-child(11) { padding-left: 28px; }

/* 사용자 관리 헤더 래퍼 — 데스크탑: 한 줄 flex, 모바일: 세로 */
.users-header-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.users-header-wrap > .page-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    margin-right: auto;
}
.users-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.users-filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    .users-header-wrap {
        flex-wrap: wrap;
        padding-bottom: 0;
        border-bottom: none;
        margin-bottom: 0;
        gap: 0;
    }
    .users-header-wrap > .page-header {
        padding-bottom: var(--sp-4);
        border-bottom: none;
        margin-bottom: 0;
        flex: 1 1 auto;
    }
    .users-header-actions {
        flex-shrink: 0;
        padding-bottom: var(--sp-4);
    }
    .users-header-wrap > .page-header,
    .users-header-actions {
        border-bottom: 1px solid var(--border);
    }
    .users-filter-bar {
        flex: 1 1 100%;
        padding-top: var(--sp-3);
        padding-bottom: var(--sp-4);
        margin-bottom: var(--sp-4);
    }
}

/* 휴가 관리 헤더 — 데스크탑: h2 왼쪽, year+sub-controls 오른쪽 */
.hday-page-header {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
}
.hday-page-header > h2 { margin-right: auto; }
.hday-sub-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    .hday-sub-controls {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}


/* 편집 버튼 셀 너비 최소화 */
.col-edit { width: 1%; white-space: nowrap; }

.mobile-team-inline { display: none; }
@media (max-width: 768px) {
    .mobile-team-inline {
        display: block;
        font-size: var(--text-sm);
        color: var(--text-muted);
        margin-top: 2px;
    }
}

/* 사용자 관리 테이블 짝홀수 행 배경 */
#users-tbody tr:nth-child(odd) td { background: var(--bg-primary); }
#users-tbody tr:nth-child(even) td { background: var(--bg-secondary); }

/* 이전 년도 비교 값 파란 계열 */
.prev-val { color: var(--info) !important; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; border-color: var(--accent-hover); box-shadow: 0 4px 12px rgba(249,115,22,0.35); }
.btn-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
/* 반려 버튼 — 승인(btn-primary)과 동일한 solid 패턴, danger 색상 */
.btn-reject {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-reject:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; box-shadow: 0 4px 12px rgba(220,38,38,0.3); }
/* 댓글 삭제 휴지통 아이콘 버튼 */
.comment-del-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    opacity: 0;
    transition: opacity var(--t-base), color var(--t-base);
}
.comment-item:hover .comment-del-btn { opacity: 1; }
.comment-del-btn:hover { color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.btn-icon-danger:hover { color: var(--danger); border-color: var(--danger); }
.crm-autocomplete-dropdown .ac-item-active { background: var(--bg-hover); color: var(--accent); }
.btn-like {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}
.btn-like.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ── 폼 ── */
.form-group { margin-bottom: var(--sp-4); }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--t-base), box-shadow var(--t-base);
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-control:disabled,
.form-control[readonly] {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: default;
}
textarea.form-control {
    min-height: 200px;
    resize: vertical;
    font-family: inherit;
}

/* ── 카드 ── */
.card {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    padding: var(--sp-5);
    margin-bottom: var(--sp-4);
    box-shadow: var(--shadow-2);
    transition: box-shadow var(--t-base);
}

/* ── Card header / body / footer (새 구조 클래스) ── */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-5);
    border-bottom: 1px solid var(--border);
    min-height: 44px;
}
.card-header h3,
.card-header h4 {
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    line-height: var(--leading-base);
}
.card-header .card-header-action {
    font-size: var(--text-sm);
    color: var(--text-muted);
    transition: color var(--t-base);
}
.card-header .card-header-action:hover { color: var(--accent); }

.card-body {
    padding: var(--sp-5);
}
.card-body--sm {
    padding: var(--sp-3) var(--sp-5);
}

.card-footer {
    padding: var(--sp-3) var(--sp-5);
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Card modifier — 점진적 교체용 (기존 .card 삭제하지 않음) */
.card--interactive {
    transition: box-shadow var(--t-base), transform var(--t-base);
    cursor: pointer;
}
.card--interactive:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}
.card--interactive:active {
    transform: translateY(0);
    box-shadow: var(--shadow-1);
}

/* border만, shadow 없음 */
.card--flat {
    box-shadow: var(--shadow-0);
}

/* stat 카드 — 수치 강조 레이아웃 */
.card--stat {
    text-align: center;
    padding: var(--sp-4) var(--sp-3);
}
.card--stat .card__label {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--sp-2);
}
.card--stat .card__value {
    font-size: var(--text-3xl);
    font-weight: var(--fw-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}
.card--stat .card__sub {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--sp-1);
}

/* ── Icon hierarchy utilities ── */
.icon-accent  { color: var(--accent); }
.icon-primary { color: var(--text-secondary); }
.icon-muted   { color: var(--text-muted); }

/* ── 테이블 (게시판 목록) ── */
.table-wrap {
    overflow-x: auto;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
}
table.bbs-table {
    width: 100%;
    border-collapse: collapse;
}
table.bbs-table th,
table.bbs-table td {
    padding: var(--sp-3) var(--sp-3);
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-base);
}
table.bbs-table th {
    background: var(--bg-primary);
    color: var(--text-muted);
    font-weight: var(--fw-medium);
    font-size: var(--text-sm);
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}
table.bbs-table td.subject-col {
    white-space: normal;
    max-width: 400px;
}
table.bbs-table td.subject-col a {
    color: var(--text-primary);
    font-weight: 500;
}
table.bbs-table td.subject-col a:hover { color: var(--accent); }
table.bbs-table tr.bbs-row { cursor: pointer; }
table.bbs-table tr:hover { background: var(--bg-hover); }
table.bbs-table td.author-col {
    white-space: nowrap;
}
.author-cell {
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ── 게시판 배지 ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    font-size: 11px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    font-weight: 500;
}
.badge-new {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    letter-spacing: 0.3px;
    margin-left: 3px;
}
.badge-comment {
    background: var(--accent-light);
    color: var(--accent);
}
.badge-attach {
    background: rgba(13,110,253,0.08);
    color: var(--info);
}
.badge-like {
    background: rgba(220,53,69,0.08);
    color: var(--danger);
}
.icon-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 6px;
    vertical-align: middle;
}
.icon-badge svg { flex-shrink: 0; }

/* ── 페이징 ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    list-style: none;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 var(--sp-2);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}
.pagination a:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 데스크탑/모바일 페이지네이션 토글 */
.pagination-mobile { display: none; }
@media (max-width: 768px) {
    .pagination-desktop { display: none; }
    .pagination-mobile { display: flex; }
}

.mobile-hide { display: table-cell; }
@media (max-width: 768px) {
    .mobile-hide { display: none !important; }
    .note-preview-clamp { -webkit-line-clamp: 1; }
}

.addr-inline-results {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
.addr-inline-results .addr-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.addr-inline-results .addr-results-list {
    max-height: 200px;
    overflow-y: auto;
}
.addr-results-list table { width: 100%; border-collapse: collapse; }
.addr-results-list tr { cursor: pointer; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.addr-results-list tr:last-child { border-bottom: none; }
.addr-results-list tr:hover { background: var(--bg-hover); }
.addr-results-list td { padding: 7px 10px; font-size: 12px; background: inherit; }
.addr-search-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.addr-search-hint { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── 검색 ── */
.search-bar { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); }

/* ── 게시글 상세 ── */
.post-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.post-header h1 {
    font-size: var(--text-2xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    line-height: var(--leading-tight);
    margin-bottom: var(--sp-3);
    color: var(--text-primary);
}
.post-author-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}
.post-author-info { display: flex; flex-direction: column; gap: 2px; }
.post-author-name { font-size: var(--text-md); font-weight: var(--fw-semibold); }
.post-meta {
    display: flex;
    gap: var(--sp-4);
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.post-body {
    font-size: 15px;
    line-height: 1.8;
    padding: 20px;
    background: #fff;
    color: #222;
    border-radius: var(--radius);
    word-break: break-word;
}
.post-body img { max-width: 100%; height: auto; }
.post-body a { color: var(--accent); }
.post-body hr { border: none; border-top: 2px solid var(--border); margin: 16px 0; }
.post-body .ql-align-center { text-align: center; }
.post-body .ql-align-right  { text-align: right; }
.post-body .ql-align-justify { text-align: justify; }
.post-body table, .post-body .ql-html-table table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.post-body table td, .post-body table th,
.post-body .ql-html-table td, .post-body .ql-html-table th { border: 1px solid var(--border); padding: 6px 10px; min-width: 40px; word-break: break-word; }
.post-body table th, .post-body .ql-html-table th { background: var(--bg-primary); font-weight: 600; }

/* ── post-body: 리스트 (Quill ql-indent 호환) ── */
.post-body ol,
.post-body ul { padding-left: 1.8em; margin: 6px 0; }
.post-body ol { counter-reset: list-0 list-1 list-2; }
.post-body ol > li { list-style-type: none; counter-increment: list-0; counter-reset: list-1 list-2; }
.post-body ol > li::before { content: counter(list-0, decimal) '. '; }
.post-body li.ql-indent-1 { padding-left: 3em; }
.post-body li.ql-indent-2 { padding-left: 5em; }
.post-body li.ql-indent-3 { padding-left: 7em; }
.post-body ol > li.ql-indent-1 { counter-increment: list-1; counter-reset: list-2; }
.post-body ol > li.ql-indent-1::before { content: counter(list-1, lower-alpha) '. '; }
.post-body ol > li.ql-indent-2 { counter-increment: list-2; }
.post-body ol > li.ql-indent-2::before { content: counter(list-2, lower-roman) '. '; }
.post-body ul > li { list-style-type: disc; }
.post-body ul > li.ql-indent-1 { list-style-type: circle; }
.post-body ul > li.ql-indent-2 { list-style-type: square; }

/* ── post-body: blockquote ── */
.post-body blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(249,115,22,0.06);
    padding: 10px 16px;
    margin: 12px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-actions {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

/* ── 첨부파일 ── */
.attach-list {
    margin: var(--sp-4) 0;
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.attach-list h4 {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--fw-medium);
    margin-bottom: 8px;
}
.attach-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}
.attach-item a { color: var(--text-secondary); }
.attach-item a:hover { color: var(--accent); }
.attach-dl-btn {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted) !important;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.attach-dl-btn:hover { opacity: 1; color: var(--text-primary) !important; }

/* ── 이전/다음글 ── */
.post-nav {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.post-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.post-nav-item:last-child { border-bottom: none; }
.post-nav-label {
    flex-shrink: 0;
    width: 42px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.post-nav-link {
    flex: 1;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-nav-link:hover { color: var(--accent); }
.post-nav-date {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── 댓글 ── */
.comments-section { margin: 24px 12px; }
.comments-section h3 {
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    margin-bottom: var(--sp-4);
    color: var(--text-secondary);
}
.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.comment-meta strong { color: var(--text-primary); }
.comment-content {
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}
.comment-form {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.comment-form textarea { min-height: 60px; flex: 1; }

/* ── 로그인 ── */
.login-card {
    margin-top: 0;
    padding: var(--sp-8) var(--sp-8);
    box-shadow: var(--shadow-3);
}
.login-brand {
    text-align: center;
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--border);
}
.login-brand-name {
    display: block;
    font-size: 28px;
    font-weight: var(--fw-bold);
    color: var(--accent);
    letter-spacing: -0.04em;
    line-height: 1.2;
}
.login-brand-sub {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--sp-1);
    font-weight: var(--fw-normal);
}

/* ── 헤더 액션 바 ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.page-header h2 {
    font-size: var(--text-xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    padding-left: 10px;
    border-left: 3px solid var(--accent);
}

/* ── 모달 ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
}
@media (max-width: 768px) {
    .modal-overlay {
        background: rgba(0, 0, 0, 0.45);
        pointer-events: all;
        justify-content: center;
        align-items: center;
    }
    .modal-box {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        cursor: default;
        max-height: 92vh;
    }
    .modal-header { cursor: default; }
}
.modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: all;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-4);
    width: 90vw;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
    cursor: move;
    user-select: none;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 2px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: var(--sp-5); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.form-row > * { min-width: 0; }
.form-row .form-control { min-width: 0; }
.form-row input[type="date"] { padding: 9px 9px; }

/* ── 휴가 현황 ── */
.hday-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}
.stat-card {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    padding: 18px 16px;
    box-shadow: var(--shadow-1);
    text-align: center;
}
.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--fw-medium);
    margin-bottom: 10px;
}
.stat-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.status-0 { background: rgba(217,119,6,0.10);  color: #92400e; }   /* 대기 — amber */
.status-1 { background: rgba(220,38,38,0.10);  color: #991b1b; }   /* 반려 — red */
.status-2 { background: rgba(22,163,74,0.10);  color: #15803d; }   /* 승인 — green */
.status-3 { background: var(--bg-tertiary);    color: var(--text-muted); } /* 취소 — gray */

/* ── 휴가 승인 탭 ── */
.hday-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}
.hday-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s;
}
.hday-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.hday-tab:hover:not(.active) { color: var(--text-primary); }
.hday-notice {
    background: var(--bg-secondary, #f8f9fa);
    margin-bottom: 16px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.hday-notice p { margin: 0; }
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    margin-left: 6px;
}
.hday-tab.active .tab-badge { background: var(--accent-light); color: var(--accent); }

/* ── 휴가 모달 상세 그리드 ── */
.modal-detail-grid {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px 12px;
    font-size: 14px;
}
.modal-detail-grid .detail-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    padding-top: 2px;
}

/* ── 홈 페이지 ── */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow-2);
}
.dash-greeting { font-size: 15px; }
.dash-anniversary { font-size: 15px; }
.dash-anniversary i { color: var(--accent); }
@media (max-width: 640px) {
    .dash-anniversary { display: block; margin-left: 0; margin-top: 4px; }
    .dash-header { align-items: flex-start; }
}
.dash-role {
    font-size: 11px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 3px;
    padding: 2px 7px;
    margin-left: 8px;
    font-weight: 600;
    vertical-align: middle;
}
.dash-date { font-size: 13px; color: var(--text-muted); }

.home-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
}
.home-section {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-4);
    box-shadow: var(--shadow-2);
}
.home-section:last-child { margin-bottom: 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-3);
}
.section-header h3 {
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}
.section-more { font-size: var(--text-sm); color: var(--text-muted); }
.section-more:hover { color: var(--accent); }
.section-sub { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.empty-msg { font-size: 13px; color: var(--text-muted); text-align: center; padding: 12px 0; }

/* 사내 서비스 바로가기 */
.shortcut-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.shortcut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px 12px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    text-align: center;
    transition: background var(--t-base), box-shadow var(--t-base), transform var(--t-fast);
    gap: 8px;
    text-decoration: none;
}
.shortcut-card:hover {
    background: rgba(249,115,22,0.05);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}
.shortcut-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-1);
}
.shortcut-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}
.shortcut-icon svg { width: 20px; height: 20px; }
.shortcut-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.shortcut-card:hover .shortcut-label { color: var(--accent); }

/* 공지사항 목록 */
.notice-list { display: flex; flex-direction: column; }
.notice-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--bg-tertiary);
    text-decoration: none;
    transition: color 0.1s;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover .notice-title { color: var(--accent); }
.notice-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notice-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* 미니 캘린더 */
.mini-cal-table { width: 100%; border-collapse: collapse; }
.mini-cal-table th {
    padding: 4px 2px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.mini-cal-table th.sun { color: var(--danger); }
.mini-cal-table th.sat { color: var(--info); }
.mini-cal-table td {
    padding: 2px 1px;
    text-align: center;
    vertical-align: top;
}
.mini-cal-table td.cal-sun .cal-day-num { color: var(--danger); }
.mini-cal-table td.cal-sat .cal-day-num { color: var(--info); }
.mini-cal-table td.cal-today .cal-day-num {
    background: var(--accent);
    color: #fff;
}
.cal-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 1px;
    line-height: 1;
}
.cal-hday-dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    margin: 2px auto 0 auto;
}

/* 유저 정보 카드 */
.user-info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px 16px;
    gap: 8px;
}
.user-info-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.user-info-team {
    font-size: 12px;
    color: var(--text-muted);
}
.user-info-actions {
    margin-top: 4px;
    display: flex;
    gap: 6px;
    justify-content: center;
}
.today-vac-list { display: flex; flex-direction: column; gap: 5px; }
.today-vac-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}
.today-vac-type {
    margin-left: auto;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-secondary);
}

/* ── 프로필 페이지 ── */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    max-width: 760px;
}
.profile-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.profile-dl { display: flex; flex-direction: column; gap: 0; }
.profile-row {
    display: flex;
    padding: 9px 0;
    border-bottom: 1px solid var(--bg-tertiary);
    font-size: 13px;
    gap: 16px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row dt { width: 72px; flex-shrink: 0; color: var(--text-muted); font-weight: 500; }
.profile-row dd { color: var(--text-primary); }
.profile-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.profile-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.profile-photo-upload {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── 첨부파일 폼 ── */
.file-input-wrap { margin-top: 8px; }
.file-input-wrap input[type="file"] { font-size: 13px; color: var(--text-secondary); }
.existing-attach {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.existing-attach label { display: inline; margin-bottom: 0; cursor: pointer; }

/* ── Quill 에디터 ── */
.quill-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.quill-wrap .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}
.quill-wrap .ql-container {
    border: none;
    font-family: inherit;
    font-size: 14px;
    min-height: 300px;
}
.quill-wrap .ql-container.ql-snow { border: none; }
.ql-toolbar.ql-snow { border: none !important; }
.ql-container.ql-snow { border: none !important; }
.quill-wrap .ql-editor { min-height: 300px; padding: var(--sp-4); line-height: 1.7; }
.ql-editor img { max-width: 100%; height: auto !important; }
#contents { display: none; }

/* 에디터/상세 blockquote — quill.snow.css 오버라이드 (specificity 0,3,1 > 0,2,1) */
.quill-wrap .ql-container .ql-editor blockquote,
.post-body .ql-container .ql-editor blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(249,115,22,0.06);
    padding: 10px 16px;
    margin: 12px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* ── 첨부파일 수정 UI ── */
.attach-edit-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.attach-edit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: background var(--t-base), opacity var(--t-base), border-color var(--t-base);
}
.attach-edit-item.marked-delete {
    background: rgba(220,38,38,0.04);
    border-color: rgba(220,38,38,0.2);
    opacity: 0.7;
}
.attach-edit-item.marked-delete .attach-edit-name { text-decoration: line-through; color: var(--text-muted); }
.attach-edit-name { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-del-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.attach-del-btn:hover,
.attach-edit-item.marked-delete .attach-del-btn {
    background: rgba(220,38,38,0.08);
    border-color: rgba(220,38,38,0.25);
    color: var(--danger);
}
.form-hint { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }

/* ── 신규 파일 첨부 프리뷰 ── */
.file-preview-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.file-preview-name { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-del {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color var(--t-base);
}
.file-preview-del:hover { color: var(--danger); }

/* ── 전체 캘린더 ── */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav h2 { font-size: 20px; font-weight: 700; min-width: 130px; text-align: center; }
.cal-nav a {
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}
.cal-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.cal-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    table-layout: fixed;
    box-shadow: var(--shadow-1);
}
.cal-table thead th {
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
.cal-table thead th:first-child { color: #e74c3c; }
.cal-table thead th:last-child  { color: #3498db; }
.cal-table td {
    vertical-align: top;
    padding: 6px;
    height: 110px;
    border: 1px solid var(--border);
    font-size: 12px;
}
.cal-table td.other-month { background: var(--bg-tertiary); }
.cal-table td:nth-child(1) .cal-day-num-full { color: #e74c3c; }
.cal-table td:nth-child(7) .cal-day-num-full { color: #3498db; }
.cal-day-num-full {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.cal-today .cal-day-num-full { background: var(--accent); color: #fff; }
.cal-dots-row { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.cal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-dot-연차     { background: var(--accent); }
.cal-dot-반차오전 { background: #0d6efd; }
.cal-dot-반차오후 { background: #198754; }
.cal-dot-경조     { background: #dc3545; }
.cal-dot-특별     { background: #e67e22; }
.cal-dot-기타     { background: #888; }
.cal-more { font-size: 10px; color: var(--text-muted); }
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-secondary);
}
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── 도서 신청 게시판 ── */
.book-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
/* 검색/초기화 버튼 높이·크기 통일 */
.book-search-bar .btn {
    height: 36px;
    line-height: 1;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    box-sizing: border-box;
}
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.book-card {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-2);
    transition: box-shadow var(--t-base), transform var(--t-base);
    display: flex;
    flex-direction: column;
}
.book-card:hover { box-shadow: var(--shadow-3); transform: translateY(-1px); }
.book-card:active { transform: translateY(0); box-shadow: var(--shadow-2); }
.book-card-cover-link { display: block; text-decoration: none; }
.book-card-cover {
    aspect-ratio: 3/4;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
}
.book-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f4 0%, #e0e0e8 100%);
}
.book-cover-placeholder svg { width: 48px; height: 48px; color: #b0b0c0; }
.book-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.book-card-top {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.book-cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
}
.book-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    width: auto;
}
/* WAIT / DONE / REJECT */
.book-status-badge.status-WAIT   { background: rgba(249,115,22,0.12); color: var(--accent); }
.book-status-badge.status-DONE   { background: rgba(25,135,84,0.12);  color: var(--success); }
.book-status-badge.status-REJECT { background: rgba(220,53,69,0.12);  color: #dc3545; }
/* 하위호환 (구 데이터) */
.book-status-badge.status-0 { background: rgba(249,115,22,0.12); color: var(--accent); }
.book-status-badge.status-1 { background: rgba(25,135,84,0.12);  color: var(--success); }
.book-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}
.book-card-title:hover { color: var(--accent); }
.book-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.book-card-date { margin-left: auto; white-space: nowrap; }
.book-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto;
}

/* ── 표지 이미지 래퍼 (오버레이 기준점) ── */
.book-card-cover-wrap {
    position: relative;
}

/* ── 관리자 상태 변경 패널 (이미지 위 오버레이) ── */
.book-card-admin {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 8px 10px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.book-admin-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}
.book-admin-item-title {
    font-size: 11px;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-admin-select,
.book-admin-btn {
    font-size: 11px;
    height: 26px;
    line-height: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
}
.book-admin-select { padding: 0 4px; }
.book-admin-btn {
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.book-admin-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── 상태 집계 배지 행 ── */
.book-card-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.book-status-sep {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── 제목 + 댓글·좋아요 행 ── */
.book-card-title-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.book-card-title-row .book-card-title { flex: 1; min-width: 0; }
.book-card-social {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 2px;
}
.book-card-social span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.book-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.book-empty p { font-size: 14px; }

/* 도서 상세 – 책 항목 목록 */
.book-detail-items { margin: 0 -20px; }
.book-detail-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
}
.book-detail-item-cover {
    width: 130px;
    min-width: 130px;
    height: 173px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.book-detail-item-info { flex: 1; min-width: 0; }
.book-detail-item-info--can-manage { position: relative; padding-right: 175px; }
.book-detail-admin-form { position: absolute; top: 0; right: 0; }

/* 도서 신청 폼 – 책 블록 */
.book-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}
.book-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}
.book-block-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.book-block-body { padding: 16px; }
.book-block-top {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.book-block-top .form-group { min-width: 180px; }
.book-block-cover-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}
.book-drop-zone-wrap {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.book-desc-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.book-desc-textarea {
    flex: 1;
    resize: vertical;
    min-height: 120px;
}

/* 드롭존 */
.book-drop-zone {
    width: 150px;
    min-height: 120px;
    height: 100%;        /* 부모 .book-drop-zone-wrap 높이에 맞춤 */
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
    box-sizing: border-box;
}
.book-drop-zone:hover,
.book-drop-zone:focus,
.book-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light2);
    outline: none;
}
.book-drop-zone.uploading { opacity: 0.7; cursor: wait; }
.drop-zone-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 8px;
    pointer-events: none;
    user-select: none;
}
.book-drop-zone .cover-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.book-drop-zone .cover-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}
.book-drop-zone .cover-remove-btn:hover { background: rgba(0,0,0,0.8); }
.book-drop-zone .cover-file-input { display: none; }

/* 모바일 메타 행 — 기본 숨김 */
.book-meta-mobile { display: none; }

/* 반응형 */
@media (max-width: 640px) {
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .book-search-bar { flex-wrap: wrap; }
    .book-block-top { flex-direction: column; }
    #add-block-btn { gap: 3px; padding: 0 5px; }
    /* 신청 폼: 표지+설명을 가로 유지, 표지·설명 높이 동일 축소 */
    .book-block-cover-row { flex-direction: row; align-items: stretch; }
    .book-drop-zone-wrap { flex-shrink: 0; }
    .book-drop-zone { width: 90px; min-height: 50px; }
    .book-desc-textarea { min-height: 50px; }
    /* 구매링크 버튼 모바일 축소 */
    .book-link-btn { font-size: 11px; padding: 4px 8px; width: fit-content;}
    .book-link-btn svg { width: 11px; height: 11px; }
    /* 신청 폼: 추가 내용 Quill 에디터 높이 축소 */
    .quill-wrap .ql-editor { min-height: 160px; }
    .quill-wrap .ql-container { min-height: 160px; }
    /* 상세 페이지: 표지 크기 줄이고 정보 우측 배치 */
    .book-detail-item { flex-direction: row; align-items: flex-start; }
    .book-detail-item-cover {
        width: 90px;
        min-width: 90px;
        height: 120px;
        aspect-ratio: unset;
    }
    .book-detail-item-info--can-manage { padding-right: 0; display: flex; flex-direction: column; }
    .book-detail-admin-form { position: static; margin-top: 8px; }

    /* 도서 카드: 데스크탑 요소 숨김, 모바일 메타 행 표시 */
    .book-card-social { display: none; }
    .book-card-meta   { display: none; }
    .book-meta-mobile {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 4px;
        flex-wrap: wrap;
    }
}
@media (max-width: 400px) {
    .book-grid { grid-template-columns: 1fr 1fr; }
}

/* ── 앱 사이드바 내부 콘텐츠 ── */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    padding: 8px 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-2);
}
.sidebar-search .form-control {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    height: auto;
    box-shadow: none;
}
.sidebar-search .form-control:focus {
    outline: none;
    box-shadow: none;
}
.sidebar-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-search-btn:hover { color: var(--accent); }

.sidebar-section {
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow-2);
    overflow: hidden;
}
.sidebar-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}
.sidebar-section-toggle:hover { color: var(--text-secondary); }
.sidebar-arrow { font-size: 10px; color: var(--text-muted); }
.sidebar-section-body { display: none; }
.sidebar-section-body.open { display: block; }
.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-decoration: none;
    border-top: 1px solid var(--border);
    transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sidebar-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: var(--fw-medium);
}
.sidebar-link.active .sidebar-new-num,
.sidebar-link.active .sidebar-count { color: var(--accent); }
.sidebar-link-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-new-badge {
    font-size: 9px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 6px;
    flex-shrink: 0;
}
.sidebar-count {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 4px;
}
.sidebar-ext-link { color: var(--text-secondary); }
.sidebar-new-num {
    color: var(--accent);
    font-weight: 700;
}

/* nav dropdown 카운트 */
.nav-menu-count {
    float: right;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 10px;
}
.nav-new-num {
    color: var(--accent);
    font-weight: 700;
}

/* 검색결과 게시판 이름 배지 */
.board-name-badge {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
}

/* ── FAB 버튼 (확성기) ── */
.tweet-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-4);
    transition: background var(--t-base), transform var(--t-fast);
    pointer-events: auto;
}
.tweet-fab:hover { background: var(--accent-hover); transform: scale(1.05); }
.tweet-fab:active { transform: scale(0.97); }

/* ── 트윗 패널 ── */
.tweet-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 320px;
    max-height: calc(100vh - 120px);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-4);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.tweet-panel.open {
    display: flex;
    animation: panelFadeIn 0.2s ease;
}
@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tweet-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.tweet-panel-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 2px;
    transition: color var(--t-base);
}
.tweet-panel-close:hover { color: var(--text-primary); }
.tweet-panel-body {
    overflow-y: auto;
    flex: 1;
    padding: 4px 12px;
}
/* 패널 안에서는 tweet-feed-title 숨김 (헤더가 대신함) */
.tweet-panel .tweet-feed-title { display: none; }

/* ── 햄버거 버튼 ── */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-right: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--t-base);
    flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.12); }
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,0.9);
    border-radius: 1px;
}

/* ── 사이드바 오버레이 (모바일 드로어) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 250;
}
.sidebar-overlay.open { display: block; }

/* ── 모바일 메타 행 (BBS 목록) — 기본 숨김 ── */
.bbs-meta-mobile { display: none; }

/* ── 사이드바: 데스크탑 초기 펼침은 JS로 처리 ── */

/* ── 반응형 ── */

/* 우측 사이드바가 충분히 보이는 넓은 화면: FAB 숨김 */
@media (min-width: 1384px) {
    .tweet-fab  { display: none !important; }
    .tweet-panel { display: none !important; }
}

/* 우측 사이드바와 메인이 겹치는 시점부터: FAB로 전환 */
@media (max-width: 1384px) {
    .app-sidebar-right { display: none; }
    .container,
    .has-right-sidebar .container { max-width: calc(100vw - 310px); } /* 우측 사이드바 없으므로 좌측만 */
}

/* 좌측 사이드바 드로어 전환 */
@media (max-width: 1100px) {
    /* 좌측 사이드바: 드로어 방식 */
    .app-sidebar {
        position: fixed;
        left: -280px;
        top: 52px;
        height: calc(100vh - 52px);
        z-index: 260;
        width: 270px !important;   /* collapsed 상태 무시 */
        padding: 14px 12px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        border-right: 1px solid var(--border) !important;
        transition: left var(--t-slow);
        box-shadow: var(--shadow-4);
    }
    .app-sidebar.open { left: 0; }
    .sidebar-collapsed .container,
    .sidebar-collapsed.has-right-sidebar .container { max-width: 100%; }

    .home-grid { grid-template-columns: 1fr; }
    .container,
    .has-right-sidebar .container { max-width: 100%; }
}

@media (max-width: 640px) {
    /* 홈: 컨테이너 패딩 축소 */
    .container { padding: var(--sp-3); }
    .container-home { padding: var(--sp-3); }

    /* 홈 섹션 단일 컬럼 + 모바일 순서 */
    .home-grid {
        display: flex;
        flex-direction: column;
        gap: var(--sp-3);
        width: 100%;
    }
    .home-main, .home-side { display: contents; }
    .home-sec-profile  { order: 1; }
    .home-sec-vacation { order: 2; }
    .home-sec-notice   { order: 3; }
    .home-sec-book     { order: 4; }
    .home-sec-support  { order: 5; }
    .home-sec-calendar { order: 6; }
    .home-sec-shortcut { order: 7; }

    .home-section {
        border-radius: var(--radius);
        margin-bottom: 0;
        box-shadow: var(--shadow-2);
        width: 100%;
        box-sizing: border-box;
        background: var(--bg-secondary);
    }

    /* 바로가기: 6개 한 줄, 아이콘 소형 (스타일은 데스크탑 동일) */
    .shortcut-bar {
        grid-template-columns: repeat(6, 1fr);
        width: 100%;
        box-sizing: border-box;
    }
    .shortcut-card { padding: 10px 5px 8px; gap: 5px; }
    .shortcut-icon { width: 28px; height: 28px; font-size: 14px; }
    .shortcut-icon svg { width: 14px; height: 14px; }
    .shortcut-label { font-size: 11px; }

    /* BBS 테이블: 번호·작성자·날짜·조회수 열 숨김, 제목 컬럼 넓게 (CRM 테이블 제외) */
    .bbs-table:not(.crm-table) th:nth-child(1), .bbs-table:not(.crm-table) td:nth-child(1),
    .bbs-table:not(.crm-table) th:nth-child(3), .bbs-table:not(.crm-table) td:nth-child(3),
    .bbs-table:not(.crm-table) th:nth-child(4), .bbs-table:not(.crm-table) td:nth-child(4),
    .bbs-table:not(.crm-table) th:nth-child(5), .bbs-table:not(.crm-table) td:nth-child(5) { display: none; }
    .bbs-table td.subject-col { max-width: none; }
    /* 사용자 관리, 휴가 관리: 이름 열 오버라이드 (bbs-table nth-child(1) 숨김 해제) */
    #users-table th:nth-child(1), #users-table td:nth-child(1),
    #hday-table th:nth-child(1), #hday-table td:nth-child(1) { display: table-cell; }
    /* 휴가 관리: 모바일에서 num-col 우측 정렬 해제, 연차휴가 열 좌측 패딩 해제 */
    #hday-table .num-col { text-align: left !important; }
    #hday-table th:nth-child(7), #hday-table td:nth-child(7) { padding-left: var(--sp-3); }
}

@media (max-width: 480px) {
    /* 상단바: 좁은 화면에 맞게 */
    .navbar-inner { padding: 0 8px; }
    .nav-hide-mobile { display: none; }
    .nav-user-name { display: none; }
    .nav-toggle { padding: 5px 8px; }

    /* FAB: 더 높은 위치로 */
    .tweet-fab { bottom: 20px; right: 16px; }
    .tweet-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 70px;
        max-height: calc(100vh - 140px);
    }
}

/* ── 모바일 (768px) 통합 ── */
@media (max-width: 768px) {
    /* 홈: 프로필 카드 숨김 */
    .home-sec-profile { display: none; }

    /* 바로가기: 카드 shadow를 다른 카드와 동일하게 */
    .shortcut-card { box-shadow: var(--shadow-2); }

    /* 게시판 목록: 모바일 2줄 레이아웃 — 인라인 댓글·좋아요 아이콘 숨김 */
    .bbs-icon-comment, .bbs-icon-like { display: none; }
    .icon-badge { margin-left: 0; }

    /* 게시판 목록: 메타 행 표시 */
    .bbs-meta-mobile {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 4px;
        flex-wrap: wrap;
    }
    .bbs-meta-sep { color: var(--border); }

    .post-body {padding: 10px;}

    /* 프로필 페이지: 단일 컬럼 */
    .profile-layout { grid-template-columns: 1fr; }

    /* FAB 크기 축소 */
    .tweet-fab { width: 38px; height: 38px; font-size: 16px; }

    /* 컨테이너 하단 패딩 — FAB와 겹침 방지 */
    .container { padding-bottom: 50px; }

    /* 휴가 신청 이력: 기간 열 표시 (bbs-table 공통 숨김 오버라이드), 인수자 열 숨김 */
    .hday-history-table th:nth-child(3),
    .hday-history-table td:nth-child(3) { display: table-cell; }
    .hday-history-table th:nth-child(6),
    .hday-history-table td:nth-child(6) { display: none; }

    /* 휴가 현황: 5개 카드 가로 한 줄 */
    .hday-stats { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .stat-card { padding: 10px 4px; }
    .stat-label { font-size: 10px; margin-bottom: 6px; }
    .stat-value { font-size: 20px; }
    .stat-sub { font-size: 10px; }

    /* 캘린더: 도트·라벨 숨김, 이름만 표시 */
    .cal-entry-dot { display: none; }
    .cal-badge { display: none; }
    .cal-table { table-layout: fixed; width: 100%; }
    .cal-table td { height: 72px; padding: 4px; overflow: hidden; }
    .cal-entry { padding: 1px 3px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* ── CRM 테이블 모바일 ── */
    /* 모바일: crm-link-cell 개별 링크 효과 비활성화 (행 클릭으로 통합) */
    .crm-table .crm-link-cell { cursor: default; }
    .crm-table .crm-link-cell:hover { color: inherit; }


    /* 1. 고객사 관리 목록: 회사명(1) + 고객수(6) — 2,3,4,5 숨김 */
    .crm-comp-list-table th:nth-child(2), .crm-comp-list-table td:nth-child(2),
    .crm-comp-list-table th:nth-child(3), .crm-comp-list-table td:nth-child(3),
    .crm-comp-list-table th:nth-child(4), .crm-comp-list-table td:nth-child(4),
    .crm-comp-list-table th:nth-child(5), .crm-comp-list-table td:nth-child(5) { display: none; }

    /* 2. 고객 관리 목록: 이름(1) + 회사(2) + 이력수(7) — 3,4,5,6 숨김 */
    .crm-cust-list-table th:nth-child(3), .crm-cust-list-table td:nth-child(3),
    .crm-cust-list-table th:nth-child(4), .crm-cust-list-table td:nth-child(4),
    .crm-cust-list-table th:nth-child(5), .crm-cust-list-table td:nth-child(5),
    .crm-cust-list-table th:nth-child(6), .crm-cust-list-table td:nth-child(6) { display: none; }

    /* 3. 고객사 상세 > 소속 고객: 이름(1) + 이력(5) — 2,3,4 숨김 */
    .crm-comp-cust-table th:nth-child(2), .crm-comp-cust-table td:nth-child(2),
    .crm-comp-cust-table th:nth-child(3), .crm-comp-cust-table td:nth-child(3),
    .crm-comp-cust-table th:nth-child(4), .crm-comp-cust-table td:nth-child(4) { display: none; }

    /* 4. 고객 이력 목록: 고객사(1) + 고객(2) + 등록일(5) — 3,4,6 숨김 */
    .crm-note-list-table th:nth-child(3), .crm-note-list-table td:nth-child(3),
    .crm-note-list-table th:nth-child(4), .crm-note-list-table td:nth-child(4),
    .crm-note-list-table th:nth-child(6), .crm-note-list-table td:nth-child(6) { display: none; }

    /* 5. 고객사 상세 > 이력: 고객(1) + 내용(2, 1줄) — 3,4,5 숨김 */
    .crm-comp-note-table th:nth-child(3), .crm-comp-note-table td:nth-child(3),
    .crm-comp-note-table th:nth-child(4), .crm-comp-note-table td:nth-child(4),
    .crm-comp-note-table th:nth-child(5), .crm-comp-note-table td:nth-child(5) { display: none; }
    .crm-comp-note-table th:nth-child(1), .crm-comp-note-table td:nth-child(1) { width: 130px; white-space: nowrap; }

    /* 6. 고객 상세 > 이력: 내용(1, 1줄) — 2,3,4,5 숨김 */
    .crm-cust-note-table th:nth-child(2), .crm-cust-note-table td:nth-child(2),
    .crm-cust-note-table th:nth-child(3), .crm-cust-note-table td:nth-child(3),
    .crm-cust-note-table th:nth-child(4), .crm-cust-note-table td:nth-child(4),
    .crm-cust-note-table th:nth-child(5), .crm-cust-note-table td:nth-child(5) { display: none; }

    /* 5,6: 이력 내용 모바일 1줄 클램핑 */
    .crm-comp-note-table .note-preview-clamp,
    .crm-cust-note-table .note-preview-clamp {
        -webkit-line-clamp: 1;
    }
}


/* ── TAX (세금계산서) ── */

/* 차트 레이아웃: 좌 1/3 + 우 2/3 */
.tax-chart-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    min-width: 0;
}
.tax-chart-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.tax-chart-right {
    display: flex;
    min-width: 0;
}
.tax-chart-full-height {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tax-chart-full-height canvas {
    max-width: 100%;
    margin: auto 0;
}
.tax-chart-wrap {
    min-width: 0;
    overflow: hidden;
    padding: 20px;
    margin-bottom: 0;
}
.tax-chart-wrap .card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* 합계 카드 */
.tax-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.tax-summary-amounts {
    display: flex;
    gap: 24px;
    align-items: baseline;
    flex-wrap: wrap;
}
.tax-summary-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.tax-summary-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.tax-summary-accent { color: var(--accent); }
.tax-summary-count { color: var(--text-muted); font-size: 13px; }

/* 금액 셀 */
.tax-amt { text-align: right; font-variant-numeric: tabular-nums; }
.tax-amt-total { font-weight: 600; }
.tax-issno { font-family: monospace; font-size: 12px; color: var(--text-muted); }

/* IO 배지 */
.tax-io-out {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
}
.tax-io-in {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    background: rgba(37, 99, 235, 0.1);
    color: var(--info);
}

/* 상태 배지 */
.tax-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
}
.tax-status-N { background: var(--bg-secondary); color: var(--text-muted); }
.tax-status-B { background: var(--accent-light); color: var(--accent); }
.tax-status-R { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.tax-status-D { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.tax-status-cell { text-align: center; }

/* 미수금 경고 하이라이트 */
.tax-warn-3m { background: rgba(249, 115, 22, 0.08); }
.tax-warn-3m:hover { background: rgba(249, 115, 22, 0.14); }
.tax-warn-6m { background: rgba(234, 179, 8, 0.1); }
.tax-warn-6m:hover { background: rgba(234, 179, 8, 0.16); }

/* 상세 페이지 */
.tax-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}
.tax-detail-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.tax-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 70px;
    flex-shrink: 0;
}
.tax-detail-value {
    font-size: 13px;
    color: var(--text-primary);
}
.tax-party-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

/* 금액 요약 */
.tax-amount-summary {
    display: flex;
    gap: 32px;
    align-items: baseline;
    flex-wrap: wrap;
}
.tax-amount-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.tax-amount-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.tax-amount-total .tax-amount-value {
    font-size: 20px;
    color: var(--accent);
}

/* CRM 공용 정보 그리드 (라벨 위 + 값 아래) */
.crm-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    font-size: 14px;
}
.crm-info-label {
    color: var(--text-muted);
    font-size: 12px;
}
.crm-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}
.crm-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 24px;
    margin-bottom: 12px;
}

/* 탭 메뉴 */
.tax-tab-menu {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 12px;
}
.tax-tab {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--t-base), border-color var(--t-base);
}
.tax-tab:hover { color: var(--text-primary); }
.tax-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* 필터 바 */
.tax-filter-bar {
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}
.tax-filter-bar .form-control,
.tax-filter-bar .btn,
.tax-filter-bar .btn-outline {
    height: 36px;
    line-height: 36px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}
.tax-filter-field { width: 120px; flex: 0 0 120px; min-width: 120px; }
.tax-filter-date { flex: 0 0 125px; }
.tax-filter-grow { flex: 1; min-width: 160px; }
.tax-filter-grow .form-control { width: 100%; }

/* Branch 다중선택 체크리스트 */
.tax-branch-checklist {
    position: relative;
    display: inline-block;
}
.tax-branch-toggle {
    cursor: pointer;
    min-width: 120px;
    text-align: left;
    white-space: nowrap;
    height: 36px;
    line-height: 36px;
    padding-top: 0;
    padding-bottom: 0;
}
.tax-branch-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 8px;
    max-height: 280px;
    overflow-y: auto;
    min-width: 180px;
}
.tax-branch-checklist.open .tax-branch-dropdown { display: block; }
.tax-branch-option {
    display: block;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
}
.tax-branch-option:hover { background: var(--bg-secondary); }
.tax-branch-option input { margin: 0; }

/* 거래처 자동완성 */
.tax-autocomplete {
    position: relative;
    display: inline-block;
}
.tax-autocomplete-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 240px;
    overflow-y: auto;
    min-width: 200px;
}
.tax-autocomplete-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.tax-autocomplete-item:hover,
.tax-autocomplete-item.active {
    background: var(--accent-light);
    color: var(--accent);
}
.tax-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* CID 필터 태그 */
.tax-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--accent-light);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 8px;
}
.tax-filter-tag-remove {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    line-height: 1;
}
.tax-filter-tag-remove:hover { color: var(--danger); }

/* 행 배경: 청구(B) 회색 */
.tax-status-b { background: var(--bg-secondary); }
.tax-status-b:hover { background: var(--bg-hover); }

/* 링크 셀 */
.tax-link-cell {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}
.tax-link-cell:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* 대시보드 헤더 */
.tax-dash-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tax-dash-links {
    display: flex;
    gap: 8px;
}
.tax-dash-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .tax-chart-layout { grid-template-columns: 1fr; }
    .tax-party-grid { grid-template-columns: 1fr; }
    .tax-detail-grid { grid-template-columns: 1fr; }
    .tax-summary-amounts { gap: 12px; }
    .tax-summary-value { font-size: 13px; }
    .tax-tab { padding: 6px 12px; font-size: 12px; }
    .crm-info-grid { grid-template-columns: 1fr; }

    /* 목록 필터: 모바일 3열 그리드 */
    .tax-filter-bar {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        max-width: 100%;
        overflow: hidden;
    }
    .tax-filter-bar input[type="hidden"] { display: none; }
    .tax-filter-bar > * { min-width: 0; }
    .tax-filter-grow { grid-column: 1 / -1; }
    .tax-filter-field,
    .tax-filter-date {
        flex: unset !important;
        width: auto !important;
    }
    .tax-filter-bar .form-control {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 12px;
        padding: 0 6px;
    }
    /* 매입 탭: 셀렉트 2개 → 2열 */
    .tax-filter-bar.tax-filter-in {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tax-filter-bar.tax-filter-in .tax-filter-grow {
        grid-column: 1 / -1;
    }

    /* 대시보드: 헤더 줄바꿈 방지 */
    .page-header h2 { white-space: nowrap; }

    /* 대시보드: 날짜 우측, 링크 아래줄 우측 */
    .tax-dash-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }
    .tax-dash-links {
        width: 100%;
        justify-content: flex-end;
    }

    /* 대시보드: 요약 카드 1/3 */
    .tax-dash-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }
    .tax-dash-stats .stat-card {
        padding: 10px 8px;
    }
    .tax-dash-stats .stat-value {
        font-size: 14px;
    }
}

/* ── 조직 관리 ── */
/* 인터랙티브 카드 */
.oc-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
    background: var(--bg-secondary);
    text-align: center;
    min-width: 110px;
    max-width: 150px;
    font-size: var(--text-sm);
    box-shadow: var(--shadow-1);
    position: relative;
    transition: box-shadow 0.15s;
}
.oc-card:hover {
    box-shadow: var(--shadow-2);
}
.oc-card-body {
    padding: var(--sp-2);
    cursor: pointer;
}
.oc-card.oc-company {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.oc-card.oc-company .oc-pos,
.oc-card.oc-company .oc-phone { color: rgba(255,255,255,0.8); }
.oc-card.oc-division {
    background: #f6c344;
    border-color: #e5b23a;
}
.oc-card.oc-team {
    background: #e8f0f8;
    border-color: #b8c4d0;
}
.oc-meta {
    padding: 2px var(--sp-2) 4px;
    font-size: 10px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}
.oc-count {
    font-weight: 600;
}
.oc-add-btn {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: var(--shadow-1);
}
.oc-card:hover .oc-add-btn {
    display: flex;
}
.oc-add-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── 조직도 뷰 (PDF 스타일) ── */
.org-chart-container {
    overflow-x: auto;
    padding: var(--sp-4);
}

/* 게시판 내 조직도 반응형 */
.org-chart-wrap {
    overflow-x: auto;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.org-chart-wrap a[href^="tel"] {
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: none;
}
.org-chart-wrap .org-chart-inner {
    position: relative;
    width: max-content;
    min-width: 100%;
}
.org-company-info-pub {
    position: absolute !important;
    top: 0;
    left: 0;
    z-index: 1;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.8;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.org-company-info-pub img {
    height: 28px !important;
    max-width: 120px !important;
    display: block;
    margin-bottom: 6px;
}
/* 모바일: 회사 정보 상단 고정 + 조직도 아래 */
@media (max-width: 768px) {
    .org-company-info-pub {
        position: static !important;
        display: block;
        margin-bottom: 8px;
    }
}

/* CEO 영역 */
.oc-ceo-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: relative;
    width: fit-content;
    margin: 0 auto;
}
.oc-ceo-wrap > .oc-card {
    max-width: none;
}

/* 참모조직: 세로 커넥터 + 우측 가지 */
.oc-staff-row {
    position: relative;
    padding: 0 0 0 0;
}
/* 세로 관통선 (중앙) */
.oc-staff-row > .oc-connector {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    border-left: 1px solid #ccc;
    margin: 0;
}
/* 가로 분기선 */
.oc-staff-block {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-left: calc(50% + 40px);
    padding: 10px 0;
    position: relative;
}
.oc-staff-block::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    width: 40px;
    border-top: 1px solid #ccc;
}
.oc-staff-block > .oc-card {
    max-width: none;
}
.oc-staff-members {
    display: flex;
    gap: 2px;
    align-items: flex-start;
    width: max-content;
}
.oc-staff-members .oc-card {
    min-width: 110px;
    max-width: 150px;
}

/* CEO → 본부 세로 연결선 */
.oc-connector {
    width: 0;
    height: 30px;
    border-left: 1px solid #ccc;
    margin: 0 auto;
}

/* 본부 블록 가로 배치 */
.oc-divs-wrap {
    display: flex;
    justify-content: center;
    gap: var(--sp-6);
    position: relative;
    padding-top: 30px;
}
/* 본부 간 가로 연결선 */
.oc-divs-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    /* 첫째 중심 ~ 마지막 중심 */
    left: 0;
    right: 0;
    border-top: 1px solid #ccc;
}

/* 각 본부 블록 */
.oc-div-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.oc-div-block::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 50%;
    height: 30px;
    border-left: 1px solid #ccc;
}
.oc-div-header {
    margin-bottom: 2px;
    width: 100%;
}
.oc-div-header .oc-card,
.oc-div-block > .oc-leader {
    max-width: none;
    width: 100%;
}

/* 팀 컬럼 배치 */
.oc-teams-wrap {
    display: flex;
    gap: 2px;
    align-items: stretch;
    position: relative;
    margin-top: 2px;
    width: 100%;
}

/* 각 팀 컬럼 */
.oc-team-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.oc-team-col .oc-card {
    width: 100%;
    max-width: none;
}

/* 드래그 앤 드롭 */
.oc-card[draggable="true"] {
    cursor: grab;
}
.oc-card[draggable="true"]:active {
    cursor: grabbing;
}
.oc-dragging {
    opacity: 0.4;
}
.oc-drag-over {
    background: rgba(249, 115, 22, 0.05);
}
.oc-insert-before {
    border-top: 2px solid var(--accent) !important;
}
.oc-insert-after {
    border-bottom: 2px solid var(--accent) !important;
}
.oc-insert-left {
    border-left: 2px solid var(--accent) !important;
}
.oc-insert-right {
    border-right: 2px solid var(--accent) !important;
}
.oc-drag-over-col {
    border-left: 2px solid var(--accent) !important;
}

/* 색상 팔레트 */
.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
    padding: 0;
}
.color-swatch:hover {
    transform: scale(1.15);
}
.color-swatch.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-secondary);
}

/* 대표 멤버 카드 */
.oc-leader {
    background: #fef9ee;
    border-color: #f5c542;
}
.oc-div-header + .oc-leader {
    margin-top: 2px;
}

.oc-name { font-weight: 600; }
.oc-pos { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.oc-pos-inline { font-size: 11px; color: var(--text-muted); margin-left: 4px; font-weight: 400; }
.oc-phone { font-size: 10px; color: var(--text-muted); }
