/* ══════════════════════════════════
   카비서 웹 통합 - 모바일 최적화 CSS
   ══════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

/* ──────── 앱 헤더 ──────── */
.app-header {
    background: #fee500;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #3c1e1e;
    text-decoration: none;
}

/* ──────── 앱 메인 ──────── */
.app-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 80px;
}

/* ──────── 하단 네비게이션 ──────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    border-top: 1px solid #e5e5e5;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}
/* 채팅 페이지에서는 하단 네비 숨김 (사이드바 사용) */
.chat-page .bottom-nav { display: none; }
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    text-decoration: none;
    color: #999;
    font-size: 11px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.nav-item.active { color: #3c1e1e; }
.nav-icon { font-size: 20px; margin-bottom: 2px; }
.nav-label { font-weight: 500; }

/* ──────── 페이지 공통 ──────── */
.page-content { padding-top: 8px; }
.page-title {
    font-size: 22px;
    text-align: center;
    margin-bottom: 4px;
}
.page-subtitle {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* ──────── 플래시 메시지 ──────── */
.flash-messages { margin-bottom: 16px; }
.flash {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}

/* ──────── 버튼 ──────── */
.btn {
    display: inline-block;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { opacity: 0.7; }
.btn-primary { background: #fee500; color: #3c1e1e; }
.btn-secondary { background: #3c1e1e; color: #fff; }
.btn-outline { background: #fff; color: #333; border: 2px solid #ddd; }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-danger { background: #e74c3c; color: #fff; }

/* 검수 페이지 */
.review-actions { margin-top: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.reject-reason-input { padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; width: 240px; }
.capture-link { color: #4a90d9; text-decoration: underline; font-weight: 600; }

/* 반려 표시 (업로드 카드) */
.item-card.rejected { border-left: 4px solid #e74c3c; }
.item-reject-notice {
    color: #e74c3c; font-size: 13px; font-weight: 600;
    margin-top: 4px; padding: 4px 8px; background: #fce4ec; border-radius: 6px;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    border-radius: 16px;
    width: 100%;
}
.menu-buttons { display: flex; flex-direction: column; gap: 16px; }
.btn-icon { font-size: 36px; margin-bottom: 8px; }
.btn-text { font-size: 18px; font-weight: 700; }
.btn-desc { font-size: 13px; opacity: 0.7; margin-top: 4px; }

/* ──────── 폼 ──────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    -webkit-appearance: none;
}
.form-group input:focus { border-color: #fee500; }

/* ──────── 검색 ──────── */
.search-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.search-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    -webkit-appearance: none;
}
.search-input:focus { border-color: #fee500; }

/* ──────── 로그인 ──────── */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
}
.login-logo {
    text-align: center;
    margin-bottom: 40px;
}
.logo-icon {
    width: 80px;
    height: 80px;
    background: #fee500;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
    color: #3c1e1e;
    margin: 0 auto 12px;
}
.login-subtitle { color: #888; font-size: 14px; margin-top: 4px; }
.login-form-wrap { width: 100%; }
.login-warning {
    background: #fff3e0;
    color: #e65100;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.4;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }

/* ──────── 채팅 페이지 ──────── */

.chat-header {
    background: #fee500;
    padding: 12px 16px;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.chat-header-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-profile { display: flex; align-items: center; gap: 10px; }
.profile-avatar {
    width: 36px;
    height: 36px;
    background: #3c1e1e;
    color: #fee500;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
}
.profile-name { font-weight: 700; font-size: 16px; color: #3c1e1e; }
.profile-status { font-size: 12px; color: #666; display: block; }
.menu-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #3c1e1e;
    padding: 4px;
}

/* ──────── 사이드바 ──────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.sidebar-overlay.open { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed;
    top: 0;
    right: -260px;
    bottom: 0;
    width: 260px;
    background: #fff;
    z-index: 201;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px rgba(0,0,0,0.12);
    transition: right 0.25s ease;
}
.sidebar.open { right: 0; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.sidebar-title { font-size: 18px; font-weight: 700; color: #3c1e1e; }
.sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    transition: background 0.15s;
}
.sidebar-item:hover, .sidebar-item:active { background: #f5f5f5; }
.sidebar-item.active { color: #3c1e1e; font-weight: 700; background: #fff8e1; }
.sidebar-icon { font-size: 20px; width: 28px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
}
.sidebar-logout {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: background 0.15s;
}
.sidebar-logout:active { background: #eee; }

/* 채팅 컨테이너 */
.chat-container, .chat-body {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}
.chat-messages { padding: 16px; }

/* 채팅 버블 */
.chat-bubble {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-end;
    gap: 6px;
}
.chat-bubble.bot { flex-direction: row; }
.chat-bubble.user { flex-direction: row-reverse; }

.bubble-avatar {
    width: 32px;
    height: 32px;
    background: #3c1e1e;
    color: #fee500;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    align-self: flex-start;
}

.bubble-content {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.chat-bubble.bot .bubble-content {
    background: #fff;
    color: #333;
    border-top-left-radius: 4px;
}
.chat-bubble.user .bubble-content {
    background: #fee500;
    color: #3c1e1e;
    border-top-right-radius: 4px;
}

.bubble-time {
    font-size: 11px;
    color: rgba(0,0,0,0.4);
    flex-shrink: 0;
    align-self: flex-end;
}

.typing-indicator {
    display: none;
    padding: 10px 14px;
    background: #fff;
    border-radius: 16px;
    border-top-left-radius: 4px;
    max-width: 80px;
    margin-left: 38px;
}
.typing-indicator.show { display: block; }
.typing-dots {
    display: flex;
    gap: 4px;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* 채팅 입력 */
.chat-input-area {
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 6px 16px;
}
.chat-input-wrap {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.chat-input-wrap textarea {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    -webkit-appearance: none;
    resize: none;
    overflow-y: hidden;
    min-height: 42px;
    max-height: 84px;
    line-height: 1.4;
    font-family: inherit;
}
.chat-input-wrap textarea.scrollable {
    overflow-y: auto;
}
.chat-input-wrap textarea:focus { border-color: #fee500; }
.send-btn {
    width: 44px;
    height: 44px;
    background: #fee500;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #3c1e1e;
    -webkit-tap-highlight-color: transparent;
}
.send-btn:active { opacity: 0.7; }

/* ──────── 상태 카드 ──────── */
.section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 12px;
    color: #555;
}
.status-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.status-card.completed { opacity: 0.7; }
.status-card.rejected { border-left: 4px solid #e74c3c; }
.reject-notice span { color: #e74c3c; font-weight: 600; }
.reject-notice .label { color: #e74c3c; }
.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.product-name { font-size: 16px; font-weight: 700; }
.status-badge { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.yellow { background: #ffc107; }
.status-dot.blue { background: #2196f3; }
.status-dot.orange { background: #ff9800; }
.status-dot.green { background: #4caf50; }
.status-dot.done { background: #4caf50; }
.status-dot.cancel { background: #f44336; }
.status-card-body { font-size: 13px; color: #666; }
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}
.info-row .label { color: #999; }

/* ──────── 입금현황 ──────── */
.payment-section { margin-bottom: 24px; }
.section-title.payment-done { color: #4caf50; }
.section-title.payment-pending { color: #ff9800; }
.section-title.payment-no-review { color: #f44336; }
.payment-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    align-items: center;
}
.payment-product { font-weight: 600; }
.payment-id { color: #888; }
.payment-amount { color: #4caf50; font-weight: 600; }
.payment-date { color: #888; font-size: 12px; }

/* ──────── 업로드 ──────── */
.item-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.item-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, opacity 0.3s;
}
.item-card.uploading {
    box-shadow: 0 0 0 2px #fee500, 0 2px 8px rgba(254,229,0,0.3);
}
.item-info { margin-bottom: 12px; }
.item-product { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.item-detail { font-size: 13px; color: #666; margin-bottom: 2px; }
.file-input { display: none; }
.upload-controls { position: relative; }
.upload-result { margin-top: 8px; }
.result-success { color: #2e7d32; font-size: 14px; font-weight: 600; }
.result-fail { color: #d32f2f; font-size: 13px; }
.item-card.uploaded {
    opacity: 0.6;
    border-left: 3px solid #4caf50;
}

/* File select area */
.file-select-area { }
.file-select-label { cursor: pointer; display: inline-block; }
.file-select-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    line-height: 24px;
    transition: background 0.15s;
}
.file-select-label:active .file-select-btn { background: #e0e0e0; }

/* File selected indicator */
.file-selected-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 10px;
}
.file-selected-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2e7d32;
}
.file-selected-check { font-size: 16px; }
.file-selected-actions {
    display: flex;
    gap: 6px;
}
.file-action-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.file-action-btn:active { background: #f0f0f0; }
.file-action-change { color: #1976d2; border-color: #90caf9; }
.file-action-change:active { background: #e3f2fd; }
.file-action-remove { color: #d32f2f; border-color: #ef9a9a; }
.file-action-remove:active { background: #ffebee; }

/* ──────── Sticky top bar ──────── */
.upload-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    padding: 12px 16px;
    margin: 0 -16px 16px -16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 12px 12px;
}
.sticky-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #333;
}
.sticky-icon { font-size: 20px; }
.sticky-label { font-weight: 500; }
.sticky-label strong { color: #3c1e1e; font-size: 18px; }

.sticky-submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: #ccc;
    color: #888;
    transition: all 0.2s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.sticky-submit-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
}
.sticky-submit-btn.active {
    background: #fee500;
    color: #3c1e1e;
}
.sticky-submit-btn.active:active { opacity: 0.8; }

/* ──────── Batch progress overlay ──────── */
.batch-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.batch-overlay-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.batch-overlay-title {
    font-size: 18px;
    font-weight: 700;
    color: #3c1e1e;
    margin-bottom: 20px;
}
.progress-bar-wrap { margin-bottom: 12px; }
.progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fee500, #4caf50);
    border-radius: 5px;
    width: 0;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

/* ──────── Confirmation modal ──────── */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 310;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.confirm-dialog {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 20px;
    width: 100%;
    max-width: 340px;
    text-align: center;
}
.confirm-message {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.confirm-btn {
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    min-height: 48px;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.confirm-btn:active { opacity: 0.7; }
.confirm-btn-submit {
    background: #fee500;
    color: #3c1e1e;
}
.confirm-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

/* ──────── 성공 페이지 ──────── */
.success-page { text-align: center; padding: 40px 0; }
.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-message { font-size: 16px; color: #666; margin-bottom: 32px; }
.success-actions { display: flex; flex-direction: column; gap: 12px; }

/* ──────── 빈 상태 ──────── */
.empty-state { text-align: center; padding: 40px 20px; color: #888; }
.empty-state p { margin-bottom: 12px; }

.back-link {
    display: block;
    text-align: center;
    color: #888;
    text-decoration: none;
    font-size: 14px;
    margin-top: 20px;
    padding: 8px;
}

/* ══════════════════════════════════
   관리자 페이지
   ══════════════════════════════════ */

.admin-body { background: #f8f9fa; }

.admin-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.admin-login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}
.admin-login-box h1 {
    margin-bottom: 24px;
    font-size: 24px;
}

.admin-header {
    background: #3c1e1e;
    color: #fff;
    padding: 0 20px;
}
.admin-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}
.admin-logo {
    font-size: 18px;
    font-weight: 700;
    color: #fee500;
    text-decoration: none;
}
.admin-nav { display: flex; gap: 4px; }
.admin-nav a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}
.admin-nav a:hover, .admin-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}
.admin-main h1 { font-size: 24px; margin-bottom: 20px; }
.admin-main h2 { font-size: 18px; margin: 24px 0 12px; }

.admin-search {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.admin-search input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.admin-search input:focus { border-color: #fee500; }

.admin-empty {
    color: #888;
    text-align: center;
    padding: 40px;
}

/* 통계 카드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-number { font-size: 32px; font-weight: 800; color: #3c1e1e; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }

/* 최근 메시지 */
.recent-messages { display: flex; flex-direction: column; gap: 4px; }
.recent-msg {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    align-items: center;
}
.msg-reviewer { font-weight: 600; min-width: 120px; }
.msg-sender {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 36px;
    text-align: center;
}
.msg-sender.bot { background: #e3f2fd; color: #1565c0; }
.msg-sender.user { background: #fff8e1; color: #f57f17; }
.msg-text { color: #666; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 관리자 테이블 */
.admin-table-wrap { overflow-x: auto; margin-bottom: 20px; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}
.admin-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #e8f5e9;
    color: #2e7d32;
}

/* 대화 뷰어 */
.chat-viewer-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    min-height: 400px;
}
.reviewer-list-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
    max-height: 600px;
}
.reviewer-list-panel h3 { font-size: 14px; margin-bottom: 12px; }
.reviewer-list-item {
    display: block;
    padding: 8px 10px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 2px;
}
.reviewer-list-item:hover { background: #f5f5f5; }
.reviewer-list-item.active { background: #fee500; font-weight: 600; }

.chat-view-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
    max-height: 600px;
}
.chat-view-panel h3 { font-size: 14px; margin-bottom: 12px; }

.admin-chat-messages { display: flex; flex-direction: column; gap: 8px; }
.admin-chat-msg { display: flex; flex-direction: column; }
.admin-chat-msg.bot { align-items: flex-start; }
.admin-chat-msg.user { align-items: flex-end; }
.admin-chat-msg .msg-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}
.admin-chat-msg.bot .msg-bubble {
    background: #f0f0f0;
    border-top-left-radius: 4px;
}
.admin-chat-msg.user .msg-bubble {
    background: #fee500;
    border-top-right-radius: 4px;
}
.msg-meta { font-size: 11px; color: #999; margin-top: 2px; }
.rate-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    opacity: 0.5;
}
.rate-btn:hover { opacity: 1; }

/* ──────── 퀵 버튼 ──────── */
.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    margin-left: 38px;
}
.quick-btn {
    padding: 10px 16px;
    background: #fff;
    border: 1.5px solid #fee500;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #3c1e1e;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
}
.quick-btn:active {
    background: #fee500;
    transform: scale(0.96);
}

.chat-action-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #4a90d9;
    color: #fff !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
}
.chat-action-btn:active {
    background: #357abd;
}

/* ──────── 인라인 버튼 (서버 전송) ──────── */
.inline-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.inline-buttons.disabled { opacity: 0.5; pointer-events: none; }
.inline-btn {
    padding: 10px 18px;
    background: #fff;
    border: 1.5px solid #fee500;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #3c1e1e;
    cursor: pointer;
    transition: all 0.15s;
}
.inline-btn:active { background: #fee500; transform: scale(0.96); }
.inline-btn:disabled { opacity: 0.5; cursor: default; }
.inline-btn-danger {
    border-color: #e74c3c;
    color: #e74c3c;
}
.inline-btn-danger:active { background: #fce4e4; }
.inline-btn-secondary {
    border-color: #ccc;
    color: #888;
}
.inline-btn-secondary:active { background: #f0f0f0; }

/* ──────── 캠페인 카드 (아코디언) ──────── */
.campaign-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
    margin-left: 38px;
    max-width: calc(100% - 38px);
}
.campaign-cards.disabled { opacity: 0.5; pointer-events: none; }
.campaign-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.campaign-card.campaign-card-expanded {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    border-color: #fee500;
}

/* 헤더 (항상 표시, 클릭으로 토글) */
.campaign-card-header.campaign-card-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.campaign-card-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.campaign-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #3c1e1e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.campaign-remain-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #6366f1;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.campaign-card-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: 8px;
}
.campaign-card-expanded .campaign-card-arrow {
    transform: rotate(180deg);
}

.campaign-urgent {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #e74c3c;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.campaign-closed {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #888;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 상세 영역 (접힘/펼침) */
.campaign-card-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
}
.campaign-card-expanded .campaign-card-detail {
    max-height: 500px;
    padding: 0 16px 14px;
}

.campaign-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}
.campaign-card-row {
    font-size: 13px;
    color: #555;
}
.campaign-card-row.remaining { font-weight: 600; color: #333; }
.campaign-card-row.remaining.urgent { color: #e74c3c; }
.campaign-card-icon { margin-right: 4px; }

/* 내 진행 이력 */
.campaign-card-history {
    border-top: 1px solid #eee;
    padding-top: 8px;
    margin-top: 8px;
    font-size: 13px;
}
.campaign-card-history-title {
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}
.campaign-card-history-item {
    color: #666;
    padding-left: 8px;
}

/* 신청 버튼 */
.campaign-card-btn-disabled {
    background: #ccc !important;
    color: #888 !important;
    cursor: not-allowed;
}
.campaign-card-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #fee500;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #3c1e1e;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}
.campaign-card-btn:active { background: #f5d800; transform: scale(0.98); }

/* ──────── 관리자 버튼 ──────── */
.admin-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.admin-btn:hover { background: #f5f5f5; }
.admin-btn-sm { padding: 4px 10px; font-size: 12px; }
.admin-btn-primary {
    background: #3c1e1e;
    color: #fff;
    border-color: #3c1e1e;
}
.admin-btn-primary:hover { background: #5a3030; }

/* ──────── 관리자 폼 ──────── */
.admin-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-subtitle {
    font-size: 14px;
    color: #888;
    margin: -12px 0 20px 0;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #fee500;
}
.form-group-full { grid-column: 1 / -1; }
.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ──────── 관리자 플래시 메시지 ──────── */
.admin-flash {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #2e7d32;
    font-size: 14px;
}

/* ──────── 반응형 ──────── */
@media (max-width: 768px) {
    .admin-nav { flex-wrap: wrap; gap: 2px; }
    .admin-nav a { font-size: 12px; padding: 6px 8px; }
    .chat-viewer-layout {
        grid-template-columns: 1fr;
    }
    .reviewer-list-panel { max-height: 200px; }
    .form-grid { grid-template-columns: 1fr; }
}
