@font-face {
    font-family: 'D2Coding';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_three@1.0/D2Coding.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'D2Coding', monospace;
    margin-bottom: 0;
}

/* ── 페이지 로딩 진행 바 ──────────────────────────── */
#kbs-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--bs-primary);
    z-index: 9999;
    transition: width 0.2s ease;
    pointer-events: none;
}

    #kbs-progress.done {
        opacity: 0;
        transition: width 0.1s ease, opacity 0.4s ease 0.1s;
    }

/* ── 사이드바 레이아웃 ─────────────────────────────── */
:root {
    --sidebar-width: 220px;
    --topbar-height: 50px;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    transition: width 0.2s ease, min-width 0.2s ease;
    overflow: hidden;
}

    .sidebar.sidebar-hidden {
        width: 0;
        min-width: 0;
    }

.sidebar-brand a {
    color: var(--bs-body-color);
}

.sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color);
    padding: 0 0.5rem;
    white-space: nowrap;
}

.sidebar-link {
    display: block;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--bs-body-color);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

    .sidebar-link:hover {
        background: var(--bs-secondary-bg);
        color: var(--bs-body-color);
    }

    .sidebar-link.active {
        background: var(--bs-primary);
        color: #fff;
    }

.sidebar-footer {
    white-space: nowrap;
}

/* ── 모바일 사이드바 오버레이 ─────────────────────── */
#sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
}

@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        z-index: 300;
        transform: translateX(0);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 16px rgba(0,0,0,0.3);
    }

        .sidebar.sidebar-hidden {
            width: var(--sidebar-width); /* 모바일에서는 너비 유지, transform으로 숨김 */
            min-width: var(--sidebar-width);
            transform: translateX(calc(-1 * var(--sidebar-width)));
        }

    #main-wrapper {
        width: 100%;
    }

    .sidebar.sidebar-hidden + #main-wrapper,
    #main-wrapper {
        margin-left: 0 !important;
    }

    #sidebar-backdrop.show {
        display: block;
    }
}

/* ── 상단 헤더 ────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bs-body-bg);
}

.topbar-toggle {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.1rem;
    color: var(--bs-secondary-color);
    cursor: pointer;
    border-radius: 0.375rem;
    line-height: 1;
}

    .topbar-toggle:hover {
        background: var(--bs-secondary-bg);
        color: var(--bs-body-color);
    }

/* 검색바 — 레퍼런스 디자인 */
.topbar-search {
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 600px;
    background: var(--bs-secondary-bg);
    border-radius: 8px;
    padding: 0 0.75rem;
    gap: 0.5rem;
}

.topbar-search-icon {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    flex-shrink: 0;
    line-height: 1;
}

.topbar-search-input {
    flex-grow: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--bs-body-color);
    font-size: 0.9rem;
    padding: 0.45rem 0;
}

    .topbar-search-input::placeholder {
        color: var(--bs-secondary-color);
    }

/* 검색창 클릭 시 테두리 강조 */
.topbar-search:focus-within {
    outline: 1px solid var(--bs-primary);
}

#main-wrapper {
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* 검색 키워드 하이라이트 */
mark {
    background: rgba(255, 213, 0, 0.35);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

table thead th {
    text-align: center;
}

table tbody td {
    vertical-align: middle;
}

.Count {
    text-align: center;
    width: 100px;
}

.CreatedAt {
    text-align: center;
    width: 170px;
}

.btn-es {
    --bs-btn-padding-y: .25rem;
    --bs-btn-padding-x: .5rem;
    --bs-btn-font-size: .75rem;
}