/* ============================================
   스마트상점 신청관리 시스템 — 라이트 테마
   ============================================ */

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --secondary: #64748B;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --orange: #F97316;

  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --text: #0F172A;
  --text-muted: #64748B;
  --text-sm: 0.8125rem;

  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', -apple-system, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 로그인 ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e3a5f 0%, #2563EB 100%); }
.login-wrap { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; box-shadow: 0 20px 40px rgba(0,0,0,.2); }
.login-logo { text-align: center; margin-bottom: 12px; }
.login-title { font-size: 1.5rem; font-weight: 700; text-align: center; color: var(--text); line-height: 1.4; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin: 8px 0 24px; }
.login-form .form-group { margin-bottom: 16px; }
.login-notice { margin-top: 24px; text-align: center; font-size: 0.75rem; color: #94A3B8; line-height: 1.6; }

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

/* 사이드바 */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  box-shadow: var(--shadow);
}
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.sidebar-brand { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.brand-sub { font-size: 0.7rem; color: var(--text-muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.875rem; transition: all .15s; margin-bottom: 2px; }
.nav-item:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 4px; }
.nav-section { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; padding: 4px 12px; letter-spacing: .05em; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); }
.user-avatar { width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 0.7rem; color: var(--text-muted); }
.logout-btn { color: var(--text-muted); padding: 4px; border-radius: 4px; }
.logout-btn:hover { color: var(--danger); }
.sidebar-logout-full { display: flex; align-items: center; gap: 8px; margin: 0 12px 14px; padding: 9px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; color: var(--danger); background: #FEF2F2; border: 1px solid #FECACA; transition: background .15s; }
.sidebar-logout-full:hover { background: #FEE2E2; }
.topbar-logout-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; color: var(--danger); background: #FEF2F2; border: 1px solid #FECACA; transition: background .15s; white-space: nowrap; }
.topbar-logout-btn:hover { background: #FEE2E2; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }

/* 메인 */
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 14px; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-muted); border-radius: 4px; }
.menu-btn:hover { background: var(--bg); }
.topbar-title { font-weight: 600; font-size: 0.95rem; flex: 1; }
.org-badge { background: var(--primary-light); color: var(--primary); font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.main-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; }

/* ── 카드 ── */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 0.95rem; font-weight: 600; }

/* ── 페이지 헤더 ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.25rem; font-weight: 700; }
.page-title-group { display: flex; align-items: center; gap: 10px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-btn { color: var(--text-muted); display: flex; align-items: center; padding: 4px; border-radius: 4px; }
.back-btn:hover { background: var(--border); }

/* ── 버튼 ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; border: none; cursor: pointer; transition: all .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #475569; color: white; }
.btn-secondary:hover { background: #334155; }
.btn-outline { background: white; color: var(--text); border: 1px solid var(--border-strong); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger-outline { background: white; color: var(--danger); border: 1px solid #FECACA; }
.btn-danger-outline:hover { background: #FEF2F2; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803D; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }
.btn-lg { padding: 10px 22px; font-size: 0.9rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── 폼 ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.req-label { }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--text);
  background: white; transition: border-color .15s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { margin-bottom: 4px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-divider { height: 1px; background: var(--border); margin: 20px 0; }
.form-actions { display: flex; gap: 10px; padding-top: 8px; flex-wrap: wrap; }
.required-note { font-size: 0.75rem; color: var(--text-muted); }
.req { color: var(--danger); }
.section-title { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }

/* 업종 선택 카드 */
.biz-type-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-card input { display: none; }
.radio-card-inner { border: 2px solid var(--border-strong); border-radius: var(--radius); padding: 14px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; transition: all .15s; font-size: 0.85rem; font-weight: 500; }
.radio-card input:checked + .radio-card-inner { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* 체크리스트 */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.875rem; }
.check-item input { width: 16px; height: 16px; accent-color: var(--primary); }

/* 필터 카드 */
.filter-card { padding: 16px 20px; margin-bottom: 16px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { flex: 1; min-width: 140px; }

/* ── 테이블 ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { background: #F8FAFC; font-weight: 600; font-size: 0.8rem; color: var(--text-muted); text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-hover tr:hover td { background: #F8FAFC; }
.table-row-link { cursor: pointer; }
.table-sm th, .table-sm td { padding: 7px 10px; font-size: 0.8rem; }
.empty-row { text-align: center; padding: 40px 20px !important; color: var(--text-muted); }

/* ── 배지/상태 ── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-lg { padding: 5px 14px; font-size: 0.875rem; }
.badge-sm { padding: 2px 7px; font-size: 0.7rem; }
.badge-stage { background: #EDE9FE; color: #7C3AED; }
.status-draft { background: #F1F5F9; color: #64748B; }
.status-submitted { background: #DBEAFE; color: #1D4ED8; }
.status-reviewing { background: #FEF3C7; color: #92400E; }
.status-supplement { background: #FFEDD5; color: #9A3412; }
.status-approved { background: #DCFCE7; color: #15803D; }
.status-rejected { background: #FEE2E2; color: #B91C1C; }
.status-completed { background: #D1FAE5; color: #065F46; }

.count-badge { background: var(--primary-light); color: var(--primary); font-size: 0.8rem; font-weight: 600; padding: 2px 10px; border-radius: 20px; margin-left: 8px; }
.app-no { font-family: monospace; font-weight: 600; color: var(--primary); }
.org-tag { background: #F0F4FF; color: #4338CA; font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; }
.role-badge { background: #F0F9FF; color: #0369A1; font-size: 0.7rem; padding: 1px 6px; border-radius: 4px; }
.org-type-badge { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.org-type-본사 { background: #EDE9FE; color: #6D28D9; }
.org-type-지점 { background: #DBEAFE; color: #1D4ED8; }
.org-type-가맹점 { background: #D1FAE5; color: #065F46; }
.org-type-딜러 { background: #FEF3C7; color: #92400E; }

/* ── 알림 ── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.875rem; }
.alert-error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.missing-docs strong { display: block; margin-bottom: 6px; }
.missing-list { list-style: none; margin-top: 4px; }
.missing-list li::before { content: "• "; color: var(--danger); }
.missing-list li { padding: 1px 0; }

/* 서류 미비 강화 경고 */
.missing-alert-card { background: #FEF2F2; border: 1.5px solid #FECACA; border-left: 4px solid #DC2626; border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; }
.missing-alert-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.missing-alert-head strong { display: block; color: #B91C1C; font-size: .95rem; font-weight: 800; margin-bottom: 2px; }
.missing-alert-head span { color: #DC2626; font-size: .82rem; }
.missing-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.missing-chip { background: #fff; border: 1.5px solid #FECACA; color: #B91C1C; padding: 4px 12px; border-radius: 20px; font-size: .78rem; font-weight: 700; }

/* 서류미비 배지/필터 */
.badge-missing { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }
.spill-missing { border-color: #FECACA !important; color: #DC2626 !important; }
.spill-missing.active { background: #DC2626 !important; color: #fff !important; border-color: #DC2626 !important; }

/* 파일 검수 상태 배지 */
.file-review-pending { background: #FEF9C3; color: #92400E; border: 1px solid #FDE68A; }
.file-review-approved { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.file-review-rejected { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.file-review-note { font-size: .78rem; color: #DC2626; margin-top: 4px; padding: 3px 8px; background: #FEF2F2; border-radius: 4px; display: inline-block; }

/* ── 대시보드 ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); transition: all .15s; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 차트 그리드 */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-wrap { position: relative; height: 220px; display: flex; align-items: center; justify-content: center; padding: 8px 0; }
.donut-center { position: absolute; top: 50%; left: 30%; transform: translate(-50%,-50%); text-align: center; pointer-events: none; }
.donut-val { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.donut-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* 메시지 피드 */
.msg-feed { padding: 8px 0; }
.msg-item { display: flex; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.msg-item:hover { background: var(--bg); text-decoration: none; }
.msg-avatar { width: 32px; height: 32px; background: var(--secondary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.msg-sender { font-weight: 600; font-size: 0.8rem; }
.msg-time { font-size: 0.7rem; color: var(--text-muted); }
.msg-text { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 프로그레스 바 */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width .6s ease; }

/* 알림 배너 */
.alert-banner { display:flex; align-items:center; gap:10px; background:#FFF7ED; border:1px solid #FED7AA; border-radius:8px; padding:12px 16px; margin-bottom:20px; font-size:14px; color:#92400E; }
.alert-banner.alert-urgent { background:#FEF2F2; border-color:#FECACA; color:#991B1B; }
.alert-link { margin-left:auto; color:#2563EB; font-weight:600; white-space:nowrap; text-decoration:none; }
.alert-link:hover { text-decoration:underline; }

/* 가맹점/딜러 현황 카드 */
.field-status-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
.field-stat-card { background:#fff; border:1px solid var(--border); border-radius:10px; padding:20px; display:flex; flex-direction:column; gap:6px; }
.field-stat-label { font-size:12px; color:var(--text-muted); font-weight:500; text-transform:uppercase; letter-spacing:.5px; }
.field-stat-val { font-size:2.5rem; font-weight:700; line-height:1; }
.field-stat-desc { font-size:13px; color:var(--text-muted); }
.field-stat-link { font-size:13px; color:#2563EB; font-weight:600; text-decoration:none; margin-top:4px; }
.field-stat-link:hover { text-decoration:underline; }

/* 진행 단계 안내 */
.step-guide { display:flex; align-items:center; gap:8px; padding:8px 0; flex-wrap:wrap; }
.step-item { display:flex; align-items:flex-start; gap:12px; flex:1; min-width:140px; }
.step-num { width:32px; height:32px; border-radius:50%; background:#2563EB; color:#fff; font-size:14px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.step-num.done { background:#16A34A; }
.step-body { flex:1; }
.step-title { font-size:14px; font-weight:600; color:var(--text-primary); }
.step-desc { font-size:12px; color:var(--text-muted); margin-top:2px; line-height:1.4; }
.step-arrow { color:#CBD5E1; font-size:18px; flex-shrink:0; }

/* 조직 유형 뱃지 */
.org-type-badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; font-weight:500; }
.org-type-본사 { background:#DBEAFE; color:#1D4ED8; }
.org-type-지점 { background:#F3E8FF; color:#6D28D9; }
.org-type-가맹점 { background:#DCFCE7; color:#166534; }
.org-type-딜러 { background:#FEF9C3; color:#854D0E; }

/* ── 신청서 상세 ── */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.detail-main { min-width: 0; }
.detail-side { }
.detail-main .card, .detail-side .card { padding: 20px; }
.detail-main .card-header { margin: -20px -20px 20px; }

/* 단계 탭 */
.stage-tabs { display: flex; gap: 6px; }
.stage-tab { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; background: var(--border); color: var(--text-muted); }
.stage-tab.active { background: #EDE9FE; color: #7C3AED; font-weight: 600; }

/* 정보 그리드 (읽기 전용) */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.info-row { display: flex; border-bottom: 1px solid var(--border); }
.info-row.full { grid-column: 1/-1; }
.info-label { width: 120px; flex-shrink: 0; background: #F8FAFC; font-size: 0.8rem; font-weight: 600; padding: 9px 12px; border-right: 1px solid var(--border); }
.info-value { flex: 1; padding: 9px 12px; font-size: 0.875rem; }

/* 서류 체크리스트 */
.doc-checklist { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 16px; }
.doc-item { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; }
.doc-ok { background: #DCFCE7; color: #15803D; }
.doc-missing { background: #FEE2E2; color: #B91C1C; }

/* 파일 업로드 */
.upload-form { padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-input { display: none; }

/* 파일 목록 */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #FAFAFA; }
.file-icon { flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 0.85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.file-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 상태 정보 */
.status-info { }
.status-current { text-align: center; padding: 16px 0; }
.meta-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.meta-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.meta-item span { color: var(--text-muted); }

/* 승인 처리 */
.status-form { }
.template-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 이력 타임라인 */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.timeline-content { flex: 1; }
.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.timeline-who { font-size: 0.8rem; font-weight: 600; }
.timeline-comment { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── 채팅 ── */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 120px); background: white; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: #F8FAFC; }
.chat-system { text-align: center; display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--text-muted); font-size: 0.75rem; }
.chat-system::before, .chat-system::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.chat-item { display: flex; gap: 8px; }
.chat-mine { flex-direction: row-reverse; }
.chat-other { flex-direction: row; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; background: #94A3B8; color: white; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.chat-bubble-wrap { display: flex; flex-direction: column; max-width: 70%; }
.chat-sender { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.chat-bubble { padding: 10px 14px; border-radius: 12px; max-width: 100%; word-break: break-word; }
.chat-bubble-mine { background: var(--primary); color: white; border-radius: 12px 12px 4px 12px; }
.chat-bubble-other { background: white; border: 1px solid var(--border); color: var(--text); border-radius: 12px 12px 12px 4px; }
.chat-text { font-size: 0.875rem; line-height: 1.5; white-space: pre-wrap; }
.chat-meta { font-size: 0.7rem; opacity: .65; margin-top: 4px; }
.read-mark { font-size: 0.65rem; }
.chat-input-area { border-top: 1px solid var(--border); background: white; }
.quick-templates { padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); }
.template-label { font-size: 0.75rem; color: var(--text-muted); align-self: center; }
.chat-form { padding: 12px 16px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input { flex: 1; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 0.875rem; resize: none; font-family: inherit; transition: border-color .15s; }
.chat-input:focus { outline: none; border-color: var(--primary); }
.chat-send { height: auto; align-self: flex-end; padding: 10px 14px; }

/* ── 관리자 ── */
.action-btns { display: flex; gap: 6px; }

/* ── 모달 ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: white; border-radius: var(--radius); width: 100%; max-width: 520px; box-shadow: 0 20px 40px rgba(0,0,0,.2); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 16px; }

/* ── 차트 ── */
.chart-bars { padding: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.chart-bar-item { display: flex; align-items: center; gap: 12px; }
.chart-bar-label { width: 100px; font-size: 0.8rem; text-align: right; color: var(--text-muted); }
.chart-bar-wrap { flex: 1; height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: var(--primary); border-radius: 6px; transition: width .6s ease; }
.chart-bar-val { width: 50px; font-size: 0.8rem; font-weight: 600; }

/* ── 신규 신청 폼 섹션 ── */
.breadcrumb { display:flex; align-items:center; gap:6px; font-size:0.8rem; color:var(--text-muted); margin-bottom:8px; }
.breadcrumb-link { color:var(--text-muted); transition:color .15s; }
.breadcrumb-link:hover { color:var(--primary); text-decoration:none; }

.form-section { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:20px; overflow:hidden; }
.form-section-header { display:flex; align-items:center; gap:14px; padding:16px 24px; border-bottom:1px solid var(--border); background:#F8FAFC; }
.form-section-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.form-section-title { font-size:0.95rem; font-weight:700; color:var(--text); }
.form-section-desc { font-size:0.78rem; color:var(--text-muted); margin-top:2px; }
.form-section-body { padding:20px 24px; }
.form-section-body > *:last-child { margin-bottom:0; }

.biz-type-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; padding:20px 24px; }
.biz-card { display:block; cursor:pointer; }
.biz-card input[type="radio"] { display:none; }
.biz-card-body { border:2px solid var(--border-strong); border-radius:12px; padding:24px 16px 20px; display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; transition:all .2s; background:white; position:relative; }
.biz-card:hover .biz-card-body, .biz-card.selected .biz-card-body { border-color:var(--primary); background:var(--primary-light); }
.biz-card-icon { width:64px; height:64px; border-radius:16px; display:flex; align-items:center; justify-content:center; }
.biz-card-title { font-size:0.95rem; font-weight:700; color:var(--text); }
.biz-card-desc { font-size:0.8rem; color:var(--text-muted); line-height:1.5; }
.biz-card-check { width:24px; height:24px; border-radius:50%; background:var(--primary); position:absolute; top:10px; right:10px; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .2s; }
.biz-card.selected .biz-card-check { opacity:1; }

.form-input-lg { padding:11px 14px; font-size:0.9375rem; border-radius:8px; }
.form-select-lg { padding:11px 14px; font-size:0.9375rem; border-radius:8px; }
.form-submit-bar { display:flex; justify-content:flex-end; gap:12px; padding:20px 0 8px; align-items:center; }

/* ── 신청 목록 ── */
.page-sub { font-size:0.85rem; color:var(--text-muted); margin-top:4px; }

.status-pills-wrap { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.spill { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border-radius:20px; font-size:0.8rem; font-weight:500; border:1px solid var(--border-strong); background:white; color:var(--text-muted); cursor:pointer; transition:all .15s; text-decoration:none; }
.spill:hover { text-decoration:none; color:var(--text); border-color:#94A3B8; }
.spill.active { font-weight:600; }
.spill-all.active { background:#0F172A; color:white; border-color:#0F172A; }
.spill-draft.active { background:#F1F5F9; color:#475569; border-color:#94A3B8; }
.spill-submitted.active { background:#DBEAFE; color:#1D4ED8; border-color:#93C5FD; }
.spill-reviewing.active { background:#FEF3C7; color:#92400E; border-color:#FCD34D; }
.spill-supplement.active { background:#FFEDD5; color:#9A3412; border-color:#FDBA74; }
.spill-approved.active { background:#DCFCE7; color:#15803D; border-color:#86EFAC; }
.spill-rejected.active { background:#FEE2E2; color:#B91C1C; border-color:#FCA5A5; }
.spill-completed.active { background:#D1FAE5; color:#065F46; border-color:#6EE7B7; }

.search-bar-card { padding:14px 20px; margin-bottom:16px; }
.search-filter-form { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.search-input-wrap { position:relative; flex:1; min-width:200px; }
.search-input-icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#94A3B8; pointer-events:none; }
.search-input { width:100%; padding:9px 12px 9px 38px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); font-size:0.875rem; background:white; font-family:inherit; transition:border-color .15s; }
.search-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.1); }

.row-draft td:first-child { border-left:3px solid #94A3B8; }
.row-submitted td:first-child { border-left:3px solid #3B82F6; }
.row-reviewing td:first-child { border-left:3px solid #F59E0B; }
.row-supplement td:first-child { border-left:3px solid #F97316; }
.row-approved td:first-child { border-left:3px solid #16A34A; }
.row-rejected td:first-child { border-left:3px solid #DC2626; }
.row-completed td:first-child { border-left:3px solid #059669; }

.empty-state-row { padding:0 !important; }
.empty-state { display:flex; flex-direction:column; align-items:center; gap:14px; padding:60px 20px; }
.empty-state-icon { color:#CBD5E1; }
.empty-state-text { font-size:0.95rem; color:var(--text-muted); text-align:center; }
.empty-state-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }

/* ── 유틸 ── */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.code-tag { background: #F1F5F9; color:#334155; padding: 1px 6px; border-radius: 3px; font-size: 0.75rem; font-family: monospace; }
.code-tag.tag-ok   { background: #DCFCE7; color: #166534; }
.code-tag.tag-err  { background: #FEE2E2; color: #991B1B; }
.code-tag.tag-muted{ background: #F1F5F9; color: #64748B; }
.code-tag.tag-info { background: #DBEAFE; color: #1D4ED8; }

/* ── 반응형 ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .donut-center { left: 50%; }
  .field-status-grid { grid-template-columns: 1fr 1fr; }
  .step-guide { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
}

@media (max-width: 600px) {
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row.two-col { grid-template-columns: 1fr; }
  .filter-form { flex-direction: column; }
  .filter-group { min-width: 100%; }
  .biz-type-group { flex-direction: column; }
  .biz-type-grid { grid-template-columns: 1fr 1fr; padding: 16px; gap: 10px; }
  .biz-card-icon { width: 48px; height: 48px; }
  .search-filter-form { flex-direction: column; }
  .search-input-wrap { min-width: 100%; }
  .form-section-body { padding: 16px; }
  .chat-wrap { height: calc(100vh - var(--topbar-h) - 80px); }
}

/* ── 웹 알림 ── */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.notif-wrap { position: relative; }
.notif-btn {
  position: relative;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.notif-btn:hover { background: var(--primary-light); color: var(--primary); }
.notif-badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  transform: translate(30%, -30%);
  pointer-events: none;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px; max-height: 360px; overflow-y: auto;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 1000;
}
.notif-panel-header {
  padding: 10px 14px;
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .04em;
}
.notif-item {
  display: block; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background .12s;
}
.notif-item:hover { background: var(--primary-light); }
.notif-item:last-child { border-bottom: none; }
.notif-app-name { font-size: .75rem; font-weight: 600; color: var(--primary); margin-bottom: 2px; }
.notif-text { font-size: .8rem; color: var(--text); line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.notif-at { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
.notif-type-status .notif-app-name { color: var(--success); }
.notif-empty { padding: 20px 14px; font-size: .82rem; color: var(--text-muted); text-align: center; }

/* 신청 목록 안읽음 배지 */
.nav-unread-badge {
  margin-left: auto;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
