/* Brand colors */
:root {
    --brand-primary: #f4d000;
    --brand-primary-hover: #dbbb00;
    --brand-primary-active: #c2a600;
    --brand-primary-soft: rgba(244, 208, 0, 0.12);
    --brand-on-primary: #1f2937; /* primary 배경 위의 텍스트 */
    --brand-primary-dark: #8a7600; /* 텍스트용 진한 브랜드 색 (가독성 확보) */
}

/* ─── 공통 유틸 클래스 ─────────────────────────────────── */

/* 검색 폼 필터 컬럼 (form-row 내부에서 단독 사용, col-md-2 불필요) */
.search-filter-col {
    flex: 1 1 190px;
    max-width: 260px;
    min-width: 180px;
    padding-right: 5px;
    padding-left: 5px;
}

.search-filter-col .form-control {
    width: 100%;
}

.form-row.align-items-center {
    row-gap: 0.35rem;
}

/* 권한별 메뉴 — 메뉴 블록 그리드 (가용 폭에 맞춰 최대한 많은 블록 배치) */
.menu-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.menu-blocks-grid .menu-block {
    background: #f8f9fc;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: border-color .15s ease-in-out;
}

.menu-blocks-grid .menu-block:hover {
    border-color: #d7dbec;
}

/* 역할 탭 */
.role-menu-tabs .nav-link {
    border-radius: 999px;
    padding: .4rem 1rem;
    color: #5a5c69;
    background: #f8f9fc;
}

.role-menu-tabs .nav-link .role-count-badge {
    background: #fff;
    color: #6e707e;
}

/* 폼 라벨 (모달/등록 폼 공통) */
.form-label-strong {
    font-weight: 600;
    color: #475569;
}

/* 키가 큰 input/select (h=48, radius=12) */
.form-control-lg-rounded {
    height: 48px;
    border-radius: 12px;
}

/* 둥근 textarea */
textarea.form-control-rounded {
    border-radius: 12px;
}

/* 관리자 계정 담당 범위 선택 */
.assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem;
}

.assignment-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-height: 64px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s;
}

.assignment-option:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.assignment-option input {
    margin-top: 0.2rem;
}

.assignment-option input:checked + span strong {
    color: var(--brand-primary-dark);
}

.assignment-option strong,
.assignment-option small {
    display: block;
    line-height: 1.25;
}

.assignment-option small {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.78rem;
}

.empty-assignment {
    padding: 0.9rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.9rem;
    text-align: center;
}

.assignment-summary {
    max-width: 320px;
}

/* 커뮤니티 관리 화면 공통 */
.community-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    /* 목록 이미지 칸에서 가운데로 (셀 폭이 썸네일보다 넓다) */
    display: block;
    margin: 0 auto;
}

.community-thumb-sm {
    width: 48px;
    height: 48px;
}

.community-thumb-placeholder {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 8px;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.community-hero-image,
.community-hero-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
}

.community-hero-image {
    object-fit: cover;
}

.community-hero-placeholder {
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.community-content {
    white-space: pre-wrap;
    line-height: 1.7;
}

.community-preview {
    max-width: 220px;
}

.upload-box {
    position: relative;
    min-height: 220px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1rem;
    margin: 0;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.upload-box:hover,
.upload-box:focus-within {
    border-color: var(--brand-primary);
    background: #fffdf0;
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.upload-box.has-file {
    border-style: solid;
    border-color: var(--brand-primary);
    background: #fffdf0;
}

.upload-box-compact {
    min-height: 130px;
}

.upload-box-preview {
    width: 168px;
    max-width: 100%;
    min-height: 150px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.upload-box-gallery {
    height: 132px;
    min-height: 132px;
    overflow: hidden;
    align-items: stretch;
}

.upload-box-preview .image-preview-main {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 10px;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    height: 100%;
}

.upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    font-size: 1.25rem;
}

.upload-title {
    font-weight: 700;
    color: #1f2937;
}

.upload-filename {
    max-width: 100%;
    color: #64748b;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview-box {
    width: 100%;
    height: 100px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

.image-preview-box-main {
    height: 220px;
}

.image-preview {
    display: none;
    max-width: 100%;
    max-height: 140px;
    border-radius: 8px;
    object-fit: cover;
}

.image-preview-main {
    width: 100%;
    max-height: 240px;
    aspect-ratio: 1 / 1;
}

.multi-image-preview {
    display: none;
    grid-auto-flow: column;
    grid-auto-columns: 76px;
    grid-template-columns: none;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
}

.multi-image-preview img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    object-fit: cover;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.schedule-field {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.schedule-field .form-label-strong {
    margin-bottom: 6px;
    font-size: 0.86rem;
}

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

/* 모달 공통 */
.modal-content.modal-rounded {
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-header.modal-header-divider {
    border-bottom: 1px solid #f1f5f9;
    padding: 25px;
}

.modal-footer.modal-footer-divider {
    border-top: 1px solid #f1f5f9;
    padding: 20px;
}

.modal-body.modal-body-padded {
    padding: 25px;
}

.modal-dialog.modal-dialog-tall {
    max-width: 980px;
}

.modal-dialog-tall .modal-content {
    max-height: calc(100vh - 32px);
}

.modal-dialog-tall .modal-body {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
}

.meeting-description-input {
    min-height: 280px;
}

.modal-title.modal-title-bold {
    font-weight: 700;
}

/* 둥근 버튼 */
.btn.btn-rounded {
    border-radius: 10px;
}

.btn.btn-rounded-wide {
    border-radius: 10px;
    padding: 10px 25px;
}

/* Soft 뱃지 */
.badge.badge-soft-success {
    background-color: #d4edda;
    color: #155724;
    padding: 0.35em 0.65em;
}

.badge.badge-soft-secondary {
    background-color: #e2e3e5;
    color: #383d41;
    padding: 0.35em 0.65em;
}

.badge.badge-soft-info {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 0.35em 0.65em;
}

.badge.badge-soft-danger {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.35em 0.65em;
}

.badge.badge-soft-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.35em 0.65em;
}

.badge.badge-soft-primary {
    background-color: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
    padding: 0.35em 0.65em;
}

/* 잔여일 임박 경고 */
.remaining-critical { color: #dc3545 !important; font-weight: 700; }
.remaining-warning  { color: #f0932b !important; font-weight: 700; }

/* 회원 목록 필터 chip */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    background-color: var(--brand-primary-soft, #e7f1ff);
    color: var(--brand-primary-dark, #0d6efd);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
    text-decoration: none;
}
.filter-chip:hover { text-decoration: none; opacity: 0.85; }
.filter-chip .chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.08);
    color: inherit;
    font-size: 0.7rem;
    line-height: 1;
}
.filter-chip .chip-remove:hover { background-color: rgba(0,0,0,0.18); }

/* 정렬 가능한 테이블 헤더 */
th.sortable a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
th.sortable a:hover { color: var(--brand-primary-dark, #0d6efd); }
th.sortable .sort-icon { opacity: 0.4; font-size: 0.75rem; }
th.sortable.sort-active .sort-icon { opacity: 1; color: var(--brand-primary, #0d6efd); }

/* 락커 그리드 — 명시적 위치(gridRow/gridCol) 기반 배치 + 사이즈별 비율.
   gap 0으로 락커들이 실제 옷장처럼 딱 붙어있게. 그리드 cols는 박스 설정값 사용.
   기본 단위는 45px (소형의 너비) — 소형 1×2, 중형 2×2, 대형 2×4 칸으로 표현. */
:root {
    --locker-unit: 45px;
    --locker-gap: 0px;
}
.locker-grid {
    display: grid;
    grid-template-columns: repeat(var(--locker-cols, 12), var(--locker-unit));
    grid-template-rows: repeat(var(--locker-rows, 8), var(--locker-unit));
    /* 명시 그리드를 벗어나 자동 생성되는 트랙도 같은 칸 크기로 고정.
       지정하지 않으면 auto(=내용 크기)라, 회원명·잔여일이 붙는 사용 중 락커만
       빈 락커보다 크게 그려진다. */
    grid-auto-rows: var(--locker-unit);
    grid-auto-columns: var(--locker-unit);
    gap: var(--locker-gap);
    padding: 1rem;
    overflow: auto;
    background-color: #fafafa;
    border-radius: 8px;
    position: relative;
}
/* 빈 placeholder 셀 — 드래그 드롭 좌표를 정확히 잡기 위한 백그라운드 그리드 */
.locker-grid-cell-placeholder {
    border: 2px dashed transparent;
    background-color: transparent;
    transition: background-color 0.12s, border-color 0.12s;
    pointer-events: none;
}
/* 편집 모드일 때 placeholder가 또렷이 보이도록 강조 (회색 점선 + 옅은 배경) */
.locker-grid.drop-target-active .locker-grid-cell-placeholder {
    border: 2px dashed #adb5bd;
    background-color: rgba(173, 181, 189, 0.12);
    pointer-events: auto;
}
/* 목적지 미리보기 — 락커가 실제로 차지할 영역(span 전체)을 그리드 위에 표시 */
.locker-drop-preview {
    border: 2px solid var(--brand-primary);
    background-color: var(--brand-primary-soft);
    border-radius: 2px;
    pointer-events: none;
    z-index: 3;
}
.locker-drop-preview.is-blocked {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.15);
}
/* 범위 선택 밴드 — 빈 곳을 드래그해 여러 락커를 한 번에 고를 때 */
.locker-select-band {
    position: absolute;
    z-index: 5;
    display: none;
    border: 1px solid var(--brand-primary);
    background-color: rgba(244, 208, 0, 0.18);
    pointer-events: none;
}
/* 편집 모드에서 선택된 락커 */
.locker-cell.locker-selected {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px var(--brand-primary-soft), 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 4;
}
/* 이동 불가 피드백 */
@keyframes lockerShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
}
.locker-cell.locker-move-blocked {
    animation: lockerShake 0.18s ease-in-out 2;
    border-color: #dc3545 !important;
}

/* ── 위치 편집 툴바 ── */
.locker-edit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 0.7rem 1.25rem;
    background-color: #fffbea;
    border-top: 1px solid #f2e6b3;
    border-bottom: 1px solid #f2e6b3;
}
.locker-edit-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 0.82rem;
    color: #6b5b12;
}
.locker-edit-step b {
    display: inline-flex;
    width: 17px;
    height: 17px;
    margin-right: 5px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #6b5b12;
    color: #fff;
    font-size: 0.68rem;
}
.locker-edit-arrow { font-size: 0.6rem; color: #b9a94f; }
.locker-edit-tip { color: #8c7d2f; font-size: 0.76rem; }
.locker-edit-tip kbd {
    padding: 1px 4px;
    background-color: #fff;
    border: 1px solid #ddd3a0;
    border-radius: 3px;
    color: #6b5b12;
    font-size: 0.7rem;
}
.locker-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.locker-edit-status {
    font-size: 0.8rem;
    color: #8c7d2f;
    white-space: nowrap;
}
.locker-edit-status.is-selected { color: #6b5b12; font-weight: 700; }

/* ── 락커 편집 토스트 ── */
.locker-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 2000;
    padding: 10px 18px;
    border-radius: 8px;
    background-color: rgba(33, 37, 41, 0.94);
    color: #fff;
    font-size: 0.85rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.locker-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.locker-toast.locker-toast-warn  { background-color: rgba(240, 173, 78, 0.97); color: #3d2c00; }
.locker-toast.locker-toast-error { background-color: rgba(220, 53, 69, 0.96); }
.locker-cell {
    border: 1px solid #c9ced3;
    border-radius: 0;     /* 네모, 딱 붙음 */
    padding: 0.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s, z-index 0s;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: white;
    z-index: 1;
}
.locker-cell:hover {
    z-index: 2;
}
.locker-cell:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
/* 락커가 차지하는 칸수는 코드 관리(LOCKER_SIZE)의 가로/세로 칸수가 소유하며,
   셀의 인라인 grid-row/grid-column 으로 지정된다.
   여기에 size-SMALL/MEDIUM/LARGE 별 span 을 다시 박아두면 운영자가 코드 관리에서
   칸수를 바꿔도 반영되지 않으므로 두지 않는다. (size-* 클래스는 마크업 식별용으로만 남김) */
/* 드롭 가능 표시 */
.locker-grid.drop-target-active {
    background-color: rgba(244, 208, 0, 0.05);
    outline: 1px dashed var(--brand-primary);
}
.locker-cell.drop-target {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}
.locker-cell .locker-number {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    line-height: 1.1;
}
.locker-cell .locker-size {
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1;
}
.locker-cell .locker-member {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-primary-dark);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.locker-cell .locker-period {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.15rem;
}
.locker-cell .locker-remaining {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.15rem;
}
.locker-cell.locker-in-use {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.06);
}
.locker-cell.locker-empty {
    border-color: #dee2e6;
    background-color: #f8f9fa;
}
.locker-cell.locker-inactive {
    border-color: #dee2e6;
    background-color: #e9ecef;
    opacity: 0.6;
}
/* 점검/직원/보관/기타 통합 — 단일 warning 톤. 셀 안의 작은 아이콘으로 세부 구분. */
.locker-cell.locker-problem {
    border-color: #f0ad4e;
    background-color: rgba(240, 173, 78, 0.10);
}
/* 셀 안의 세부 용도 아이콘 (좌상단). 노이즈 줄이려 작고 흐릿하게. */
.locker-cell .locker-usage-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    opacity: 0.7;
}
.locker-cell .locker-usage-icon.icon-broken { color: #dc3545; }
.locker-cell .locker-usage-icon.icon-staff   { color: #6f42c1; }
.locker-cell .locker-usage-icon.icon-storage { color: #fd7e14; }
.locker-cell .locker-usage-icon.icon-other   { color: #20c997; }

.locker-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.locker-status-dot.dot-in-use  { background-color: #28a745; }
.locker-status-dot.dot-empty   { background-color: #adb5bd; }
.locker-status-dot.dot-problem { background-color: #f0ad4e; }
.locker-status-dot.dot-inactive{ background-color: #343a40; }
.locker-status-dot.dot-broken  { background-color: #f0ad4e; } /* 호환용 — 신규 마크업은 dot-problem 사용 */

/* 테이블 셀 수직 중앙 정렬 */
.table td, .table th {
    vertical-align: middle;
}

/* 회원 목록: 많은 데이터를 한 화면에서 볼 수 있도록 행 높이를 일정하고 조밀하게 유지 */
.member-status-table thead th {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    white-space: nowrap;
}
.member-status-table tbody td {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    line-height: 1.25;
    white-space: nowrap;
}
.member-status-table tbody small {
    line-height: 1.2;
}
/* 숫자 컬럼은 오른쪽 정렬 — 자릿수가 흔들리지 않도록 고정폭 숫자를 쓴다 */
.member-status-table .num-col {
    font-variant-numeric: tabular-nums;
}
.member-status-table .member-cell {
    /* 컬럼이 17개로 늘어 좁혔다. td에 white-space:nowrap 이 걸려 있어 min-width만 줄이면
       긴 아이디가 그대로 칸을 밀어내므로, 최대 폭을 함께 잡고 넘치면 말줄임한다. */
    min-width: 96px;
    max-width: 120px;
}
.member-cell .member-name,
.member-cell .member-sub {
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-cell .member-name { font-weight: 700; line-height: 1.25; }
.member-cell .member-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    min-width: 0;   /* flex 안에서 말줄임이 먹으려면 필요 */
}
.member-cell .member-sub { color: #6c757d; font-size: 0.8rem; line-height: 1.2; }
.member-cell .member-sub > span + span::before { content: ' · '; margin: 0 0.15rem; }
.member-cell .member-auth-types {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.member-status-table .member-auth-types .badge,
.member-status-table .member-more-badge {
    padding: 0.25em 0.5em;
}
.member-status-table .member-status-meta {
    display: block;
    margin-top: 0.15rem;
}
.member-status-table .member-box-statuses {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 대시보드 KPI 숫자 (index.html) */
.kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary-dark, #2c3e50);
    line-height: 1.2;
}
.kpi-unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
    margin-left: 2px;
}
.min-width-0 {
    min-width: 0;
}

/* 상세 페이지 우측 요약 카드 - 브랜드 상단 악센트 */
.summary-card {
    border-top: 3px solid var(--brand-primary) !important;
}

.summary-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 1rem !important;
}

.summary-card .card-body > .d-flex.align-items-center.mb-3 {
    margin-bottom: 0.5rem !important;
}

.summary-card .summary-body {
    flex: 1 1 auto;
}

.summary-card .summary-body .row.py-2 {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.summary-card .mt-3.pt-2.border-top {
    margin-top: 0.5rem !important;
    padding-top: 0.5rem !important;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
}

#wrapper {
    display: flex;
    flex: 1;
}

/* ─── Bootstrap primary overrides ─────────────────────────────────── */
.btn-primary {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
    color: var(--brand-on-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(244, 208, 0, 0.35) !important;
}

.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--brand-primary-active) !important;
    border-color: var(--brand-primary-active) !important;
    color: var(--brand-on-primary) !important;
}

.btn-outline-primary {
    color: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
    border-color: var(--brand-primary) !important;
}

.btn-light.text-primary {
    color: var(--brand-primary-dark) !important;
}

.bg-primary {
    background-color: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
}

.text-primary {
    color: var(--brand-primary-dark) !important;
}

.badge-primary,
.badge.badge-primary {
    background-color: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
}

/* 페이징 색은 admin-ui.css 의 "페이징" 규칙 하나로 통일한다.
   여기서 브랜드색을 !important 로 칠하면 .pagination 쓰는 화면만 노란 활성 버튼이 되고,
   .pager 를 쓰는 화면(WOD·카테고리 등)은 검은 활성 버튼이라 화면마다 달라 보였다. */

/* Form focus state */
.form-control:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(244, 208, 0, 0.25) !important;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

/* ─── Card header 브랜드 액센트 ──────────────────────────────────── */
/* h6 제목: 좀 더 브랜드스러운 앰버 톤 */
.card-header h6.text-primary,
.card-header .font-weight-bold.text-primary {
    color: var(--brand-primary-active) !important;
}

/* 아이콘(fas/fa/far)은 원색 브랜드 컬러로 강조 */
.card-header i.text-primary,
.card-header .fas.text-primary,
.card-header .fa.text-primary,
.card-header .far.text-primary {
    color: var(--brand-primary) !important;
}

/* 카드 상단에 얇은 브랜드 색 보더로 구분감 */
.card:not(.bg-primary) > .card-header {
    border-bottom: 2px solid var(--brand-primary-soft) !important;
}

/* list-group active 항목도 브랜드 컬러로 */
.list-group-item.active {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
}

/* list-group-item hover에 브랜드 soft 적용 */
.list-group-item-action:hover:not(.active) {
    background-color: var(--brand-primary-soft) !important;
}

/* ─── 회원 상세 등 폼 섹션 제목 ──────────────────────────────────── */
.info-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-primary-active);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-primary-soft);
}

/* ─── Select2 Bootstrap 4 호환 스타일 ──────────────────────────────── */
.select2-container--default .select2-selection--single {
    height: 48px;
    border: 1px solid #ced4da;
    border-radius: 12px;
    padding: 10px 15px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    padding-right: 20px;
    line-height: 1.6;
    color: #495057;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 8px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(244, 208, 0, 0.25);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
}
.select2-dropdown {
    border-color: var(--brand-primary);
    border-radius: 8px;
}
/* 모달 내부 z-index 보정 */
.select2-container--open {
    z-index: 9999;
}

/* ─── FullCalendar 요일 색상 (평일 검정/토 파랑/일 빨강) ───────────── */
.fc .fc-col-header-cell a,
.fc .fc-daygrid-day-number {
    color: #1f2937; /* 평일 검정 계열 */
    text-decoration: none;
}

.fc .fc-col-header-cell.fc-day-sat a,
.fc .fc-daygrid-day.fc-day-sat .fc-daygrid-day-number {
    color: #1d4ed8 !important; /* 토요일 파랑 */
}

.fc .fc-col-header-cell.fc-day-sun a,
.fc .fc-daygrid-day.fc-day-sun .fc-daygrid-day-number {
    color: #dc2626 !important; /* 일요일 빨강 */
}

/* timeGrid에서 상단 날짜 숫자에도 동일 적용 */
.fc .fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion,
.fc .fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion * {
    color: #1d4ed8 !important;
}
.fc .fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion,
.fc .fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion * {
    color: #dc2626 !important;
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(244, 208, 0, 0.25) !important;
}

/* Links */
a {
    color: var(--brand-primary-dark);
}

a:hover {
    color: var(--brand-primary-active);
}

/* Sidebar Styling (dark base + brand accents) */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

#sidebar .sidebar-header {
    padding: 25px 20px;
    background: var(--brand-primary);
    text-align: center;
}

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

#sidebar .sidebar-header h3 {
    margin-bottom: 5px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* 로고의 "STADION" 글자 일부를 브랜드로 포인트 처리하고 싶다면 템플릿에서 <span class="brand-accent"> 처리 */
#sidebar .sidebar-header .brand-accent {
    color: var(--brand-primary);
}

#sidebar .user-info {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar .user-avatar {
    margin-right: 15px;
    color: var(--brand-primary); /* 브랜드 accent */
}

#sidebar .user-details p {
    margin: 0;
}

#sidebar .user-details .welcome-text {
    font-size: 0.8em;
    opacity: 0.7;
}

#sidebar .user-details .user-name {
    font-weight: 600;
    font-size: 1em;
}

#sidebar ul.components {
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95em;
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

#sidebar ul li a i {
    width: 25px;
    margin-right: 10px;
    text-align: center;
}

#sidebar ul li a:hover {
    color: #fff;
    background: #34495e;
}

#sidebar ul li.active > a {
    color: #fff;
    background: rgba(244, 208, 0, 0.15); /* 브랜드 틴트로 배경과 구분 */
    border-left: 3px solid var(--brand-primary);
    font-weight: 600;
}

#sidebar ul ul a {
    font-size: 0.85em !important;
    padding-left: 40px !important;
    background: #1a252f;
}

#sidebar ul ul a:hover {
    background: #2c3e50 !important;
    color: #fff;
}

#sidebar ul ul li.active > a {
    background: rgba(244, 208, 0, 0.2) !important; /* 서브메뉴 active: 브랜드 틴트 (더 진하게) */
    color: var(--brand-primary) !important;
    border-left: 3px solid var(--brand-primary);
    font-weight: 600;
}

#sidebar ul.components ul {
    display: none;
    list-style: none;
    padding: 0;
}

#sidebar ul.components li.active ul {
    display: block;
}

#sidebar .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    border: none;
    float: right;
    transition: transform 0.3s;
}

#sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

#sidebar .sidebar-footer {
    padding: 15px 20px;
    background: #1a252f;
}

#sidebar .btn-logout {
    width: 100%;
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.2s;
}

#sidebar .btn-logout:hover {
    background: #c0392b;
}

/* Content Styling */
#content {
    width: 100%;
    padding: 30px;
    min-height: 100vh;
    transition: all 0.3s;
    background-color: #f8f9fc;
}

/* Card Styling */
.search-card, .table-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    margin-bottom: 25px;
    border: none;
}

.search-card {
    padding: 20px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.search-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary-dark);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.search-item label i {
    margin-right: 5px;
}

.search-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e3e6f0;
}

.btn-search-submit {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: 600;
}

.btn-search-reset {
    background-color: #eaecf4;
    color: #5a5c69;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
}

.btn-search-reset:hover {
    background-color: #dddfeb;
    color: #5a5c69;
    text-decoration: none;
}

/* Table Styling */
.table-card .table thead th {
    background-color: #f8f9fc;
    border-bottom: 2px solid #e3e6f0;
    color: var(--brand-primary-dark);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 15px;
}

.table-card .table tbody td {
    padding: 15px;
    vertical-align: middle;
    color: #5a5c69;
}

/* Badge Styling */
.badge-soft-primary {
    background-color: var(--brand-primary-soft);
    color: var(--brand-primary-dark);
}

.badge-soft-info {
    background-color: rgba(54, 185, 204, 0.1);
    color: #36b9cc;
}

.badge-soft-success {
    background-color: rgba(28, 200, 138, 0.1);
    color: #1cc88a;
}

/* Breadcrumb Styling */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item a {
    color: var(--brand-primary-dark);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #858796;
}

/* ─── Dashboard KPI ─────────────────────────────────────────────── */
.dashboard-header h1 {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1f2937;
}

.kpi-card {
    border: 0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
    overflow: hidden;
}

.kpi-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.kpi-card .card-body {
    padding: 1.1rem 1.25rem 0.6rem;
}

.kpi-card .kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.kpi-card .kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.kpi-card .kpi-value .unit {
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    margin-left: 2px;
}

.kpi-card .kpi-meta {
    font-size: 0.74rem;
    color: #6b7280;
    margin-top: 0.35rem;
}

.kpi-card .kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
    margin-right: 4px;
}

.kpi-card .kpi-trend.up { background: rgba(16, 185, 129, 0.12); color: #047857; }
.kpi-card .kpi-trend.down { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.kpi-card .kpi-trend.flat { background: rgba(107, 114, 128, 0.12); color: #4b5563; }

.kpi-card .kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.kpi-card .kpi-icon.icon-blue   { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.kpi-card .kpi-icon.icon-green  { background: rgba(16, 185, 129, 0.12); color: #047857; }
.kpi-card .kpi-icon.icon-gold   { background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.kpi-card .kpi-icon.icon-purple { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }

.kpi-card .kpi-spark {
    margin: 0 -1.25rem -0.6rem;
    padding-top: 4px;
}

.kpi-card .kpi-spark canvas {
    display: block;
    width: 100% !important;
    height: 48px !important;
}

.dashboard-section-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.dashboard-section-card .card-header {
    background: transparent;
    border-bottom: 1px solid #f1f3f5;
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.2px;
}

.dashboard-section-card .card-header .header-meta {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    margin-left: 8px;
}

.dashboard-section-card .card-body {
    padding: 1rem 1.25rem;
}

/* 페이지네이션이 좁은 화면에서도 폭을 넘기지 않도록 줄바꿈 허용. 윈도우는 컨트롤러 측 템플릿에서 ±5 로 제한. */
.pagination {
    flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────────────
   STADION 디자인 컨셉 통일 (전 화면 공용)
   WOD 관리/카테고리 등 커스텀 화면과 룩앤필을 맞춘다.
   - 폰트: Pretendard (base.html 에서 로드)
   - 페이지 배경: 밝은 회색
   - 카드/모달: 둥근 모서리
   파일 최하단 = 동일 specificity 규칙을 후순위로 덮어써 적용.
   브랜드 노란색/포커스/뱃지 등 기존 테마는 그대로 둔다.
   ───────────────────────────────────────────────────────────────── */
body,
button, input, select, textarea, optgroup,
.btn, .form-control, .form-control-lg-rounded, .modal, .dropdown-menu,
table, .badge, .breadcrumb {
    font-family: 'Pretendard', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body { background-color: #F1F3F5; }
.card { border-radius: 14px; }
.modal-content { border-radius: 16px; }
