/* ─── 기본 스타일 ──────────────────────────────────────────── */
:root {
    --sidebar-width: 250px;
    --primary-color: #4361ee;
    --primary-light: #eef0ff;
    --success-color: #2ec4b6;
    --warning-color: #ff9f1c;
    --danger-color: #e71d36;
    --dark-color: #2b2d42;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-600: #6c757d;
}

body {
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: #f5f6fa;
    color: #292a2f;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
}

/* ─── 사이드바 ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--dark-color);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 13px;
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
    border-left-color: rgba(255,255,255,0.3);
}

.sidebar .nav-link.active {
    color: white;
    background: rgba(67, 97, 238, 0.2);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 0.5rem;
}

/* ─── 사이드바 그룹 메뉴 ─────────────────────────────────── */
.sidebar-nav {
    padding: 0.5rem 0;
    overflow-y: auto;
    flex: 1;
}

.nav-group {
    margin-bottom: 2px;
}

.nav-group-toggle {
    display: flex !important;
    align-items: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.85) !important;
    padding: 0.6rem 1.5rem !important;
}

.nav-group-toggle:hover {
    color: white !important;
}

.nav-group-toggle.active {
    background: none !important;
    border-left-color: transparent !important;
    color: white !important;
}

.nav-group-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.25s ease;
    width: auto !important;
    margin-right: 0 !important;
}

.nav-group-toggle[aria-expanded="true"] .nav-group-arrow {
    transform: rotate(180deg);
}

.nav-group-items {
    padding: 0 0 0.25rem 0;
}

.nav-group-items .nav-link {
    padding: 0.5rem 1.5rem 0.5rem 2.75rem !important;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.nav-group-items .nav-link i {
    font-size: 0.85rem;
    width: 20px;
}

.nav-group-items .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
    border-left-color: rgba(255,255,255,0.2);
}

.nav-group-items .nav-link.active {
    color: white;
    background: rgba(67, 97, 238, 0.2);
    border-left-color: var(--primary-color);
}

/* ─── 사이드바 푸터 ──────────────────────────────────────── */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

.sidebar-footer .nav-link {
    padding: 0.5rem 0;
    font-size: 13px;
}

.sidebar-quick-links {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-quick-links .nav-link {
    color: rgba(255,255,255,0.85);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
}
.sidebar-quick-links .nav-link i {
    width: 18px;
    text-align: center;
}
.sidebar-quick-links .nav-link:hover,
.sidebar-quick-links .nav-link.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.sidebar-footer .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ─── 사이드바 오버레이 (모바일) ─────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ─── 메인 컨텐츠 ─────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    overflow-x: hidden;       /* 어느 자식도 viewport 밖으로 못 나감 */
    min-width: 0;             /* flex 자식 overflow 방지 */
}

/* 본문 전체 — 모든 페이지 horizontal 안전망 */
.main-content > * { max-width: 100%; }
.main-content .container-fluid { overflow-x: hidden; }
.main-content img, .main-content canvas, .main-content video {
    max-width: 100%; height: auto;
}
.main-content table { max-width: 100%; }

/* html/body — 페이지 전체 horizontal scroll 차단 */
html, body { overflow-x: hidden; max-width: 100vw; }

/* ─── 페이지 제목 일관 — 대시보드 .dash-title 톤에 맞춤 ─── */
/* 38+ 페이지가 사용하는 패턴: <h4 class="mb-0|mb-3"><i class="bi bi-XXX"></i> 제목</h4>
   대시보드와 글꼴·사이즈·아이콘 색상 통일. */
.main-content h4.mb-0,
.main-content h4.mb-3,
.main-content h4.page-title {
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -0.025em !important;
    color: var(--toss-text, #191F28);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.25;
}
.main-content h4.mb-0 > i.bi,
.main-content h4.mb-3 > i.bi,
.main-content h4.page-title > i.bi {
    color: var(--toss-blue, #7C5CFF);
    font-size: 22px;
}
/* h4 안의 텍스트 색 강조 클래스 (text-warning/danger 등) 는 우선순위 유지 */
.main-content h4.mb-0 > .text-warning > i.bi,
.main-content h4.mb-0 > .text-danger > i.bi,
.main-content h4.mb-0 > .text-success > i.bi { color: inherit; }

/* ─── 모바일 상단바 ──────────────────────────────────────── */
.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ─── 카드 스타일 ─────────────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--gray-600);
}

.icon-primary { background: var(--primary-light); color: var(--primary-color); }
.icon-success { background: #e8f8f5; color: var(--success-color); }
.icon-warning { background: #fff8e8; color: var(--warning-color); }
.icon-danger { background: #fde8eb; color: var(--danger-color); }
.icon-info { background: #e8f4fd; color: #3498db; }

/* ─── 테이블 ──────────────────────────────────────────────── */
.table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.table-card .card-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 500;
    font-size: 14px;
    padding: 1rem 1.25rem;
}

.table th {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 13px;
    font-weight: 400;
}

/* responsive table wrapper */
.table-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-mobile > .table {
    margin-bottom: 0;
}

/* ─── 뱃지 ────────────────────────────────────────────────── */
.badge-in {
    background: #d4edda;
    color: #155724;
}

.badge-out {
    background: #f8d7da;
    color: #721c24;
}

.stock-low {
    color: var(--danger-color);
    font-weight: 700;
}

.stock-ok {
    color: var(--success-color);
    font-weight: 600;
}

/* ─── 공용 상태 뱃지 ─────────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 0.3em 0.65em;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    line-height: 1;
    white-space: nowrap;
}

.badge-status-pending   { background: #fff3cd; color: #856404; }
.badge-status-confirmed { background: #cce5ff; color: #004085; }
.badge-status-shipping  { background: #d4edda; color: #155724; }
.badge-status-delivered  { background: #d1ecf1; color: #0c5460; }
.badge-status-cancelled { background: #f8d7da; color: #721c24; }
.badge-status-success   { background: #d4edda; color: #155724; }
.badge-status-warning   { background: #fff3cd; color: #856404; }
.badge-status-danger    { background: #f8d7da; color: #721c24; }
.badge-status-info      { background: #d1ecf1; color: #0c5460; }

/* ─── 썸네일 유틸 ─────────────────────────────────────────── */
.thumb-sm {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--gray-200);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.thumb-md {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--gray-200);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

/* ─── 폼 ──────────────────────────────────────────────────── */
.form-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--dark-color);
}

/* ─── 로그인 ──────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1a2e 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card .card-body {
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-weight: 700;
    color: var(--primary-color);
}

/* ─── 바코드 스캐너 ───────────────────────────────────────── */
.scanner-area {
    border: 2px dashed var(--gray-200);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: var(--gray-100);
}

/* ─── 차트 영역 ───────────────────────────────────────────── */
.chart-container {
    position: relative;
    height: 300px;
}

/* ─── 이미지 업로드 ───────────────────────────────────────── */
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: #f0f2ff;
}

/* ─── 유틸리티 ───────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }

/* ─── 반응형: 태블릿 (768px - 991px) ─────────────────────── */
@media (min-width: 768px) and (max-width: 991.98px) {
    :root {
        --sidebar-width: 220px;
    }

    .sidebar .nav-link {
        padding: 0.6rem 1.25rem;
        font-size: 12.5px;
    }

    .nav-group-items .nav-link {
        padding: 0.4rem 1.25rem 0.4rem 2.5rem !important;
        font-size: 12.5px;
    }

    .main-content .container-fluid {
        padding: 1rem !important;
    }

    .stat-card .card-body {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }
}

/* ─── 반응형: 모바일 (< 768px) ───────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .main-content .container-fluid {
        padding: 1rem !important;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    .stat-card .card-body {
        padding: 1rem;
    }

    /* card spacing */
    .card {
        margin-bottom: 0.75rem;
    }

    .card .card-body {
        padding: 1rem;
    }

    .card .card-header {
        padding: 0.75rem 1rem;
    }

    /* table on mobile - 가독성 향상 */
    .table th,
    .table td {
        padding: 0.6rem 0.55rem;
        font-size: 13px;
    }

    /* hide columns marked for mobile hiding */
    .d-mobile-none {
        display: none !important;
    }

    /* form adjustments - 라벨 가독성 */
    .form-label {
        font-size: 13.5px;
        font-weight: 500;
    }

    /* 버튼: 터치 타겟 44px 보장, 폰트 가독성 */
    .btn {
        font-size: 14px;
        min-height: 44px;
        padding: 0.55rem 1rem;
    }

    /* btn-sm도 모바일에선 충분히 누를 수 있게 */
    .btn-sm {
        min-height: 38px;
        padding: 0.4rem 0.75rem;
        font-size: 13px;
    }

    /* 아이콘 전용 버튼은 정사각형 유지 */
    .btn-icon,
    .btn.btn-icon-only {
        min-width: 44px;
    }

    /* iOS 자동 줌 방지: 입력 필드 폰트 16px 이상 */
    input[type="text"],
    input[type="number"],
    input[type="tel"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="time"],
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    /* 체크박스·라디오 터치 타겟 확대 */
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0.2rem;
    }

    .form-check-label {
        padding-left: 0.25rem;
        line-height: 1.5rem;
    }

    /* 테이블 리사이저: 모바일에선 비활성화 (실수 드래그 방지) */
    .col-resizer,
    .table-col-resizer {
        display: none !important;
    }

    /* 드롭다운: hover 의존 제거, 터치 친화 */
    .dropdown-menu {
        font-size: 14px;
    }

    .dropdown-item {
        padding: 0.65rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* 모달: 모바일 화면에 꽉 차게 */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-fullscreen-sm-down {
        margin: 0;
        max-width: 100vw;
        height: 100vh;
    }

    /* 페이지네이션 터치 친화 */
    .page-link {
        min-height: 40px;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ─── 반응형: 소형 모바일 (< 576px) ──────────────────────── */
@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }

    .main-content .container-fluid {
        padding: 0.75rem !important;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .stat-card .stat-label {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.45rem;
        font-size: 12.5px;
    }

    h1, .h1 { font-size: 1.4rem; }
    h2, .h2 { font-size: 1.2rem; }
    h3, .h3 { font-size: 1.05rem; }

    .chart-container {
        height: 220px;
    }

    /* 버튼 그룹·필터바: 좁은 화면에선 100% 너비 활용 */
    .btn-group-mobile-block .btn {
        flex: 1 1 auto;
    }
}

/* ─── 모바일 전용 유틸리티 (전 화면대 적용) ──────────────── */

/* iOS Notch / Dynamic Island 대응 */
.safe-area-top {
    padding-top: max(1rem, env(safe-area-inset-top));
}

.safe-area-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.mobile-topbar {
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

/* 모바일 sticky 하단 액션바 (주문 버튼 등 핵심 CTA용) */
.sticky-mobile-bottom {
    display: none;
}

@media (max-width: 767.98px) {
    .sticky-mobile-bottom {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--gray-200);
        padding: 0.75rem 1rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        z-index: 1030;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
        gap: 0.5rem;
        align-items: center;
    }

    .sticky-mobile-bottom .btn {
        flex: 1;
    }

    /* sticky 액션바가 있을 때 본문 하단 여백 추가 */
    body.has-sticky-bottom {
        padding-bottom: 80px;
    }
}

/* 모바일 카드뷰 — 테이블 대신 사용할 패턴 */
.mobile-card-list {
    display: none;
}

.desktop-table {
    display: block;
}

@media (max-width: 767.98px) {
    .mobile-card-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .desktop-table.hide-on-mobile {
        display: none;
    }

    .mobile-card-item {
        background: white;
        border: 1px solid var(--gray-200);
        border-radius: 0.5rem;
        padding: 0.85rem 1rem;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    .mobile-card-item-title {
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 0.35rem;
        color: var(--dark-color);
    }

    .mobile-card-item-meta {
        font-size: 12.5px;
        color: var(--gray-600);
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 0.85rem;
        margin-bottom: 0.35rem;
    }

    .mobile-card-item-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
        flex-wrap: wrap;
    }

    .mobile-card-item-actions .btn {
        min-height: 38px;
        padding: 0.4rem 0.75rem;
        font-size: 13px;
        flex: 1;
    }
}

/* 검색·필터 입력 영역: 모바일에서 한 손 사용 친화 */
@media (max-width: 767.98px) {
    .filter-bar-mobile {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--gray-100);
        padding: 0.5rem;
        margin: -1rem -1rem 1rem;
        border-bottom: 1px solid var(--gray-200);
    }

    .filter-bar-mobile .form-control,
    .filter-bar-mobile .form-select {
        font-size: 16px !important;
    }
}

/* hover 효과 제거: 터치 디바이스 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .nav-link:hover,
    .dropdown-item:hover {
        /* hover 상태를 active 상태로 단축 */
        transition: none;
    }
}

/* ─── 관리자 화면 글로벌 모바일 헬퍼 ──────────────────────── */
@media (max-width: 767.98px) {
    /* 페이지 상단 액션 행 (h4 + 버튼들) — 자동 줄바꿈 + 간격 */
    .page-header,
    .page-actions {
        flex-wrap: wrap !important;
        gap: 0.5rem;
    }

    /* 다컬럼 정보 그리드 — 모바일에서 항상 풀폭 */
    .info-grid .col-md-3,
    .info-grid .col-md-4,
    .info-grid .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* 합계 표(.summary-table) 행 정렬 — 라벨/값 좌우 배치 자동 */
    .summary-table td {
        font-size: 13.5px;
    }

    /* 일반 테이블 가로 스크롤 보장 (감싼 .table-responsive 없는 경우 대비) */
    table:not(.responsive-cards) {
        font-size: 13px;
    }

    /* ─── responsive-cards: 테이블을 모바일에서 카드로 변환 ─── */
    /* 사용법: <table class="table responsive-cards">
              <td data-label="주문번호">CO-...</td>
       데스크톱은 일반 테이블, 모바일은 카드 한 행씩. */
    table.responsive-cards { display: block; width: 100%; }
    table.responsive-cards thead { display: none; }
    table.responsive-cards tbody { display: block; width: 100%; }
    table.responsive-cards tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 0.6rem;
        margin-bottom: 0.75rem;
        background: #fff;
        padding: 0.85rem 1rem;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }
    table.responsive-cards tr:hover { background: #fff !important; }
    table.responsive-cards td {
        display: block;
        padding: 0.35rem 0;
        border: none !important;
        text-align: left !important;
        white-space: normal !important;
        font-size: 13.5px;
    }
    table.responsive-cards td[data-label]::before {
        content: attr(data-label);
        display: inline-block;
        font-weight: 600;
        color: #6c757d;
        margin-right: 0.5rem;
        min-width: 70px;
        font-size: 12px;
    }
    /* 강조 셀: 카드의 첫 td를 헤더처럼 노출 */
    table.responsive-cards td.cell-primary {
        font-size: 15px;
        font-weight: 700;
        color: #1f2937;
        border-bottom: 1px dashed #f0f0f0 !important;
        margin-bottom: 0.35rem;
        padding-bottom: 0.5rem;
    }
    table.responsive-cards td.cell-primary::before { display: none; }
    /* 액션 셀: 우측 정렬 + 버튼 그룹 wrap */
    table.responsive-cards td.cell-actions {
        text-align: right !important;
        padding-top: 0.5rem;
        border-top: 1px dashed #f0f0f0 !important;
        margin-top: 0.35rem;
    }
    table.responsive-cards td.cell-actions::before { display: none; }
    table.responsive-cards td.cell-actions .btn {
        min-height: 36px;
        font-size: 13px;
        padding: 0.35rem 0.7rem;
    }
    /* 빈 상태(td colspan=N) — 카드 안에서 텍스트 가운데 */
    table.responsive-cards td[colspan] {
        text-align: center !important;
        padding: 1rem 0 !important;
    }

    /* 다컬럼 폼 row — 모바일에서 항상 풀폭 분기 (.form-row-mobile-stack) */
    .form-row-mobile-stack > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* 페이지별 sticky 액션 바 (저장·확정 등) */
    .page-action-bar {
        position: sticky;
        bottom: 0; left: 0; right: 0;
        background: white;
        padding: 0.75rem 1rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        border-top: 1px solid #e5e7eb;
        z-index: 100;
        margin: 1rem -1rem 0;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
        display: flex;
        gap: 0.5rem;
    }
    .page-action-bar .btn { flex: 1; }
}

/* ─── 커스텀 배지 색상 ─────────────────────────────────────── */
.badge.bg-purple {
    background-color: #7c3aed !important;
    color: #fff !important;
}

