/* 최종관리자(admin) 페이지 공통 모바일 보강 */

/* 모바일 탑바/오버레이 — 기본(데스크톱)은 숨김 */
.admin-topbar { display: none; }
.admin-overlay { display: none; }

/* 줄바꿈 시 한글 어절이 중간에 잘리지 않도록(공백 단위로만 줄바꿈, 긴 문자열은 넘칠 때만 분리).
   word-break·overflow-wrap 은 상속 속성이라 body 한 곳이면 전 텍스트에 적용됨. */
body { word-break: keep-all; overflow-wrap: break-word; }

@media (max-width: 768px) {
    /* ── 모바일 네비게이션: 햄버거 탑바 + 슬라이드 사이드바 ── */
    .admin-topbar {
        display: flex; align-items: center; gap: 12px;
        position: sticky; top: 0; z-index: 250;
        background: var(--admin-side, #2c3e50); color: #fff;
        padding: 11px 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }
    .admin-burger {
        background: rgba(255,255,255,0.12); border: none; color: #fff;
        width: 38px; height: 38px; border-radius: 10px; font-size: 1.05rem; cursor: pointer;
    }
    .admin-topbar-brand { font-weight: 800; font-size: 1.02rem; }
    .admin-topbar-brand b { background: #f39c12; color: #2c3e50; padding: 1px 7px; border-radius: 6px; font-size: 0.68rem; margin-left: 4px; }
    /* 사이드바 — 인라인 display:none 무시하고 화면 밖에서 대기 */
    .sidebar {
        display: block !important; transform: translateX(-100%);
        transition: transform 0.28s ease; z-index: 300 !important;
    }
    .sidebar.open { transform: translateX(0); }
    .admin-overlay {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
        z-index: 290; opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
    }
    .admin-overlay.show { opacity: 1; pointer-events: auto; }


    /* 본문 영역 — 사이드바 숨김 시 전체폭 + 패딩 축소 */
    .main { margin-left: 0 !important; padding: 16px 12px 60px !important; }
    .card, .section, .page-card { border-radius: 16px !important; }
    .card-body { padding: 16px !important; }
    h1, h2, .page-title { font-size: 1.1rem !important; }

    /* ── 카드형 표 (.tbl-card): 각 행을 카드로 (첫 칸=제목, 나머지=라벨:값) ── */
    table.tbl-card { display: block !important; width: 100% !important; }
    table.tbl-card thead { display: none !important; }
    table.tbl-card tbody, table.tbl-card tr, table.tbl-card td { display: block !important; width: 100% !important; }
    table.tbl-card tr {
        border: 1px solid #e8edf3 !important; border-radius: 14px !important;
        padding: 12px 14px !important; margin-bottom: 10px !important;
        background: #fff !important; box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
    }
    table.tbl-card td {
        border: none !important; padding: 6px 0 !important; text-align: left !important;
        word-break: break-word; display: grid !important; grid-template-columns: 92px 1fr;
        gap: 10px; align-items: start; justify-items: start; font-size: 0.86rem !important; white-space: normal !important;
    }
    table.tbl-card td::before { content: attr(data-label); font-weight: 700; color: #94a3b8; font-size: 0.74rem; }
    table.tbl-card td:first-child {
        display: block !important; font-weight: 800; font-size: 1.02rem;
        padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px dashed #eef2f7;
    }
    table.tbl-card td:first-child::before { content: ""; display: none; }
    /* 관리/버튼 칸 — 라벨 숨기고 버튼 줄바꿈 */
    table.tbl-card td[data-label="관리"], table.tbl-card td[data-label=""] {
        display: block !important; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #eef2f7;
    }
    table.tbl-card td[data-label="관리"]::before { content: ""; display: none; }
    table.tbl-card td .btn { margin: 0 6px 6px 0; }
}
