/* ===================================================================
   entrue Admin — 통합 스타일시트 v2 (onforis 디자인 언어 이식)
   관리자 전 페이지 공통. admin_header.php 에서 <link> 로 로드.
   디자인 방향: 편안함 · 저채도 파스텔 블루 · 밝은 사이드바 · keep-all 한글 조판
   ⚠️ 클래스명·CSS 변수명은 페이지 인라인 스타일이 참조하므로 변경 금지
   =================================================================== */

/* ── Pretendard 웹폰트 ─────────────────────────────────── */
@font-face {
    font-family: 'Pretendard'; font-weight: 400; font-style: normal; font-display: swap;
    src: url('/assets/fonts/Pretendard-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Pretendard'; font-weight: 500; font-style: normal; font-display: swap;
    src: url('/assets/fonts/Pretendard-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Pretendard'; font-weight: 600; font-style: normal; font-display: swap;
    src: url('/assets/fonts/Pretendard-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Pretendard'; font-weight: 700; font-style: normal; font-display: swap;
    src: url('/assets/fonts/Pretendard-Bold.woff2') format('woff2');
}
@font-face {
    font-family: 'Pretendard'; font-weight: 800; font-style: normal; font-display: swap;
    src: url('/assets/fonts/Pretendard-ExtraBold.woff2') format('woff2');
}

/* ── 리셋 & 토큰 ──────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* 레이아웃 */
    --sidebar-w:    216px;
    --topbar-h:     52px;

    /* 브랜드 — 저채도 페리윙클 블루 */
    --primary:      #8095C9;
    --primary-dark: #6A81BA;
    --primary-soft: #EDF1F9;
    --deep:         #4D5977;   /* 제목·강조 텍스트용 딥 슬레이트 블루 */
    --active-text:  #5D6FA3;   /* 활성 메뉴·탭 텍스트 */

    /* 뉴트럴 (살짝 블루기 있는 그레이) */
    --bg:           #FAFAFC;
    --card-bg:      #FFFFFF;
    --border:       #E9E9EF;
    --border-soft:  #F1F1F5;
    --txt:          #2B2A33;
    --txt-muted:    #7C7A89;
    --txt-faint:    #A6A4B0;

    /* 시맨틱 (채도 낮은 파스텔) */
    --success:      #7FB89A;
    --success-soft: #EDF6F1;
    --danger:       #C97D74;
    --danger-soft:  #FAEEED;
    --warning:      #E0BE7F;
    --warning-soft: #FBF4E7;

    /* 사이드바 (밝은 서피스) */
    --sidebar-bg:   #FFFFFF;
    --sidebar-txt:  var(--txt-muted);
    --sidebar-act:  var(--primary-soft);

    /* 형태 */
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 1px 3px rgba(43,42,51,0.05);
    --shadow-md:    0 6px 18px rgba(77,89,119,0.10);
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    font-size: 13.5px;
    color: var(--txt);
    background: var(--bg);
    line-height: 1.55;
    letter-spacing: -0.01em;
    /* 한글 조판: 어절 단위 줄바꿈 + 긴 토큰(URL 등)은 강제 개행 */
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

/* ── 레이아웃 ─────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.22s ease;
}

/* ── 사이드바 (밝은 서피스 + 좌측 인디케이터) ──────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: width 0.22s ease;
}

.sidebar-toggle-wrap {
    display: flex;
    align-items: center;
    padding: 12px 14px 4px;
}
.sidebar-toggle-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--txt-faint);
    letter-spacing: 0.08em;
    flex: 1;
}
.sidebar-toggle-btn {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border: none; border-radius: 7px;
    background: transparent;
    color: var(--txt-faint);
    cursor: pointer; flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.sidebar-toggle-btn:hover { background: var(--primary-soft); color: var(--active-text); }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-soft);
}
.sidebar-logo svg { width: 26px; height: 26px; stroke: var(--primary); flex-shrink: 0; }
.sidebar-logo-text { display: flex; flex-direction: column; gap: 1px; }
.logo-title { font-size: 15px; font-weight: 800; color: var(--deep); white-space: nowrap; letter-spacing: -0.02em; }
.logo-sub   { font-size: 9.5px; font-weight: 700; color: var(--txt-faint); letter-spacing: 0.09em; }

/* ── 메뉴 (onforis 스타일 — 섹션 라벨 + 텍스트 항목) ──── */
.sidebar-nav { padding: 10px; flex: 1; overflow-y: auto; }
.sidebar-label {
    padding: 14px 11px 4px;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em;
    color: var(--txt-faint); text-transform: uppercase;
}
.sidebar-nav-item {
    position: relative;
    display: block;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--sidebar-txt);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, color 0.15s;
}
.sidebar-nav-item:hover { background: var(--bg); color: var(--txt); }
.sidebar-nav-item.active {
    background: var(--primary-soft);
    color: var(--active-text);
    font-weight: 700;
}
/* 활성 메뉴 좌측 인디케이터 바 */
.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: -10px; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: var(--primary);
}

/* ── 이벤트 컨텍스트 박스 (onforis EVENT 섹션) ─────────── */
.ev-section {
    margin: 14px 0 6px;
    padding: 10px 8px 8px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.ev-section .sidebar-nav-item.active::before { left: -8px; }
.ev-section-head {
    display: flex; align-items: center; gap: 7px;
    padding: 0 3px 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}
.ev-chip {
    font-size: 9px; font-weight: 800; letter-spacing: 0.08em;
    color: var(--active-text);
    background: var(--primary-soft);
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
}
.ev-section-name {
    font-size: 12px; font-weight: 700; color: var(--deep);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}

.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border-soft); }
.sidebar-admin-info { display: flex; align-items: center; gap: 10px; }
.admin-avatar {
    width: 32px; height: 32px;
    background: var(--primary-soft);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--active-text); flex-shrink: 0;
}
.admin-name { font-size: 13px; font-weight: 600; color: var(--txt); }
.admin-role { font-size: 11px; color: var(--txt-faint); }

/* 사이드바 접힘 */
body.sidebar-collapsed .sidebar      { width: 0; overflow: hidden; border-right: none; }
body.sidebar-collapsed .main-wrapper { margin-left: 0; }

/* ── 상단바 ───────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title { font-size: 14.5px; font-weight: 700; color: var(--deep); letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: none; border-radius: 7px;
    background: transparent; color: var(--txt-muted);
    cursor: pointer; flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.topbar-menu-btn:hover { background: var(--primary-soft); color: var(--active-text); }
.topbar-logout {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 12.5px; font-weight: 500; color: var(--txt-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.topbar-logout:hover { background: var(--primary-soft); color: var(--active-text); border-color: #D8DCE8; }

/* ── 콘텐츠 ───────────────────────────────────────────── */
.content { padding: 22px 24px 44px; flex: 1; }

/* ── 페이지 헤더 ──────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}
.page-header-title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--txt); }
.page-header-sub   { font-size: 12.5px; color: var(--txt-muted); margin-top: 3px; }

/* ── 카드 ─────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-title { font-size: 13.5px; font-weight: 700; color: var(--deep); }
.card-body  { padding: 18px; }

/* ── 스탯 카드 ────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #DDE2EE; }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; fill: none; }
.stat-icon.blue   { background: var(--primary-soft); } .stat-icon.blue svg   { stroke: var(--active-text); }
.stat-icon.green  { background: var(--success-soft); } .stat-icon.green svg  { stroke: #4E8A6C; }
.stat-icon.amber  { background: var(--warning-soft); } .stat-icon.amber svg  { stroke: #A8853F; }
.stat-icon.purple { background: #F1EDF9; }             .stat-icon.purple svg { stroke: #7A6BB0; }
.stat-value {
    font-size: 24px; font-weight: 800; line-height: 1; margin-bottom: 5px;
    letter-spacing: -0.02em; color: var(--deep); font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--txt-muted); }

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: -0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
    white-space: nowrap;
    line-height: 1.3;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B96A61; color: #fff; }
.btn-outline { background: var(--card-bg); color: #454351; border-color: #DBDAE2; }
.btn-outline:hover { background: var(--bg); }
.btn-warn { background: var(--warning-soft); border-color: var(--warning); color: #A8853F; font-weight: 700; }
.btn-warn:hover { background: #F6E9D2; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ── 테이블 ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    white-space: nowrap;
}
th:first-child, td:first-child { padding-left: 18px; }
th:last-child,  td:last-child  { padding-right: 18px; }
thead th {
    background: var(--bg);
    font-weight: 700;
    color: var(--txt-muted);
    font-size: 12px;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border);
}
tbody td { color: var(--txt); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td.center, th.center { text-align: center; }
td.muted { color: var(--txt-muted); }
td.faint { color: var(--txt-faint); font-size: 12px; }

/* ── 배지 (파스텔 연한 배경 + 진한 톤 글씨) ───────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-blue  { background: var(--primary-soft); color: var(--active-text); }
.badge-green { background: var(--success-soft); color: #4E8A6C; }
.badge-amber { background: var(--warning-soft); color: #A8853F; }
.badge-red   { background: var(--danger-soft);  color: #B05F57; }
.badge-gray  { background: #F1F1F5; color: var(--txt-muted); }

/* ── 알림 ─────────────────────────────────────────────── */
.alert {
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-soft); border-color: #D9EBE1; color: #4E8A6C; }
.alert-error   { background: var(--danger-soft);  border-color: #F2DDDB; color: #B05F57; }
.alert-info    { background: var(--primary-soft); border-color: #DCE3F2; color: var(--active-text); }

/* ── 폼 ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: var(--deep); }
.form-control {
    display: block;
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--txt);
    background: var(--card-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    font-family: inherit;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-control::placeholder { color: #B8B6C4; }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-hint { font-size: 11.5px; color: var(--txt-muted); margin-top: 4px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > .form-group { flex: 1; min-width: 180px; }
.date-time-pair { display: flex; gap: 6px; }
.date-time-pair input[type=date] { flex: 1; min-width: 130px; }
.date-time-pair select { width: auto; flex-shrink: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* ── 공용 유틸 ────────────────────────────────────────── */
.empty-state { padding: 36px 24px; text-align: center; color: var(--txt-faint); font-size: 13px; }
.u-flex      { display: flex; align-items: center; }
.u-gap-8     { gap: 8px; }
.u-mt-16     { margin-top: 16px; }
.u-mb-16     { margin-bottom: 16px; }
.u-mb-20     { margin-bottom: 20px; }

/* 페이지 헤더 우측 액션 묶음 */
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ── 탭 네비게이션 (밑줄 스타일 — 편안한 저채도) ──────── */
.tab-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
}
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px 8px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--txt-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.13s, border-color 0.13s;
}
.tab-link:hover { color: var(--txt); }
.tab-link.active {
    color: var(--active-text);
    border-bottom-color: var(--primary);
}
.tab-count {
    display: inline-block;
    min-width: 17px;
    background: #F1F1F5; color: var(--txt-muted);
    font-size: 10.5px; font-weight: 800;
    padding: 0 6px; border-radius: 100px; line-height: 1.7;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.tab-link.active .tab-count { background: var(--primary-soft); color: var(--active-text); }
.tab-count.hot { background: var(--danger-soft); color: #B05F57; }

/* 클릭 가능한 테이블 행 */
tbody tr.row-link { cursor: pointer; }

/* ── 대시보드 (미니 달력 좌 + 상태 탭 현황 우) ──────────── */
.dash-grid {
    display: grid;
    grid-template-columns: 284px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.dash-grid > .card { margin-top: 0; }   /* .card + .card 간격 규칙 상쇄 */

/* 카드 안에 들어가는 탭 (여백·밑줄을 카드에 맞춤) */
.tab-nav-card { margin-bottom: 0; padding: 0 8px; border-bottom: 1px solid var(--border-soft); }
.tab-nav-card .tab-link { padding: 10px 11px 9px; font-size: 13px; }

/* 기능 활성 표시 (바코드·영수증·가입문자) — 이벤트명 아래 한 줄.
   켜짐만 색이 들어와, 표를 훑으면 켜진 기능만 눈에 띈다.
   열을 따로 두지 않는 이유: 표가 넓어져 1400px 아래에서 [관리] 버튼이 가로 스크롤 밖으로 밀려난다. */
.feat-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.feat-chip {
    display: inline-flex; align-items: center;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--card-bg);
    font-size: 10px; font-weight: 600; line-height: 1.6;
    color: var(--txt-faint);
    white-space: nowrap;
    cursor: inherit;          /* 행 전체가 링크라 손가락 커서를 그대로 물려받는다 */
}
/* 회원 열이 늘어난 만큼 이 표에서는 긴 코드를 말줄임한다 (전체 폭이 카드를 넘지 않게 — 원본은 title 로 남는다) */
.dash-grid table td.code { max-width: 116px; overflow: hidden; text-overflow: ellipsis; }

/* 가입 회원수 — 숫자를 누르면 그 이벤트의 회원 관리로 */
.member-count { font-weight: 700; color: var(--deep); text-decoration: none; }
.member-count:hover { color: var(--active-text); text-decoration: underline; }
.member-count.is-zero { font-weight: 500; color: var(--txt-faint); }

.feat-chip.on {
    background: var(--primary-soft);
    border-color: transparent;
    color: var(--active-text);
    font-weight: 700;
}
/* 웹사이트 칩은 이벤트명 끝에 붙는다 — 글 흐름에 실려 남는 자리를 쓰므로 아래 칩 줄이 접히지 않는다 */
.site-chip { vertical-align: 2px; margin-left: 5px; font-weight: 600; }

/* 웹사이트 바로가기 — 유일하게 눌러서 나가는 칩이라 화살표로 구분한다 (새 창) */
a.feat-chip.link {
    gap: 3px;
    border-color: var(--primary);
    color: var(--active-text);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
a.feat-chip.link:hover { background: var(--primary-soft); }
a.feat-chip.link svg { width: 9px; height: 9px; flex-shrink: 0; }

/* 미니 달력 */
.mini-cal-head { padding: 10px 12px; }
.mini-cal-head .card-title { flex: 1; text-align: center; }
.mini-cal-nav {
    width: 26px; height: 26px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--txt-muted);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.mini-cal-nav:hover { background: var(--primary-soft); color: var(--active-text); }

.mini-cal-body { padding: 10px 12px 8px; }
.mini-cal-week, .mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.mini-cal-week span {
    text-align: center; padding-bottom: 6px;
    font-size: 11px; font-weight: 700; color: var(--txt-faint);
}
.mini-cal-week .sun { color: #C4837B; }
.mini-cal-week .sat { color: var(--primary); }
.mini-cal-grid { gap: 2px; }
.mini-cal-cell {
    appearance: none;
    border: 1px solid transparent;
    background: none;
    border-radius: 8px;
    padding: 4px 0 3px;
    min-height: 36px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font: inherit; color: var(--txt);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.mini-cal-cell .n { font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.mini-cal-cell.sun .n { color: #C4837B; }
.mini-cal-cell.sat .n { color: var(--active-text); }
.mini-cal-cell:hover { background: var(--bg); }
.mini-cal-cell.other { opacity: 0.35; }
.mini-cal-cell.today { border-color: var(--primary); }
.mini-cal-cell.today .n { color: var(--active-text); font-weight: 800; }
.mini-cal-cell.selected { background: var(--primary); border-color: var(--primary); opacity: 1; }
.mini-cal-cell.selected .n { color: #fff; }
.mini-cal-cell.selected .dot { background: #fff; }
.mini-cal-cell .dots { display: flex; gap: 2px; height: 5px; }

.dot {
    display: inline-block; width: 5px; height: 5px;
    border-radius: 50%; background: var(--txt-faint); flex-shrink: 0;
}
.dot-active { background: var(--success); }
.dot-draft  { background: var(--warning); }
.dot-ended  { background: #CBCAD3; }

.mini-cal-legend {
    display: flex; justify-content: center; gap: 12px;
    padding-top: 8px;
    font-size: 11px; color: var(--txt-muted);
}
.mini-cal-legend span { display: inline-flex; align-items: center; gap: 4px; }

/* 선택일 일정 목록 */
.mini-cal-day { border-top: 1px solid var(--border-soft); padding: 10px 12px 12px; }
.mini-cal-day-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--deep);
}
.mini-cal-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.mini-cal-list li.empty { font-size: 12px; color: var(--txt-faint); padding: 6px 2px; }
.mini-cal-list a {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 8px; border-radius: 8px;
    text-decoration: none; color: var(--txt); font-size: 12.5px;
    transition: background 0.12s;
}
.mini-cal-list a:hover { background: var(--bg); }
.mini-cal-list .badge { padding: 1px 7px; font-size: 10.5px; }
.mini-cal-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mini-cal-list .s { font-size: 11px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }   /* 표 nowrap 이 열 폭을 키우지 않도록 */
}

/* ── 정렬 헤더 (includes/ListSort.php) ─────────────────── */
/* 누를 수 있는 열이라는 걸 알아채야 한다 — 평소엔 조용하고, 올려두면 드러난다 */
.sort-th {
    display: inline-flex; align-items: center; gap: 3px;
    color: inherit; text-decoration: none; white-space: nowrap;
    transition: color 0.12s;
}
.sort-th:hover { color: var(--active-text); }
.sort-th .ar {
    font-size: 9px; line-height: 1;
    color: var(--active-text);
    opacity: 0;                      /* 정렬 중인 열에서만 보인다 */
    transition: opacity 0.12s;
}
.sort-th.on { color: var(--active-text); }
.sort-th.on .ar { opacity: 1; }
/* 마우스를 올리면 "여기 누르면 정렬된다"는 힌트로 흐린 화살표를 미리 보여 준다 */
.sort-th:hover .ar { opacity: .45; }
.sort-th.on:hover .ar { opacity: 1; }

/* ── 아젠다 관리 (admin/agenda/index.php) ───────────────── */
/* 추가 폼 — 목록과 시각적으로 분리한다 */
.ag-addform {
    padding: 14px 16px 4px;
    margin-bottom: 16px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}
.ag-addform .form-group { margin-bottom: 12px; }

/* 구분 필터 (전체 / 좌장 / 연자) */
.ag-rolefilter { display: flex; gap: 4px; }
.ag-rolefilter a {
    padding: 4px 11px; border-radius: 7px;
    font-size: 12.5px; font-weight: 600; color: var(--txt-muted);
    text-decoration: none; transition: background 0.12s, color 0.12s;
}
.ag-rolefilter a:hover { background: var(--bg); }
.ag-rolefilter a.on { background: var(--primary-soft); color: var(--active-text); }
.ag-rolefilter a span { font-weight: 700; opacity: .7; }

/* 명단 — 사진이 있어야 누구인지 바로 알아본다 */
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.ag-card {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px; border: 1px solid var(--border); border-left: 3px solid var(--primary);
    border-radius: var(--radius); background: var(--card-bg);
}
.ag-card.chair { border-left-color: var(--warning); }

.ag-photo {
    flex: none; width: 62px; height: 78px; border-radius: 8px; overflow: hidden;
    background: var(--bg); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
}
.ag-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-photo .none { font-size: 10.5px; line-height: 1.35; text-align: center; color: var(--txt-faint); }
.ag-photo.big { width: 130px; height: 164px; }

.ag-info { flex: 1; min-width: 0; }
.ag-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ag-top .nm  { font-size: 15px; font-weight: 700; }
.ag-top .pos { font-size: 12px; color: var(--txt-muted); }
.ag-info .org   { margin-top: 2px; font-size: 12.5px; color: var(--txt-muted); }
.ag-info .topic {
    margin-top: 6px; padding: 5px 9px; border-radius: 7px;
    background: var(--primary-soft); color: var(--active-text);
    font-size: 12.5px; font-weight: 600; line-height: 1.5; word-break: keep-all;
}
.ag-info .contact { margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.ag-info .contact a { font-size: 12px; color: var(--txt-muted); text-decoration: none; border-bottom: 1px dotted #C9C7D2; }
.ag-info .contact a:hover { color: var(--active-text); }
.ag-info .memo { margin-top: 6px; font-size: 12px; color: var(--txt-faint); line-height: 1.5; }
.ag-act { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ag-qaform { margin: 0; }

/* 개별질문 스위치 (038) — 켜진 사람만 공개 사이트 질문 대상이 된다 */
.ag-qatgl {
    display: inline-flex; align-items: center; gap: 6px; width: 100%;
    padding: 4px 8px 4px 5px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--card-bg); color: var(--txt-faint);
    font-family: inherit; font-size: 11px; font-weight: 700; white-space: nowrap;
    cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.ag-qatgl i {
    position: relative; flex: none; width: 26px; height: 15px; border-radius: 999px;
    background: #D3D7E2; transition: background .15s;
}
.ag-qatgl i::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(20, 25, 40, .3);
    transition: left .15s;
}
.ag-qatgl:hover { border-color: var(--primary); }
.ag-qatgl.on { background: var(--primary-soft); border-color: var(--primary); color: var(--active-text); }
.ag-qatgl.on i { background: var(--primary); }
.ag-qatgl.on i::after { left: 13px; }

/* 개별질문 안내 바 — 명단 위, 전체 켜기/끄기 */
.ag-qabar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 11px 14px; margin-bottom: 14px;
    background: var(--primary-soft); border: 1px solid #DCE3F2; border-radius: var(--radius);
}
.ag-qabar-txt { flex: 1; min-width: 240px; font-size: 12.5px; line-height: 1.65; color: var(--txt-muted); }
.ag-qabar-txt strong { display: block; font-size: 13px; color: var(--deep); }
.ag-qabar-txt b { color: var(--active-text); }
.ag-qabar-act { display: flex; gap: 6px; flex: none; }

/* 진행표 — 셀 안 입력칸은 표 밖 폼과 form= 속성으로 연결된다 */
#items table td { padding: 7px 8px; }
#items table td .form-control { padding: 6px 9px; font-size: 13px; }

/* 일차 탭 (039) — 구분 필터와 같은 생김새, 맨 끝 ＋ 는 점선으로 "아직 없는 것"임을 보인다 */
.ag-days { flex-wrap: wrap; }
.ag-days a.add { color: var(--txt-faint); border: 1px dashed var(--border); padding-top: 3px; padding-bottom: 3px; }
.ag-days a.add:hover { color: var(--active-text); border-color: var(--primary); background: var(--card-bg); }
.ag-dayhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ag-dayhead strong { font-size: 15px; color: var(--deep); }
.ag-dayhead span   { font-size: 12.5px; color: var(--txt-muted); }
.ag-dayhead em     { font-size: 12px; font-style: normal; color: var(--active-text); }

@media (max-width: 720px) {
    .ag-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── 영수증 관리 (admin/receipt/index.php) ──────────────── */
.rc-ok   { margin-top: 8px; font-size: 12px; font-weight: 600; color: #4E8A6C; }
.rc-warn { margin-top: 8px; font-size: 12px; font-weight: 600; color: #B05F57; }

/* 참가자 한 줄 = 그 사람이 낸 영수증 전부 */
.rc-person { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.rc-person:last-of-type { border-bottom: none; }
.rc-who { flex: 0 0 150px; min-width: 0; }
.rc-who .n   { font-size: 14.5px; font-weight: 700; }
.rc-who .o   { margin-top: 1px; font-size: 12px; color: var(--txt-muted); }
.rc-who .sum { margin-top: 5px; font-size: 14px; font-weight: 800; color: var(--active-text); font-variant-numeric: tabular-nums; }

/* 오른쪽 — 교통비 먼저, 그다음 기타 */
.rc-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.rc-grp { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.rc-grp .lbl { flex: 0 0 46px; padding-top: 6px; font-size: 11.5px; font-weight: 800; color: var(--txt-muted); }
.rc-grp.tr .lbl { color: var(--active-text); }
.rc-one { display: flex; flex-direction: column; gap: 3px; }

/* 영수증 썸네일 카드 */
.rc-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--card-bg); font-family: inherit; cursor: pointer;
    transition: border-color .12s, box-shadow .12s;
}
.rc-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.rc-chip.st9 { opacity: .55; }
.rc-chip .th {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 7px; overflow: hidden;
    border: 1px solid var(--border); display: block; line-height: 0; background: var(--bg);
}
.rc-chip .th img { width: 100%; height: 100%; object-fit: cover; }
.rc-chip .th .doc {
    display: flex; width: 100%; height: 100%; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 700; color: var(--txt-muted);
}
.rc-chip .b { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.rc-chip .a { font-size: 13px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; }
.rc-chip .s { max-width: 11em; font-size: 11px; color: var(--txt-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.trip { padding-left: 4px; font-size: 11.5px; color: var(--txt-muted); line-height: 1.45; }
.trip b { color: var(--txt); font-weight: 700; }
/* 청구액이 예상 요금과 30% 이상 벌어진 건 — 확인이 필요하다는 표시 */
.trip .gap { margin-left: 4px; padding: 1px 5px; border-radius: 5px; background: var(--danger-soft); color: #B05F57; font-weight: 700; }

/* 영수증 모달 — 왼쪽 사진, 오른쪽 입력 */
.rc-modal-wrap { display: none; position: fixed; inset: 0; z-index: 900; }
.rc-modal-wrap.open { display: block; }
.rc-modal-back { position: absolute; inset: 0; background: rgba(30, 30, 40, .45); }
.rc-modal {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 880px; max-width: calc(100% - 24px); max-height: calc(100% - 40px);
    display: flex; flex-direction: column;
    background: var(--card-bg); border-radius: 14px; overflow: hidden;
    box-shadow: 0 20px 56px rgba(30, 30, 40, .28);
}
.rc-modal-head {
    flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 12px 14px 18px; border-bottom: 1px solid var(--border);
}
.rc-modal-x { width: 34px; height: 34px; border: none; background: none; font-size: 22px; line-height: 1; color: var(--txt-muted); cursor: pointer; }
.rc-modal-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; gap: 16px; align-items: flex-start; padding: 18px; }
.rc-pic { flex: 0 0 320px; }
.rc-pic img { display: block; width: 100%; border: 1px solid var(--border); border-radius: 10px; }
.rc-noimg { padding: 40px 12px; text-align: center; font-size: 12.5px; color: var(--txt-muted); background: var(--bg); border-radius: 10px; line-height: 1.6; }
.rc-form { flex: 1; min-width: 0; }
.rc-meta { margin-bottom: 12px; font-size: 12.5px; color: var(--txt-muted); line-height: 1.55; }
.rc-ocr { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #DCE3F2; border-radius: 10px; background: var(--primary-soft); }
.rc-ocr-h { margin-bottom: 8px; font-size: 12px; font-weight: 800; color: var(--active-text); }

@media (max-width: 820px) {
    .rc-person { flex-direction: column; gap: 8px; }
    .rc-modal-body { flex-direction: column; }
    .rc-pic { flex: none; width: 100%; }
}

/* ── 이벤트 목록 · 행사일 (events/list.php) ─────────────── */
td.ev-date {
    white-space: nowrap;
    font-size: 17px; font-weight: 700; letter-spacing: -0.3px;
    color: var(--deep); font-variant-numeric: tabular-nums;
}
td.ev-date .y { font-size: 14px; font-weight: 600; color: var(--txt-faint); }   /* 연도는 한 톤 낮게 */
td.ev-date.none { font-size: 13px; font-weight: 500; color: var(--txt-faint); letter-spacing: 0; }

/* ── QR 코드 디자인 선택 (페이지 관리 · site/main.php) ──── */
.qr-style-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 88px; padding: 9px 6px 8px;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.qr-style-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.qr-style-btn.is-on {
    border-color: var(--primary); background: var(--primary-soft);
    box-shadow: 0 0 0 2px var(--primary-soft);
}
.qr-style-btn .qr-thumb {
    display: block; width: 60px; height: 60px;
    background: #fff; border-radius: 6px; overflow: hidden;
}
.qr-style-btn .qr-thumb svg { display: block; width: 100%; height: 100%; }
.qr-style-btn .qr-name {
    font-size: 11.5px; font-weight: 500; color: var(--txt-muted);
    line-height: 1.2; text-align: center; word-break: keep-all;
}
.qr-style-btn.is-on .qr-name { color: var(--active-text); font-weight: 600; }
#qrPreview svg { display: block; width: 100%; height: 100%; }

/* ── 반응형 ───────────────────────────────────────────── */
@media (max-width: 860px) {
    .sidebar {
        box-shadow: var(--shadow-md);
    }
}
@media (max-width: 720px) {
    .content { padding: 16px 14px 32px; }
    .topbar { padding: 0 14px; }
    th, td { padding: 9px 11px; }
    th:first-child, td:first-child { padding-left: 14px; }
    th:last-child,  td:last-child  { padding-right: 14px; }
}
