/* ── 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;
}
.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;
}

/* ── 우측 사이드바: 트윗 피드 ── */
.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;
}
/* 트윗 작성 입력 */
.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 - 570px); /* 270px 좌측 + 300px 우측 사이드바 */
    padding: var(--sp-5);
}
.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-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-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; }
}

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

/* ── 게시글 상세 ── */
.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;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-4);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
}
.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); }

/* ── 휴가 현황 ── */
.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); }
.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-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%; }
#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-admin {
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    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-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; }

/* 반응형 */
@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; }
    .book-block-cover-row { flex-direction: column; }
    .book-detail-item { flex-direction: column; }
    .book-detail-item-cover {
        width: 100%;
        max-width: 160px;
        height: auto;
        aspect-ratio: 3/4;
    }
}
@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: none;
    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; }

/* ── 사이드바: 데스크탑에서 항상 펼침 ── */
@media (min-width: 1101px) {
    .sidebar-section-body { display: block !important; }
}

/* ── 반응형 ── */

/* 우측 사이드바가 충분히 보이는 넓은 화면: 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 { max-width: calc(100vw - 310px); } /* 우측 사이드바 없으므로 좌측만 */
}

/* 좌측 사이드바 드로어 전환 */
@media (max-width: 1100px) {
    /* 좌측 사이드바: 드로어 방식 */
    .hamburger-btn { display: flex; }
    .app-sidebar {
        position: fixed;
        left: -280px;
        top: 52px;
        height: calc(100vh - 52px);
        z-index: 260;
        transition: left var(--t-slow);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-4);
    }
    .app-sidebar.open { left: 0; }

    .home-grid { grid-template-columns: 1fr; }
    .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-calendar { order: 5; }
    .home-sec-shortcut { order: 6; }

    .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);
    }
    .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 테이블: 번호·작성자·날짜·조회수 열 숨김, 제목 컬럼 넓게 */
    .bbs-table th:nth-child(1), .bbs-table td:nth-child(1),
    .bbs-table th:nth-child(3), .bbs-table td:nth-child(3),
    .bbs-table th:nth-child(4), .bbs-table td:nth-child(4),
    .bbs-table th:nth-child(5), .bbs-table td:nth-child(5) { display: none; }
    .bbs-table td.subject-col { max-width: none; }
}

@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: 84px;
    }
}

/* ── 모바일 (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; }

    /* 게시판 목록: 메타 행 표시 */
    .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); }

    /* 프로필 페이지: 단일 컬럼 */
    .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 td { height: 72px; padding: 4px; }
    .cal-entry { padding: 1px 3px; font-size: 10px; }
}
