/* 백오피스 전체 글꼴 */
:root {
    --font-nanum-square-light: "NanumSquareLight";
    --font-nanum-square: "NanumSquare";
    --font-nanum-square-bold: "NanumSquareBold";
    --font-nanum-square-extra-bold: "NanumSquareExtraBold";
    --font-nanum-square-acb: "NanumSquareAcB";
    --font-nanum-square-aceb: "NanumSquareAcEB";
    --font-nanum-square-acl: "NanumSquareAcL";
    --font-nanum-square-acr: "NanumSquareAcR";
    --bs-font-sans-serif: var(--font-nanum-square),
        var(--font-nanum-square-light), "Malgun Gothic", "맑은 고딕",
        system-ui, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
    font-family: var(--bs-font-sans-serif);
}

/* 백오피스 레이아웃: 왼쪽 사이드바 + 상단 바 */

:root {
    --sidebar-width: 220px;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: width 0.2s ease;
}

.app-sidebar.collapsed {
    width: 0;
}

.sidebar-logo {
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo a {
    color: #fff;
    text-decoration: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem 0.25rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

.sidebar-section-header:hover {
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-section-header .chevron {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.sidebar-section-header[aria-expanded="false"] .chevron {
    transform: rotate(-90deg);
}

.sidebar-link {
    display: block;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 600;
}

.sidebar-link-sub {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    padding-left: 2rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.sidebar-icon {
    display: inline-block;
    width: 1.2rem;
    margin-right: 0.5rem;
    text-align: center;
}

.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    display: flex;
    align-items: center;
    background: #212529;
    border-bottom: 1px solid #343a40;
    padding: 0.5rem 1rem;
}

.app-topbar .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.app-topbar .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.45);
    color: rgba(255, 255, 255, 0.85);
}

.app-topbar .btn-outline-secondary:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.user-menu {
    position: relative;
}

.avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.65rem;
    line-height: 1;
}

.avatar-btn::after {
    margin-left: 0.25rem;
    border-top-color: rgba(255, 255, 255, 0.75);
    border-right-width: 0.25rem;
    border-left-width: 0.25rem;
}

.avatar-btn:hover,
.avatar-btn:focus-visible {
    color: #fff;
}

.notif-bell-btn {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
}

.notif-bell-btn:hover,
.notif-bell-btn:focus-visible {
    color: #fff;
}

.user-dropdown-menu {
    min-width: 12rem;
    margin-top: 0.5rem !important;
    padding: 0.45rem 0;
    border: 1px solid #e5e9ee;
    border-radius: 0.45rem;
    box-shadow: 0 0.5rem 1.25rem rgba(31, 45, 61, 0.15);
}

.user-dropdown-menu .dropdown-item {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
}

.user-dropdown-menu .dropdown-item:focus,
.user-dropdown-menu .dropdown-item:hover {
    background: #f4f7fa;
    color: #212529;
}

.user-dropdown-menu .dropdown-item.text-danger:focus,
.user-dropdown-menu .dropdown-item.text-danger:hover {
    color: #dc3545;
}

.app-content {
    padding: 1.5rem;
}

.hamburger-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.hamburger-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
}

.modal-content {
    border: 0;
    border-radius: 0.55rem;
    box-shadow: 0 0.75rem 2rem rgba(31, 45, 61, 0.2);
}

.modal-header {
    border-bottom-color: #edf0f3;
}

.modal-footer {
    border-top-color: #edf0f3;
}

.modal .form-control {
    background-color: #fff !important;
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
    opacity: 1 !important;
}

.modal .form-control::placeholder {
    color: #6c757d !important;
    -webkit-text-fill-color: #6c757d !important;
    opacity: 1 !important;
}

.modal .form-control:focus {
    background-color: #fff !important;
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
}

#changePasswordModal .modal-body,
#changePasswordModal .form-label {
    color: #212529;
}

#changePasswordModal input.password-change-input,
#changePasswordModal input.password-change-input:focus,
#changePasswordModal input.password-change-input:active {
    background: #ffffff !important;
    color: #212529 !important;
    caret-color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

.password-input-group {
    position: relative;
}

.password-input-group .password-change-input {
    padding-right: 2.75rem;
}

/* 나눔스퀘어에서 password 마스킹 글리프가 보이지 않는 환경을 위한 보정 (모달 외 일반 폼에도 적용) */
input.password-change-input[type="password"] {
    font-family: Arial, "Malgun Gothic", sans-serif !important;
    font-size: 1rem;
    letter-spacing: 0.12em;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: #f1f3f5;
    color: #212529;
    outline: none;
}

.password-toggle i {
    font-size: 1.05rem;
    line-height: 1;
}

/* 대시보드 요약 통계 카드 */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.6rem;
    color: #fff !important;
    box-shadow: 0 0.35rem 1rem rgba(31, 45, 61, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover,
.stat-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0.6rem 1.4rem rgba(31, 45, 61, 0.25);
    color: #fff !important;
}

.stat-card-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.95;
}

.stat-card-icon i {
    font-size: 1.5rem;
}

.stat-card-value {
    flex-shrink: 0;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.stat-card-label {
    font-size: 0.85rem;
    opacity: 0.92;
}

.stat-card-blue {
    background-color: #2a5fd0 !important;
    background-image: linear-gradient(135deg, #4f8ef7, #2a5fd0) !important;
    border-color: #2a5fd0;
}

.stat-card-purple {
    background-color: #7c3aed !important;
    background-image: linear-gradient(135deg, #a78bfa, #7c3aed) !important;
    border-color: #7c3aed;
}

.stat-card-pink {
    background-color: #e11d48 !important;
    background-image: linear-gradient(135deg, #fb7185, #e11d48) !important;
    border-color: #e11d48;
}

.stat-card-green {
    background-color: #059669 !important;
    background-image: linear-gradient(135deg, #34d399, #059669) !important;
    border-color: #059669;
}

/* 대시보드 DAU 차트 (이 프로젝트는 라이트 모드 전용이라 팔레트도 라이트 값만 사용) */
.dau-hero {
    font-size: 2.5rem;
    font-weight: 600;
    color: #0b0b0b;
    line-height: 1.1;
}

.dau-chart-wrap {
    position: relative;
    height: 110px;
}

/* 데이터 테이블: cmsServer 스타일의 단정한 관리자 목록 */
.app-content .table-responsive {
    overflow-x: auto;
    margin-bottom: 0;
    border: 1px solid #c4ccd6;
    border-top: 2px solid #8f9aa8;
    border-radius: 0.35rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(31, 45, 61, 0.04);
}

.app-content .table {
    min-width: 640px;
    margin-bottom: 0;
    color: #3f4b5b;
    font-size: 0.875rem;
    vertical-align: middle;
}

.app-content .table > :not(caption) > * > * {
    padding: 0.8rem 1rem;
    border-color: #e9edf2;
}

.app-content .table > tbody > tr > td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.app-content .table > thead > tr > th {
    vertical-align: bottom;
    background: #e9ecef;
    color: #495057;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border-bottom: 2px solid #dee2e6;
}

.app-content .table > tbody > tr {
    transition: background-color 0.15s ease;
}

.app-content .table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #f8fbff;
    color: inherit;
}

.app-content .table > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* Bootstrap pagination을 cmsServer의 데이터 목록 컨트롤처럼 표시 */
.app-content .pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin: 1.25rem 0 0;
}

.app-content .pagination .page-item {
    margin: 0;
}

.app-content .pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #dfe5eb;
    border-radius: 0.3rem;
    background: #fff;
    color: #687585;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    transition: color 0.15s ease, background-color 0.15s ease,
        border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-content .pagination .page-link:hover {
    z-index: 1;
    border-color: #86b7fe;
    background: #f4f8ff;
    color: #0d6efd;
}

.app-content .pagination .page-item.active .page-link {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.2);
}

.app-content .pagination .page-item.disabled .page-link {
    border-color: #edf0f3;
    background: #f8f9fa;
    color: #b2bac4;
    pointer-events: none;
}

@media (max-width: 575.98px) {
    .app-content .table > :not(caption) > * > * {
        padding: 0.65rem 0.75rem;
    }

    .app-content .pagination {
        gap: 0.2rem;
    }

    .app-content .pagination .page-link {
        min-width: 2rem;
        height: 2rem;
        padding-right: 0.45rem;
        padding-left: 0.45rem;
    }
}
