/* ============================================================
   Formula X Cloud - Styles
   ============================================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --pt: #e87040;
  --fc: #3b82f6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --mobile-nav-height: 72px;
}

/* ── Formula 모드 다크 테마 (localStorage + 시스템 연동) ── */
:root[data-formula-theme="dark"] {
  color-scheme: dark;
  --primary-dark: #818cf8;
  --bg: #0f172a;
  --bg-sub: #1e293b;
  --card: #1e293b;
  --text: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

:root[data-formula-theme="dark"] .main-nav {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

:root[data-formula-theme="dark"] .nav-tab:hover {
  background: rgba(99, 102, 241, 0.12);
}

:root[data-formula-theme="dark"] .role-card {
  background: var(--card);
  color: var(--text);
}

:root[data-formula-theme="dark"] .role-card:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

:root[data-formula-theme="dark"] .mobile-context-bar {
  background: rgba(30, 41, 59, 0.97);
  color: var(--text-sub);
}

:root[data-formula-theme="dark"] .mobile-nav-bottom {
  background: rgba(30, 41, 59, 0.98);
}

:root[data-formula-theme="dark"] .mobile-nav-tab,
:root[data-formula-theme="dark"] .mobile-more-toggle,
:root[data-formula-theme="dark"] .mobile-more-tab {
  background: #334155;
  color: var(--text-sub);
}

:root[data-formula-theme="dark"] .mobile-more-toggle {
  background: var(--card);
}

:root[data-formula-theme="dark"] .mobile-more-sheet {
  background: var(--card);
}

:root[data-formula-theme="dark"] .mobile-more-close {
  background: var(--card);
  color: var(--text-sub);
}

:root[data-formula-theme="dark"] .profit-table-wrap {
  border-color: var(--border);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

:root[data-formula-theme="dark"] .profit-table th,
:root[data-formula-theme="dark"] .profit-table td {
  border-bottom-color: #334155;
}

:root[data-formula-theme="dark"] .profit-table thead th {
  background: #334155;
  color: #cbd5e1;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table thead th {
  background: #334155;
  box-shadow: 0 1px 0 0 var(--border);
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table thead th:last-child {
  box-shadow: 0 1px 0 0 var(--border);
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table thead th:nth-child(2n) {
  background: #3d4f63;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table thead th:nth-child(2n+1):not(:first-child) {
  background: #334155;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody td:nth-child(2n) {
  background: #1e293b;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody td:nth-child(2n+1):not(:first-child) {
  background: #0f172a;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(2n) {
  background: #273549;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(2n+1):not(:first-child) {
  background: #1e293b;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody tr:hover td:nth-child(2n) {
  background: #475569;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody tr:hover td:nth-child(2n+1):not(:first-child) {
  background: #334155;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody td:first-child {
  background: #0f172a;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody tr:nth-child(even) td:first-child {
  background: #1e293b;
}

:root[data-formula-theme="dark"] .activity-table-wrap .profit-table tbody tr:hover td:first-child {
  background: #334155;
}

:root[data-formula-theme="dark"] .profit-table tbody tr {
  background: #0f172a;
}

:root[data-formula-theme="dark"] .profit-table tbody tr:nth-child(even) {
  background: #1e293b;
}

:root[data-formula-theme="dark"] .profit-table tbody tr:hover {
  background: #334155;
}

:root[data-formula-theme="dark"] .profit-table tbody td:first-child {
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .fx-modal {
  background: var(--card);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .fx-modal-header,
:root[data-formula-theme="dark"] .fx-modal-footer {
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .fx-modal-checklist {
  border-color: var(--border);
}

:root[data-formula-theme="dark"] input.form-control,
:root[data-formula-theme="dark"] select.form-control,
:root[data-formula-theme="dark"] textarea.form-control,
:root[data-formula-theme="dark"] .form-control {
  background: #0f172a;
  border-color: var(--border);
  color: var(--text);
  color-scheme: dark; /* 네이티브 날짜 피커/달력 아이콘을 다크에 맞게 렌더 */
}

/* 지출 결의 입력표: 라이트 기본값 + 다크 오버라이드 */
:root[data-formula-theme="dark"] .expense-request-entry-table {
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .expense-request-entry-table th,
:root[data-formula-theme="dark"] .expense-request-entry-table td {
  border-bottom-color: var(--border);
}
:root[data-formula-theme="dark"] .expense-request-entry-table th {
  background: #111c33;
  color: var(--text);
}
/* 클립보드 붙여넣기 존 (라이트/다크 공통 기반은 인라인 제거 후 클래스로) */
.er-modal-paste-zone,
.er-edit-paste-zone {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}
:root[data-formula-theme="dark"] .er-modal-paste-zone,
:root[data-formula-theme="dark"] .er-edit-paste-zone {
  background: #0f172a;
  border-color: var(--border);
}
/* 지출 결의 목록: 신청일시 아래 지출일 서브라인 */
.er-expense-date-sub {
  font-size: 11px;
  opacity: .7;
  margin-top: 2px;
  white-space: nowrap;
}

:root[data-formula-theme="dark"] .admin-sidebar {
  background: var(--card);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .admin-menu-item {
  color: var(--text-sub);
}

:root[data-formula-theme="dark"] .flatpickr-calendar {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

:root[data-formula-theme="dark"] .flatpickr-months .flatpickr-month,
:root[data-formula-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
:root[data-formula-theme="dark"] .flatpickr-current-month .numInputWrapper input {
  background: transparent;
  color: var(--text);
}

:root[data-formula-theme="dark"] span.flatpickr-weekday {
  color: var(--text-muted);
}

:root[data-formula-theme="dark"] .flatpickr-day {
  color: var(--text-sub);
}

:root[data-formula-theme="dark"] .flatpickr-day:hover {
  background: #334155;
  border-color: #334155;
}

:root[data-formula-theme="dark"] .flatpickr-day.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Formula 다크: 지점/필터 입력·네이티브 select ── */
:root[data-formula-theme="dark"] #page-dashboard select,
:root[data-formula-theme="dark"] .branch-selector select {
  background: #0f172a;
  color: var(--text);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .overview-filter-row select,
:root[data-formula-theme="dark"] .overview-filter-row input[type="date"],
:root[data-formula-theme="dark"] .overview-filter-row input[type="text"] {
  background: #0f172a;
  color: var(--text);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .overview-filter-row input[type="date"]:disabled,
:root[data-formula-theme="dark"] .overview-filter-row input#overview-date-range:disabled {
  background: #1e293b;
  color: var(--text-muted);
}

:root[data-formula-theme="dark"] .flatpickr-input,
:root[data-formula-theme="dark"] input.flatpickr-input {
  background: #0f172a !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* 종합: 매출 구성 박스 */
:root[data-formula-theme="dark"] .overview-sales-split .split-box {
  background: #1e293b;
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .overview-sales-total {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.4);
}

:root[data-formula-theme="dark"] .overview-sales-total .label {
  color: #6ee7b7;
}

:root[data-formula-theme="dark"] .overview-sales-total .value {
  color: #34d399;
}

/* 매출 표 */
:root[data-formula-theme="dark"] .sales-table-wrap {
  border-color: var(--border);
  background: var(--card);
}

:root[data-formula-theme="dark"] .sales-table th {
  background: #334155;
  color: #e2e8f0;
  box-shadow: inset 0 -1px 0 var(--border);
}

:root[data-formula-theme="dark"] .sales-tab-scroll .sales-table thead th {
  background: #334155;
}

:root[data-formula-theme="dark"] .sales-table td {
  color: var(--text);
  border-bottom-color: #334155;
}

:root[data-formula-theme="dark"] .sales-amount-track {
  background: #1e293b;
  border: 1px solid rgba(51, 65, 85, 0.9);
  box-sizing: border-box;
}

/* 전체/일별 매출 등 is-total: 밝은 회색 막대 + 밝은 글자 → 대비 소실 방지 */
:root[data-formula-theme="dark"] .sales-amount-fill.is-total {
  background: linear-gradient(90deg, #475569 0%, #64748b 100%);
}

:root[data-formula-theme="dark"] .sales-amount-text {
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.9);
}

:root[data-formula-theme="dark"] .sales-table .sales-amount-text {
  color: #f8fafc !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

:root[data-formula-theme="dark"] body.mobile-nav-enabled .sales-table-wrap {
  background: var(--card);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .sales-ratio-track {
  background: #334155;
}

:root[data-formula-theme="dark"] .sales-period-toggle {
  background: var(--card);
  border-bottom-color: var(--border);
}

:root[data-formula-theme="dark"] .sales-month-projection-pill {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.5) 0%, rgba(22, 101, 52, 0.4) 100%);
  border-color: #475569;
}

:root[data-formula-theme="dark"] .sales-month-projection-label {
  color: #93c5fd;
}

:root[data-formula-theme="dark"] .sales-month-projection-value {
  color: #f1f5f9;
}

:root[data-formula-theme="dark"] .sales-month-projection-hint {
  color: var(--text-muted);
}

:root[data-formula-theme="dark"] .sales-month-projection-inline {
  color: #93c5fd;
}

:root[data-formula-theme="dark"] .sales-month-projection-inline-label {
  color: #cbd5e1;
}

:root[data-formula-theme="dark"] .sales-upload-card-header {
  border: 1px solid var(--border);
}

:root[data-formula-theme="dark"] .sales-upload-card-title {
  color: var(--text);
}

:root[data-formula-theme="dark"] .sales-upload-card-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* 플레이스 테이블·주별 지표 */
:root[data-formula-theme="dark"] .place-table-wrap {
  background: var(--card);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .place-tab-scroll .place-table-wrap > table thead th {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .place-weekly-sticky-head {
  background: var(--card);
}

:root[data-formula-theme="dark"] .place-weekly-sticky-head .place-weekly-head-table th {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .place-weekly-body-table tbody td {
  color: var(--text);
  border-bottom-color: #334155;
}

:root[data-formula-theme="dark"] .place-row-total td {
  background: rgba(250, 204, 21, 0.14) !important;
  color: var(--text) !important;
  border-top-color: var(--border) !important;
}

.place-data-sync-hint-card {
  margin-bottom: 16px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
}

.place-data-sync-hint-title {
  margin: 0;
  font-size: 13px;
  color: #1e40af;
}

.place-data-sync-hint-body {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #1e3a8a;
  line-height: 1.45;
}

:root[data-formula-theme="dark"] .place-data-sync-hint-card {
  background: rgba(30, 58, 138, 0.35);
  border-color: #3b82f6;
}

:root[data-formula-theme="dark"] .place-data-sync-hint-title {
  color: #bfdbfe;
}

:root[data-formula-theme="dark"] .place-data-sync-hint-body {
  color: #e2e8f0;
}

/* 관리자 페이지 기본 테이블 (브랜드 관리 등) */
:root[data-formula-theme="dark"] #page-admin th {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] #page-admin td {
  color: var(--text);
  border-bottom-color: #334155;
}

:root[data-formula-theme="dark"] #page-admin tr:hover {
  background: rgba(99, 102, 241, 0.08);
}

/* 대시보드: 클래스 없는 일반 table (필요 시만) */
:root[data-formula-theme="dark"] #page-dashboard .card table:not(.profit-table):not(.sales-table):not(.place-weekly-head-table):not(.place-weekly-body-table) th {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] #page-dashboard .card table:not(.profit-table):not(.sales-table):not(.place-weekly-head-table):not(.place-weekly-body-table) td {
  color: var(--text);
  border-bottom-color: #334155;
}

/* 목표 달성률 */
:root[data-formula-theme="dark"] .goal-achievement-conversion-table {
  background: var(--card);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .goal-achievement-conversion-table thead th {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .goal-achievement-conversion-table th,
:root[data-formula-theme="dark"] .goal-achievement-conversion-table td {
  border-bottom-color: #334155;
  color: var(--text);
}

:root[data-formula-theme="dark"] .goal-achievement-conversion-label {
  background: #1e293b;
  color: var(--text);
  border-left-color: var(--border);
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap {
  background: var(--card);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table thead tr.goal-achievement-thead-group th.goal-achievement-th-activity {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table thead tr.goal-achievement-thead-group th.goal-achievement-th-conversion {
  background: #273549;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table thead tr:not(.goal-achievement-thead-group) th.goal-achievement-th-conversion-col {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table thead th:first-child {
  background: #334155;
  color: #e2e8f0;
  box-shadow: 2px 0 0 var(--border);
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody td:first-child {
  background: #0f172a;
  color: #f1f5f9;
  box-shadow: 2px 0 0 var(--border);
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:first-child {
  background: #1e293b;
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:hover td:first-child {
  background: #334155;
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(14),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(15),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(16),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(17),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(18) {
  background: #1e293b;
}

:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody td:nth-child(14),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody td:nth-child(15),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody td:nth-child(16),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody td:nth-child(17),
:root[data-formula-theme="dark"] .goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody td:nth-child(18) {
  background: #0f172a;
  color: var(--text);
}

:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(1),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(2),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(3),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(4),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(5),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(6),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(7) {
  background: #334155;
  color: #e2e8f0;
}

:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table thead th:nth-child(7) {
  box-shadow: 2px 0 0 var(--border);
}

:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody td:nth-child(1),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody td:nth-child(2),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody td:nth-child(3),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody td:nth-child(4),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody td:nth-child(5),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody td:nth-child(6),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody td:nth-child(7) {
  background: #0f172a !important;
  color: var(--text) !important;
}

:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(1),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(2),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(3),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(4),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(5),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(6),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(7) {
  background: #1e293b !important;
}

:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(1),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(2),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(3),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(4),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(5),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(6),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(7) {
  background: #334155 !important;
}

:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(1),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(2),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(3),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(4),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(5),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(6),
:root[data-formula-theme="dark"] .goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(7) {
  background: #1e3a5f !important;
}

/* 관리자: 사용자·브랜드 테이블 보조 */
:root[data-formula-theme="dark"] .admin-users-table .admin-user-branch {
  background: #0f172a;
  border-color: var(--border);
  color: var(--text);
}

:root[data-formula-theme="dark"] .admin-users-table .branch-tag-inline {
  background: #334155;
  color: var(--text);
}

:root[data-formula-theme="dark"] .sales-upload-report .item {
  background: #334155;
  color: var(--text);
}

:root[data-formula-theme="dark"] .profit-table .st-cell-achieved {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}

:root[data-formula-theme="dark"] .profit-table .st-cell-missed {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

:root[data-formula-theme="dark"] .goal-achievement-conversion-mobile {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

.formula-theme-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.formula-theme-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.formula-theme-select {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  cursor: pointer;
  max-width: 92px;
}

:root[data-formula-theme="dark"] .formula-theme-label {
  color: var(--text-muted);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Auth Pages ── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.auth-logo p {
  font-size: 14px;
  color: var(--text-sub);
  margin-top: 6px;
}
.role-select-intro {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.role-select-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin: 0 0 12px;
}
.role-select-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}
.role-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99,102,241,0.12);
}
.role-card-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.role-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: block;
}
.role-card-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.role-select-hint {
  font-size: 11px;
  margin: 10px 0 0;
}
.auth-card.entry-member .auth-logo p { color: var(--primary); }
@media (max-width: 640px) {
  .role-select-cards { grid-template-columns: repeat(2, 1fr); }
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.signup-type-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.signup-type-option {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.signup-type-option:hover { background: rgba(99,102,241,0.03); border-color: var(--primary-light); }
.signup-type-option input { margin: 0 10px 0 0; vertical-align: middle; }
.signup-type-option span { vertical-align: middle; }
.signup-type-option input:checked + span { font-weight: 700; color: var(--primary); }
.signup-type-option small { display: block; font-size: 12px; margin-top: 4px; margin-left: 22px; }
.onboarding-wait-text { font-size: 14px; line-height: 1.6; color: var(--text-sub); }
.onboarding-wait-text p + p { margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: rgba(99,102,241,0.05); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-google {
  width: 100%;
  background: #fff;
  color: #334155;
  border: 1px solid var(--border);
}
.btn-google:hover {
  background: #f8fafc;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
  margin-bottom: 12px;
}
.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-sub);
}
.auth-link a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.auth-link a:hover { text-decoration: underline; }
.auth-divider {
  margin: 14px 0 12px;
  text-align: center;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--border);
}
.auth-divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--card);
}

/* ── Navigation ── */
.main-nav {
  display: none;
  align-items: stretch;
  justify-content: space-between;
  background: var(--card);
  padding: 14px 24px 16px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
  min-width: 0;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  padding-right: 16px;
}
.nav-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  transition: color .2s ease, text-shadow .2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo.is-formula {
  color: var(--primary);
}
.nav-logo.is-bemove {
  color: #0ea5e9;
  text-shadow: 0 0 16px rgba(14, 165, 233, 0.2);
}
.nav-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.nav-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-tab:hover { background: rgba(99,102,241,0.06); }
.nav-tab.active { background: var(--primary); color: #fff; }

/* ===== Premium nav tab (디자인 with AI) ===== */
.nav-tab--premium {
  position: relative;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 35%, #a855f7 100%);
  background-size: 200% 200%;
  color: #fff !important;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.25), 0 6px 18px rgba(168, 85, 247, 0.28);
  letter-spacing: 0.01em;
  animation: navPremiumShimmer 6s ease-in-out infinite;
}
.nav-tab--premium::before {
  content: '✨';
  margin-right: 6px;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7));
}
.nav-tab--premium:hover {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 35%, #c084fc 100%);
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.nav-tab--premium.active {
  background: linear-gradient(135deg, #f59e0b 0%, #a855f7 100%);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #a855f7, 0 8px 24px rgba(168, 85, 247, 0.45);
  color: #fff !important;
}
@keyframes navPremiumShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.mobile-nav-tab.nav-tab--premium,
.mobile-more-tab.nav-tab--premium {
  border-radius: 10px;
}
/* 라이트 모드 모바일 메뉴에서 premium 탭 가시성 보강 */
.mobile-more-tab.nav-tab--premium {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 35%, #a855f7 100%);
  color: #ffffff !important;
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.22);
}
:root[data-formula-theme="dark"] .mobile-more-tab.nav-tab--premium {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 35%, #a855f7 100%);
  color: #ffffff !important;
}
:root[data-formula-theme="dark"] .nav-tab--premium {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4), 0 6px 22px rgba(168, 85, 247, 0.45);
}

.mobile-nav-shell {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1300;
  pointer-events: none;
}
.mobile-nav-shell.is-active {
  display: block;
}
.mobile-context-bar {
  pointer-events: auto;
  margin: 0 12px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.97);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 12px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.mobile-nav-bottom {
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
}
.mobile-primary-tabs {
  grid-column: 1 / span 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.mobile-nav-tab,
.mobile-more-toggle,
.mobile-more-tab {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 6px;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
}
.mobile-nav-tab.active,
.mobile-more-tab.active {
  background: var(--primary);
  color: #fff;
}
.mobile-more-toggle {
  border-color: var(--border);
  background: #fff;
}
.mobile-more-toggle.has-active-child {
  border-color: var(--primary);
  color: var(--primary);
}
.mobile-more-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.mobile-more-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-more-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(100%);
  transition: transform .22s ease;
  border-radius: 14px 14px 0 0;
  border-top: 1px solid var(--border);
  background: #fff;
  max-height: min(72vh, 560px);
  overflow: auto;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  pointer-events: auto;
}
.mobile-more-sheet.is-open {
  transform: translateY(0);
}
.mobile-more-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mobile-more-close {
  min-height: 38px;
  min-width: 58px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
}
.mobile-more-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nav-center {
  flex: 1;
  min-width: 0;
}
.nav-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  min-height: 58px;
  margin-left: 16px;
}
.nav-right-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}
.nav-right-main { min-height: 28px; }
.nav-right-mode { min-height: 20px; }
.nav-right-mode:empty { display: none; min-height: 0; }
.nav-right span,
.nav-right button,
.nav-right .role-badge,
.nav-right-row span,
.nav-right-row button,
.nav-right-row .role-badge {
  white-space: nowrap !important;
  flex-shrink: 0;
}
.bemove-nav-group {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-height: 24px;
  margin-top: -4px;
}
.bemove-nav-group .app-mode-switcher {
  flex-basis: auto;
}
.app-mode-switcher {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}
.app-mode-switcher .app-mode-toggle-text {
  white-space: nowrap !important;
  flex-shrink: 0;
}
.app-mode-toggle-text {
  border: none;
  background: transparent;
  color: #60a5fa;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 0;
  font-size: 12px;
  transition: transform .2s ease, opacity .2s ease, color .2s ease;
}
.app-mode-toggle-text:hover {
  color: #93c5fd;
  transform: translateY(-1px);
}
.app-mode-toggle-text.is-busy {
  opacity: 0.75;
  cursor: wait;
}
.nav-right-mode .app-mode-toggle-text { padding-top: 0; padding-bottom: 0; }

/* 대시보드: 헤더 탭과 분리 — 화면·보기·브랜드·모드 전환 (지점 카드 위) */
.dashboard-context-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
  padding: 2px 0 12px;
  margin: 0 0 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dashboard-context-toolbar:empty {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
}
.dashboard-context-toolbar .bemove-view-as-switcher {
  margin-right: 0;
  margin-left: 0;
  min-height: 24px;
}
.dashboard-context-toolbar .bemove-view-as-label {
  font-size: 10px;
}
.dashboard-context-toolbar .bemove-view-as-btn {
  padding: 3px 7px;
  font-size: 10px;
}

/* 설정: 슈퍼 Formula 보기 전환 */
#page-settings .settings-super-view-as .formula-view-as-switcher {
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

/* 보기 모드 바: 헤더 바로 아래 콘텐츠 상단 (슈퍼 관리자 Bemove 시) */
.bemove-view-as-bar {
  display: flex;
  align-items: center;
  padding: 8px 24px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
  min-height: 40px;
}
.bemove-view-as-bar .bemove-view-as-switcher {
  margin-right: 0;
}
.bemove-view-as-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-right: 10px;
  min-height: 28px;
  flex-shrink: 0;
}
.nav-right-main .bemove-view-as-switcher {
  margin-right: 0;
  margin-left: 6px;
  min-height: 24px;
}
.nav-right-mode .bemove-view-as-switcher {
  margin-right: 0;
  margin-left: 6px;
  min-height: 24px;
}
.nav-right-main .bemove-view-as-label {
  font-size: 10px;
}
.nav-right-mode .bemove-view-as-label {
  font-size: 10px;
}
.nav-right-main .bemove-view-as-btn {
  padding: 3px 7px;
  font-size: 10px;
}
.nav-right-mode .bemove-view-as-btn {
  padding: 3px 7px;
  font-size: 10px;
}
.bemove-view-as-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.bemove-view-as-btn {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.bemove-view-as-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.bemove-view-as-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Formula 모드 보기 전환 (슈퍼 → 브랜드/FC) */
.formula-view-as-switcher .formula-view-as-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}
.formula-view-as-switcher .formula-view-as-select-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.formula-view-as-switcher .formula-view-as-select {
  font-size: 11px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 120px;
  max-width: 180px;
}

.fx-formula-demo-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}
:root[data-formula-theme="dark"] .fx-formula-demo-badge {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(147, 197, 253, 0.45);
}
.settings-formula-demo .fx-mcrm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-mode-transition {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(59,130,246,0.22), rgba(15,23,42,0.9));
  backdrop-filter: blur(6px);
  animation: modeFxIn .24s ease-out;
}
.app-mode-transition.leave {
  animation: modeFxOut .26s ease-in forwards;
}
.app-mode-transition-panel {
  min-width: 280px;
  max-width: 90vw;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(145deg, rgba(15,23,42,0.96), rgba(30,41,59,0.92));
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.45);
}
.app-mode-transition-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid rgba(148, 163, 184, 0.35);
  border-top-color: #22d3ee;
  border-right-color: #60a5fa;
  animation: modeFxSpin .9s linear infinite;
}
.app-mode-transition-title {
  color: #e2e8f0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.app-mode-transition-subtitle {
  margin-top: 6px;
  color: #93c5fd;
  font-size: 13px;
  font-weight: 600;
}
@keyframes modeFxSpin {
  to { transform: rotate(360deg); }
}
@keyframes modeFxIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modeFxOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.role-super { background: rgba(239,68,68,0.1); color: var(--danger); }
.role-brand { background: rgba(99,102,241,0.1); color: var(--primary); }
.role-branch { background: rgba(34,197,94,0.1); color: var(--success); }
.role-member { background: rgba(14,165,233,0.1); color: #0284c7; }
.role-duty { background: rgba(100,116,139,0.12); color: var(--text-sub); }

#nav-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
#nav-brand-name { font-size: 12px; color: var(--text-sub); }

/* ── Page Layout ── */
.page { display: none; }
.page-content {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* 대시보드: 페이지 스크롤 방지 → 플레이스 탭 등 탭 내부만 스크롤, sticky 정상 동작 */
#page-dashboard .page-content {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  overflow: hidden;
}
#page-dashboard #tab-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#page-dashboard #tab-content > * {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}
#page-dashboard #tab-content > .place-tab-scroll {
  height: auto;
}
#page-dashboard #tab-content > .sales-tab-layout {
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#page-dashboard #tab-content > .expenses-tab-scroll {
  height: auto;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

/* 관리자 카드 헤더: 한 줄에 제목 + 버튼, 브랜드 추가 버튼 크기 축소 */
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-card-header h3 { margin: 0; }
.btn-add-brand-inline {
  width: auto !important;
  flex-shrink: 0;
}

/* 지점 셀: 태그들을 한 줄에 흐르게 */
.td-branches {
  text-align: left;
  min-width: 140px;
  max-width: 320px;
  vertical-align: middle;
}
.branch-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* 지점 태그 (브랜드 관리) - 한 줄에 여러 개 잘 보이도록 컴팩트 */
.branch-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  padding: 2px 6px 2px 8px;
  margin: 0;
  background: var(--border);
  color: var(--text);
  border-radius: 999px;
  white-space: nowrap;
}
.branch-tag .btn-icon {
  padding: 0 2px;
  min-width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.75;
}
.branch-tag .btn-icon:hover {
  background: rgba(0,0,0,0.1);
  opacity: 1;
}
.branch-tag .btn-branch-delete:hover {
  color: var(--danger, #dc2626);
}

/* ===== 플레이스 대시보드 (확장 프로그램과 동일 UI) ===== */
.table-title { font-size: 16px; font-weight: 700; margin-bottom: 0; color: var(--text); padding: 16px 16px 12px; }
.bar-cell { position: relative; min-width: 60px; height: 28px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; overflow: hidden; }
.bar-fill { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 4px; transition: width 0.3s ease; }
.bar-value { position: relative; z-index: 1; font-weight: 700; font-size: 13px; color: var(--text); }
.funnel-bar-row { display: flex; height: 28px; border-radius: 6px; overflow: hidden; min-width: 120px; }
.funnel-bar-row > div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.place-row-total td { font-weight: 800 !important; background: rgba(254, 252, 232, 0.6) !important; border-top: 2px solid var(--border); }

/* ── 플레이스 인사이트 카드 (확장 프로그램 스타일) ── */
.insights-card {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 16px;
}
.insights-card .table-title { color: #f1f5f9; }
.insight-item {
  font-size: 13px;
  line-height: 1.5;
  margin: 6px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.insight-item .tag { margin-right: 4px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.tag-up { background: rgba(34, 197, 94, 0.25); color: #86efac; }
.tag-down { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.tag-info { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
.tag-warn { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }

/* Overview AI chat */
.overview-ai-dock-toggle {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 85;
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #312e81;
}
.overview-ai-dock-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  z-index: 86;
}
.overview-ai-dock-panel {
  position: fixed;
  top: 78px;
  right: 16px;
  width: min(920px, calc(100vw - 32px));
  height: min(78vh, 760px);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
  z-index: 87;
  display: none;
  overflow: hidden;
}
.overview-ai-dock-panel.is-open {
  display: block;
}
.overview-ai-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 0;
}
.overview-ai-dock-panel .overview-ai-chat-subtitle {
  margin: 0 14px 10px;
}
.overview-ai-dock-panel .overview-ai-chat-layout {
  margin: 0 14px 14px;
  height: calc(min(78vh, 760px) - 120px);
  min-height: 0;
}
.overview-ai-dock-panel .overview-ai-chat-sidebar {
  min-height: 0;
}
.overview-ai-dock-panel .overview-ai-chat-main {
  height: 100%;
  min-height: 0;
}
.overview-ai-dock-panel .overview-ai-chat-messages {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.overview-ai-chat-card .table-title {
  padding-bottom: 8px;
}
.overview-ai-chat-subtitle {
  margin: 0 16px 10px;
}
.overview-ai-chat-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  margin: 0 16px 16px;
  min-height: 520px;
}
.overview-ai-chat-sidebar {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.overview-ai-chat-history {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
}
.overview-ai-history-item {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.overview-ai-history-item.active {
  border-color: #6366f1;
  background: #e0e7ff;
  color: #312e81;
}
.overview-ai-chat-main {
  min-width: 0;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.overview-ai-chat-reco-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.overview-ai-reco-btn {
  font-size: 12px;
}
.overview-ai-chat-messages {
  margin: 0;
  padding: 12px;
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}
.overview-ai-msg {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 8px 10px;
  border-radius: 8px;
}
.overview-ai-msg-assistant {
  background: #f1f5f9;
  color: #0f172a;
}
.overview-ai-msg-user {
  background: #e0e7ff;
  color: #1e1b4b;
  align-self: flex-end;
}
.overview-ai-chat-input-row {
  margin: 10px 0 0;
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 6px;
}
.overview-ai-chat-input {
  flex: 1 1 0;
  min-width: 0;
}
.overview-ai-chat-send-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 10px;
  min-width: 72px;
  white-space: nowrap;
}
@media (max-width: 980px) {
  .overview-ai-dock-toggle {
    top: 72px;
    right: 12px;
  }
  .overview-ai-dock-panel {
    top: 64px;
    right: 8px;
    width: calc(100vw - 16px);
    height: calc(100vh - 84px);
  }
  .overview-ai-dock-panel .overview-ai-chat-layout {
    height: calc(100vh - 220px);
    min-height: 0;
  }
  .overview-ai-chat-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .overview-ai-chat-sidebar {
    min-height: 120px;
  }
  .overview-ai-chat-history {
    max-height: 120px;
  }
  .overview-ai-chat-main {
    min-height: 420px;
  }
  .overview-ai-chat-messages {
    min-height: 260px;
    max-height: 420px;
  }
}

/* 지식 대시보드 플로팅 버튼 (F 모드 전역) */
.knowledge-dashboard-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
  width: auto;
  min-width: auto;
  max-width: none;
  height: auto;
}
.knowledge-dashboard-floating-btn:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}
.knowledge-dashboard-floating-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.knowledge-dashboard-floating-text {
  font-size: 14px;
  line-height: 1;
}
.knowledge-dashboard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  z-index: 86;
}
.knowledge-dashboard-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(920px, calc(100vw - 48px));
  height: min(78vh, 760px);
  max-height: calc(100vh - 48px);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
  z-index: 87;
  display: none;
  overflow: hidden;
}
.knowledge-dashboard-panel.is-open {
  display: block;
}
.knowledge-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 0;
}
.knowledge-dashboard-subtitle {
  margin: 0 14px 10px;
}
.knowledge-dashboard-layout {
  margin: 0 14px 14px;
  height: calc(min(78vh, 760px) - 120px);
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
}
.knowledge-dashboard-sidebar {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.knowledge-dashboard-history {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
}
.knowledge-dashboard-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.knowledge-dashboard-reco-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.knowledge-dashboard-reco-btn {
  font-size: 12px;
}
.knowledge-dashboard-messages {
  margin: 0;
  padding: 12px;
  min-height: 360px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}
.knowledge-dashboard-input-row {
  margin: 10px 0 0;
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 6px;
}
.knowledge-dashboard-input {
  flex: 1 1 0;
  min-width: 0;
}
.knowledge-dashboard-send-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 10px;
  min-width: 72px;
  white-space: nowrap;
}
@media (max-width: 980px) {
  .knowledge-dashboard-floating-btn {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
  }
  .knowledge-dashboard-floating-text {
    display: none;
  }
  .knowledge-dashboard-floating-icon {
    font-size: 18px;
  }
  .knowledge-dashboard-panel {
    bottom: 16px;
    right: 16px;
    width: calc(100vw - 32px);
    height: calc(100vh - 84px);
    max-height: calc(100vh - 32px);
  }
  .knowledge-dashboard-layout {
    height: calc(100vh - 220px);
    grid-template-columns: 1fr;
  }
  .knowledge-dashboard-sidebar {
    min-height: 120px;
  }
  .knowledge-dashboard-history {
    max-height: 120px;
  }
  .knowledge-dashboard-main {
    min-height: 420px;
  }
  .knowledge-dashboard-messages {
    min-height: 260px;
    max-height: 420px;
  }
}

/* ── Bemove Super Dashboard ── */
.bemove-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bemove-title-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.bemove-hero {
  background: linear-gradient(150deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
}
.bemove-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.bemove-hero-title {
  font-size: 12px;
  color: #93c5fd;
  margin-bottom: 6px;
}
.bemove-hero-mini-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: none;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
}
.bemove-hero-mini {
  text-align: right;
  padding-left: 8px;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
}
.bemove-hero-mini span {
  display: inline;
  font-size: 10px;
  color: #93c5fd;
  opacity: 0.95;
  margin-right: 6px;
}
.bemove-hero-mini strong {
  display: inline;
  margin-top: 0;
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
}
.bemove-hero-mini strong em {
  font-style: normal;
  font-weight: 700;
  color: #cbd5e1;
  font-size: 11px;
}
.bemove-hero-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
}
.bemove-hero-value span {
  font-size: 14px;
  color: #cbd5e1;
  font-weight: 600;
}
.bemove-hero-rate {
  margin-top: 6px;
  text-align: right;
  font-size: 28px;
  font-weight: 800;
  color: #22c55e;
}
@media (max-width: 1100px) {
  .bemove-hero-head {
    flex-direction: column;
    gap: 8px;
  }
  .bemove-hero-mini-grid {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .bemove-hero-mini {
    text-align: left;
    border-left: none;
    padding-left: 0;
  }
}
.bemove-stat-approval-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bemove-stat-grid-super-line .bemove-stat-approval-card {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.bemove-stat-grid-super-line .bemove-stat-approval-card .bemove-approval-open-btn {
  align-self: center;
  margin-top: 0;
  margin-left: auto;
}
.bemove-approval-open-btn {
  align-self: flex-end;
  margin-top: 2px;
}
.bemove-approval-modal {
  z-index: 10080;
}
.bemove-approval-modal-dialog {
  width: min(1100px, 96vw);
  max-height: 86vh;
  overflow: auto;
  padding: 16px;
}
.bemove-progress {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.bemove-progress > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0%, #38bdf8 100%);
}
.bemove-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}
.bemove-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.bemove-stat div {
  color: var(--text-sub);
  font-size: 12px;
}
.bemove-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 34px;
  line-height: 1.1;
}
.bemove-stat strong span {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 600;
}
.bemove-stat-grid-compact {
  gap: 8px;
}
.bemove-stat-compact {
  padding: 8px 10px;
  border-radius: 10px;
}
.bemove-stat-compact div {
  font-size: 11px;
}
.bemove-stat-compact strong {
  margin-top: 2px;
  font-size: 20px;
}
.bemove-stat-compact strong span {
  font-size: 11px;
}
.bemove-stat-grid-super-line {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}
.bemove-stat-grid-super-line .bemove-stat-compact {
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  flex-wrap: nowrap;
}
.bemove-stat-grid-super-line .bemove-stat-compact div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.bemove-stat-grid-super-line .bemove-stat-compact strong {
  white-space: nowrap;
  flex-shrink: 0;
}
.bemove-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bemove-subtab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-sub);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}
.bemove-subtab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.bemove-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
}
.bemove-panel {
  margin-bottom: 0;
  padding: 16px;
}
.bemove-panel h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}
.bemove-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bemove-panel-title-row h4 {
  margin: 0;
}
.bemove-panel-title-row h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.bemove-panel-meta {
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 700;
}
.bemove-approval-panel {
  margin-top: 10px;
}
.bemove-approval-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bemove-user-role-section {
  margin-bottom: 8px;
}
.bemove-user-role-section:last-child {
  margin-bottom: 0;
}
.bemove-user-row .bemove-edit-field,
.bemove-user-row .bemove-manage-edit {
  display: none;
}
.bemove-user-row.is-editing .bemove-view-field,
.bemove-user-row.is-editing .bemove-manage-view {
  display: none;
}
.bemove-user-row.is-editing .bemove-edit-field,
.bemove-user-row.is-editing .bemove-manage-edit {
  display: block;
}
.bemove-user-main strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bemove-user-email {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  margin-top: 1px;
  word-break: break-all;
  overflow-wrap: break-word;
}
.bemove-user-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: 420px;
  overflow-x: hidden;
  overflow-y: auto;
}
.profit-table-wrap.bemove-user-table-wrap {
  overflow-x: hidden !important;
}
.bemove-user-manage-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
}
/* 직원 권한 테이블만 .profit-table 전역 min-width:980px 적용 제거 → 래퍼 너비에 맞춰 3열 한눈에 표시 */
.bemove-user-table-wrap .bemove-user-manage-table {
  min-width: 0;
}
.bemove-user-manage-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: 0 1px 0 0 #e2e8f0;
  font-weight: 700;
  font-size: 12px;
}
.bemove-user-manage-table th,
.bemove-user-manage-table td {
  vertical-align: middle;
  padding: 3px 4px;
  font-size: 12px;
}
.bemove-user-manage-table th:nth-child(1),
.bemove-user-manage-table td:nth-child(1) {
  padding-left: 6px;
  padding-right: 2px;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.bemove-user-manage-table th:nth-child(2),
.bemove-user-manage-table td:nth-child(2) {
  white-space: normal;
  padding-left: 2px;
  padding-right: 3px;
  min-width: 0;
}
.bemove-user-manage-table tbody tr:nth-child(even) td:nth-child(3) {
  background: #fafafa;
}
.bemove-user-manage-table td:nth-child(2) .role-badge {
  white-space: nowrap;
}
.bemove-user-manage-table th:nth-child(3),
.bemove-user-manage-table td:nth-child(3) {
  white-space: nowrap;
  padding-left: 2px;
  padding-right: 4px;
  text-align: center;
  min-width: 0;
}
.bemove-role-select,
.bemove-branch-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 13px;
}
.bemove-name-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 13px;
}
.bemove-user-trainer-position {
  margin-top: 1px;
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  line-height: 1.2;
}
.bemove-user-branch-inline {
  margin-top: 0;
  font-size: 10px;
  color: var(--text-sub);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bemove-user-branch-edit {
  margin-top: 4px;
}
.bemove-user-branch-edit label {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  color: var(--text-sub);
}
.bemove-user-position-edit {
  margin-top: 6px;
}
.bemove-user-position-edit label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 700;
}
.bemove-trainer-position-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 13px;
}
.bemove-admin-month-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.bemove-admin-month-row label {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 700;
}
.bemove-admin-month-row input[type="month"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 13px;
}
.bemove-target-manager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.bemove-target-manager-controls select,
.bemove-target-manager-controls input[type="month"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 13px;
}
.bemove-position-target-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font-size: 13px;
}
.bemove-branch-checks {
  max-height: 140px;
  overflow-y: auto;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bemove-branch-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.bemove-branch-check-label input {
  margin: 0;
}
.bemove-view-branches {
  max-width: 240px;
  word-break: break-word;
}
.bemove-manage-view,
.bemove-manage-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}
.bemove-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  margin-right: 0;
  padding: 0 2px;
  line-height: 1;
}
.bemove-icon-trash {
  width: 16px;
  height: 16px;
  display: block;
}
.bemove-icon-btn.edit { color: #2563eb; }
.bemove-icon-btn.key { color: #ea580c; }
.bemove-icon-btn.delete { color: #dc2626; }
.bemove-icon-btn.save { color: #16a34a; }
.bemove-icon-btn.cancel { color: #9ca3af; }

.bemove-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.bemove-modal {
  width: min(760px, 92vw);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.26);
  overflow: hidden;
}
.bemove-modal-header {
  padding: 24px 28px 12px;
  border-bottom: 1px solid var(--border);
}
.bemove-modal-header h4 {
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
  font-weight: 900;
}
.bemove-modal-header p {
  margin: 8px 0 0;
  color: var(--text-sub);
  font-size: 18px;
  font-weight: 700;
}
.bemove-modal-body {
  padding: 18px 28px;
}
.bemove-modal-warn {
  border: 2px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 20px;
  line-height: 1.45;
}
.bemove-modal-warn p {
  margin: 0 0 10px;
}
.bemove-modal-warn ul {
  margin: 0;
  padding-left: 22px;
}
.bemove-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 28px 24px;
}
.bemove-modal-footer .btn {
  min-width: 140px;
}
.bemove-branch-hero {
  background: linear-gradient(120deg, #7c3aed 0%, #6d28d9 40%, #4f46e5 100%);
  color: #f5f3ff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(109, 40, 217, 0.25);
}
.bemove-branch-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #ddd6fe;
  margin-bottom: 8px;
}
.bemove-branch-hero-top b {
  font-size: 11px;
  color: #fef3c7;
  background: rgba(15, 23, 42, 0.24);
  border-radius: 999px;
  padding: 3px 8px;
}
.bemove-branch-hero-value {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.05;
}
.bemove-branch-hero-value span {
  font-size: 14px;
  color: #ede9fe;
  font-weight: 700;
}
.bemove-member-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #f5f3ff;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.bemove-member-alert-icon { font-size: 1.2rem; }
.bemove-member-alert-text { flex: 1; }
.bemove-member-alert-text strong { display: block; }
.bemove-member-alert-text small { opacity: 0.9; }
.bemove-member-alert-btn { flex-shrink: 0; color: #4f46e5; }
.bemove-member-alert.is-compact { padding: 8px 10px; border-radius: 10px; margin-bottom: 10px; font-size: 12px; }
.bemove-member-alert.is-compact .bemove-member-alert-icon { font-size: 1rem; }
.bemove-member-alert.is-compact .bemove-member-alert-text strong { font-size: 12px; }
.bemove-member-alert.is-compact .bemove-member-alert-text small { font-size: 11px; }
.bemove-nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; vertical-align: middle; }
.bemove-member-hero {
  position: relative;
  background: linear-gradient(120deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  color: #eff6ff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.bemove-member-hero h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.bemove-member-hero p { margin: 0; opacity: 0.95; }
.bemove-member-hero-refresh {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.9;
}
.bemove-member-section-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.bemove-member-pt-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.bemove-pt-card {
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.bemove-pt-label { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.bemove-pt-card strong { font-size: 1.4rem; display: block; }
.bemove-pt-total { background: #dbeafe; color: #1e40af; }
.bemove-pt-done { background: #dcfce7; color: #166534; }
.bemove-pt-remain { background: #ffedd5; color: #c2410c; }
.bemove-member-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.bemove-member-progress-label { font-size: 13px; font-weight: 600; min-width: 60px; }
.bemove-member-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bemove-member-progress-bar {
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.bemove-member-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
  border-radius: 999px;
}
.bemove-member-progress-pct { font-size: 13px; font-weight: 600; color: var(--text); }
.bemove-member-stage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.bemove-member-stage-label { font-size: 13px; font-weight: 600; min-width: 70px; }
.bemove-member-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffedd5;
  color: #c2410c;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.bemove-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.bemove-member-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bemove-member-card h4 { margin: 0 0 4px; }
.bemove-member-card p { flex: 1; margin: 0; }
/* 회원 홈: kcal 네비게이터 */
.bemove-member-kcal-nav { margin-top: 14px; }
.bemove-member-kcal-nav h4 { margin: 0 0 10px; font-size: 16px; }
.bemove-member-kcal-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.bemove-member-kcal-kpis span { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #f8fafc; display: flex; align-items: center; justify-content: space-between; gap: 8px; white-space: nowrap; min-width: 0; }
.bemove-member-kcal-kpis em { font-style: normal; color: var(--text-sub); font-size: clamp(10px, 1.9vw, 12px); flex: 0 1 auto; min-width: 0; }
.bemove-member-kcal-kpis strong { font-size: clamp(12px, 3.1vw, 16px); color: #0f172a; line-height: 1; letter-spacing: -0.02em; flex: 0 1 auto; min-width: 0; }
.bemove-member-kcal-nav-msg { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.bemove-member-kcal-nav-sub { font-size: 12px; color: var(--text-sub); }
body[data-bemove-role="member"] .nav-tabs .nav-tab { font-size: 0.9rem; }
/* 회원 뷰: 모바일 앱 스타일 하단 탭바 */
body[data-bemove-role="member"] .nav-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  overflow: visible;
}
body[data-bemove-role="member"] .nav-tabs .nav-tab {
  min-height: 44px;
  margin: 0 2px;
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
}
body[data-bemove-role="member"] .main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
}
body[data-bemove-role="member"] .nav-left {
  flex: 0 0 auto;
  padding-right: 8px;
}
body[data-bemove-role="member"] #page-dashboard .page-content {
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

/* 트레이너 뷰: 상단 헤더 최소화(탭 숨김, 헤더 축소) */
body[data-bemove-role="trainer"] .nav-tabs { display: none !important; }
body[data-bemove-role="trainer"] .main-nav { padding: 8px 16px 10px; min-height: 48px; align-items: center; }
body[data-bemove-role="trainer"] .nav-left { flex: 0 0 auto; padding-right: 12px; }
body[data-bemove-role="trainer"] .nav-logo { font-size: 14px; }
body[data-bemove-role="trainer"] #page-dashboard #tab-content { padding-top: 0; }
body[data-bemove-role="trainer"] .bemove-screen { padding-top: 0; gap: 12px; }
body[data-bemove-role="trainer"] .bemove-trainer-layout { margin-top: 0; }
body[data-bemove-role="trainer"] .bemove-trainer-main .card:first-child { margin-top: 0; }
body[data-bemove-role="trainer"] #page-dashboard .page-content { height: calc(100vh - 48px); }

/* 트레이너 헤더 목표 (이 달의 목표 달성 현황) */
.bemove-trainer-header-goal {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 0 16px;
}
.bemove-trainer-header-goal-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}
.bemove-trainer-header-goal-value {
  font-size: 12px;
  color: var(--text);
}
.bemove-trainer-header-goal-bar {
  flex: 1;
  min-width: 80px;
  max-width: 160px;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.bemove-trainer-goal-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}
.bemove-trainer-goal-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 4px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.2s ease;
}
.bemove-trainer-header-goal-done {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.bemove-branch-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}
.bemove-hero-trophy {
  font-size: 1.2rem;
  margin-right: 6px;
  opacity: 0.9;
}
.bemove-branch-ranking-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.bemove-ranking-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.bemove-ranking-list { display: block; }
.bemove-ranking-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.bemove-ranking-col {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 6px;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  background: #fff;
}
.bemove-ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bemove-ranking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.bemove-rank-1 { background: #fef08a; color: #854d0e; }
.bemove-rank-2 { background: #e5e7eb; color: #374151; }
.bemove-rank-3 { background: #fed7aa; color: #9a3412; }
.bemove-ranking-name { flex: 1; }
.bemove-ranking-col .bemove-ranking-name {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}
.bemove-my-branch { color: var(--primary); font-weight: 600; margin-left: 4px; }
.bemove-ranking-sales { font-weight: 600; color: var(--text); }
.bemove-ranking-col .bemove-ranking-sales {
  font-size: 12px;
}
.bemove-branch-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
}
.bemove-branch-kpi-grid .bemove-stat {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 12px 12px 10px;
}
.bemove-branch-kpi-grid .bemove-kpi-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
}
.bemove-branch-kpi-grid .bemove-kpi-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #eef2ff;
}
.bemove-branch-kpi-grid .bemove-stat small {
  display: block;
  font-size: 10px;
  color: var(--text-sub);
  margin-top: 3px;
}
.bemove-branch-kpi-grid .bemove-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.bemove-branch-members-screen {
  display: grid;
  gap: 14px;
}
.bemove-members-hero {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 14px;
  padding: 14px 16px;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bemove-members-hero h3 {
  margin: 0;
  font-size: 1.4rem;
}
.bemove-members-hero p {
  margin: 4px 0 0;
  color: rgba(248, 250, 252, 0.88);
  font-size: 13px;
}
.bemove-members-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bemove-members-count {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
}
.bemove-members-table th,
.bemove-members-table td {
  font-size: 13px;
}
.bemove-member-td-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bemove-member-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.bemove-member-phase {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}
.bemove-member-trainer-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}
.bemove-member-trainer-wrap {
  display: grid;
  gap: 6px;
}
.bemove-member-trainer-select {
  min-width: 110px;
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  background: #fff;
}
.bemove-member-edit-btn {
  border: 0;
  border-radius: 10px;
  width: 28px;
  height: 28px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.bemove-equipment-board {
  padding: 14px;
}
.bemove-equipment-category-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.bemove-equipment-category-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  min-height: 240px;
}
.bemove-equipment-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.bemove-equipment-category-head span {
  min-width: 24px;
  text-align: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
}
.bemove-equipment-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.bemove-equipment-category-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.bemove-equipment-item-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.bemove-equipment-qr-modal {
  width: min(520px, 94vw);
}
.bemove-equipment-qr-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.bemove-equipment-qr-title span {
  color: #64748b;
  font-size: 12px;
}
.bemove-equipment-qr-img-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.bemove-equipment-qr-img {
  width: 240px;
  height: 240px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.bemove-equipment-qr-url {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  word-break: break-all;
  margin-bottom: 10px;
}
.bemove-equipment-qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bemove-equipment-qr-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.bemove-equipment-qr-entry-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.bemove-equipment-qr-entry-filters label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}
.bemove-equipment-qr-selected {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  display: flex;
  align-items: center;
}
.bemove-equipment-qr-entry-filters input,
.bemove-equipment-qr-entry-filters select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 8px;
}
.bemove-equipment-qr-entry-actions {
  display: flex;
  align-items: flex-end;
}
.bemove-equipment-qr-summary {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.bemove-equipment-qr-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bemove-equipment-qr-preview img {
  width: 220px;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bemove-equipment-qr-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.bemove-equipment-qr-kpis span {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
}
.bemove-equipment-qr-reco-msg {
  margin: 8px 0 10px;
}
.bemove-equipment-qr-record-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bemove-equipment-qr-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.bemove-equipment-qr-columns > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}
.bemove-equipment-qr-columns h6 {
  margin: 0 0 8px;
  font-size: 13px;
}
.bemove-equipment-qr-columns ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 12px;
}
.bemove-member-qr-only {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bemove-member-qr-scan-modal {
  width: min(520px, 94vw);
}
.bemove-member-qr-video {
  width: 100%;
  min-height: 220px;
  max-height: 320px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
}
.bemove-member-qr-status {
  margin: 8px 0;
  color: #64748b;
  font-size: 12px;
}
.bemove-member-qr-file-label {
  width: fit-content;
}
@media (max-width: 1200px) {
  .bemove-branch-kpi-grid .bemove-stat strong {
    font-size: 18px;
  }
  .bemove-equipment-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bemove-equipment-qr-entry-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bemove-equipment-qr-summary {
    grid-template-columns: 1fr;
  }
  .bemove-equipment-qr-kpis {
    grid-template-columns: 1fr;
  }
  .bemove-equipment-qr-columns {
    grid-template-columns: 1fr;
  }
  .bemove-ranking-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .bemove-branch-kpi-grid .bemove-kpi-head {
    font-size: 11px;
  }
  .bemove-branch-kpi-grid .bemove-stat strong {
    font-size: 16px;
  }
  .bemove-members-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .bemove-equipment-category-grid {
    grid-template-columns: 1fr;
  }
  .bemove-ranking-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* ── 트레이너 대시보드 레이아웃 (사이드바 + 메인) ── */
.bemove-trainer-layout {
  display: flex;
  min-height: 400px;
  gap: 0;
}
.bemove-trainer-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bemove-trainer-sidebar-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: -0.02em;
}
.bemove-trainer-sidebar-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bemove-rank-chip {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  grid-template-areas:
    "label value delta badge"
    "prev prev prev prev";
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #dbe3ff;
  border-radius: 10px;
  background: #f8fbff;
}
.bemove-rank-chip .label {
  grid-area: label;
  font-size: 11px;
  color: #6b7280;
  font-weight: 700;
}
.bemove-rank-chip .value {
  grid-area: value;
  font-size: 14px;
  font-weight: 900;
  color: #1f2937;
  letter-spacing: -0.01em;
}
.bemove-rank-chip .badge {
  grid-area: badge;
  font-size: 10px;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.25);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(59, 130, 246, 0.08);
  font-weight: 700;
}
.bemove-rank-chip .delta {
  grid-area: delta;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 6px;
  line-height: 1.2;
}
.bemove-rank-chip .prev {
  grid-area: prev;
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  margin-top: -2px;
}
.bemove-rank-chip .delta.is-up { color: #166534; background: #dcfce7; }
.bemove-rank-chip .delta.is-down { color: #991b1b; background: #fee2e2; }
.bemove-rank-chip .delta.is-flat { color: #475569; background: #f1f5f9; }
.bemove-rank-chip .delta.is-new { color: #1d4ed8; background: #dbeafe; }
.bemove-trainer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}
.bemove-trainer-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.bemove-trainer-nav-icon {
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}
.bemove-trainer-nav-label {
  min-width: 0;
}
.bemove-trainer-nav-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}
.bemove-trainer-nav-item.active {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 600;
}
.bemove-trainer-sidebar-foot {
  font-size: 12px;
  color: var(--text-sub);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.bemove-trainer-main {
  flex: 1;
  min-width: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bemove-trainer-schedule {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border-color: #93c5fd !important;
}
.bemove-trainer-manage-status {
  background: #fff;
}
.bemove-trainer-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bemove-trainer-manage-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.bemove-trainer-manage-card.is-rereg {
  background: #fffbeb;
  border-color: #fcd34d;
}
.bemove-trainer-manage-card.is-attend {
  background: #fdf2f8;
  border-color: #fbcfe8;
}
.bemove-trainer-manage-card h5 {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.bemove-trainer-manage-card h5 .badge {
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(30, 64, 175, 0.1);
  color: #1e40af;
}
.bemove-trainer-manage-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.5);
}
.bemove-trainer-manage-row:first-of-type {
  border-top: none;
}
.bemove-trainer-manage-row .name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-weight: 700;
  color: #111827;
}
.bemove-trainer-manage-row .name small {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}
.bemove-trainer-manage-row .bemove-manage-contact {
  margin-left: auto;
  width: auto;
  min-width: 84px;
  padding: 0 14px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.bemove-trainer-schedule h4 {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bemove-trainer-schedule-title-emoji {
  font-size: 18px;
  line-height: 1;
}
.bemove-trainer-schedule-icon-wrap {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  color: #1e40af;
}
.bemove-trainer-schedule-icon-wrap span { font-size: 1.5rem; }
.bemove-trainer-today-list { display: grid; gap: 8px; margin-top: 8px; }
.bemove-trainer-today-row {
  display: grid;
  grid-template-columns: 120px 1fr 56px;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  color: #1e3a8a;
  text-align: left;
  cursor: pointer;
}
.bemove-trainer-today-row:hover { background: #fff; }
.bemove-trainer-today-row .time { font-weight: 700; }
.bemove-trainer-today-row .name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bemove-trainer-today-row .name .last-workout { font-size: 11px; color: #334155; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bemove-trainer-today-row .dur { text-align: right; font-size: 12px; opacity: 0.9; }
.bemove-journal-queue-modal { max-width: 760px; width: min(760px, calc(100vw - 24px)); }
.bemove-journal-queue-section { margin-bottom: 14px; }
.bemove-journal-queue-section h4 { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: #1f2937; }
.bemove-journal-queue-row {
  display: grid;
  grid-template-columns: 110px 90px 1fr 56px 56px;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 6px;
  cursor: pointer;
}
.bemove-journal-queue-row:hover { background: #f8fafc; }
.bemove-journal-queue-row .date, .bemove-journal-queue-row .time { font-weight: 700; color: #334155; }
.bemove-journal-queue-row .name { color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bemove-journal-queue-row .dur { text-align: right; color: #334155; font-size: 12px; }
.bemove-journal-queue-row .badge { justify-self: end; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 999px; }
.bemove-journal-queue-row .badge.is-unfilled { background: #fee2e2; color: #991b1b; }
.bemove-journal-queue-row .badge.is-upcoming { background: #e0e7ff; color: #3730a3; }
.bemove-homework-board-modal { max-width: 860px; width: min(860px, calc(100vw - 24px)); }
.bemove-homework-board-list { display: grid; gap: 8px; }
.bemove-homework-board-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px 78px 68px;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.bemove-homework-board-row:hover { background: #f8fafc; }
.bemove-homework-board-row .name { font-weight: 700; color: #0f172a; }
.bemove-homework-board-row .latest { color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bemove-homework-board-row .date { color: #64748b; font-size: 12px; text-align: right; }
.bemove-homework-board-row .badge { justify-self: end; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 999px; }
.bemove-homework-board-row .badge.pending { background: #fee2e2; color: #991b1b; }
.bemove-homework-board-row .badge.done { background: #dcfce7; color: #166534; }
.bemove-trainer-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.bemove-trainer-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bemove-trainer-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.bemove-trainer-action-btn .bemove-action-icon { font-size: 1.75rem; }
.bemove-action-register { background: #dbeafe; color: #1e40af; }
.bemove-action-library, .bemove-action-journal-list { background: #dcfce7; color: #166534; }
.bemove-action-diet { background: #ffedd5; color: #c2410c; }
.bemove-action-schedule { background: #f3e8ff; color: #6b21a8; }
.bemove-action-homework-board { background: #f3e8ff; color: #6b21a8; }
@media (max-width: 900px) {
  .bemove-trainer-layout { flex-direction: column; }
  .bemove-trainer-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .bemove-trainer-nav { flex-direction: row; flex-wrap: wrap; }
  .bemove-trainer-main { padding-left: 0; padding-top: 16px; }
  .bemove-trainer-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ── 트레이너 PT 회원 리스트 ── */
.bemove-pt-list-main { gap: 16px; }
.bemove-pt-list-header { margin-bottom: 8px; }
.bemove-pt-list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.bemove-pt-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bemove-pt-member-view-scope {
  min-width: 150px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}
.bemove-pt-list-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}
.bemove-pt-period-select {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}
.bemove-pt-list-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
}
.bemove-pt-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.bemove-pt-member-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease;
}
.bemove-pt-member-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.bemove-pt-member-card-alert {
  border-left: 3px solid #dc2626;
}
.bemove-pt-member-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-style: dashed;
  cursor: pointer;
}
.bemove-pt-avatar-new {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 12px;
}
.bemove-pt-member-new .bemove-pt-member-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}
.bemove-pt-member-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-sub);
}
.bemove-pt-member-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.bemove-pt-member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.bemove-pt-member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bemove-pt-member-info .bemove-pt-member-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.bemove-pt-member-meta {
  font-size: 12px;
  color: var(--text-sub);
}
.bemove-pt-member-phone {
  font-size: 12px;
  color: var(--text-sub);
}
.bemove-pt-member-arrow {
  font-size: 1.25rem;
  color: var(--text-sub);
  flex-shrink: 0;
}
.bemove-pt-member-session {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 8px;
}
.bemove-pt-session-label { margin-right: 4px; }
.bemove-pt-session-frac { color: var(--text-sub); }
.bemove-pt-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.bemove-pt-progress-wrap .bemove-progress {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.bemove-pt-progress-wrap .bemove-progress > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #a78bfa, #6366f1);
  transition: width 0.2s ease;
}
.bemove-pt-member-card.bemove-pt-progress-full .bemove-pt-progress-wrap .bemove-progress > span {
  background: linear-gradient(90deg, #fb923c, #ea580c);
}
.bemove-pt-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  min-width: 32px;
}
.bemove-pt-warning {
  font-size: 12px;
  color: #b45309;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.bemove-pt-status {
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── PT 회원 등록 모달 ── */
.bemove-member-register-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}
.bemove-member-register-modal {
  width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
}
.bemove-member-register-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 10px;
}
.bemove-member-register-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
  color: #111827;
}
.bemove-member-register-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}
.bemove-member-register-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.bemove-member-register-tab {
  border: none;
  background: #fff;
  color: #6b7280;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 10px 12px;
  border-bottom: 4px solid transparent;
  cursor: pointer;
}
.bemove-member-register-tab.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.bemove-member-register-body { padding: 18px 22px 24px; }
.bemove-member-register-pane { display: none; }
.bemove-member-register-pane.is-active { display: block; }
.bemove-member-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.bemove-member-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}
.bemove-member-form-grid label.full { grid-column: 1 / -1; }
.bemove-member-form-grid input,
.bemove-member-form-grid select,
.bemove-member-form-grid textarea,
.bemove-member-register-pane select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  color: #111827;
  background: #fff;
}
.bemove-member-form-grid textarea {
  min-height: 90px;
  resize: vertical;
}
.bemove-member-register-pane[data-pane="existing"] label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}
.bemove-member-register-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.bemove-member-register-actions .btn {
  min-height: 44px;
  font-size: 14px;
  font-weight: 800;
}
.bemove-member-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: rgba(15, 23, 42, 0.45);
  overflow: auto;
}
.bemove-member-detail-page {
  width: min(1280px, 96vw);
  margin: 10px auto 24px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 12px 14px;
}
.bemove-member-detail-main .bemove-member-detail-page {
  width: 100%;
  margin: 0;
}
.bemove-trainer-layout-detail {
  align-items: flex-start;
}
.bemove-member-detail-back {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.bemove-member-detail-back-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.bemove-member-detail-header-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.bemove-member-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
}
.bemove-member-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.bemove-member-detail-title-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}
.bemove-member-detail-status {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 7px;
  background: #f3e8ff;
  color: #7c3aed;
}
.bemove-member-detail-sub {
  margin: 0 0 6px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 600;
}
.bemove-member-detail-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-sub);
  font-size: 12px;
}
.bemove-member-detail-kpis b {
  color: var(--text);
}
.bemove-member-detail-head-actions {
  display: flex;
  gap: 6px;
}
.bemove-member-detail-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 16px;
}
.bemove-member-detail-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.bemove-member-detail-tab {
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}
.bemove-member-detail-tab.is-active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
  color: #2563eb;
}
.bemove-member-detail-content {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: none;
}
.bemove-member-detail-content.is-active {
  display: block;
}
.bemove-member-detail-banner {
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 100%);
  color: #dbeafe;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.bemove-member-detail-banner h4 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 16px;
}
.bemove-member-detail-banner p {
  margin: 0;
  font-size: 12px;
}
.bemove-member-detail-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bemove-member-form-item label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.bemove-member-form-item textarea,
.bemove-member-form-item input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
}
.bemove-member-form-item textarea {
  min-height: 64px;
  resize: vertical;
}
.bemove-member-option-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.bemove-member-option-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bemove-member-option-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bemove-member-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #fff;
}
.bemove-member-option.is-active {
  border-color: #3b82f6;
  box-shadow: inset 0 0 0 1px #3b82f6;
  color: #2563eb;
}
.bemove-member-detail-save {
  min-height: 44px;
  font-size: 15px;
  font-weight: 800;
}
.bemove-555-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bemove-555-title-row > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.bemove-555-title-row h4 {
  margin: 0;
  font-size: 16px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.bemove-555-title-row p {
  margin: 0;
  color: var(--text-sub);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bemove-555-title-row .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 140px;
  padding-left: 14px;
  padding-right: 14px;
  white-space: nowrap;
}
.bemove-555-overview-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 20px;
}
.bemove-555-overview-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.bemove-555-overview-head {
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 100%);
  color: #dbeafe;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bemove-555-overview-head strong {
  display: block;
  color: #fff;
}
.bemove-555-overview-head span {
  font-size: 12px;
}
.bemove-555-overview-head .btn.btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  background: transparent;
}
.bemove-555-overview-head .btn.btn-outline:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
}
.bemove-555-share-btn,
.bemove-555-overview-head .bemove-555-share-btn,
.bemove-555-overview-head .bemove-555-share-btn:visited,
.bemove-555-overview-head .bemove-555-share-btn:hover,
.bemove-555-overview-head .bemove-555-share-btn:active,
.bemove-555-overview-head .bemove-555-share-btn:focus {
  color: #fff !important;
}
.bemove-555-overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}
.bemove-555-overview-kpis div {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  padding: 10px;
}
.bemove-555-overview-kpis span {
  display: block;
  color: var(--text-sub);
  font-size: 12px;
}
.bemove-555-overview-kpis b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 800;
}
.bemove-555-overview-note {
  margin: 0 10px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 3px solid #60a5fa;
  background: #eff6ff;
}
.bemove-555-overview-note.is-goal {
  border-left-color: #22c55e;
  background: #f0fdf4;
}
.bemove-555-overview-note.is-ai {
  border-left-color: #8b5cf6;
  background: #f5f3ff;
}
.bemove-555-overview-note b {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}
.bemove-555-overview-note p {
  margin: 0;
  color: var(--text-sub);
  font-size: 12px;
}
.bemove-555-archive-card {
  margin-top: 10px;
}
.bemove-555-archive-card h5 {
  margin: 0 0 8px;
  font-size: 14px;
}
.bemove-555-archive-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.bemove-555-archive-table {
  width: 100%;
  border-collapse: collapse;
}
.bemove-555-archive-table th,
.bemove-555-archive-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
}
.bemove-555-archive-row {
  cursor: pointer;
}
.bemove-555-archive-row:hover {
  background: #f8fafc;
}
.bemove-555-archive-row.is-active {
  background: #eef2ff;
}
.bemove-555-archive-details {
  padding: 10px;
  background: #f8fafc;
}
.bemove-555-archive-detail {
  display: none;
}
.bemove-555-archive-detail.is-open {
  display: block;
}
.bemove-555-archive-workout {
  display: grid;
  gap: 8px;
}
.bemove-555-archive-workout-item {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}
.bemove-555-archive-workout-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.bemove-555-archive-workout-head strong {
  color: #0f172a;
  font-size: 13px;
}
.bemove-555-archive-workout-head span {
  color: #475569;
  font-size: 12px;
}
.bemove-555-archive-set-table {
  width: 100%;
  border-collapse: collapse;
}
.bemove-555-archive-set-table th,
.bemove-555-archive-set-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: center;
  font-size: 12px;
  background: #fff;
}
.bemove-555-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.bemove-555-modal-card {
  width: min(1040px, 98vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #d1d5db;
}
.bemove-555-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(120deg, #1d4ed8 0%, #7e22ce 100%);
}
.bemove-555-modal-head h3 {
  margin: 0;
  font-size: 20px;
}
.bemove-555-modal-head p {
  margin: 4px 0 0;
  font-size: 13px;
}
.bemove-555-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.bemove-555-steps {
  display: flex;
  justify-content: space-around;
  background: linear-gradient(120deg, #1d4ed8 0%, #7e22ce 100%);
  padding: 0 20px 16px;
}
.bemove-555-steps span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.bemove-555-steps span.on {
  background: #fff;
  color: #3730a3;
}
.bemove-555-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
.bemove-555-tab {
  border: none;
  background: #f8fafc;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  border-bottom: 3px solid transparent;
}
.bemove-555-tab.is-active {
  color: #3730a3;
  border-bottom-color: #4f46e5;
  background: #fff;
}
.bemove-555-merge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.bemove-555-merge-summary {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.bemove-555-merge-summary strong {
  font-size: 12px;
  color: #334155;
}
.bemove-555-merge-summary span {
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bemove-555-merge-actions {
  display: flex;
  gap: 6px;
}
.bemove-555-merge-actions .btn {
  white-space: nowrap;
}
.bemove-555-body {
  padding: 14px 16px;
}
.bemove-555-body h4 {
  margin: 0 0 10px;
  font-size: 14px;
}
.bemove-555-section {
  margin-bottom: 14px;
}
.bemove-555-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 13px;
}
.bemove-555-section input,
.bemove-555-section textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
}
.bemove-555-section textarea {
  min-height: 120px;
  resize: vertical;
}
.bemove-555-condition-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.bemove-555-condition,
.bemove-555-pain {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 8px;
}
.bemove-555-condition.is-active,
.bemove-555-pain.is-active {
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #2563eb;
}
.bemove-555-pain-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bemove-555-pain {
  border-radius: 999px;
  padding: 8px 14px;
}
.bemove-555-exercise {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.bemove-555-ex-head {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
.bemove-555-ex-head input,
.bemove-555-ex-head select {
  width: 100%;
  min-width: 0;
}
.bemove-555-icon-del {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  width: 40px;
}
.bemove-555-set-table {
  width: 100%;
  border-collapse: collapse;
}
.bemove-555-set-table th,
.bemove-555-set-table td {
  border: 1px solid var(--border);
  text-align: center;
  padding: 6px;
}
.bemove-555-set-table input {
  width: 100%;
  text-align: center;
}
.bemove-555-set-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.bemove-555-equip-helper {
  display: grid;
  grid-template-columns: auto 160px 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
.bemove-555-equip-helper input,
.bemove-555-equip-helper select {
  min-width: 0;
}
.bemove-555-summary {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 12px;
}
.bemove-555-summary h5 {
  margin: 0 0 8px;
  font-size: 16px;
}
.bemove-555-summary p {
  margin: 2px 0;
}
.bemove-555-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 16px;
}
.bemove-555-foot .btn {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .bemove-trainer-manage-grid {
    grid-template-columns: 1fr;
  }
  .bemove-555-condition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bemove-555-tabs {
    grid-template-columns: 1fr;
  }
  .bemove-555-merge-row {
    flex-direction: column;
    align-items: stretch;
  }
  .bemove-555-merge-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

/* ── 인바디 관리 ── */
.bemove-inbody-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bemove-inbody-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 10px;
  align-items: stretch;
}
.bemove-inbody-score-card {
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 100%);
}
.bemove-inbody-score-card p {
  margin: 0;
  font-size: 12px;
  opacity: 0.95;
}
.bemove-inbody-score-card strong {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 38px;
  line-height: 1;
}
.bemove-inbody-score-card strong span {
  font-size: 18px;
  line-height: 1.2;
}
.bemove-inbody-graph-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.bemove-inbody-graph-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.bemove-inbody-graph-head h4 {
  margin: 0;
  font-size: 15px;
}
.bemove-inbody-actions {
  display: inline-flex;
  gap: 8px;
}
.bemove-inbody-actions .btn {
  width: auto;
  min-width: 96px;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.bemove-inbody-chart-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfdff 0%, #f8fbff 100%);
  padding: 10px 10px 8px;
}
.bemove-inbody-chart-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-sub);
  text-align: center;
  padding: 24px 12px;
  font-size: 12px;
}
.bemove-inbody-chart {
  width: 100%;
  height: 230px;
  display: block;
}
.bemove-inbody-chart .y-grid line {
  stroke: #e5e7eb;
  stroke-dasharray: 3 4;
}
.bemove-inbody-chart .y-grid text,
.bemove-inbody-chart .x-labels text {
  fill: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}
.bemove-inbody-chart .line {
  fill: none;
  stroke-width: 2.5;
}
.bemove-inbody-chart .line.is-smm { stroke: #2563eb; }
.bemove-inbody-chart .line.is-weight { stroke: #ef4444; }
.bemove-inbody-chart .line.is-bfp { stroke: #f59e0b; }
.bemove-inbody-chart .dot {
  stroke: #fff;
  stroke-width: 2;
}
.bemove-inbody-chart .dot.is-smm { fill: #2563eb; }
.bemove-inbody-chart .dot.is-weight { fill: #ef4444; }
.bemove-inbody-chart .dot.is-bfp { fill: #f59e0b; }
.bemove-inbody-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}
.bemove-inbody-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  font-weight: 700;
}
.bemove-inbody-legend span::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.bemove-inbody-legend .is-smm::before { background: #2563eb; }
.bemove-inbody-legend .is-weight::before { background: #ef4444; }
.bemove-inbody-legend .is-bfp::before { background: #f59e0b; }
.bemove-inbody-latest-strip {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr) auto;
  gap: 8px;
  margin-top: 0;
  align-items: stretch;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.bemove-inbody-latest-strip {
  overflow-x: auto;
}
.bemove-inbody-latest-strip .metric {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  min-width: 96px;
}
.bemove-inbody-latest-strip .metric b {
  display: block;
  color: var(--text-sub);
  font-size: 10px;
  margin-bottom: 2px;
}
.bemove-inbody-latest-strip .metric strong {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.bemove-inbody-latest-strip .metric.date strong {
  font-size: 18px;
}
.bemove-inbody-latest-strip .metric.weight strong { color: #ef4444; }
.bemove-inbody-latest-strip .metric.smm strong { color: #2563eb; }
.bemove-inbody-latest-strip .metric.bfp strong { color: #d97706; }
.bemove-inbody-insight {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.bemove-inbody-insight h4 {
  margin: 0 0 10px;
  font-size: 16px;
}
.bemove-inbody-ai-loading {
  display: inline-flex;
  margin-left: 8px;
  font-size: 12px;
  color: #2563eb;
  font-weight: 700;
}
.bemove-inbody-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.bemove-inbody-box h5 {
  margin: 0 0 6px;
  font-size: 14px;
}
.bemove-inbody-box p,
.bemove-inbody-box li {
  font-size: 12px;
}
.bemove-inbody-box ul {
  margin: 0;
  padding-left: 16px;
}
.bemove-inbody-box.is-current { background: #eff6ff; border-color: #bfdbfe; }
.bemove-inbody-box.is-needs { background: #fef2f2; border-color: #fecaca; }
.bemove-inbody-box.is-method { background: #ecfdf5; border-color: #bbf7d0; }
.bemove-inbody-box.is-goal { background: #f5f3ff; border-color: #ddd6fe; }
.bemove-inbody-box.is-diet { background: #fff7ed; border-color: #fed7aa; }
.bemove-inbody-box.is-exercise { background: #ecfeff; border-color: #a5f3fc; }
.bemove-inbody-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.bemove-inbody-grid .bemove-inbody-box.is-exercise {
  grid-column: 1 / -1;
}
.bemove-inbody-history {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.bemove-inbody-history h4 {
  margin: 0 0 8px;
  font-size: 16px;
}
.bemove-inbody-history-table-wrap {
  overflow: auto;
}
.bemove-inbody-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}
.bemove-inbody-history-table th,
.bemove-inbody-history-table td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: center;
  font-size: 12px;
}
.bemove-inbody-history-table th {
  background: #f8fafc;
  font-weight: 700;
}
.bemove-inbody-manual-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bemove-inbody-manual-modal {
  width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #d1d5db;
}
.bemove-inbody-manual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.bemove-inbody-manual-head h3 {
  margin: 0;
  font-size: 20px;
}
.bemove-inbody-manual-head button {
  border: none;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}
.bemove-inbody-manual-body {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.bemove-inbody-manual-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}
.bemove-inbody-manual-body input {
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 12px;
}
.bemove-inbody-manual-foot {
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── AI 운동 처방 + 기구 관리 ── */
.bemove-ai-rx { display: flex; flex-direction: column; gap: 12px; }
.bemove-ai-rx-hero {
  border-radius: 14px;
  padding: 14px;
  color: #fff;
  background: linear-gradient(125deg, #1d4ed8 0%, #1e40af 100%);
}
.bemove-ai-rx-title h4 { margin: 0; font-size: 22px; }
.bemove-ai-rx-title p { margin: 6px 0 0; opacity: .92; font-size: 12px; }
.bemove-ai-rx-metrics { margin-top: 12px; display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bemove-ai-rx-metric { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 10px; }
.bemove-ai-rx-metric span { display: block; font-size: 11px; opacity: .9; }
.bemove-ai-rx-metric strong { font-size: 32px; line-height: 1.05; letter-spacing: -0.02em; }
.bemove-ai-rx-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fff; }
.bemove-ai-rx-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bemove-ai-rx-head h5 { margin: 0; font-size: 22px; }
.bemove-ai-rx-head p { margin: 4px 0 0; color: var(--text-sub); font-size: 12px; }
.bemove-ai-rx-error { border: 1px solid #fecaca; color: #b91c1c; background: #fff1f2; border-radius: 10px; padding: 8px 10px; font-size: 12px; margin-bottom: 10px; }
.bemove-ai-rx-report h6 { margin: 0 0 6px; font-size: 16px; }
.bemove-ai-rx-report p { margin: 0 0 8px; font-size: 12px; color: #334155; }
.bemove-ai-rx-report ul { margin: 0; padding-left: 16px; }
.bemove-ai-rx-report li { margin: 4px 0; font-size: 12px; }
.bemove-ai-rx-warning { margin-top: 10px; padding: 10px; border: 1px solid #fed7aa; border-radius: 10px; background: #fff7ed; }
.bemove-ai-rx-warning strong { font-size: 12px; }

.bemove-hw-wrap { display: flex; flex-direction: column; gap: 14px; }
.bemove-hw-hero {
  border-radius: 14px;
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(125deg, #4f46e5 0%, #4338ca 100%);
}
.bemove-hw-hero h4 { margin: 0; font-size: 28px; line-height: 1.15; }
.bemove-hw-hero p { margin: 6px 0 0; font-size: 13px; opacity: .92; }
.bemove-hw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.bemove-hw-left, .bemove-hw-right { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 14px; }
.bemove-hw-left h5, .bemove-hw-right h5 { margin: 0; font-size: 22px; }
.bemove-hw-count { margin: 6px 0 10px; color: #6366f1; font-size: 12px; font-weight: 700; }
.bemove-hw-parts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.bemove-hw-part {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  text-align: left;
  gap: 2px 8px;
  padding: 10px 12px;
}
.bemove-hw-part-label { font-size: 14px; font-weight: 700; color: #0f172a; }
.bemove-hw-part-sub { font-size: 11px; color: var(--text-sub); }
.bemove-hw-part-plus { grid-row: 1 / span 2; font-size: 20px; color: #94a3b8; }
.bemove-hw-part.is-active { border-color: #6366f1; background: #eef2ff; }
.bemove-hw-part.is-active .bemove-hw-part-plus { color: #4f46e5; }
.bemove-hw-generate { width: 100%; min-height: 44px; }
.bemove-hw-generate:disabled { opacity: .45; cursor: not-allowed; }
.bemove-hw-preview {
  border: 1px solid #f3e8a8;
  border-radius: 12px;
  min-height: 280px;
  background: #fffbeb;
  padding: 18px 16px;
  color: #334155;
}
.bemove-hw-preview-empty {
  height: 100%;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 4px;
  color: #64748b;
  font-size: 14px;
}
.bemove-hw-preview-text { font-size: 13px; line-height: 1.55; white-space: normal; }
.bemove-hw-tip { margin: 8px 0 0; color: var(--text-sub); font-size: 11px; }
.bemove-self-homework-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.bemove-self-homework-item input[type="checkbox"] { width: 16px; height: 16px; }
.bemove-self-homework-item span { display: flex; flex-direction: column; min-width: 0; }
.bemove-self-homework-item span b { font-size: 12px; color: #0f172a; line-height: 1.2; }
.bemove-self-homework-item span small {
  margin-top: 2px;
  color: var(--text-sub);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bemove-self-homework-item em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
}
.bemove-self-homework-row { cursor: pointer; }
.bemove-self-homework-row.is-active { border-color: #818cf8; background: #f8faff; }
.bemove-self-homework-detail {
  display: none;
  margin: -2px 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}
.bemove-self-homework-detail.is-open { display: block; }
.bemove-self-homework-detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.bemove-self-homework-detail-head b { color: #334155; }
.bemove-self-homework-detail-head span { color: #1f2937; font-weight: 600; }
.bemove-self-homework-guide b {
  display: block;
  font-size: 12px;
  color: #334155;
  margin-bottom: 6px;
}
.bemove-self-homework-guide ul {
  margin: 0;
  padding-left: 18px;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.5;
}
.bemove-self-homework-guide li + li { margin-top: 4px; }
.bemove-workout-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
}
.bemove-workout-section-head h4 {
  margin: 0;
  white-space: nowrap;
  word-break: keep-all;
  flex: 0 0 auto;
}
.bemove-self-workout-open {
  min-height: 34px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.bemove-self-workout-modal {
  width: min(960px, 92vw);
  max-height: 88vh;
  overflow: auto;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
}
.bemove-self-workout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.bemove-self-workout-head h3 { margin: 0; font-size: 20px; }
.bemove-self-workout-close {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #0f172a;
}
.bemove-self-workout-body {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bemove-self-workout-type-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bemove-self-workout-type {
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}
.bemove-self-workout-type.is-active {
  color: #fff;
}
.bemove-self-workout-type[data-type="weight"].is-active {
  background: #16a34a;
  border-color: #0ea5e9;
}
.bemove-self-workout-type[data-type="cardio"].is-active {
  background: #2563eb;
  border-color: #1d4ed8;
}
.bemove-self-workout-group { display: flex; flex-direction: column; gap: 8px; }
.bemove-self-workout-group label { font-size: 13px; font-weight: 800; margin: 0; }
.bemove-self-workout-group textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
}
.bemove-self-workout-group input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}
.bemove-self-workout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bemove-self-workout-ex-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 180px;
  background: #fff;
}
.bemove-self-workout-empty {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.bemove-self-workout-empty-icon { font-size: 28px; margin-bottom: 8px; }
.bemove-self-workout-ex-item { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.bemove-self-workout-ex-item:last-child { margin-bottom: 0; }
.bemove-self-workout-ex-item input {
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}
.bemove-self-workout-ex-item select {
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
  background: #fff;
}
.bemove-self-workout-ex-item.is-cardio { gap: 10px; background: #f8fafc; border-radius: 12px; padding: 10px; }
.bemove-self-workout-ex-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 8px;
}
.bemove-self-workout-ex-grid {
  display: grid;
  grid-template-columns: 120px 120px auto;
  gap: 8px;
}
.bemove-self-workout-ex-grid.is-cardio {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.bemove-self-workout-ex-grid.is-cardio label { display: flex; flex-direction: column; gap: 4px; }
.bemove-self-workout-ex-grid.is-cardio label span { font-size: 11px; color: var(--text-sub); }
.bemove-self-workout-add {
  min-height: 38px;
  background: #6366f1 !important;
  border-color: #6366f1 !important;
}
.bemove-self-workout-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}
.bemove-self-workout-foot .btn {
  min-height: 50px;
  font-size: 14px;
  font-weight: 800;
}
@media (max-width: 900px) {
  .bemove-self-workout-modal { width: 96vw; }
  .bemove-self-workout-head { padding: 14px; }
  .bemove-self-workout-body { padding: 12px 14px; }
  .bemove-self-workout-foot { padding: 12px 14px 14px; }
  .bemove-self-workout-type { min-height: 48px; font-size: 12px; }
  .bemove-self-workout-ex-top { grid-template-columns: 1fr; }
  .bemove-self-workout-ex-grid,
  .bemove-self-workout-ex-grid.is-cardio { grid-template-columns: 1fr; }
}

.bemove-equipment-main { display: flex; flex-direction: column; gap: 12px; }
.bemove-equipment-card h4 { margin: 0 0 6px; }
.bemove-equipment-input-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 8px;
  margin: 10px 0;
  align-items: center;
}
.bemove-equipment-input-row select {
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 12px;
  width: 100%;
}
.bemove-equipment-input-row input {
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 12px;
  width: 100%;
}
.bemove-equipment-input-row .btn {
  white-space: nowrap;
  min-height: 40px;
}
.bemove-equipment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bemove-equipment-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
@media (max-width: 900px) {
  .bemove-ai-rx-metrics { grid-template-columns: 1fr; }
  .bemove-ai-rx-metric strong { font-size: 24px; }
  .bemove-ai-rx-head { flex-direction: column; align-items: flex-start; }
  .bemove-equipment-input-row { grid-template-columns: 140px minmax(220px, 1fr) auto; }
  .bemove-hw-grid { grid-template-columns: 1fr; }
  .bemove-hw-hero h4 { font-size: 22px; }
  .bemove-hw-left h5, .bemove-hw-right h5 { font-size: 18px; }
}
@media (max-width: 900px) {
  .bemove-inbody-top {
    grid-template-columns: 1fr;
  }
  .bemove-inbody-latest-strip,
  .bemove-inbody-grid,
  .bemove-inbody-manual-body,
  .bemove-inbody-manual-foot {
    grid-template-columns: 1fr;
  }
  .bemove-inbody-legend {
    flex-wrap: wrap;
  }
  .bemove-inbody-latest-strip .metric strong {
    font-size: 20px;
  }
  .bemove-inbody-score-card strong {
    font-size: 36px;
  }
}

/* ── 트레이너 OT 회원 탭 ── */
.bemove-ot-main { gap: 16px; }
.bemove-ot-wrap { display: flex; flex-direction: column; gap: 14px; }
.bemove-ot-view-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bemove-ot-view-mode {
  display: inline-flex;
  gap: 8px;
}
.bemove-ot-view-filters .btn.is-active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}
.bemove-ot-view-filters select {
  min-width: 180px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.bemove-ot-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}
.bemove-ot-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.bemove-ot-kpi {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.bemove-ot-kpi-label { color: var(--text-sub); font-size: 13px; margin-bottom: 8px; }
.bemove-ot-kpi strong { font-size: 30px; line-height: 1; }
.bemove-ot-kpi-total { background: #e8f1ff; color: #1d4ed8; }
.bemove-ot-kpi-pending { background: #ecfdf5; color: #047857; }
.bemove-ot-kpi-converted { background: #f5f3ff; color: #7c3aed; }
.bemove-ot-kpi-rate { background: #fff7ed; color: #c2410c; }
.bemove-ot-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bemove-ot-list-head h4 { margin: 0; }
.bemove-ot-rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.bemove-ot-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.bemove-ot-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.bemove-ot-name-line strong { font-size: 18px; }
.bemove-ot-tag {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  border-radius: 999px;
  padding: 2px 8px;
}
.bemove-ot-email, .bemove-ot-date {
  font-size: 13px;
  color: var(--text-sub);
}
.bemove-ot-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.bemove-ot-progress-num {
  font-size: 34px;
  font-weight: 800;
  color: #2563eb;
  line-height: 1;
}
.bemove-ot-progress-label { font-size: 12px; color: var(--text-sub); }
.bemove-ot-log-btn { min-width: 160px; }
.bemove-ot-empty {
  padding: 16px 0 4px;
  color: var(--text-sub);
  font-size: 14px;
}
.bemove-ot-table td strong { font-size: 15px; }
.bemove-ot-table .bemove-ot-log-btn {
  min-width: 120px;
  white-space: nowrap;
}

/* OT 전환 기록 */
.bemove-conversion-wrap { padding: 0 0 2rem; }
.bemove-conversion-title { font-size: 1.5rem; margin-bottom: 1.25rem; font-weight: 700; }
.bemove-conversion-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .bemove-conversion-cards { grid-template-columns: repeat(2, 1fr); }
}
.bemove-conversion-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.bemove-conversion-card-label { font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.bemove-conversion-card-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.bemove-conversion-card-icon { font-size: 24px; opacity: 0.9; }
.bemove-conversion-card-success .bemove-conversion-card-value { color: #047857; }
.bemove-conversion-card-failure .bemove-conversion-card-value { color: #dc2626; }
.bemove-conversion-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.bemove-conversion-filter {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}
.bemove-conversion-filter.is-active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.bemove-conversion-table-wrap { overflow-x: auto; }
.bemove-conversion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bemove-conversion-table th,
.bemove-conversion-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.bemove-conversion-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-sub);
}
.bemove-conversion-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.bemove-conversion-success { background: #d1fae5; color: #047857; }
.bemove-conversion-failure { background: #fee2e2; color: #dc2626; }
.bemove-conversion-pending { background: #e0e7ff; color: #4338ca; }

/* 매출 관리 */
.bemove-sales-wrap { padding: 0 0 2rem; }
.bemove-sales-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.75rem; }
.bemove-sales-title { font-size: 1.5rem; margin: 0; font-weight: 700; }
.bemove-sales-header-actions { display: flex; gap: 0.5rem; align-items: center; }
.bemove-sales-header-actions .btn { white-space: nowrap; padding: 0.35rem 0.75rem; min-height: auto; line-height: 1.4; font-size: 14px; }
.bemove-sales-tabs { display: flex; gap: 0.25rem; margin-bottom: 1.25rem; }
.bemove-sales-tab { padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; }
.bemove-sales-tab.is-active { background: #2563eb; color: #fff; border-color: #2563eb; }
.bemove-sales-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .bemove-sales-cards { grid-template-columns: 1fr; } }
.bemove-sales-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; position: relative; }
.bemove-sales-card-icon { font-size: 24px; margin-bottom: 0.5rem; opacity: 0.9; }
.bemove-sales-card-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.bemove-sales-card-label { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.bemove-sales-card-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.bemove-sales-card-total { border-left: 4px solid #2563eb; }
.bemove-sales-card-new { border-left: 4px solid #059669; }
.bemove-sales-card-rereg { border-left: 4px solid #7c3aed; }
.bemove-sales-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .bemove-sales-two-col { grid-template-columns: 1fr; } }
.bemove-sales-chart-caption { font-size: 12px; color: var(--text-sub); margin: 0 0 8px 0; }
.bemove-sales-chart { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; min-height: 160px; padding: 1rem 0; }
.bemove-sales-chart-bar-wrap { display: flex; flex-direction: column; align-items: center; }
.bemove-sales-chart-bar { width: 32px; min-height: 4px; background: #2563eb; border-radius: 4px 4px 0 0; transition: height 0.2s; }
.bemove-sales-chart-label { font-size: 12px; color: var(--text-sub); margin-top: 6px; }
.bemove-sales-inflow .bemove-sales-inflow-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.bemove-sales-table-section h4 { margin-bottom: 0.75rem; }
.bemove-sales-table-pane { display: none; }
.bemove-sales-table-pane.is-active { display: block; }
.bemove-sales-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bemove-sales-table th, .bemove-sales-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.bemove-sales-table th { background: #f8fafc; font-weight: 600; color: var(--text-sub); }
.bemove-sales-badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 12px; font-weight: 600; }
.bemove-sales-badge-new { background: #d1fae5; color: #047857; }
.bemove-sales-badge-rereg { background: #dbeafe; color: #1d4ed8; }
.bemove-sales-badge-deposit { background: #ffedd5; color: #c2410c; }
.bemove-sales-badge-outstanding { background: #fce7f3; color: #be185d; }
.bemove-sales-actions { white-space: nowrap; }
.bemove-sales-btn-edit, .bemove-sales-btn-delete { background: none; border: none; cursor: pointer; padding: 0 4px; font-size: 14px; }
.bemove-sales-goal-summary { margin-top: 0.75rem; font-size: 14px; color: var(--text-sub); }
.bemove-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.bemove-modal { background: #fff; border-radius: 12px; min-width: 320px; max-width: 480px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.bemove-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 700; }
.bemove-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; line-height: 1; opacity: 0.7; }
.bemove-modal-body { padding: 1.25rem; }
.bemove-modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.bemove-modal-head h3 { margin: 0; font-size: 16px; }
.bemove-modal-body,
.bemove-modal-body label,
.bemove-modal-body input,
.bemove-modal-body select,
.bemove-modal-body textarea,
.bemove-modal-foot .btn { font-size: 13px; white-space: nowrap; }
.btn-nowrap { white-space: nowrap; }
.expense-request-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.expense-request-status-badge.is-draft {
  background: #f3f4f6;
  color: #374151;
}
.expense-request-status-badge.is-pending {
  background: #fef3c7;
  color: #92400e;
}
.expense-request-status-badge.is-approved {
  background: #dcfce7;
  color: #166534;
}
.expense-request-status-badge.is-rejected {
  background: #fee2e2;
  color: #991b1b;
}
.expense-request-status-badge.is-done {
  background: #dbeafe;
  color: #1d4ed8;
}
.expense-request-status-badge.is-cancelled {
  background: #e5e7eb;
  color: #6b7280;
}
.expense-request-status-badge.is-default {
  background: #e2e8f0;
  color: #334155;
}
.fx-expense-request-modal .fx-modal-body {
  padding-top: 14px;
}
.expense-request-entry-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.expense-request-entry-table th,
.expense-request-entry-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 12px;
  vertical-align: middle;
}
.expense-request-entry-table tr:last-child th,
.expense-request-entry-table tr:last-child td {
  border-bottom: 0;
}
.expense-request-entry-table th {
  width: 160px;
  background: #f8fafc;
  text-align: left;
  font-weight: 700;
  color: #1f2937;
}
.er-modal-bulk-preview .profit-table th,
.er-modal-bulk-preview .profit-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}
.bemove-modal-foot .btn { min-height: 38px; }
.bemove-form-row { margin-bottom: 1rem; }
.bemove-form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-sub); }
.bemove-form-row input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.bemove-adjust-sessions-btn { margin-left: 0.5rem; vertical-align: middle; }
.bemove-sales-form-section { margin-bottom: 1rem; }
.bemove-sales-form-section label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-sub); }
.bemove-sales-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.bemove-sales-radio-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.bemove-sales-radio, .bemove-sales-radio-contract { padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; }
.bemove-sales-radio.is-active, .bemove-sales-radio-contract.is-active { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.bemove-sales-select, .bemove-sales-form-section input[type="text"], .bemove-sales-form-section input[type="number"], .bemove-sales-form-section input[type="date"] { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.bemove-sales-member-search-wrap { margin-bottom: 0.5rem; }
.bemove-sales-form-section .bemove-sales-select { display: block; }
.bemove-sales-table-filters { display: grid; grid-template-columns: 140px 1fr 1fr 1.4fr auto; gap: 8px; margin: 10px 0 12px; align-items: center; }
.bemove-sales-table-filters input[type="date"],
.bemove-sales-table-filters input[type="text"] { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
@media (max-width: 900px) {
  .bemove-sales-table-filters { grid-template-columns: 1fr 1fr; }
}
.bemove-refund-head { background: #dc2626; color: #fff; }
.bemove-refund-notice { background: #fef3c7; color: #92400e; padding: 0.75rem 1rem; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; }

/* 일정 관리 */
.bemove-schedule-main { padding: 1rem; }
.bemove-schedule-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.bemove-schedule-nav { display: flex; align-items: center; gap: 0.5rem; }
.bemove-schedule-nav-btn { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bemove-schedule-nav-btn:hover { background: #f1f5f9; }
.bemove-schedule-month { font-size: 1.25rem; font-weight: 700; min-width: 140px; text-align: center; }
.bemove-schedule-today { padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; }
.bemove-schedule-today:hover { background: #f1f5f9; }
.bemove-schedule-view-mode { display: flex; gap: 0.25rem; }
.bemove-schedule-view-btn { padding: 0.4rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; }
.bemove-schedule-view-btn.is-active { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.bemove-schedule-add { white-space: nowrap; }
.bemove-schedule-grid { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.bemove-schedule-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: #f8fafc; font-size: 13px; font-weight: 600; color: var(--text-sub); text-align: center; }
.bemove-schedule-weekday { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
.bemove-schedule-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.bemove-schedule-cell { min-height: 80px; padding: 0.5rem; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); cursor: pointer; position: relative; }
.bemove-schedule-cell:nth-child(7n) { border-right: none; }
.bemove-schedule-cell:hover { background: #f8fafc; }
.bemove-schedule-cell.is-other-month { background: #fafafa; color: #94a3b8; }
.bemove-schedule-cell.is-today { background: #eff6ff; }
.bemove-schedule-cell.is-today .bemove-schedule-cell-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #2563eb; color: #fff; font-weight: 700; }
.bemove-schedule-cell-num { font-size: 14px; font-weight: 500; }
.bemove-schedule-cell-dots { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.bemove-schedule-dot { width: 6px; height: 6px; border-radius: 50%; background: #2563eb; }

/* 수업 일정 잡기 모달 */
.bemove-schedule-class-modal .bemove-modal { max-width: 420px; }
.bemove-schedule-field { margin-bottom: 1rem; }
.bemove-schedule-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-sub); }
.bemove-schedule-input-wrap { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.bemove-schedule-input-wrap .bemove-schedule-icon { padding: 0 0.75rem; color: #64748b; font-size: 14px; }
.bemove-schedule-input-wrap .bemove-schedule-icon-right { padding: 0 0.75rem; color: #64748b; font-size: 14px; margin-left: auto; }
.bemove-schedule-select, .bemove-schedule-date, .bemove-schedule-time, .bemove-schedule-time-select { flex: 1; border: none; padding: 0.6rem 0.75rem; font-size: 14px; min-width: 0; }
.bemove-schedule-time-selects { display: flex; gap: 6px; width: 100%; padding-right: 0.4rem; }
.bemove-schedule-time-select { background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.bemove-schedule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.bemove-schedule-duration-group { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.bemove-schedule-duration { padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; }
.bemove-schedule-duration.is-active { border-color: #2563eb; color: #2563eb; background: #eff6ff; font-weight: 600; }
.bemove-schedule-end-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-sub); }
.bemove-schedule-end-label { display: flex; align-items: center; gap: 0.25rem; }
.bemove-schedule-submit { width: 100%; justify-content: center; padding: 0.75rem; }
.bemove-schedule-time-hint { font-size: 12px; color: var(--text-muted); margin: 0.25rem 0 0; }

/* 주별/일별 보기 - 0~24시 타임테이블 */
.bemove-schedule-timetable { width: 100%; border-collapse: collapse; font-size: 13px; }
.bemove-schedule-timetable th, .bemove-schedule-timetable td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.bemove-schedule-timetable thead th { background: #f8fafc; font-weight: 700; color: var(--text-sub); }
.bemove-schedule-time-col { width: 56px; min-width: 56px; text-align: center !important; font-weight: 600; color: var(--text-sub); white-space: nowrap; }
.bemove-schedule-day-col { min-width: 80px; }
.bemove-schedule-day-col.is-today { background: #eff6ff; }
.bemove-schedule-timetable-cell { cursor: pointer; min-height: 32px; }
.bemove-schedule-timetable-cell:hover { background: #f8fafc; }
.bemove-schedule-timetable-cell.bemove-schedule-drop-target { background: #dbeafe !important; outline: 2px dashed #3b82f6; outline-offset: -2px; }
.bemove-schedule-grid-week { overflow-x: auto; padding: 0; }
.bemove-schedule-grid-week .bemove-schedule-timetable { margin: 0; }
.bemove-schedule-slot-chip { font-size: 12px; color: var(--text); background: #e0e7ff; padding: 4px 8px; border-radius: 6px; margin-bottom: 4px; }
.bemove-schedule-slot-chip[draggable="true"],
.bemove-schedule-day-slot-row[draggable="true"] { cursor: grab; }
.bemove-schedule-slot-chip:last-child { margin-bottom: 0; }
.bemove-schedule-grid-day { padding: 1rem; }
.bemove-schedule-grid-day .bemove-schedule-timetable-day .bemove-schedule-timetable-cell { min-width: 200px; }
.bemove-schedule-day-header { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.bemove-schedule-day-slot-row { padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.bemove-schedule-day-slot-row:last-child { border-bottom: none; }
.bemove-schedule-delete-btn { margin-left: 6px; padding: 2px 6px; font-size: 12px; border: none; background: transparent; cursor: pointer; vertical-align: middle; }
.bemove-schedule-delete-btn:hover { background: rgba(239, 68, 68, 0.15); border-radius: 4px; }
.bemove-schedule-cal-dot.bemove-schedule-clickable-slot { cursor: pointer; padding: 0 2px; }
.bemove-schedule-cal-dot.bemove-schedule-clickable-slot:hover { opacity: 0.8; text-decoration: underline; }
.bemove-schedule-grid-list { padding: 1rem; }
.bemove-schedule-list-table { width: 100%; }
.bemove-schedule-cell-actions { white-space: nowrap; }
.bemove-schedule-list-row.bemove-schedule-clickable-slot { cursor: pointer; }
.bemove-schedule-list-row.bemove-schedule-clickable-slot:hover { background: #f8fafc; }
.bemove-modal-foot .btn-danger { color: #dc2626; border-color: #dc2626; }
.bemove-modal-foot .btn-danger:hover { background: #dc2626; color: #fff; }
/* 재등록 성과 */
.bemove-retention-screen { padding: 0 4px; }
.bemove-retention-hero { margin-bottom: 20px; }
.bemove-retention-title { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.bemove-retention-subtitle { font-size: 14px; color: var(--text-sub); margin: 0; }
.bemove-retention-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.bemove-retention-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; position: relative; overflow: hidden; }
.bemove-retention-card-icon { position: absolute; top: 12px; right: 12px; font-size: 24px; opacity: 0.7; }
.bemove-retention-card-rate { border-left: 4px solid var(--primary); }
.bemove-retention-card-sales { border-left: 4px solid var(--warning); }
.bemove-retention-card-churned { border-left: 4px solid var(--danger); }
.bemove-retention-card-value { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.bemove-retention-card-label { font-size: 13px; font-weight: 700; color: var(--text-sub); margin-bottom: 4px; }
.bemove-retention-card-detail { font-size: 12px; color: var(--text-muted); }
.bemove-retention-table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; overflow-x: auto; }
.bemove-retention-table-title { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.bemove-retention-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bemove-retention-table th, .bemove-retention-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.bemove-retention-table th { font-weight: 700; color: var(--text-sub); background: #f8fafc; }
.bemove-retention-status { padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.bemove-retention-status-success { background: #dcfce7; color: #166534; }
.bemove-retention-status-fail { background: #fee2e2; color: #991b1b; }
.bemove-retention-status-pending { background: #e0e7ff; color: #3730a3; }
.bemove-retention-empty { text-align: center; color: var(--text-muted); padding: 24px; margin: 0; font-size: 14px; }

/* 만족도 관리 */
.bemove-satisfaction-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bemove-kpi { font-size: 1.6rem; font-weight: 800; line-height: 1.2; display: block; margin-top: 6px; }
.bemove-satisfaction-table-wrap { overflow-x: auto; }
.bemove-satisfaction-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bemove-satisfaction-table th, .bemove-satisfaction-table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; }
.bemove-satisfaction-table th { color: var(--text-sub); background: #f8fafc; font-weight: 700; }

/* 회원 설문 모달 */
.bemove-survey-modal { width: min(760px, calc(100vw - 24px)); }
.bemove-survey-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.bemove-survey-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.bemove-survey-item select { min-width: 94px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: #fff; }
.bemove-survey-msg { display: block; margin-top: 10px; }
.bemove-survey-msg > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-sub); font-weight: 700; }
.bemove-survey-msg textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px; resize: vertical; min-height: 72px; }

/* 회원 식단 */
.bemove-diet-summary-kcal { font-size: 28px; font-weight: 900; color: #111827; margin-top: 6px; }
.bemove-diet-summary-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
.bemove-diet-summary-macros { display: inline-flex; align-items: center; gap: 12px; color: #64748b; font-size: 14px; font-weight: 600; white-space: nowrap; }
.bemove-diet-summary-macros b { color: #334155; font-weight: 800; }
.bemove-diet-kpi-grid { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bemove-diet-kpi-value { font-size: 22px; font-weight: 800; margin-top: 4px; color: #1f2937; }
.bemove-diet-mix { margin-top: 6px; display: grid; gap: 6px; }
.bemove-diet-mix-row { display: grid; grid-template-columns: 40px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-sub); }
.bemove-diet-mix-row .bar { height: 7px; background: #eef2ff; border-radius: 999px; overflow: hidden; }
.bemove-diet-mix-row .bar i { display: block; height: 100%; background: #4f46e5; border-radius: 999px; }
.bemove-diet-mix-row strong { text-align: right; font-size: 12px; color: #374151; }
.bemove-diet-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.bemove-diet-create-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-sub); }
.bemove-diet-create-grid label.full { grid-column: 1 / -1; }
.bemove-diet-create-grid input,
.bemove-diet-create-grid select,
.bemove-diet-create-grid textarea { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13px; background: #fff; }
.bemove-diet-photo-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bemove-diet-photo-inputs input[type="file"] { width: 100%; }
.bemove-diet-photo-inputs .btn { width: 100%; justify-content: center; }
#bemove-diet-photo-selection { display: block; margin-top: 6px; }
.bemove-diet-create-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.bemove-diet-alert-card { margin-top: 10px; }
.bemove-diet-alert-list { display: grid; gap: 8px; }
.bemove-diet-alert-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.bemove-diet-alert-row p { margin: 4px 0 0; font-size: 12px; color: var(--text-sub); }
.bemove-diet-alert-row.is-read { opacity: 0.72; background: #f8fafc; }
.bemove-diet-log-list { margin-top: 12px; display: grid; gap: 10px; }
.bemove-diet-log-card { padding: 12px; }
.bemove-diet-log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bemove-diet-log-head strong { font-size: 14px; }
.bemove-diet-log-head span { font-size: 12px; color: var(--text-sub); }
.bemove-diet-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bemove-diet-top-main { flex: 1; min-width: 0; }
.bemove-diet-top-kcal { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; padding: 4px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 16px; font-weight: 800; letter-spacing: 0.01em; }
.bemove-diet-top-photo { display: inline-flex; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #f8fafc; flex: 0 0 auto; }
.bemove-diet-top-photo img { width: 100%; height: 100%; object-fit: cover; }
.bemove-diet-top-photo.is-empty { width: 92px; height: 92px; opacity: 0.35; }
.bemove-diet-items { margin: 0 0 2px; font-size: 12px; }
.bemove-diet-nutri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bemove-diet-nutri-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-sub); }
.bemove-diet-nutri-grid input { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.bemove-diet-ai-feedback-input { margin-top: 8px; width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px; font-size: 12px; resize: vertical; min-height: 56px; }
.bemove-diet-ai-feedback-input[readonly] { background: #f8fafc; color: #334155; }
.bemove-diet-analysis-error { margin-top: 6px; font-size: 11px; color: #b45309; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 6px 8px; }
.bemove-diet-log-foot { margin-top: 8px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bemove-diet-log-actions { display: flex; align-items: center; gap: 6px; }
.bemove-diet-log-actions .btn { white-space: nowrap; }
.bemove-diet-archive-card { margin-top: 10px; }
.bemove-diet-archive-wrap { overflow-x: auto; }
.bemove-diet-archive-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.bemove-diet-archive-table th, .bemove-diet-archive-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.bemove-diet-archive-table th { color: var(--text-sub); background: #f8fafc; font-weight: 700; }
.bemove-diet-archive-row { cursor: pointer; }
.bemove-diet-archive-row:hover { background: #f8fafc; }
.bemove-diet-archive-row.is-active { background: #eef2ff; }
.bemove-diet-archive-details { margin-top: 10px; }
.bemove-diet-archive-detail { display: none; }
.bemove-diet-archive-detail.is-open { display: block; }
.bemove-diet-thread-wrap { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.bemove-diet-thread-wrap h5 { margin: 0 0 8px; font-size: 13px; }
.bemove-diet-thread { display: grid; gap: 6px; }
.bemove-diet-thread-row { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fafcff; }
.bemove-diet-thread-row strong { font-size: 12px; }
.bemove-diet-thread-row span { margin-left: 6px; font-size: 11px; color: var(--text-sub); }
.bemove-diet-thread-row p { margin: 6px 0 0; font-size: 12px; color: var(--text); }
.bemove-diet-thread-input { margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.bemove-diet-thread-input textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px; font-size: 12px; resize: vertical; min-height: 52px; }
.bemove-trainer-diet-feedback-modal { width: min(980px, calc(100vw - 24px)); max-width: 980px; }
.bemove-trainer-diet-feedback-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bemove-trainer-diet-feedback-top h4 { margin: 0; font-size: 16px; }
.bemove-trainer-diet-feedback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bemove-trainer-diet-feedback-card textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 8px; font-size: 12px; resize: vertical; min-height: 58px; margin-top: 8px; }
@media (max-width: 900px) {
  .bemove-diet-kpi-grid { grid-template-columns: 1fr; }
  .bemove-diet-nutri-grid { grid-template-columns: 1fr 1fr; }
  .bemove-diet-top-kcal { font-size: 18px; }
  .bemove-diet-top-photo, .bemove-diet-top-photo.is-empty { width: 72px; height: 72px; }
  .bemove-diet-summary-line { align-items: center; }
  .bemove-diet-summary-macros { gap: 8px; font-size: 12px; }
  .bemove-member-kcal-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .bemove-member-kcal-kpis span { padding: 7px 8px; gap: 6px; }
  .bemove-trainer-diet-feedback-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bemove-member-kcal-kpis { gap: 4px; }
  .bemove-member-kcal-kpis span { padding: 6px; gap: 4px; border-radius: 8px; }
  .bemove-member-kcal-kpis em { font-size: 10px; }
  .bemove-member-kcal-kpis strong { font-size: 11px; letter-spacing: -0.03em; }
}
@media (max-width: 420px) {
  .bemove-member-kcal-kpis em { font-size: 9px; }
  .bemove-member-kcal-kpis strong { font-size: 10px; }
}

/* 인사이트 */
.bemove-insight-title { margin: 0; font-size: 1.5rem; font-weight: 900; color: var(--text); letter-spacing: -0.01em; }
.bemove-insight-sub { margin: 4px 0 14px; color: var(--text-sub); font-size: 13px; }
.bemove-insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.bemove-insight-card { border-radius: 14px; min-height: 190px; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05); }
.bemove-insight-grid > .bemove-insight-card { height: 100%; }
.bemove-insight-sales-card { min-height: 264px; }
.bemove-insight-grid .big { font-size: 2rem; font-weight: 900; margin-top: 8px; letter-spacing: -0.01em; }
.bemove-insight-month-bars { margin-top: 10px; display: grid; gap: 7px; }
.bemove-insight-month-row { display: grid; grid-template-columns: 40px 1fr 90px; align-items: center; gap: 8px; font-size: 12px; color: #6b7280; }
.bemove-insight-month-row strong { white-space: nowrap; text-align: right; }
.bemove-insight-month-bar { height: 8px; background: #eef2ff; border-radius: 999px; overflow: hidden; }
.bemove-insight-month-bar i { display: block; height: 100%; background: #4f46e5; border-radius: 999px; }
.bemove-insight-rank-row { display: grid; grid-template-columns: 30px 64px 1fr 72px 80px; align-items: center; gap: 8px; border: 1px solid #dbe3ff; border-radius: 12px; padding: 10px 12px; margin-top: 8px; background: #f8fbff; }
.bemove-insight-rank-head { display: grid; grid-template-columns: 30px 64px 1fr 72px 80px; gap: 8px; align-items: center; margin-top: 6px; padding: 0 12px; color: #64748b; font-size: 11px; font-weight: 700; }
.bemove-insight-rank-row .rank-badge { font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.bemove-insight-rank-row .amount { font-size: 1rem; font-weight: 900; color: #111827; }
.bemove-insight-rank-row .name { font-weight: 700; color: #1f2937; }
.bemove-insight-rank-row .name .me-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.14);
}
.bemove-insight-rank-row .title, .bemove-insight-rank-row .branch { color: #6b7280; font-size: 12px; text-align: right; }
.bemove-insight-rank-row.is-gold { border-color: #f59e0b; background: linear-gradient(90deg, #fff7ed 0%, #fffbeb 100%); }
.bemove-insight-rank-row.is-silver { border-color: #94a3b8; background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%); }
.bemove-insight-rank-row.is-bronze { border-color: #b45309; background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 100%); }
.bemove-insight-rank-row.is-me { box-shadow: 0 0 0 2px rgba(59,130,246,0.28) inset; }
.bemove-insight-rank-row.is-dummy { opacity: 0.9; }
.bemove-insight-overall { font-size: 3rem; line-height: 1; font-weight: 900; text-align: center; margin: 6px 0 12px; }
.bemove-insight-stars { text-align: center; color: #facc15; letter-spacing: 2px; font-size: 15px; margin-top: -4px; margin-bottom: 10px; }
.bemove-insight-score-list { display: grid; gap: 8px; }
.bemove-insight-score-row { display: grid; grid-template-columns: 72px 1fr 34px; align-items: center; gap: 8px; font-size: 12px; }
.bemove-insight-score-row .bar { height: 8px; background: #eef2ff; border-radius: 999px; overflow: hidden; }
.bemove-insight-score-row .bar i { display: block; height: 100%; background: #4f46e5; border-radius: 999px; }
.bemove-insight-feedback-list { display: grid; gap: 8px; }
.bemove-insight-feedback-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.bemove-insight-feedback-row .msg { margin-top: 4px; font-size: 13px; color: var(--text); }
.bemove-insight-feedback-row .msg.private { color: #4b5563; font-weight: 600; }
.bemove-insight-survey-card { background: linear-gradient(180deg, #f8faff 0%, #f2f6ff 100%); }
.bemove-insight-survey-kpi { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(99, 102, 241, 0.08); }
.bemove-insight-survey-kpi span { color: #475569; font-size: 12px; font-weight: 600; }
.bemove-insight-survey-kpi strong { color: #1d4ed8; font-size: 1.35rem; font-weight: 900; }
.bemove-insight-send-btn { width: 100%; margin-top: 12px; }
.bemove-insight-feedback-card { grid-column: 1 / -1; }
@media (max-width: 980px) {
  .bemove-insight-grid { grid-template-columns: 1fr; }
  .bemove-survey-items { grid-template-columns: 1fr; }
  .bemove-insight-rank-head { grid-template-columns: 26px 56px 1fr; }
  .bemove-insight-rank-row { grid-template-columns: 26px 56px 1fr; }
  .bemove-insight-rank-row .title, .bemove-insight-rank-row .branch { display: none; }
}
/* 소진율 가로 그래프 요약 블록 */
.bemove-schedule-summary-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-bottom: 0.75rem; }
.bemove-schedule-summary-block { margin-bottom: 0; flex: 1 1 200px; min-width: 180px; }
/* 한 줄 요약: 라벨 + 그래프(막대) + 갯수 % */
.bemove-schedule-summary-oneline { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex: 1 1 auto; min-width: 0; }
.bemove-schedule-summary-oneline .bemove-schedule-summary-label { font-size: 0.875rem; font-weight: 600; color: var(--text); white-space: nowrap; margin: 0; }
.bemove-schedule-summary-oneline .bemove-schedule-summary-bar-wrap { flex: 1; min-width: 60px; height: 8px; margin: 0; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,0.12); }
.bemove-schedule-summary-oneline .bemove-schedule-summary-bar { height: 100%; border-radius: 999px; transition: width 0.3s ease; min-width: 2px; }
.bemove-schedule-summary-oneline .bemove-schedule-summary-text { font-size: 0.875rem; color: var(--text-muted, rgba(255,255,255,0.7)); white-space: nowrap; margin: 0; }
.bemove-schedule-summary-oneline .bemove-schedule-summary-text .bemove-schedule-summary-pct { font-weight: 700; color: var(--text); }
.bemove-schedule-summary-block .bemove-schedule-summary-label { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
.bemove-schedule-summary-bar-wrap { height: 10px; background: rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; margin-bottom: 0.35rem; }
.bemove-schedule-summary-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%); transition: width 0.3s ease; min-width: 2px; }
.bemove-schedule-summary-bar-period { background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%); }
.bemove-schedule-summary-text { font-size: 0.875rem; color: var(--text-muted, rgba(255,255,255,0.7)); }
.bemove-schedule-summary-text .bemove-schedule-summary-pct { font-weight: 700; color: var(--text); }
.bemove-schedule-today-summary { }
.bemove-schedule-month-summary { }
.bemove-schedule-briefing { margin-bottom: 12px; }
.bemove-schedule-briefing h4 { margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.bemove-schedule-briefing p { margin: 4px 0; font-size: 13px; color: #334155; }
.bemove-schedule-journal-btn { margin-right: 0.5rem; }
.bemove-schedule-delete-in-modal { white-space: nowrap; color: #fff !important; background: #dc2626 !important; border-color: #dc2626 !important; }
.bemove-schedule-delete-in-modal:hover { background: #b91c1c !important; color: #fff !important; }
.bemove-schedule-cancel-btn { white-space: nowrap; border-color: #f59e0b !important; color: #b45309 !important; }
.bemove-schedule-cancel-btn:hover { background: #f59e0b !important; color: #fff !important; }
.bemove-schedule-modal-actions { gap: 10px; }
.bemove-schedule-modal-actions .btn { flex: 1 1 0; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.bemove-schedule-modal-actions .bemove-schedule-journal-btn { margin-right: 0; }

.bemove-trainer-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
}
.bemove-trainer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bemove-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}
.bemove-trainer-right {
  float: right;
  margin-top: -26px;
  font-weight: 800;
  color: #2563eb;
}
.bemove-trainer-row-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.bemove-trainer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.bemove-trainer-info { flex: 1; min-width: 0; }
.bemove-trainer-meta { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.bemove-role-tag {
  font-size: 11px;
  color: var(--text-sub);
  margin-left: 6px;
}
.bemove-trainer-pct {
  font-weight: 700;
  color: #2563eb;
  font-size: 14px;
}
.bemove-trainer-foot {
  margin-top: 6px;
  color: var(--text-sub);
  font-size: 12px;
}
.bemove-share-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}
.bemove-share-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bemove-share-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bemove-share-bar-wrap {
  height: 20px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.bemove-share-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
  min-width: 0;
  transition: width 0.2s ease;
}
.bemove-share-pct { font-size: 12px; color: var(--text-sub); text-align: right; }
.bemove-chart-month { font-size: 12px; color: var(--text-sub); margin-top: 8px; display: block; }
.bemove-chart-placeholder {
  border: 1px dashed var(--border);
  border-radius: 10px;
  min-height: 220px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.bemove-chart-bar {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
}
.bemove-chart-placeholder span {
  font-size: 12px;
  color: var(--text-sub);
}
.bemove-branch-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.bemove-branch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.bemove-branch-head span {
  color: var(--text-sub);
  font-weight: 700;
}

.bemove-branch-name-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  line-height: 1.2;
}
.bemove-branch-name-text {
  display: inline-block;
}
.bemove-branch-div-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 0;
  color: #9A6B00;
}
.bemove-branch-div-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.bemove-branch-div-icon--talent { color: #A87400; }
.bemove-branch-div-icon--innovation { color: #8B5E00; }
.bemove-branch-div-icon--victory { color: #7A5200; }
:root[data-formula-theme="dark"] .bemove-branch-div-icon--talent { color: #E8B84A; }
:root[data-formula-theme="dark"] .bemove-branch-div-icon--innovation { color: #DDB04A; }
:root[data-formula-theme="dark"] .bemove-branch-div-icon--victory { color: #F0C05A; }
.fx-pt-branch-badge--with-div .bemove-branch-div-icon {
  color: rgba(0, 0, 0, 0.72);
  filter: drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.35));
}
:root[data-formula-theme="dark"] .fx-pt-branch-badge--with-div .bemove-branch-div-icon {
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}
.branch-quick-switch-buttons .branch-quick-btn .bemove-branch-name-with-icon {
  gap: 4px;
}
.branch-quick-switch-buttons .branch-quick-btn .bemove-branch-div-icon {
  width: 16px;
  height: 16px;
}
.bemove-ranking-name .bemove-branch-div-icon,
.bemove-insight-rank-row .branch .bemove-branch-div-icon {
  width: 16px;
  height: 16px;
}
.fx-pt-division-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}
.fx-pt-division-label-text {
  line-height: 1.2;
}
.bemove-branch-foot {
  margin-top: 6px;
  color: var(--text-sub);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (max-width: 1200px) {
  .bemove-stat-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  .bemove-branch-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  .bemove-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 매출 탭: 업로드 대상 선택 ── */
.sales-upload-target {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sales-upload-target-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}
.sales-upload-target-select {
  max-width: 360px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.sales-upload-target-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.sales-upload-target-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Bemove 모드에서는 Formula 전역 지점 선택 바를 숨긴다 */
body[data-app-mode="bemove"] #branch-selector {
  display: none !important;
}

.sales-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 1rem;
  cursor: default;
  transition: border-color 0.15s, background 0.15s;
}
.sales-drop-zone:focus {
  outline: none;
  border-color: var(--primary);
}
.sales-drop-zone.sales-drop-zone-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
  color: var(--text);
}

.sales-upload-report {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 8px;
}

.sales-upload-report .item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
}

/* 매출 탭: 제목과 업로드 같은 줄, 업로드는 토글로 최소화 */
.sales-tab-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 400px;
  min-width: 0;
}
.sales-tab-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}
/* 매출 본문 스크롤: 테이블 헤더(월·FC·PT…)만 상단 고정 */
.sales-tab-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.sales-tab-scroll .sales-table-wrap {
  max-height: none;
  overflow: visible;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.sales-tab-scroll .sales-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 #e2e8f0;
}
.sales-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-bottom: 10px;
}
.sales-tab-header .sales-tab-title {
  line-height: 36px;
  margin: 0;
  font-size: 18px;
}
.sales-subtab-nav {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 10px;
  padding: 0 2px;
}
.sales-subtab-btn {
  padding: 0.45rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub, #64748b);
  cursor: pointer;
}
.sales-subtab-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.sales-subtab-pane {
  min-height: 120px;
}
.sales-analysis-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sales-mix-month-select {
  margin-left: 6px;
  padding: 0.35rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}
.sales-info-fold {
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 10px;
}
.sales-info-fold-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.sales-info-fold-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sales-info-fold-head-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.sales-info-fold-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.sales-info-fold-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
}
.sales-info-fold-badge.is-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.sales-info-fold-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-left: auto;
}
.sales-info-fold-switch-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.sales-info-fold-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.sales-info-fold-collapsed .sales-info-fold-body {
  display: none;
}
.sales-mix-unparsed-hint {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.5;
}
.sales-mix-reconcile-inner {
  font-size: 13px;
}
.sales-mix-reconcile-note {
  margin: 8px 0 0;
  font-size: 12px;
}
:root[data-formula-theme="dark"] .sales-info-fold {
  background: #1e293b;
  border-color: #334155;
}
:root[data-formula-theme="dark"] .sales-info-fold-warn {
  background: rgb(120 53 15 / 0.2);
  border-color: rgb(245 158 11 / 0.45);
}
:root[data-formula-theme="dark"] .sales-info-fold-title {
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .sales-info-fold-body {
  border-top-color: #334155;
}
.sales-mix-reconcile {
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
}
.sales-mix-reconcile-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.sales-mix-summary-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.sales-mix-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.sales-mix-card-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}
.sales-mix-card-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}
.sales-mix-card-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
}
.sales-mix-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.sales-mix-section {
  padding: 14px 16px;
}
.sales-mix-section-hint {
  margin: -4px 0 10px;
  font-size: 12px;
}
.sales-mix-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.sales-mix-bar-label {
  font-weight: 600;
  color: #334155;
}
.sales-mix-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.sales-mix-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 999px;
  min-width: 2px;
}
.sales-mix-bar-meta {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}
.sales-mix-bar-share {
  font-weight: 700;
  color: #2563eb;
}
.sales-mix-th-pt {
  color: #c2410c !important;
  background: #fff7ed !important;
}
.sales-mix-th-fc {
  color: #1d4ed8 !important;
  background: #eff6ff !important;
}
.sales-mix-trend-bar-cell {
  text-align: center;
  padding: 0.35rem 0.4rem !important;
}
.sales-mix-trend-value-shell {
  position: relative;
  width: 100%;
  min-width: 88px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
}
.sales-mix-trend-value-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 8px;
  z-index: 0;
  min-width: 4px;
  transition: width 0.2s ease;
}
.sales-mix-trend-value-shell.is-pt .sales-mix-trend-value-fill {
  background: linear-gradient(90deg, #fdba74, #f97316);
}
.sales-mix-trend-value-shell.is-fc .sales-mix-trend-value-fill {
  background: linear-gradient(90deg, #93c5fd, #3b82f6);
}
.sales-mix-trend-value-shell.is-peak .sales-mix-trend-value-fill {
  box-shadow: inset 0 0 0 2px rgb(15 23 42 / 0.12);
}
.sales-mix-trend-value-shell.is-peak.is-pt .sales-mix-trend-value-fill {
  background: linear-gradient(90deg, #fb923c, #ea580c);
}
.sales-mix-trend-value-shell.is-peak.is-fc .sales-mix-trend-value-fill {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}
.sales-mix-trend-count {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  line-height: 1;
  text-shadow: 0 0 4px rgb(255 255 255 / 0.85), 0 1px 2px rgb(255 255 255 / 0.6);
}
.sales-mix-trend-value-shell.is-peak .sales-mix-trend-count {
  font-weight: 800;
  color: #0f172a;
}
.sales-mix-trend-plain {
  text-align: right;
}
.sales-mix-trend-count-plain {
  font-weight: 600;
  color: #334155;
}
.sales-mix-trend-peak-plain .sales-mix-trend-count-plain {
  font-weight: 800;
  color: #1d4ed8;
}
.sales-mix-trend-empty {
  color: #94a3b8;
  text-align: center;
}
.sales-mix-trend-card {
  margin-bottom: 12px;
}
.sales-mix-trend-note {
  margin: -4px 0 10px;
  font-size: 12px;
}
.sales-fc-unit-card {
  margin-bottom: 12px;
  padding: 14px 16px;
}
.sales-fc-unit-note {
  margin: -4px 0 12px;
  font-size: 12px;
}
.sales-fc-unit-avg-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  border: 1px solid #bfdbfe;
}
.sales-fc-unit-avg-label {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
}
.sales-fc-unit-avg-value {
  font-size: 22px;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.1;
}
.sales-fc-unit-avg-unit {
  margin-left: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #3b82f6;
}
.sales-fc-unit-avg-sub {
  width: 100%;
  font-size: 12px;
  color: #64748b;
}
.sales-fc-unit-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.sales-fc-unit-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.sales-fc-unit-bar-cell {
  min-width: 0;
}
.sales-fc-unit-bar-cell .sales-mix-trend-value-shell {
  min-width: 0;
  width: 100%;
}
.sales-fc-unit-bar-cell .sales-mix-trend-value-shell.is-above-avg .sales-mix-trend-value-fill {
  background: linear-gradient(90deg, #fca5a5, #ef4444);
}
.sales-fc-unit-bar-cell .sales-mix-trend-value-shell.is-below-avg .sales-mix-trend-value-fill {
  background: linear-gradient(90deg, #86efac, #16a34a);
}
.sales-fc-unit-bar-cell .sales-mix-trend-value-shell.is-at-avg .sales-mix-trend-value-fill {
  background: linear-gradient(90deg, #93c5fd, #3b82f6);
}
.sales-fc-unit-meta {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}
.sales-fc-unit-narrative {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.65;
  color: #334155;
}
.sales-fc-unit-warn {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 12px;
  line-height: 1.55;
}
.sales-fc-unit-excluded {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  font-size: 12px;
}
.sales-fc-unit-excluded-title {
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}
.sales-fc-unit-excluded-item {
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 4px;
}
.sales-fc-unit-row-wrap {
  margin-bottom: 10px;
}
.sales-fc-unit-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-left: 56px;
}
.sales-fc-unit-sample-chip {
  font-size: 10px;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.sales-fc-unit-picker {
  margin: 0 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}
.sales-fc-unit-picker-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
}
.sales-fc-unit-picker-summary::-webkit-details-marker {
  display: none;
}
.sales-fc-unit-picker-mode {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.sales-fc-unit-picker-mode.is-auto {
  background: #e0f2fe;
  color: #0369a1;
}
.sales-fc-unit-picker-mode.is-manual {
  background: #fef3c7;
  color: #b45309;
}
.sales-fc-unit-picker-note {
  margin: 8px 0 0;
  font-size: 12px;
}
.sales-fc-unit-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.sales-fc-unit-picker-list {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sales-fc-unit-picker-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}
.sales-fc-unit-picker-name {
  line-height: 1.4;
  word-break: break-all;
}
.sales-fc-unit-picker-meta {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}
.sales-fc-unit-picker-auto-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}
:root[data-formula-theme="dark"] .sales-fc-unit-picker {
  background: #1e293b;
  border-color: #334155;
}
:root[data-formula-theme="dark"] .sales-fc-unit-picker-item {
  background: #0f172a;
  border-color: #334155;
}
.sales-product-class-panel {
  margin-bottom: 14px;
  padding: 10px 12px;
}
.sales-product-class-panel-collapsed {
  padding-bottom: 10px;
}
.sales-product-class-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sales-product-class-panel-head-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sales-product-class-panel-title {
  font-weight: 600;
  font-size: 14px;
}
.sales-product-class-panel-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-left: auto;
}
.sales-product-class-panel-switch-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.sales-product-class-panel-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
.sales-product-class-panel-collapsed .sales-product-class-panel-body {
  display: none;
}
:root[data-formula-theme="dark"] .sales-product-class-panel-body {
  border-top-color: #334155;
}
:root[data-formula-theme="dark"] .sales-product-class-panel-switch-label {
  color: #94a3b8;
}
.sales-product-class-note {
  margin: 8px 0 0;
  font-size: 12px;
}
.sales-product-class-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.sales-product-class-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  cursor: pointer;
  user-select: none;
}
.sales-product-class-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.sales-product-class-toggle input.sales-product-class-filter-diff {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.sales-product-class-toggle-track {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.sales-product-class-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.2);
  transition: transform 0.2s ease;
}
.sales-product-class-toggle input.sales-product-class-filter-diff:checked + .sales-product-class-toggle-track {
  background: #2563eb;
}
.sales-product-class-toggle input.sales-product-class-filter-diff:checked + .sales-product-class-toggle-track .sales-product-class-toggle-thumb {
  transform: translateX(18px);
}
.sales-product-class-toggle input.sales-product-class-filter-diff:focus-visible + .sales-product-class-toggle-track {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
:root[data-formula-theme="dark"] .sales-product-class-toggle-label {
  color: #cbd5e1;
}
:root[data-formula-theme="dark"] .sales-product-class-toggle-track {
  background: #475569;
}
:root[data-formula-theme="dark"] .sales-product-class-toggle input.sales-product-class-filter-diff:checked + .sales-product-class-toggle-track {
  background: #3b82f6;
}
.sales-product-class-table-wrap {
  margin-top: 10px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.sales-product-class-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.sales-product-class-table th,
.sales-product-class-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}
.sales-product-class-table th {
  background: #f8fafc;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.sales-product-class-name {
  word-break: break-all;
  min-width: 160px;
}
.sales-product-class-stats {
  white-space: nowrap;
  color: #64748b;
}
.sales-product-class-manual {
  min-width: 280px;
}
.sales-product-class-segment {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.sales-product-class-seg-btn {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  padding: 5px 7px;
  min-height: 26px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sales-product-class-seg-btn:hover {
  background: #eef2ff;
  color: #3730a3;
}
.sales-product-class-seg-btn.is-active {
  background: #4f46e5;
  color: #fff;
  border-color: #4338ca;
  box-shadow: 0 1px 2px rgb(67 56 202 / 0.25);
}
.sales-product-class-seg-btn.is-active.cat-fc_membership {
  background: #2563eb;
  border-color: #1d4ed8;
}
.sales-product-class-seg-btn.is-active.cat-pt {
  background: #db2777;
  border-color: #be185d;
}
.sales-product-class-seg-btn.is-active.cat-package {
  background: #d97706;
  border-color: #b45309;
}
.sales-product-class-seg-btn.is-active.cat-daily_pass {
  background: #059669;
  border-color: #047857;
}
.sales-product-class-seg-btn.is-active.cat-option {
  background: #64748b;
  border-color: #475569;
}
.sales-product-class-seg-btn.is-active.cat-exclude {
  background: #dc2626;
  border-color: #b91c1c;
}
.sales-product-class-seg-btn.is-active.cat-auto {
  background: #0ea5e9;
  border-color: #0284c7;
}
.sales-product-class-row.is-manual .sales-product-class-segment {
  border-color: #fcd34d;
  background: #fffbeb;
}
:root[data-formula-theme="dark"] .sales-product-class-segment {
  background: #1e293b;
  border-color: #334155;
}
:root[data-formula-theme="dark"] .sales-product-class-seg-btn {
  color: #94a3b8;
}
:root[data-formula-theme="dark"] .sales-product-class-seg-btn:hover {
  background: #334155;
  color: #e2e8f0;
}
.sales-product-class-auto-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.sales-product-class-auto-badge.cat-fc_membership { background: #dbeafe; color: #1d4ed8; }
.sales-product-class-auto-badge.cat-pt { background: #fce7f3; color: #be185d; }
.sales-product-class-auto-badge.cat-package { background: #fef3c7; color: #b45309; }
.sales-product-class-auto-badge.cat-daily_pass { background: #d1fae5; color: #047857; }
.sales-product-class-auto-badge.cat-option { background: #e2e8f0; color: #475569; }
.sales-product-class-auto-badge.cat-exclude { background: #fee2e2; color: #b91c1c; }
.sales-product-class-row.is-changed {
  background: #fffbeb;
}
:root[data-formula-theme="dark"] .sales-product-class-table-wrap {
  border-color: #334155;
}
:root[data-formula-theme="dark"] .sales-product-class-table th {
  background: #1e293b;
}
:root[data-formula-theme="dark"] .sales-product-class-table td {
  border-color: #334155;
}
:root[data-formula-theme="dark"] .sales-product-class-row.is-changed {
  background: rgb(120 53 15 / 0.2);
}
.sales-product-bundled-callout {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}
.sales-product-bundled-tag {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
  cursor: help;
}
.sales-product-bundled-tag.is-inline {
  margin-left: 4px;
}
.sales-product-bundled-tag-label {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  white-space: nowrap;
}
.sales-product-bundled-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: min(300px, 72vw);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.12);
  text-align: left;
  white-space: normal;
}
.sales-product-bundled-tag:hover .sales-product-bundled-tip,
.sales-product-bundled-tag:focus .sales-product-bundled-tip,
.sales-product-bundled-tag:focus-within .sales-product-bundled-tip {
  display: block;
}
.sales-product-class-name-text {
  display: inline;
  word-break: break-all;
}
.sales-product-class-row.has-bundled .sales-product-class-name {
  min-width: 200px;
}
.sales-product-class-origin {
  min-width: 92px;
  white-space: nowrap;
}
.sales-product-origin-details {
  font-size: 11px;
}
.sales-product-origin-summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 600;
  list-style: none;
}
.sales-product-origin-summary::-webkit-details-marker {
  display: none;
}
.sales-product-origin-body {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  min-width: 280px;
}
.sales-product-origin-table-wrap {
  overflow: auto;
  max-width: min(520px, 70vw);
}
.sales-product-origin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.sales-product-origin-table th,
.sales-product-origin-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}
.sales-product-origin-table th {
  background: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.sales-product-origin-pname {
  word-break: break-all;
  min-width: 120px;
}
.sales-product-origin-file {
  word-break: break-all;
  max-width: 120px;
}
.sales-product-origin-amt {
  white-space: nowrap;
}
.sales-product-origin-variants {
  margin: 0 0 6px;
  font-size: 10px;
}
.sales-product-origin-more {
  margin: 6px 0 0;
  font-size: 10px;
}
.sales-product-origin-related {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}
.sales-product-origin-related-title {
  font-size: 10px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}
.sales-product-origin-related-list {
  margin: 0;
  padding-left: 16px;
  font-size: 10px;
  line-height: 1.5;
}
.sales-product-origin-related-empty {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.45;
}
:root[data-formula-theme="dark"] .sales-product-origin-body {
  background: #0f172a;
  border-color: #334155;
}
:root[data-formula-theme="dark"] .sales-product-origin-table th {
  background: #1e293b;
}
:root[data-formula-theme="dark"] .sales-product-origin-summary {
  color: #93c5fd;
}
:root[data-formula-theme="dark"] .sales-product-bundled-callout {
  background: rgb(30 58 138 / 0.25);
  border-color: rgb(59 130 246 / 0.45);
  color: #dbeafe;
}
:root[data-formula-theme="dark"] .sales-product-bundled-tip {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .sales-fc-unit-avg-banner {
  background: linear-gradient(135deg, rgb(30 58 138 / 0.35), rgb(15 23 42 / 0.6));
  border-color: rgb(59 130 246 / 0.45);
}
:root[data-formula-theme="dark"] .sales-fc-unit-avg-value {
  color: #dbeafe;
}
:root[data-formula-theme="dark"] .sales-fc-unit-narrative {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
@media (max-width: 900px) {
  .sales-fc-unit-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .sales-fc-unit-meta {
    white-space: normal;
  }
}
.sales-mix-table-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.sales-mix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
.sales-mix-table th,
.sales-mix-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
}
.sales-mix-table th:first-child,
.sales-mix-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #f8fafc;
  z-index: 1;
}
.sales-mix-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}
:root[data-formula-theme="dark"] .sales-subtab-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
:root[data-formula-theme="dark"] .sales-subtab-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
:root[data-formula-theme="dark"] .sales-mix-card {
  background: #1e293b;
  border-color: #334155;
}
:root[data-formula-theme="dark"] .sales-mix-card-value {
  color: #f1f5f9;
}
:root[data-formula-theme="dark"] .sales-mix-bar-track {
  background: #334155;
}
:root[data-formula-theme="dark"] .sales-mix-bar-share {
  color: #93c5fd;
}
:root[data-formula-theme="dark"] .sales-mix-th-pt {
  color: #fdba74 !important;
  background: rgb(124 45 18 / 0.35) !important;
}
:root[data-formula-theme="dark"] .sales-mix-th-fc {
  color: #93c5fd !important;
  background: rgb(30 58 138 / 0.35) !important;
}
:root[data-formula-theme="dark"] .sales-mix-trend-value-shell {
  background: #1e293b;
}
:root[data-formula-theme="dark"] .sales-mix-trend-count {
  color: #f8fafc;
  text-shadow: 0 0 6px rgb(15 23 42 / 0.9), 0 1px 3px rgb(15 23 42 / 0.75);
}
:root[data-formula-theme="dark"] .sales-mix-trend-count-plain {
  color: #cbd5e1;
}
:root[data-formula-theme="dark"] .sales-mix-trend-peak-plain .sales-mix-trend-count-plain {
  color: #93c5fd;
}
:root[data-formula-theme="dark"] .sales-mix-table th,
:root[data-formula-theme="dark"] .sales-mix-table td:first-child {
  background: #1e293b;
}
@media (max-width: 900px) {
  .sales-mix-summary-cards,
  .sales-mix-two-col {
    grid-template-columns: 1fr;
  }
  .sales-mix-bar-row {
    grid-template-columns: 64px 1fr;
  }
  .sales-mix-bar-meta {
    grid-column: 2;
  }
}
.sales-tab-header .sales-upload-card .sales-upload-card-header {
  min-height: 36px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}
.sales-upload-card {
  flex-shrink: 0;
  min-width: 0;
}
.sales-upload-card-collapsed {
  width: auto;
  padding: 0;
}
.sales-upload-card-collapsed .sales-upload-card-header {
  margin-bottom: 0;
  border-radius: var(--radius);
}
.sales-upload-card:not(.sales-upload-card-collapsed) {
  min-width: 280px;
  width: 100%;
  max-width: 360px;
}
.sales-upload-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg-sub, #f1f5f9);
  cursor: pointer;
  user-select: none;
}
.sales-upload-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.sales-upload-card-toggle {
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 4px;
}
.sales-upload-card-toggle:hover {
  color: var(--text);
  background: rgba(0,0,0,0.06);
}
.sales-upload-card-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sales-upload-card-collapsed .sales-upload-card-body {
  display: none;
}
.sales-period-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sales-period-wrap label { font-size: 13px; font-weight: 600; color: var(--text-sub); }
.sales-context-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub, #64748b);
  margin-left: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.sales-month-projection-slot {
  flex: 1 1 200px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.sales-month-projection-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  font-size: 12px;
  line-height: 1.35;
  max-width: 100%;
  box-sizing: border-box;
}
.sales-month-projection-label {
  font-weight: 700;
  color: #1e40af;
  white-space: nowrap;
}
.sales-month-projection-value {
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.sales-month-projection-hint {
  color: var(--text-sub, #64748b);
  font-size: 11px;
  white-space: nowrap;
}
.sales-total-cell-with-projection {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}
.sales-month-projection-inline {
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  line-height: 1.25;
}
.sales-month-projection-inline-label {
  font-weight: 700;
  color: #334155;
}
.sales-period-toggle-inline {
  display: flex;
  gap: 6px;
}

.sales-meta-toggle-row {
  display: flex;
  justify-content: flex-start;
}

.sales-meta-panel {
  margin-bottom: 12px;
}

.sales-period-toggle {
  display: flex;
  gap: 8px;
  position: sticky;
  top: 58px;
  z-index: 12;
  background: #fff;
  padding: 6px 0 8px;
  border-bottom: 1px solid #e2e8f0;
}
.sales-period-toggle .sales-period-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.sales-period-cell {
  white-space: nowrap;
}

.sales-card > h3,
.sales-table-title {
  text-align: center;
}

.sales-table-title {
  /* sticky 제거: 스크롤 시 제목이 테이블을 가리는 현상 방지 */
  margin-bottom: 8px;
}
.sales-table-card {
  padding-top: 12px;
  padding-bottom: 14px;
  margin-bottom: 12px;
}
.sales-table-card .sales-table-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  line-height: 1.3;
}

.sales-table-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 72vh;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.sales-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
  border-collapse: separate;
  border-spacing: 0;
}

.sales-table th,
.sales-table td {
  white-space: normal;
  word-break: keep-all;
  padding: 6px 6px;
  line-height: 1.25;
  min-width: 0;
}

.sales-table th {
  text-transform: none;
  letter-spacing: 0;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 8;
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

.sales-table .sales-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1.35;
  font-size: 10px;
}

.sales-table .chip-pt { background: rgba(232,112,64,0.18); color: #c2410c; }
.sales-table .chip-fc { background: rgba(59,130,246,0.18); color: #1d4ed8; }
.sales-table .chip-new { background: rgba(34,197,94,0.18); color: #15803d; }
.sales-table .chip-re { background: rgba(168,85,247,0.18); color: #7e22ce; }
.sales-table .chip-member { background: rgba(22,163,74,0.15); color: #166534; }
.sales-table .chip-pt-price { background: rgba(251,146,60,0.2); color: #c2410c; }
.sales-table .chip-fc-price { background: rgba(96,165,250,0.2); color: #1d4ed8; }

.sales-amount-track {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 6px;
  background: #eef2f7;
  overflow: hidden;
}

.sales-amount-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 100%);
}

.sales-amount-fill.is-total {
  background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 100%);
}

.sales-amount-fill.is-pt {
  background: linear-gradient(90deg, rgba(251,146,60,0.55) 0%, rgba(234,88,12,0.55) 100%);
}

.sales-amount-fill.is-fc {
  background: linear-gradient(90deg, rgba(96,165,250,0.55) 0%, rgba(37,99,235,0.55) 100%);
}

.sales-amount-fill.is-new {
  background: linear-gradient(90deg, rgba(74,222,128,0.55) 0%, rgba(22,163,74,0.55) 100%);
}

.sales-amount-fill.is-re {
  background: linear-gradient(90deg, rgba(196,181,253,0.7) 0%, rgba(147,51,234,0.55) 100%);
}

.sales-amount-fill.is-member {
  background: linear-gradient(90deg, rgba(134,239,172,0.55) 0%, rgba(22,163,74,0.35) 100%);
}

.sales-amount-text {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 100%;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
  color: #334155;
}

.sales-table .funnel-bar-row {
  height: 24px;
  min-width: 88px;
}

.sales-table .funnel-bar-row > div {
  font-size: 10px;
}

.sales-table .funnel-bar-row.ratio-left > div {
  justify-content: flex-start;
  padding-left: 6px;
}

.sales-table .funnel-bar-row {
  min-width: 100px;
}

/* FC/PT %, 신규/재등록 %: 가독성 위해 최소 너비 확보 */
.sales-table th.sales-col-fcpt-pct,
.sales-table td:nth-child(6) {
  min-width: 108px;
}
.sales-table th.sales-col-newre-pct,
.sales-table td:nth-child(9) {
  min-width: 108px;
}

/* FC신규/FC재등록/PT신규/PT재등록: 공간 절약 */
.sales-table th.member-col,
.sales-table td.member-col {
  width: 64px;
  max-width: 64px;
  min-width: 64px;
  padding-left: 4px;
  padding-right: 4px;
}

.sales-inline-ratios {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.sales-ratio-inline {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.sales-ratio-track {
  display: flex;
  width: 100%;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: #eef2f7;
}

.sales-ratio-left,
.sales-ratio-right {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sales-inline-ratio-badge {
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.2;
  white-space: nowrap;
}

/* ── Profitability Tab ── */
.profit-card {
  margin-bottom: 18px;
  border-radius: 12px;
  overflow: hidden;
}
.expense-requests-card {
  overflow: visible;
}

/* 재무 관리 탭 레이아웃 (PC: 좌측 메뉴 / 모바일: 상단 세그먼트) */
.finance-layout {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
/* CRM 단독 탭: 좌측 서브메뉴 없이 본문만 전폭 */
.finance-layout.fx-crm-standalone {
  grid-template-columns: minmax(0, 1fr);
}
.finance-layout.fx-crm-standalone .finance-main {
  min-width: 0;
}
.finance-sidebar {
  padding: 10px;
  width: fit-content;
  max-width: 170px;
}
.finance-sidebar-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
}
.finance-menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 마케팅 서브메뉴: 온라인 / 오프라인 구역 */
.fx-mcrm-sidebar-menu {
  gap: 0;
}
.fx-mcrm-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fx-mcrm-nav-group-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #64748b;
  margin: 0 0 2px 2px;
}
.fx-mcrm-nav-group + .fx-mcrm-nav-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.fx-mcrm-mobile-group {
  width: 100%;
}
.fx-mcrm-mobile-group-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #64748b;
  margin: 0 0 6px 4px;
}
.fx-mcrm-mobile-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fx-mcrm-mobile-group-tabs .finance-mobile-tab-btn {
  flex: 0 1 auto;
}
/* 모바일 전용 메뉴 select (기본은 숨김; 900px 이하 미디어쿼리에서 표시) */
.fx-mcrm-mobile-select {
  display: none;
  width: 100%;
}
:root[data-formula-theme="dark"] .fx-mcrm-nav-group-label,
:root[data-formula-theme="dark"] .fx-mcrm-mobile-group-label {
  color: #94a3b8;
}
:root[data-formula-theme="dark"] .fx-mcrm-nav-group + .fx-mcrm-nav-group {
  border-top-color: rgba(148, 163, 184, 0.35);
}
.finance-menu-item {
  border: 1px solid #dbe3ff;
  background: #f8fbff;
  color: #334155;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  width: 100%;
}
.finance-menu-item:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.finance-menu-item.is-active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #fff;
}
.finance-menu-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.finance-main {
  min-width: 0;
}
.finance-mobile-tabs {
  display: none;
  margin-bottom: 10px;
  padding: 6px;
}
.finance-mobile-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 10px;
  cursor: pointer;
  flex: 1 1 0;
}
.finance-mobile-tab-btn.is-active {
  background: #4f46e5;
  color: #fff;
  border-color: #4338ca;
}
.finance-mobile-tab-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .finance-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .finance-sidebar {
    display: none;
  }
  .finance-mobile-tabs {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .finance-mobile-tabs.fx-mcrm-mobile-tabs-stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 8px;
  }
  /* 모바일에서 그룹 버튼은 숨기고 select 한 개로 대체 */
  .fx-mcrm-mobile-tabs-stacked .fx-mcrm-mobile-group {
    display: none;
  }
  .fx-mcrm-mobile-tabs-stacked .fx-mcrm-mobile-select {
    display: block;
    width: 100%;
  }
}

:root[data-formula-theme="dark"] .finance-sidebar-title {
  color: var(--text);
}
:root[data-formula-theme="dark"] .finance-menu-item {
  background: rgba(79, 70, 229, 0.2);
  border-color: var(--border);
  color: var(--text);
}
:root[data-formula-theme="dark"] .finance-menu-item:hover {
  background: rgba(99, 102, 241, 0.32);
}
:root[data-formula-theme="dark"] .finance-mobile-tabs {
  background: var(--card);
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .finance-mobile-tab-btn {
  color: var(--text-sub);
}
:root[data-formula-theme="dark"] .finance-mobile-tab-btn.is-active {
  color: #fff;
}

/* 마케팅 > 블로그 */
.fx-blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.fx-blog-bottom {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(280px, 0.9fr);
  gap: 10px;
}
.fx-blog-left,
.fx-blog-right,
.fx-blog-list,
.fx-blog-perf {
  padding: 12px;
}
.fx-blog-body {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}
.fx-blog-suggest {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fx-blog-seo-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.fx-blog-guide-step {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fx-blog-guide-step strong {
  font-size: 11px;
  color: #475569;
}
.fx-blog-guide-step span {
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
}
.fx-blog-guide-step.is-active {
  border-color: #a5b4fc;
  background: #eef2ff;
}
.fx-blog-selected-panel {
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}
.fx-blog-selected-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.fx-blog-selected-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fx-blog-selected-chip {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.fx-blog-keyword-chip {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 9px;
  padding: 6px 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  text-align: left;
}
.fx-blog-keyword-chip span {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}
.fx-blog-keyword-chip small {
  font-size: 10px;
  color: #64748b;
}
.fx-blog-keyword-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.fx-blog-keyword-chip.is-top {
  border-color: #f59e0b;
  background: #fffbeb;
}
.fx-blog-seo-summary {
  width: 100%;
  font-size: 12px;
  color: #475569;
  margin-bottom: 6px;
  font-weight: 700;
}
.fx-blog-optional-settings {
  margin-top: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}
.fx-blog-optional-settings summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.fx-blog-discover-status {
  min-height: 18px;
  font-size: 12px;
}
.fx-blog-discover-status.is-loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(71, 85, 105, 0.25);
  border-top-color: #475569;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -2px;
  animation: fxBlogSpin 0.8s linear infinite;
}
@keyframes fxBlogSpin {
  to { transform: rotate(360deg); }
}
.fx-blog-tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #334155;
  background: #e2e8f0;
}
.fx-blog-tier-badge.is-top {
  color: #92400e;
  background: #fde68a;
}
.fx-blog-row {
  cursor: pointer;
}
.fx-blog-row.is-active td {
  background: #eef2ff;
}

@media (max-width: 900px) {
  .fx-blog-layout,
  .fx-blog-bottom {
    grid-template-columns: 1fr;
  }
  .fx-blog-body {
    min-height: 240px;
  }
}

:root[data-formula-theme="dark"] .fx-blog-keyword-chip {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.65);
}
:root[data-formula-theme="dark"] .fx-blog-seo-guide .fx-blog-guide-step {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
}
:root[data-formula-theme="dark"] .fx-blog-guide-step strong {
  color: #94a3b8;
}
:root[data-formula-theme="dark"] .fx-blog-guide-step span {
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-blog-guide-step.is-active {
  border-color: rgba(129, 140, 248, 0.65);
  background: rgba(67, 56, 202, 0.3);
}
:root[data-formula-theme="dark"] .fx-blog-selected-panel {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
}
:root[data-formula-theme="dark"] .fx-blog-selected-chip {
  border-color: rgba(129, 140, 248, 0.6);
  background: rgba(67, 56, 202, 0.35);
  color: #c7d2fe;
}
:root[data-formula-theme="dark"] .fx-blog-keyword-chip.is-top {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(120, 53, 15, 0.45);
}
:root[data-formula-theme="dark"] .fx-blog-keyword-chip span {
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-blog-keyword-chip small {
  color: #94a3b8;
}
:root[data-formula-theme="dark"] .fx-blog-seo-summary {
  color: #cbd5e1;
}
:root[data-formula-theme="dark"] .fx-blog-tier-badge {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.28);
}
:root[data-formula-theme="dark"] .fx-blog-optional-settings {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.55);
}
:root[data-formula-theme="dark"] .fx-blog-optional-settings summary {
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-blog-discover-status {
  color: #cbd5e1 !important;
}
:root[data-formula-theme="dark"] .fx-blog-discover-status.is-loading::before {
  border-color: rgba(203, 213, 225, 0.35);
  border-top-color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-blog-tier-badge.is-top {
  color: #fde68a;
  background: rgba(146, 64, 14, 0.52);
}
:root[data-formula-theme="dark"] .fx-blog-row.is-active td {
  background: rgba(79, 70, 229, 0.22);
}

/* 지출 > 항목별 지출 분석 카드/차트 */
.expense-item-analytics-card {
  padding: 10px;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.expense-item-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 10px;
}
.expense-item-chart-pane {
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  overflow-x: auto;
  padding-bottom: 4px;
}
.expense-item-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  max-width: 96px;
  flex: 1;
}
.expense-item-chart-amount {
  font-size: 11px;
  font-weight: 700;
}
.expense-item-chart-track {
  height: 120px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
}
.expense-item-chart-label {
  font-size: 12px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

:root[data-formula-theme="dark"] .expense-item-analytics-card {
  background: var(--card);
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .expense-item-chart-track {
  background: rgba(15, 23, 42, 0.7);
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .expense-item-chart-amount {
  color: var(--text);
}

/* 지출 탭 보기 전환(지출 결의 / 지점 지출) */
.expense-view-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  margin: 0 0 8px 0;
  padding: 0;
}
.expense-view-switch-card {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  column-gap: 10px;
  row-gap: 0;
  flex: none !important;
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 12px !important;
  margin-bottom: 8px;
  overflow: hidden;
  align-self: flex-start !important;
}
.expense-view-switch-head {
  display: flex;
  align-items: center;
}
.expense-view-switch-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  line-height: 1.2;
}
.expense-view-switch-segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 4px;
  background: #f8fafc;
}
.expense-view-switch-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  padding: 6px 10px;
  min-height: 30px;
  cursor: pointer;
}
.expense-view-switch-btn:hover {
  background: #eef2ff;
  color: #3730a3;
}
.expense-view-switch-btn.is-active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4338ca;
}

.expense-requests-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

.expense-requests-meta-chip {
  border: 1px solid #dbe3ff;
  background: #f8fbff;
  color: #334155;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  padding: 6px 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s ease;
}

.expense-requests-meta-chip:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.expense-requests-meta-chip.is-active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #fff;
}

.expense-requests-meta-chip.is-pending {
  border-color: #facc15;
  background: #fef9c3;
  color: #854d0e;
}

.expense-requests-meta-chip.is-transfer {
  border-color: #67e8f9;
  background: #ecfeff;
  color: #0e7490;
}

.expense-requests-meta-chip.is-pending.is-active,
.expense-requests-meta-chip.is-transfer.is-active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #fff;
}
@media (max-width: 640px) {
  .expense-view-switch-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .expense-view-switch-card {
    display: flex;
    flex-wrap: wrap;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 10px 12px !important;
  }
  .expense-view-switch-segment {
    width: 100%;
    justify-content: stretch;
  }
  .expense-view-switch-btn {
    flex: 1 1 0;
    text-align: center;
  }
}

.profit-card h3 {
  font-weight: 700;
  color: #1e293b;
}

.profit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.profit-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.profit-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.profit-table th,
.profit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  text-align: right;
  white-space: nowrap;
}

.profit-table td.col-actions {
  white-space: normal;
  min-width: 210px;
}

.expense-requests-card .profit-table.expense-requests-table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}

.expense-requests-card .er-col-select { width: 34px; }
.expense-requests-card .er-col-branch { width: 92px; }
.expense-requests-card .er-col-date { width: 132px; }
.expense-requests-card .er-col-amount { width: 80px; }
.expense-requests-card .er-col-item { width: 84px; }
.expense-requests-card .er-col-memo { width: auto; } /* 가변: 남는 폭을 메모가 흡수 */
.expense-requests-card .er-col-account { width: 132px; }
.expense-requests-card .er-col-attach { width: 44px; }
.expense-requests-card .er-col-payment { width: 56px; }
.expense-requests-card .er-col-status { width: 72px; }
.expense-requests-card .er-col-actions { width: 210px; } /* 작업: 고정폭(버튼은 줄바꿈) → 우측 빈 공간 제거 */

.expense-requests-card .profit-table.expense-requests-table th.er-col-branch,
.expense-requests-card .profit-table.expense-requests-table td.er-col-branch,
.expense-requests-card .profit-table.expense-requests-table th.er-col-date,
.expense-requests-card .profit-table.expense-requests-table td.er-col-date,
.expense-requests-card .profit-table.expense-requests-table th.er-col-amount,
.expense-requests-card .profit-table.expense-requests-table td.er-col-amount,
.expense-requests-card .profit-table.expense-requests-table th.er-col-item,
.expense-requests-card .profit-table.expense-requests-table td.er-col-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-requests-card .profit-table.expense-requests-table th.er-col-branch,
.expense-requests-card .profit-table.expense-requests-table td.er-col-branch {
  max-width: 92px;
}

.expense-requests-card .profit-table.expense-requests-table th.er-col-date,
.expense-requests-card .profit-table.expense-requests-table td.er-col-date {
  max-width: 132px;
}

.expense-requests-card .profit-table.expense-requests-table th.er-col-amount,
.expense-requests-card .profit-table.expense-requests-table td.er-col-amount {
  max-width: 80px;
}

.expense-requests-card .profit-table.expense-requests-table th.er-col-item,
.expense-requests-card .profit-table.expense-requests-table td.er-col-item {
  max-width: 84px;
}

.expense-requests-card .profit-table td.col-actions {
  min-width: 0;
}

.profit-table th.er-memo-col,
.profit-table td.er-memo-col {
  white-space: normal;
  word-break: break-word;
  min-width: 180px;
  width: auto;
  max-width: none;
  vertical-align: top;
  overflow: hidden;
}

.profit-table th.er-account-col,
.profit-table td.er-account-col {
  white-space: nowrap;
  max-width: 132px;
  min-width: 132px;
  width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.er-memo-cell {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.er-memo-preview {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
  font-size: 12px;
}

.er-memo-more {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 !important;
  font-size: 11px !important;
  line-height: 1.2;
  white-space: nowrap;
}

.er-account-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.35;
}

.er-memo-modal-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  font-size: 14px;
  color: #334155;
}

.table-action-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.table-action-wrap .btn {
  white-space: nowrap;
}

.profit-table thead th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 12px;
  color: #475569;
  text-transform: none;
  letter-spacing: -0.01em;
}

.profit-table thead th:first-child {
  border-radius: 12px 0 0 0;
  text-align: left;
}

.profit-table thead th:last-child {
  border-radius: 0 12px 0 0;
}

/* 활동 실적 탭: 첫 행(헤더) 고정, 세로 스크롤 시 배경으로 데이터 겹침 방지 */
.activity-table-wrap {
  overflow: auto;
  max-height: min(calc(100vh - 280px), 720px);
}
.activity-table-wrap .profit-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  box-shadow: 0 1px 0 0 #e2e8f0;
}
.activity-table-wrap .profit-table thead th:first-child {
  z-index: 11;
}
.activity-table-wrap .profit-table thead th:last-child {
  box-shadow: 0 1px 0 0 #e2e8f0;
}

/* 활동 실적: 열 구분을 위한 지그재그(교차) 컬럼 배경 */
.activity-table-wrap .profit-table thead th:nth-child(2n) {
  background: #f1f5f9;
}
.activity-table-wrap .profit-table thead th:nth-child(2n+1):not(:first-child) {
  background: #e2e8f0;
}
.activity-table-wrap .profit-table tbody td:nth-child(2n) {
  background: #f8fafc;
}
.activity-table-wrap .profit-table tbody td:nth-child(2n+1):not(:first-child) {
  background: #fff;
}
.activity-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(2n) {
  background: #f1f5f9;
}
.activity-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(2n+1):not(:first-child) {
  background: #fafbfc;
}
.activity-table-wrap .profit-table tbody tr:hover td:nth-child(2n) {
  background: #e2e8f0;
}
.activity-table-wrap .profit-table tbody tr:hover td:nth-child(2n+1):not(:first-child) {
  background: #f1f5f9;
}
.activity-table-wrap .profit-table tbody td:first-child {
  background: #fff;
}
.activity-table-wrap .profit-table tbody tr:nth-child(even) td:first-child {
  background: #fafbfc;
}
.activity-table-wrap .profit-table tbody tr:hover td:first-child {
  background: #f8fafc;
}

.profit-table tbody tr {
  background: #fff;
}

.profit-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.profit-table tbody tr:hover {
  background: #f8fafc;
}

.profit-table tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: #334155;
}

.profit-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 12px;
}

.profit-table tbody tr:last-child td:last-child {
  border-radius: 0 0 12px 0;
}

.profit-input {
  width: 100%;
  min-width: 96px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 12px;
  text-align: right;
  background: #fff;
}

.profit-row-msg {
  margin-top: 6px;
  min-height: 14px;
  font-size: 11px;
}

/* 목표 매출 달성률 셀: 달성=초록, 미달=빨강 */
.profit-table .st-cell-achieved {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  font-weight: 600;
}
.profit-table .st-cell-missed {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  font-weight: 600;
}

/* 목표 매출: 월별 누적 합계·주차별 합계/합계 매출 행 */
.profit-table tbody tr.sales-target-weekly-summary-row,
.profit-table tbody tr.sales-target-weekly-grand-row {
  background: transparent;
}
.profit-table tbody tr.sales-target-weekly-summary-row td,
.profit-table tbody tr.sales-target-weekly-grand-row td {
  background: #f1f5f9;
  font-weight: 700;
}
.profit-table tbody tr.sales-target-weekly-summary-row td {
  border-top: 1px solid var(--border);
}
.profit-table tbody tr.sales-target-weekly-grand-row td.sales-target-grand-filler {
  font-weight: 500;
  color: var(--text-muted);
}
.sales-target-summary-card .profit-table tbody tr.sales-target-monthly-total-row td {
  background: #f1f5f9;
  font-weight: 700;
  border-top: 1px solid var(--border);
}

.st-target-mismatch {
  background: #fee2e2 !important;
  color: #991b1b !important;
}
.st-target-diff-hint {
  display: inline-block;
  font-size: 0.85em;
  margin-left: 4px;
  font-weight: 600;
  white-space: nowrap;
}

/* 다크: tr 줄무늬 배경이 합계 행을 밝게 덮지 않도록 */
:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-summary-row,
:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-grand-row {
  background: transparent !important;
}

:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-summary-row > td,
:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-grand-row > td,
:root[data-formula-theme="dark"] .sales-target-summary-card .profit-table tbody tr.sales-target-monthly-total-row > td {
  background-color: #252f42 !important;
  color: #f8fafc !important;
  border-top-color: var(--border) !important;
}

html[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-summary-row > td,
html[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-grand-row > td,
html[data-formula-theme="dark"] .sales-target-summary-card .profit-table tbody tr.sales-target-monthly-total-row > td {
  background-color: #252f42 !important;
  color: #f8fafc !important;
}

:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-summary-row td.st-cell-achieved,
:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-grand-row td.st-cell-achieved,
:root[data-formula-theme="dark"] .sales-target-summary-card .profit-table tbody tr.sales-target-monthly-total-row td.st-cell-achieved {
  background: rgba(34, 197, 94, 0.38) !important;
  color: #dcfce7 !important;
}

:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-summary-row td.st-cell-missed,
:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-grand-row td.st-cell-missed,
:root[data-formula-theme="dark"] .sales-target-summary-card .profit-table tbody tr.sales-target-monthly-total-row td.st-cell-missed {
  background: rgba(239, 68, 68, 0.38) !important;
  color: #fecaca !important;
}

:root[data-formula-theme="dark"] .profit-table tbody tr.sales-target-weekly-grand-row td.sales-target-grand-filler {
  background-color: #1e293b !important;
  color: #94a3b8 !important;
}

:root[data-formula-theme="dark"] .st-target-mismatch,
html[data-formula-theme="dark"] .st-target-mismatch {
  background: rgba(239, 68, 68, 0.35) !important;
  color: #fecaca !important;
}

/* 목표 달성율 탭: 상단 통합 표, 하단 주차별 테이블 */
.goal-achievement-root {
  padding-bottom: 24px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}
/* 목표 달성률: 카드 제목 옆에 전환율 목표 표시 */
.goal-achievement-header-card .goal-achievement-title-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;
  row-gap: 6px;
  margin-bottom: 8px;
}
.goal-achievement-header-card {
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}
.goal-achievement-header-card .goal-achievement-title-row {
  min-width: 0;
}
.goal-achievement-header-card .goal-achievement-main-title {
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal-achievement-title-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.goal-achievement-legend {
  margin: 0 0 4px 0;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}
.goal-achievement-month-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.goal-achievement-month-inline .form-control {
  width: auto;
  min-width: 110px;
  height: 30px;
  padding: 4px 8px;
}
.goal-achievement-conversion-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--border);
}
.goal-achievement-conversion-block {
  justify-self: end;
  align-self: start;
  margin-left: 14px;
  max-width: 100%;
  min-width: 0;
}
.goal-achievement-conversion-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}
/* 기본 테이블 스타일: 데스크톱에서만 width 100%. 미디어 쿼리가 뒤에 와야 태블릿 고정폭이 적용됨 */
.goal-achievement-conversion-table {
  font-size: 13px;
  border-collapse: collapse;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  width: 100%;
  min-width: 360px;
  table-layout: fixed;
}
.goal-achievement-conversion-table th:first-child,
.goal-achievement-conversion-table td:first-child {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  box-sizing: border-box;
}
.goal-achievement-conversion-table th,
.goal-achievement-conversion-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal-achievement-conversion-table thead th {
  background: #f8fafc;
  font-weight: 600;
}
.goal-achievement-conversion-table tbody tr:last-child td {
  border-bottom: none;
}
@media (max-width: 1100px) {
  .goal-achievement-header-card .goal-achievement-title-row {
    grid-template-columns: 1fr;
  }
  .goal-achievement-conversion-block {
    justify-self: start;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
  .goal-achievement-conversion-table-wrap {
    max-width: 100%;
  }
  .goal-achievement-conversion-table {
    font-size: 12px;
    width: 360px !important;
    min-width: 360px !important;
    max-width: 360px;
  }
  .goal-achievement-conversion-table th,
  .goal-achievement-conversion-table td {
    padding: 4px 5px;
  }
  .goal-achievement-conversion-table th:first-child,
  .goal-achievement-conversion-table td:first-child {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
  }
}

.bemove-period-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.bemove-period-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bemove-period-filter .btn.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.bemove-period-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bemove-period-inputs input[type="date"] {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 13px;
}
.bemove-equipment-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bemove-equipment-pending-badge {
  background: #eef2ff;
  color: #4338ca;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.bemove-equipment-request-box {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}
.bemove-equipment-request-box h5 {
  margin: 0 0 8px;
  font-size: 14px;
}
.bemove-equipment-req-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bemove-equipment-req-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}
.bemove-equipment-req-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bemove-equipment-req-meta {
  color: var(--text-sub);
  font-size: 12px;
}
.bemove-equipment-req-actions {
  display: flex;
  gap: 6px;
}
.bemove-equipment-req-actions .btn {
  white-space: nowrap;
  min-width: 44px;
  padding-left: 8px;
  padding-right: 8px;
}
.nav-tab .bemove-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.nav-tab.active .bemove-tab-badge {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
@media (max-width: 720px) {
  .bemove-period-filter {
    align-items: flex-start;
  }
  .bemove-period-inputs {
    width: 100%;
  }
  .bemove-period-inputs input[type="date"] {
    flex: 1 1 130px;
    min-width: 120px;
  }
}
@media (max-width: 768px) {
  .goal-achievement-conversion-table {
    font-size: 11px;
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px;
  }
  .goal-achievement-conversion-table th,
  .goal-achievement-conversion-table td {
    padding: 3px 4px;
  }
  .goal-achievement-conversion-table th:first-child,
  .goal-achievement-conversion-table td:first-child {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
  }
}
.goal-achievement-unified-card {
  margin-bottom: 24px;
  min-width: 0;
}
.goal-achievement-unified-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: scroll;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.goal-achievement-unified-table {
  min-width: 900px;
}
/* 목표 달성률: 상단 그룹 행 — 활동 지표 / 전환율 목표 위로 올려서 표시 */
.goal-achievement-unified-table thead tr.goal-achievement-thead-group th {
  padding: 12px 12px 10px 12px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: bottom;
}
.goal-achievement-unified-card .goal-achievement-unified-table-wrap {
  margin-top: -6px;
}
.goal-achievement-unified-table thead tr.goal-achievement-thead-group th.goal-achievement-th-activity {
  text-align: left;
  background: #f8fafc;
}
.goal-achievement-unified-table thead tr.goal-achievement-thead-group th.goal-achievement-th-conversion {
  text-align: center;
  background: #f1f5f9;
  border-left: 2px solid var(--border);
}
.goal-achievement-unified-table thead tr:not(.goal-achievement-thead-group) th.goal-achievement-th-conversion-col {
  background: #f8fafc;
}
/* PT 재등록 대상/성공 열 구분선 제거 (구분선 없음) */
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(14),
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(15),
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(16),
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(17),
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:nth-child(18) {
  background: #f8fafc;
}
.goal-achievement-unified-table .goal-achievement-target-input {
  padding: 4px 6px;
  font-size: 13px;
}

/* 목표 달성률: 상단 통합 표 — 구분 열 틀 고정 */
.goal-achievement-unified-table-wrap .goal-achievement-unified-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 10;
  background: #f8fafc;
  min-width: 88px;
  box-shadow: 2px 0 0 #e2e8f0;
}
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
  min-width: 88px;
  box-shadow: 2px 0 0 #e2e8f0;
  font-weight: 600;
}
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:nth-child(even) td:first-child {
  background: #fafbfc;
}
.goal-achievement-unified-table-wrap .goal-achievement-unified-table tbody tr:hover td:first-child {
  background: #f8fafc;
}

.goal-achievement-bottom {
  display: block;
  width: 100%;
  min-width: 0;
}
.goal-achievement-bottom .card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.goal-achievement-bottom .profit-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: scroll;
  -webkit-overflow-scrolling: touch;
}
.goal-achievement-bottom .profit-table {
  min-width: 1200px;
}

.goal-achievement-insight-card .insight-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 목표 달성률: 주차별 FC/PT 매출·스마트 플레이스 문의수 테이블 — 왼쪽 7열(주차~PT 달성률) 틀 고정 */
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(1),
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(2),
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(3),
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(4),
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(5),
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(6),
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(7) {
  position: sticky;
  z-index: 10;
  background: #f8fafc;
  box-shadow: 1px 0 0 #e2e8f0;
}
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(1) { left: 0; min-width: 140px; }
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(2) { left: 140px; min-width: 90px; }
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(3) { left: 230px; min-width: 90px; }
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(4) { left: 320px; min-width: 72px; }
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(5) { left: 392px; min-width: 90px; }
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(6) { left: 482px; min-width: 90px; }
.goal-achievement-place-table-wrap .profit-table thead th:nth-child(7) { left: 572px; min-width: 72px; box-shadow: 2px 0 0 #e2e8f0; }

.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(1),
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(2),
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(3),
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(4),
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(5),
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(6),
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(7) {
  position: sticky;
  z-index: 5;
  box-shadow: 1px 0 0 #e2e8f0;
}
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(1) { left: 0; min-width: 140px; background: #fff; }
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(2) { left: 140px; min-width: 90px; background: #fff; }
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(3) { left: 230px; min-width: 90px; background: #fff; }
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(4) { left: 320px; min-width: 72px; background: #fff; }
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(5) { left: 392px; min-width: 90px; background: #fff; }
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(6) { left: 482px; min-width: 90px; background: #fff; }
.goal-achievement-place-table-wrap .profit-table tbody td:nth-child(7) { left: 572px; min-width: 72px; background: #fff; box-shadow: 2px 0 0 #e2e8f0; }
.goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(1),
.goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(2),
.goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(3),
.goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(4),
.goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(5),
.goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(6),
.goal-achievement-place-table-wrap .profit-table tbody tr:nth-child(even) td:nth-child(7) {
  background: #fafbfc;
}
.goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(1),
.goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(2),
.goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(3),
.goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(4),
.goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(5),
.goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(6),
.goal-achievement-place-table-wrap .profit-table tbody tr:hover td:nth-child(7) {
  background: #f8fafc;
}
.goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(1),
.goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(2),
.goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(3),
.goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(4),
.goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(5),
.goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(6),
.goal-achievement-place-table-wrap .profit-table tbody tr.place-row-total td:nth-child(7) {
  background: #f1f5f9;
  font-weight: 600;
}

/* 수익률 월별 테이블 인라인 막대 (파스텔 톤) */
.profit-table .profit-td-bar {
  position: relative;
  min-width: 76px;
  padding: 10px 12px;
}
.profit-table .profit-td-bar .profit-bar-bg {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 10px;
  height: calc(100% - 10px);
  min-width: 4px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 1;
}
.profit-table .profit-td-bar .profit-bar-bg--right {
  left: auto;
  right: 10px;
}
.profit-table .profit-td-bar .profit-bar-txt {
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
}
.profit-table .profit-td-bar .profit-bar-txt:only-child {
  font-weight: inherit;
}

.profit-table .profit-td-bar.profit-cell-positive .profit-bar-txt {
  color: #15803d;
  font-weight: 700;
}
.profit-table .profit-td-bar.profit-cell-negative .profit-bar-txt {
  color: #b91c1c;
  font-weight: 700;
}


/* ── KPI Grid ── */
.kpi-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  gap: 12px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  min-width: 0;
  flex: 0 0 190px;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}
.kpi-label { font-size: 11px; font-weight: 600; color: var(--text-sub); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 20px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }

/* ── Overview Snapshot (퍼널 + 매출 구성) ── */
.overview-snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.overview-funnel-card .table-title,
.overview-sales-card .table-title { margin-bottom: 12px; }
.overview-filter-card {
  margin-bottom: 16px;
  padding: 12px 14px;
}
.overview-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.overview-filter-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}
.overview-filter-row select,
.overview-filter-row input[type="date"],
.overview-filter-row input[type="text"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  background: #fff;
  color: var(--text);
}
.overview-filter-row input[type="date"]:disabled {
  background: #f8fafc;
  color: #94a3b8;
}
.overview-filter-row input#overview-date-range {
  min-width: 230px;
}
.overview-filter-row input#overview-date-range:disabled {
  background: #f8fafc;
  color: #94a3b8;
}
.overview-funnel-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.overview-funnel-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  font-weight: 800;
  width: 100%;
  min-width: 180px;
  margin: 0 auto;
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.12);
}
.overview-funnel-track .stage-label { font-size: 13px; opacity: 0.95; }
.overview-funnel-track .stage-value { font-size: 30px; line-height: 1; letter-spacing: 0.01em; }
.overview-funnel-track.is-inflow { background: linear-gradient(90deg, #06b6d4, #22c1f1); width: 100%; }
.overview-funnel-track.is-order { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.overview-funnel-track.is-review { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.overview-funnel-rate {
  text-align: center;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  margin: 10px 0;
}
.overview-sales-total {
  background: #ecfdf3;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.overview-sales-total .label { font-size: 12px; color: #065f46; font-weight: 700; }
.overview-sales-total .value { font-size: 34px; line-height: 1.1; color: #047857; font-weight: 900; }
.overview-sales-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.overview-sales-split .split-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}
.overview-sales-split .label { font-size: 12px; color: var(--text-sub); font-weight: 700; }
.overview-sales-split .value { font-size: 24px; font-weight: 900; color: var(--text); }
.overview-sales-split .sub { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.overview-segment-title {
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 700;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 11px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:hover { background: rgba(99,102,241,0.02); }

/* 플레이스 탭 전체를 한 스크롤 영역으로, 빨간선(헤더 아래) 기준으로 thead만 상단 고정 */
.place-tab-scroll {
  height: calc(100vh - 120px);
  min-height: 400px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* 탭에서만 스크롤 쓰도록 래퍼 overflow 제거 → thead가 place-tab-scroll 상단에만 고정 */
.place-tab-scroll .place-table-wrap {
  max-height: none;
  overflow: visible;
}
.place-tab-scroll .place-table-wrap > table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  box-shadow: 0 1px 0 var(--border);
}

/* 주별 지표: 헤더 테이블 분리로 sticky 확실 적용(빨간선 위 고정) */
.place-weekly-sticky-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  box-shadow: 0 1px 0 var(--border);
}
.place-weekly-sticky-head .place-weekly-head-table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.place-weekly-sticky-head .place-weekly-head-table th {
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px;
  vertical-align: middle;
  min-height: 40px;
  box-sizing: border-box;
}
.place-weekly-sticky-head .place-weekly-head-table th:first-child { width: 16%; min-width: 120px; }
.place-weekly-sticky-head .place-weekly-head-table th:not(:first-child) { width: 14%; min-width: 100px; }
.place-weekly-sticky-head .place-weekly-head-table th .th-inner {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.place-weekly-body-table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.place-weekly-body-table tbody td { vertical-align: middle; }

/* 플레이스/일반 테이블 모바일 안전 래퍼 + 스크롤 시 헤더 고정 */
.place-table-wrap {
  width: 100%;
  max-height: 70vh;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.place-table-wrap > table {
  min-width: 680px;
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

/* 주별 지표: 고정 열 너비로 헤더/데이터 겹침 방지 */
.place-table-wrap.place-weekly-table {
  min-width: 720px;
}
.place-table-wrap.place-weekly-table > table {
  table-layout: fixed;
  min-width: 720px;
}
.place-table-wrap.place-weekly-table > table thead th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-table-wrap.place-weekly-table > table thead th:first-child {
  width: 16%;
  min-width: 120px;
}
.place-table-wrap.place-weekly-table > table thead th:not(:first-child) {
  width: 14%;
  min-width: 100px;
}
.place-table-wrap > table tbody td {
  vertical-align: middle;
}
.place-table-wrap.place-weekly-table > table tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-table-wrap > table thead {
  position: relative;
  z-index: 1;
  isolation: isolate;
}
.place-table-wrap > table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  box-shadow: 0 1px 0 var(--border);
  white-space: nowrap;
  min-width: 72px;
  min-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 10px;
  padding-right: 10px;
  vertical-align: middle;
  box-sizing: border-box;
}
.place-table-wrap > table thead th:first-child {
  min-width: 100px;
}
.place-table-wrap > table thead th .th-inner {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ── Admin ── */
.admin-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: calc(100vh - 60px);
}
.admin-sidebar {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.admin-menu-item {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
}
.admin-menu-item:hover { background: rgba(99,102,241,0.06); }
.admin-menu-item.active { background: var(--primary); color: #fff; }

/* 브랜드 관리 테이블: 행 높이가 달라도 마지막 칸 정렬 고정 */
.card-admin table td {
  vertical-align: top;
}

/* 사용자 관리: 지점 선택 목록이 잘리지 않도록 */
.admin-users-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}
.admin-users-table .td-branch-select {
  vertical-align: top;
}
.admin-users-table .branch-select-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.admin-users-table .admin-user-branch {
  min-width: 140px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}

.admin-users-table .td-branch-list {
  font-size: 12px;
  vertical-align: top;
}
.admin-users-table .branch-tag-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
  background: #f1f5f9;
  border-radius: 6px;
  white-space: nowrap;
}
.admin-users-table .btn-unassign-branch {
  padding: 0 4px;
  min-width: 20px;
  height: 20px;
  line-height: 1;
  border: none;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.admin-users-table .btn-unassign-branch:hover {
  background: #fecaca;
  color: #b91c1c;
}

.fx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.fx-modal {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.35);
}

.fx-modal-header,
.fx-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.fx-modal-footer {
  border-bottom: none;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.fx-modal-header h4 {
  margin: 0;
  font-size: 14px;
}

.fx-modal-body {
  padding: 12px 14px;
}
.fx-modal,
.fx-modal-body,
.fx-modal-body label,
.fx-modal-body input,
.fx-modal-body select,
.fx-modal-body textarea,
.fx-modal-footer .btn { font-size: 13px; }

.fx-modal-checklist {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  max-height: 42vh;
  overflow: auto;
}

.fx-modal-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
}

/* 환불·지출 상세: 좁은 화면에서 라벨/값 세로 배치 (피티 횟수 등 가림 방지) */
@media (max-width: 768px) {
  .fx-modal-detail-panel .fx-modal-check-item {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 8px;
  }
  .fx-modal-detail-panel .fx-modal-check-item > span:first-child {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .fx-modal-detail-panel .fx-modal-check-item > span:last-child {
    flex: 1 1 100%;
    min-width: 0;
    word-break: break-word;
    white-space: normal;
  }
}

.fx-modal-check-item input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

/* 지출·환불 상세 모달 본문: 라이트는 밝은 패널, 다크는 카드 배경 + 값 텍스트 대비 */
.fx-modal-detail-panel {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

:root[data-formula-theme="dark"] .fx-modal-detail-panel {
  background: var(--card);
  border-color: var(--border);
}

:root[data-formula-theme="dark"] .fx-modal-detail-panel .fx-modal-check-item > span:first-child {
  color: var(--text-muted) !important;
}

:root[data-formula-theme="dark"] .fx-modal-detail-panel .fx-modal-check-item > span:last-child {
  color: var(--text) !important;
}

:root[data-formula-theme="dark"] .fx-modal-detail-panel .fx-modal-check-item .btn-link {
  color: #93c5fd;
}

:root[data-formula-theme="dark"] .fx-modal-detail-panel .fx-modal-check-item .text-muted {
  color: var(--text-muted) !important;
}

.refund-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}
.refund-radio-label input[type="radio"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}

.fx-modal-footer .btn {
  width: auto !important;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* 환불 상세 모달: 이전/다음 버튼 터치 친화적 */
.fx-modal-header-refund-detail .fx-modal-header-actions .btn {
  min-height: 36px;
  min-width: 48px;
  padding: 6px 12px;
}

/* 지출 결의 상세 모달: 이전/다음 버튼 터치 친화적 */
.fx-modal-header-expense-detail .fx-modal-header-actions .btn {
  min-height: 36px;
  min-width: 48px;
  padding: 6px 12px;
}

/* 지출 결의 행 클릭 시 상세 모달 열기 */
.er-detail-row {
  cursor: pointer;
}

.profit-extra-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.profit-extra-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profit-extra-list-row .profit-extra-name {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}

.profit-extra-list-row .profit-extra-amount {
  width: 120px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}

/* ── Branch Selector ── */
.branch-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.branch-selector label { font-size: 13px; font-weight: 600; color: var(--text-sub); }
.branch-selector select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.branch-quick-switch {
  margin-top: 4px;
}
.branch-quick-switch-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.branch-quick-btn {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.branch-quick-btn:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--primary);
  color: var(--primary);
}
.branch-quick-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Onboarding ── */
.onboard-card {
  max-width: 500px;
}

/* ── Verify Email ── */
.verify-card {
  text-align: center;
}
.verify-card .icon { font-size: 48px; margin-bottom: 16px; }
.verify-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.verify-card p { font-size: 14px; color: var(--text-sub); line-height: 1.6; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; color: var(--text-sub); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Utilities ── */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; }

/* 설정 페이지 */
.settings-value { font-weight: 600; margin: 4px 0 0; }
.settings-branch-list { margin: 8px 0 0; padding-left: 20px; }
.settings-branch-list li { margin-bottom: 4px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

@media (max-width: 1024px) {
  .page-content {
    padding: 16px;
  }
  .overview-snapshot-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 16px;
  }
  .sales-tab-layout { flex-direction: column; }
  .sales-upload-card { width: 100%; }
  .sales-upload-target-select {
    max-width: 100%;
  }
  .sales-table-wrap {
    max-height: 64vh;
  }
  .sales-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .mobile-context-bar {
    display: none !important;
  }
  .main-nav {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    gap: 8px;
    padding: 10px 12px;
  }
  .nav-left,
  .nav-right {
    width: 100%;
    gap: 8px;
  }
  .nav-left { padding-right: 0; }
  .nav-right {
    margin-left: 0;
    min-height: 0;
    align-items: flex-start;
  }
  .nav-right-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .nav-tabs {
    display: none;
  }
  .nav-tab {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .btn-sm {
    min-height: 44px;
    font-size: 13px;
    padding: 8px 12px;
  }
  .app-mode-toggle-text {
    min-height: 44px;
    padding: 8px 0;
    font-size: 13px;
  }
  .branch-selector {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }
  .branch-selector select {
    width: 100%;
  }
  .admin-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .admin-sidebar {
    position: static;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kpi-card {
    padding: 14px;
  }
  .kpi-value {
    font-size: 20px;
  }
  .overview-filter-row input#overview-date-range {
    min-width: 100%;
  }
  .profit-table {
    min-width: 900px;
    font-size: 11px;
  }
  .place-table-wrap {
    border-radius: 8px;
  }
  .place-table-wrap > table {
    min-width: 640px;
    font-size: 12px;
  }
  body.mobile-nav-enabled #page-dashboard .page-content {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }
  body.mobile-nav-enabled[data-bemove-role="member"] .nav-tabs {
    display: none !important;
  }
  body.mobile-nav-enabled[data-bemove-role="member"] #page-dashboard .page-content {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }
  .bemove-modal,
  .fx-modal {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    max-height: 100dvh;
    border-radius: 14px 14px 0 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
  }
  .bemove-modal-foot,
  .bemove-modal-footer,
  .fx-modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
  }
  .bemove-modal-foot .btn,
  .bemove-modal-footer .btn,
  .fx-modal-footer .btn {
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .page-content {
    padding: 10px;
  }
  .card {
    padding: 12px;
    margin-bottom: 12px;
  }
  .sales-table-wrap {
    max-height: 56vh;
  }
  .sales-table {
    min-width: 0;
    width: 100%;
    font-size: 9px;
  }
  .sales-table th,
  .sales-table td {
    padding: 5px 5px;
    min-width: 74px;
  }
  .sales-table th:first-child,
  .sales-table td:first-child {
    min-width: 76px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  table {
    font-size: 12px;
  }
  th, td {
    padding: 8px 8px;
  }
  .place-table-wrap > table {
    min-width: 620px;
    font-size: 11px;
  }
  .profit-table {
    min-width: 860px;
    font-size: 10px;
  }
  .fx-modal {
    max-height: 92vh;
  }
  .fx-modal-checklist {
    max-height: 46vh;
  }
  .mobile-more-tabs {
    grid-template-columns: 1fr;
  }
  .mobile-card-table {
    width: 100%;
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  .mobile-card-table thead {
    display: none;
  }
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    width: 100%;
  }
  .mobile-card-table tbody tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
  }
  .mobile-card-table tbody tr + tr {
    margin-top: 10px;
  }
  .mobile-card-table tbody td {
    border: 0;
    border-bottom: 1px dashed #e2e8f0;
    padding: 10px 12px;
    text-align: right;
    font-size: 12px;
  }
  .mobile-card-table tbody td:last-child {
    border-bottom: 0;
  }
  .mobile-card-table tbody td::before {
    content: attr(data-label);
    float: left;
    color: var(--text-sub);
    font-weight: 700;
    margin-right: 10px;
    text-align: left;
  }
}

/* =========================
   Mobile content optimization (2nd pass)
   ========================= */
@media (max-width: 768px) {
  body.mobile-nav-enabled .page-content {
    padding: 8px;
    gap: 8px;
  }
  /* 모바일 상단 툴바·모드 전환 컴팩트화 */
  body.mobile-nav-enabled .dashboard-context-toolbar {
    padding: 2px 0 4px;
    margin: 0 0 4px;
    gap: 6px 10px;
    border-bottom: 0;
  }
  body.mobile-nav-enabled .app-mode-toggle-text {
    font-size: 12px;
    min-height: 32px;
    padding: 4px 8px;
  }
  body.mobile-nav-enabled .nav-right-row {
    gap: 6px;
  }
  body.mobile-nav-enabled .card {
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 10px;
  }
  body.mobile-nav-enabled .card h3 {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.35;
  }
  body.mobile-nav-enabled .card .table-title {
    padding: 10px 10px 8px;
    font-size: 14px;
  }
  body.mobile-nav-enabled .btn-sm,
  body.mobile-nav-enabled .btn-primary,
  body.mobile-nav-enabled .btn-outline,
  body.mobile-nav-enabled .btn-secondary {
    min-height: 44px;
  }
  body.mobile-nav-enabled input,
  body.mobile-nav-enabled select,
  body.mobile-nav-enabled textarea {
    min-height: 44px;
    font-size: 14px;
  }

  /* Filter area: compact + sticky for faster re-query */
  body.mobile-nav-enabled .overview-filter-card {
    position: sticky;
    top: 0;
    z-index: 9;
  }
  body.mobile-nav-enabled .overview-filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  body.mobile-nav-enabled .overview-filter-row > * {
    width: 100%;
    min-height: 44px;
  }

  /* KPI section: swipe-friendly density */
  body.mobile-nav-enabled .kpi-grid,
  body.mobile-nav-enabled .profit-kpi-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(145px, 1fr);
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  body.mobile-nav-enabled .kpi-grid .kpi-card,
  body.mobile-nav-enabled .profit-kpi-grid .kpi-card {
    min-height: 92px;
    padding: 10px;
    scroll-snap-align: start;
  }
  body.mobile-nav-enabled .kpi-value {
    font-size: 18px;
    line-height: 1.2;
  }
  body.mobile-nav-enabled .kpi-label {
    font-size: 11px;
  }

  /* Overview cards become vertical and readable */
  body.mobile-nav-enabled .overview-snapshot-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body.mobile-nav-enabled .overview-sales-total .value {
    font-size: 30px;
    line-height: 1.1;
  }
  body.mobile-nav-enabled .overview-funnel-card,
  body.mobile-nav-enabled .overview-sales-card {
    min-height: auto;
  }

  /* AI chat: content-first layout on mobile */
  body.mobile-nav-enabled .overview-ai-chat-card {
    padding: 10px;
  }
  body.mobile-nav-enabled .overview-ai-chat-subtitle {
    font-size: 12px;
    margin-bottom: 8px;
  }
  body.mobile-nav-enabled .overview-ai-chat-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 460px;
  }
  body.mobile-nav-enabled .overview-ai-chat-sidebar {
    order: 2;
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  body.mobile-nav-enabled .overview-ai-chat-history {
    max-height: 120px;
  }
  body.mobile-nav-enabled .overview-ai-chat-main {
    order: 1;
  }
  body.mobile-nav-enabled .overview-ai-chat-messages {
    min-height: 290px;
    max-height: 360px;
    padding: 10px;
    border-radius: 8px;
  }
  body.mobile-nav-enabled .overview-ai-chat-input-row {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }
  body.mobile-nav-enabled .overview-ai-chat-send-btn {
    min-width: 72px;
    padding: 0 10px;
  }

  /* Tables and forms inside content */
  body.mobile-nav-enabled .sales-table-wrap,
  body.mobile-nav-enabled .profit-table-wrap,
  body.mobile-nav-enabled .activity-table-wrap {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
  }
  body.mobile-nav-enabled .branch-selector {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
    align-items: center;
  }
  body.mobile-nav-enabled .main-nav .branch-selector.branch-selector-in-nav {
    width: 100%;
    margin-top: 4px;
    margin-bottom: 2px;
    padding: 0;
  }
  body.mobile-nav-enabled .branch-selector label {
    display: none;
  }
  body.mobile-nav-enabled .branch-selector select {
    width: 100%;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
    box-sizing: border-box;
  }
  body.mobile-nav-enabled .branch-selector #btn-add-branch {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* Bemove content readability */
  body.mobile-nav-enabled .bemove-grid,
  body.mobile-nav-enabled .bemove-branch-top-grid,
  body.mobile-nav-enabled .bemove-branch-kpi-grid,
  body.mobile-nav-enabled .bemove-member-grid,
  body.mobile-nav-enabled .bemove-equipment-category-grid,
  body.mobile-nav-enabled .bemove-pt-member-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body.mobile-nav-enabled .bemove-stat-grid,
  body.mobile-nav-enabled .bemove-stat-grid-compact,
  body.mobile-nav-enabled .bemove-stat-grid-super-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 560px) {
  body.mobile-nav-enabled .kpi-grid,
  body.mobile-nav-enabled .profit-kpi-grid {
    grid-auto-columns: minmax(136px, 1fr);
  }
  body.mobile-nav-enabled .overview-ai-chat-messages {
    min-height: 260px;
    max-height: 320px;
  }
  body.mobile-nav-enabled .bemove-stat-grid,
  body.mobile-nav-enabled .bemove-stat-grid-compact,
  body.mobile-nav-enabled .bemove-stat-grid-super-line {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Mobile detail tuning (screen-level)
   ========================= */
@media (max-width: 768px) {
  /* ---------- Expenses tab ---------- */
  body.mobile-nav-enabled .expenses-range-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }
  body.mobile-nav-enabled .expenses-range-presets .expense-range-btn {
    width: 100%;
    min-height: 44px;
    font-size: 12px;
    padding: 8px 6px;
  }
  body.mobile-nav-enabled .expense-filters,
  body.mobile-nav-enabled .expense-filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  body.mobile-nav-enabled .expense-filters input,
  body.mobile-nav-enabled .expense-filters select,
  body.mobile-nav-enabled .expense-filter-row input,
  body.mobile-nav-enabled .expense-filter-row select {
    min-height: 44px;
    width: 100%;
  }
  body.mobile-nav-enabled .expense-request-entry-table th {
    width: 120px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .expense-request-entry-table td {
    padding: 8px 10px;
  }

  /* ---------- Profit tab ---------- */
  body.mobile-nav-enabled .profit-table-wrap {
    margin-top: 8px;
  }
  body.mobile-nav-enabled .profit-table thead th {
    font-size: 11px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  body.mobile-nav-enabled .profit-table td {
    font-size: 12px;
    line-height: 1.35;
  }

  /* ---------- Overview readability ---------- */
  body.mobile-nav-enabled .overview-sales-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  body.mobile-nav-enabled .overview-segment-title {
    font-size: 12px;
    margin-bottom: 4px;
  }
  body.mobile-nav-enabled .overview-ai-reco-btn {
    min-height: 38px;
    font-size: 12px;
    padding: 6px 8px;
  }
  body.mobile-nav-enabled .overview-ai-chat-reco-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* ---------- Bemove member list/detail ---------- */
  body.mobile-nav-enabled .bemove-members-hero {
    padding: 10px;
    gap: 8px;
  }
  body.mobile-nav-enabled .bemove-members-table th,
  body.mobile-nav-enabled .bemove-members-table td {
    font-size: 12px;
    padding: 8px 6px;
  }
  body.mobile-nav-enabled .bemove-member-detail-page {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 8px;
  }
  body.mobile-nav-enabled .bemove-member-detail-header-card {
    grid-template-columns: 48px 1fr;
    gap: 8px;
  }
  body.mobile-nav-enabled .bemove-member-detail-head-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  body.mobile-nav-enabled .bemove-member-detail-avatar {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  body.mobile-nav-enabled .bemove-member-detail-title-row h3 {
    font-size: 18px;
  }
  body.mobile-nav-enabled .bemove-member-detail-sub {
    font-size: 13px;
    line-height: 1.4;
  }
  body.mobile-nav-enabled .bemove-member-detail-tabs {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  body.mobile-nav-enabled .bemove-member-detail-tab {
    flex: 0 0 auto;
    min-height: 44px;
    min-width: 110px;
    padding: 8px 10px;
    white-space: nowrap;
  }
  body.mobile-nav-enabled .bemove-member-detail-content {
    padding: 8px;
  }
  body.mobile-nav-enabled .bemove-member-option-grid.four {
    grid-template-columns: 1fr 1fr;
  }
  body.mobile-nav-enabled .bemove-member-option-grid.three {
    grid-template-columns: 1fr;
  }
  body.mobile-nav-enabled .bemove-member-form-item textarea,
  body.mobile-nav-enabled .bemove-member-form-item input[type="text"] {
    font-size: 14px;
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  body.mobile-nav-enabled .page-content {
    padding: 6px;
  }
  body.mobile-nav-enabled .card {
    padding: 9px;
    margin-bottom: 7px;
  }
  body.mobile-nav-enabled .card h3 {
    font-size: 13px;
    margin-bottom: 6px;
  }
  body.mobile-nav-enabled .expenses-range-presets {
    grid-template-columns: 1fr 1fr;
  }
  body.mobile-nav-enabled .bemove-member-detail-tab {
    min-width: 98px;
    font-size: 11px;
  }
  body.mobile-nav-enabled .bemove-member-detail-title-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  body.mobile-nav-enabled .bemove-member-detail-kpis {
    gap: 6px;
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  /* ---------- Expense input modal usability ---------- */
  body.mobile-nav-enabled .fx-modal .form-control,
  body.mobile-nav-enabled .bemove-modal .form-control,
  body.mobile-nav-enabled .fx-modal input,
  body.mobile-nav-enabled .fx-modal select,
  body.mobile-nav-enabled .fx-modal textarea {
    min-height: 42px;
    font-size: 13px;
  }
  body.mobile-nav-enabled .fx-expense-request-modal .fx-modal-body {
    padding: 10px;
  }
  body.mobile-nav-enabled .expense-request-entry-table {
    table-layout: fixed;
  }
  body.mobile-nav-enabled .expense-request-entry-table th,
  body.mobile-nav-enabled .expense-request-entry-table td {
    word-break: keep-all;
  }

  /* ---------- Dense action rows ---------- */
  body.mobile-nav-enabled .card .btn + .btn {
    margin-left: 6px;
  }
  body.mobile-nav-enabled .bemove-panel-title-row {
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  body.mobile-nav-enabled .bemove-panel-title-row h4,
  body.mobile-nav-enabled .bemove-panel-title-row h5 {
    font-size: 14px;
  }

  /* ---------- Member list table readability ---------- */
  body.mobile-nav-enabled .bemove-member-td-name {
    min-width: 120px;
  }
  body.mobile-nav-enabled .bemove-member-trainer-wrap {
    min-width: 140px;
  }
  body.mobile-nav-enabled .bemove-member-trainer-select {
    min-height: 38px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .bemove-member-edit-btn {
    min-height: 36px;
    min-width: 36px;
  }

  /* ---------- Member detail content density ---------- */
  body.mobile-nav-enabled .bemove-member-detail-banner {
    padding: 10px 10px;
    margin-bottom: 8px;
  }
  body.mobile-nav-enabled .bemove-member-detail-banner h4 {
    font-size: 15px;
  }
  body.mobile-nav-enabled .bemove-member-detail-banner p {
    font-size: 12px;
    line-height: 1.45;
  }
  body.mobile-nav-enabled .bemove-member-detail-form {
    gap: 8px;
  }
  body.mobile-nav-enabled .bemove-member-form-item label {
    font-size: 12px;
    margin-bottom: 4px;
  }
}

@media (max-width: 560px) {
  body.mobile-nav-enabled .fx-modal .form-control,
  body.mobile-nav-enabled .bemove-modal .form-control,
  body.mobile-nav-enabled .fx-modal input,
  body.mobile-nav-enabled .fx-modal select,
  body.mobile-nav-enabled .fx-modal textarea {
    font-size: 12px;
  }
  body.mobile-nav-enabled .expense-request-entry-table th {
    width: 100px;
    font-size: 11px;
  }
  body.mobile-nav-enabled .expense-request-entry-table td {
    padding: 7px 8px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .bemove-member-detail-content {
    border-radius: 10px;
  }
}

/* =========================
  Mobile pixel-fit tuning (final pass)
  ========================= */
@media (max-width: 768px) {
  /* Expense request modal: one-hand input priority */
  body.mobile-nav-enabled .fx-expense-request-modal .fx-modal-body {
    padding: 8px;
  }
  body.mobile-nav-enabled .expense-request-entry-table th {
    width: 96px;
    font-size: 11px;
    padding: 8px 8px;
    line-height: 1.3;
  }
  body.mobile-nav-enabled .expense-request-entry-table td {
    padding: 8px;
  }
  body.mobile-nav-enabled .expense-request-entry-table input,
  body.mobile-nav-enabled .expense-request-entry-table select,
  body.mobile-nav-enabled .expense-request-entry-table textarea {
    min-height: 44px;
    font-size: 13px;
  }

  /* AI chat card: maximize message area while keeping controls visible */
  body.mobile-nav-enabled .overview-ai-chat-card {
    padding: 8px;
  }
  body.mobile-nav-enabled .overview-ai-chat-layout {
    gap: 6px;
    min-height: 500px;
  }
  body.mobile-nav-enabled .overview-ai-chat-messages {
    min-height: 330px;
    max-height: 50vh;
    padding: 10px;
  }
  body.mobile-nav-enabled .overview-ai-msg {
    font-size: 12px;
    line-height: 1.45;
    padding: 7px 9px;
  }
  body.mobile-nav-enabled .overview-ai-chat-input-row {
    gap: 6px;
    margin-top: 8px;
    padding-top: 4px;
  }
  body.mobile-nav-enabled .overview-ai-chat-input {
    min-height: 44px;
    font-size: 13px;
  }
  body.mobile-nav-enabled .overview-ai-chat-send-btn {
    min-width: 68px;
    min-height: 44px;
    padding: 0 8px;
  }

  /* Bemove member detail header: compact and stable */
  body.mobile-nav-enabled .bemove-member-detail-header-card {
    padding: 10px;
    gap: 7px;
  }
  body.mobile-nav-enabled .bemove-member-detail-avatar {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  body.mobile-nav-enabled .bemove-member-detail-title-row h3 {
    font-size: 16px;
    line-height: 1.2;
  }
  body.mobile-nav-enabled .bemove-member-detail-sub {
    font-size: 12px;
    margin-bottom: 4px;
  }
  body.mobile-nav-enabled .bemove-member-detail-kpis {
    gap: 5px 8px;
    font-size: 11px;
  }
  body.mobile-nav-enabled .bemove-member-detail-head-actions .btn,
  body.mobile-nav-enabled .bemove-member-detail-icon-btn {
    min-width: 34px;
    min-height: 34px;
  }
}

@media (max-width: 560px) {
  body.mobile-nav-enabled .overview-ai-chat-layout {
    min-height: 470px;
  }
  body.mobile-nav-enabled .overview-ai-chat-messages {
    min-height: 300px;
    max-height: 50vh;
    padding: 9px;
  }
  body.mobile-nav-enabled .overview-ai-chat-history {
    max-height: 104px;
  }
  body.mobile-nav-enabled .overview-ai-history-item {
    padding: 7px 8px;
    font-size: 11px;
  }
  body.mobile-nav-enabled .expense-request-entry-table th {
    width: 90px;
    font-size: 10px;
    padding: 7px 6px;
  }
  body.mobile-nav-enabled .expense-request-entry-table td {
    padding: 7px 6px;
  }
  body.mobile-nav-enabled .expense-request-entry-table input,
  body.mobile-nav-enabled .expense-request-entry-table select,
  body.mobile-nav-enabled .expense-request-entry-table textarea {
    font-size: 12px;
  }
}

/* =========================
  Mobile usability hotfix (feedback pass)
  ========================= */
@media (max-width: 768px) {
  /* 1) Modal should stay above bottom mobile nav */
  .fx-modal-overlay,
  .bemove-modal-overlay {
    z-index: 2100;
  }
  .fx-modal,
  .bemove-modal {
    z-index: 2101;
  }

  /* 2) AI chat spacing + input guide clipping */
  body.mobile-nav-enabled .overview-ai-chat-card {
    padding: 8px 8px 6px;
  }
  body.mobile-nav-enabled .overview-ai-chat-subtitle {
    margin-bottom: 5px;
    line-height: 1.35;
  }
  body.mobile-nav-enabled .overview-ai-chat-range-meta {
    margin: 2px 0 6px;
    font-size: 11px;
    line-height: 1.3;
  }
  body.mobile-nav-enabled .overview-ai-chat-layout {
    min-height: 420px;
    gap: 6px;
  }
  body.mobile-nav-enabled .overview-ai-chat-messages {
    min-height: 220px;
    max-height: 42vh;
  }
  body.mobile-nav-enabled .overview-ai-chat-input-row {
    margin-top: 6px;
  }
  body.mobile-nav-enabled .overview-ai-chat-input {
    font-size: 12px;
  }
  body.mobile-nav-enabled .overview-ai-chat-input::placeholder {
    font-size: 11px;
  }
  body.mobile-nav-enabled .overview-ai-chat-send-btn {
    min-width: 58px;
    padding: 0 8px;
    font-size: 12px;
  }

  /* 3) Bottom mobile nav labels must stay single-line */
  .mobile-nav-tab,
  .mobile-more-toggle,
  .mobile-more-tab {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    font-size: 11px;
    letter-spacing: -0.1px;
  }

  /* 4) B-mode stat cards: reduce vertical consumption */
  body.mobile-nav-enabled .bemove-stat-grid,
  body.mobile-nav-enabled .bemove-stat-grid-compact,
  body.mobile-nav-enabled .bemove-stat-grid-super-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.mobile-nav-enabled .bemove-stat {
    padding: 10px 10px;
    border-radius: 10px;
  }
  body.mobile-nav-enabled .bemove-stat div {
    font-size: 11px;
  }
  body.mobile-nav-enabled .bemove-stat strong {
    margin-top: 3px;
    font-size: 24px;
  }
  body.mobile-nav-enabled .bemove-stat strong span {
    font-size: 11px;
  }

  /* 5) 직원 권한/지점 관리 카드 polish */
  body.mobile-nav-enabled .bemove-user-table-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    padding: 6px;
  }
  body.mobile-nav-enabled .bemove-panel-title-row {
    padding: 2px 2px 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eef2ff;
  }
  body.mobile-nav-enabled .bemove-approval-open-btn {
    min-height: 34px;
    border-radius: 999px;
    font-size: 12px;
    padding: 0 10px;
  }
}

@media (max-width: 560px) {
  body.mobile-nav-enabled .overview-ai-chat-layout {
    min-height: 390px;
  }
  body.mobile-nav-enabled .overview-ai-chat-messages {
    min-height: 200px;
    max-height: 38vh;
  }
  body.mobile-nav-enabled .mobile-nav-tab,
  body.mobile-nav-enabled .mobile-more-toggle,
  body.mobile-nav-enabled .mobile-more-tab {
    font-size: 10.5px;
  }
  body.mobile-nav-enabled .bemove-stat-grid,
  body.mobile-nav-enabled .bemove-stat-grid-compact,
  body.mobile-nav-enabled .bemove-stat-grid-super-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
}

.bemove-pt-sales-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bemove-pt-sales-head .text-muted {
  margin-top: 6px;
}

.bemove-pt-kpi-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.bemove-pt-kpi-grid .bemove-stat {
  padding: 10px 12px;
}
.bemove-pt-kpi-grid .bemove-stat > div {
  font-size: 12px;
}
.bemove-pt-kpi-grid .bemove-stat strong {
  font-size: 16px;
  line-height: 1.15;
}
.bemove-pt-sales-screen .bemove-admin-month-row select,
.bemove-pt-sales-screen .bemove-admin-month-row input[type="month"] {
  min-width: 120px;
}
.bemove-pt-sales-table {
  min-width: 100% !important;
  table-layout: fixed;
}
.bemove-pt-sales-table th,
.bemove-pt-sales-table td {
  font-size: 11px;
  padding: 6px 8px;
  white-space: normal;
  word-break: keep-all;
}
.bemove-percap-table th {
  white-space: nowrap;
  text-align: center;
}
.bemove-pt-table-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bemove-pt-table-filter select {
  height: 30px;
  font-size: 11px;
  padding: 0 8px;
}
.bemove-pt-amount-cell {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
  vertical-align: middle;
}
.bemove-inline-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  width: 92px;
  max-width: 100%;
  margin-left: auto;
}
.bemove-inline-metric-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #86efac, #22c55e);
}
.bemove-inline-metric-bar.is-trainer {
  background: linear-gradient(90deg, #93c5fd, #3b82f6);
}
.bemove-inline-metric-bar.is-goal {
  background: linear-gradient(90deg, #f9a8d4, #ec4899);
}
.bemove-inline-metric-bar.is-gap-pos {
  background: linear-gradient(90deg, #a7f3d0, #10b981);
}
.bemove-inline-metric-bar.is-gap-neg {
  background: linear-gradient(90deg, #fecaca, #ef4444);
}
.bemove-inline-metric-bar.is-percap {
  background: linear-gradient(90deg, #c4b5fd, #8b5cf6);
}
.bemove-inline-metric-text {
  font-size: 10px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}
.bemove-pt-mini-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bemove-pt-mini-chart-row {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  align-items: center;
  gap: 8px;
}
.bemove-pt-mini-chart-label {
  font-size: 12px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bemove-pt-mini-chart-track {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.bemove-pt-mini-chart-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #f97316);
}
.bemove-pt-mini-chart-fill.is-trainer {
  background: linear-gradient(90deg, #2563eb, #4f46e5);
}
.bemove-pt-mini-chart-fill.is-goal {
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
}
.bemove-pt-mini-chart-fill.is-percap {
  background: linear-gradient(90deg, #16a34a, #84cc16);
}
.bemove-pt-mini-chart-value {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: #0f172a;
}

@media (max-width: 1100px) {
  .bemove-pt-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bemove-pt-sales-table th,
  .bemove-pt-sales-table td {
    font-size: 10px;
    padding: 5px 6px;
  }
  .bemove-inline-metric {
    width: 76px;
  }
  .bemove-pt-mini-chart-row {
    grid-template-columns: 88px 1fr 90px;
    gap: 6px;
  }
}

/* 목표 달성율: 태블릿에서 카드형, 데스크톱에서 테이블 */
.goal-achievement-conversion-mobile {
  display: none;
}
.goal-achievement-conversion-desktop {
  display: block;
}
@media (max-width: 1100px) {
  .goal-achievement-conversion-mobile {
    display: block;
  }
  .goal-achievement-conversion-desktop {
    display: none;
  }
  .goal-achievement-conversion-mobile-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 8px 12px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
  }
  .goal-achievement-conversion-mobile-row:last-child {
    border-bottom: none;
  }
  .goal-achievement-conversion-mobile-name {
    font-weight: 600;
    color: #1e293b;
  }
  .goal-achievement-conversion-mobile-cell {
    text-align: right;
    white-space: nowrap;
  }
  .goal-achievement-unified-card .goal-achievement-unified-table-wrap {
    overflow-x: scroll !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100% !important;
  }
}

/* ── Formula 마케팅/CRM ── */
.fx-marketing-crm {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 24px;
  box-sizing: border-box;
}
/* 그리드 자식이 min-width:auto 때문에 테이블이 카드 밖으로 밀어내는 것 방지 */
.fx-marketing-crm .fx-marketing-crm-grid > .fx-marketing-crm-field {
  min-width: 0;
}
/* 긴 행(리타게팅 등): 카드 안에서 가로 스크롤 */
.fx-marketing-crm .table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.fx-marketing-crm .table-wrap .table {
  width: max-content;
  min-width: 100%;
}
.fx-marketing-crm-head {
  margin-bottom: 16px;
}
.fx-marketing-crm-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fx-marketing-crm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.fx-marketing-crm-field.fx-marketing-crm-span2 {
  grid-column: 1 / -1;
}
.fx-marketing-crm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}
.fx-marketing-crm-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fx-mcrm-chip {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--surface-2, #f8fafc);
  color: var(--text, #334155);
}
.fx-mcrm-chip.is-active {
  background: var(--primary, #6366f1);
  border-color: var(--primary, #6366f1);
  color: #fff;
}
.fx-mcrm-benefit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface, #fff);
}
.fx-mcrm-benefit-list li + li {
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.fx-mcrm-benefit-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  font-size: 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text, #334155);
}
.fx-mcrm-benefit-item:hover {
  background: var(--surface-2, #f8fafc);
}
.fx-mcrm-benefit-item.is-active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary, #4f46e5);
  font-weight: 600;
}
.fx-mcrm-output {
  font-size: 14px;
  line-height: 1.5;
}
.fx-mcrm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.fx-meta-ad-accounts-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.fx-meta-ad-accounts-table th,
.fx-meta-ad-accounts-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  vertical-align: middle;
}
.fx-meta-ad-accounts-table thead th {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  background: var(--surface-2, #f8fafc);
  text-align: left;
  white-space: nowrap;
}
.fx-meta-ad-accounts-table tbody tr:hover {
  background: var(--surface-hover, #f1f5f9);
}
.fx-meta-ad-accounts-table input.form-control {
  font-size: 13px;
  padding: 4px 8px;
  height: 30px;
}
.fx-meta-ad-accounts-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.fx-meta-ad-accounts-table .btn.btn-xs {
  padding: 4px 8px;
  font-size: 12px;
}
:root.dark .fx-meta-ad-accounts-table thead th,
.dark .fx-meta-ad-accounts-table thead th {
  background: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
}
:root.dark .fx-meta-ad-accounts-table tbody tr:hover,
.dark .fx-meta-ad-accounts-table tbody tr:hover {
  background: rgba(51, 65, 85, 0.4);
}
:root.dark .fx-meta-ad-accounts-table th,
:root.dark .fx-meta-ad-accounts-table td,
.dark .fx-meta-ad-accounts-table th,
.dark .fx-meta-ad-accounts-table td {
  border-bottom-color: rgba(148, 163, 184, 0.2);
}
.fx-mcrm-file-label {
  cursor: pointer;
}
.fx-mcrm-db-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.fx-mcrm-db-results {
  margin-top: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  max-height: 180px;
  overflow: auto;
}
.fx-mcrm-db-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: #fff;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}
.fx-mcrm-db-item:last-child {
  border-bottom: 0;
}
.fx-mcrm-db-item:hover {
  background: var(--surface-2, #f8fafc);
}
.fx-mcrm-recipients-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.fx-mcrm-recipients-table th,
.fx-mcrm-recipients-table td {
  font-size: 12px;
  white-space: nowrap;
}
.fx-mcrm-log {
  margin-top: 10px;
  min-height: 100px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: #0b1020;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.35;
}
.fx-mcrm-hint {
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.45;
}
/* ===== Form Builder (Google Forms / Tally style) ===== */
.fx-form-builder-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}
.fx-form-builder-main {
  padding: 18px 18px 22px;
}
.fx-form-builder-headerbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.fx-form-builder-toprow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  background: #fafbff;
  margin-bottom: 14px;
  border-left: 6px solid #4f46e5;
}
.fx-form-title-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  padding: 4px 0;
  width: 100%;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
.fx-form-title-input:focus {
  border-bottom-color: #4f46e5;
}
.fx-form-description-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: #475569;
  padding: 2px 0;
  width: 100%;
  border-bottom: 1px solid transparent;
}
.fx-form-description-input:focus {
  border-bottom-color: #94a3b8;
}
.fx-form-builder-settings {
  margin-bottom: 14px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}
.fx-form-builder-settings summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.fx-form-builder-settings[open] summary {
  margin-bottom: 8px;
}
.fx-form-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fx-form-empty-hint {
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  padding: 24px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.fx-form-inline-add {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 4px 0;
}
.fx-form-inline-add-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease;
  opacity: 0.45;
}
.fx-form-inline-add:hover .fx-form-inline-add-toggle,
.fx-form-inline-add.is-open .fx-form-inline-add-toggle,
.fx-form-inline-add.is-emphasized .fx-form-inline-add-toggle {
  opacity: 1;
}
.fx-form-inline-add-toggle:hover {
  background: rgba(99, 102, 241, 0.06);
  color: #4338ca;
}
.fx-form-inline-add.is-open .fx-form-inline-add-toggle {
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
}
.fx-form-inline-add-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cbd5e1 30%, #cbd5e1 70%, transparent);
  border-radius: 1px;
}
.fx-form-inline-add-toggle:hover .fx-form-inline-add-line,
.fx-form-inline-add.is-open .fx-form-inline-add-line {
  background: linear-gradient(90deg, transparent, #818cf8 30%, #818cf8 70%, transparent);
}
.fx-form-inline-add-plus {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  color: inherit;
}
.fx-form-inline-add-toggle:hover .fx-form-inline-add-plus,
.fx-form-inline-add.is-open .fx-form-inline-add-plus {
  background: rgba(99, 102, 241, 0.18);
}
.fx-form-inline-add-panel {
  margin: 4px 0 6px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex; flex-direction: column;
  gap: 10px;
}
.fx-form-inline-add-panel[hidden] { display: none; }
.fx-form-inline-add-section {
  display: flex; flex-direction: column; gap: 6px;
}
.fx-form-inline-add-section-title {
  font-size: 12px; font-weight: 700; color: #334155;
  display: flex; align-items: baseline; gap: 6px;
}
.fx-form-inline-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.fx-form-inline-type-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: background-color .12s ease, border-color .12s ease, transform .12s ease;
}
.fx-form-inline-type-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: #818cf8;
  transform: translateY(-1px);
}
.fx-form-inline-type-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-weight: 700; font-size: 12px;
  color: #475569;
}
.fx-form-inline-type-label { color: #1e293b; font-weight: 500; }

.fx-form-palette-details {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px 12px;
}
.fx-form-palette-details[open] { padding-bottom: 12px; }
.fx-form-palette-summary {
  cursor: pointer;
  font-size: 13px; font-weight: 600; color: #475569;
  padding: 4px 0;
  list-style: none;
}
.fx-form-palette-summary::-webkit-details-marker { display: none; }
.fx-form-palette-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform .15s ease;
}
.fx-form-palette-details[open] .fx-form-palette-summary::before { transform: rotate(90deg); }
.fx-inline-insert-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
}
.fx-inline-insert-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}
.fx-inline-insert-dialog {
  position: relative;
  width: min(680px, calc(100vw - 24px));
  padding: 14px;
  z-index: 1;
}
.fx-inline-insert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.fx-form-question-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}
.fx-form-question-card:focus-within {
  border-color: #6366f1;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.18);
}
.fx-form-question-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fx-form-question-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.fx-form-question-type-pill {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 999px;
}
.fx-form-question-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
}
.fx-form-q-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fx-form-q-icon-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
}
.fx-form-q-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.fx-form-q-title-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 600;
  padding: 4px 0 6px;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
}
.fx-form-q-title-input:focus {
  border-bottom-color: #4f46e5;
}
.fx-form-q-desc-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  font-size: 12px;
  color: #64748b;
  padding: 4px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  margin-bottom: 4px;
}
.fx-form-q-desc-input:focus {
  border-bottom-color: #cbd5e1;
}
.fx-form-q-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.fx-form-q-row-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  min-width: 36px;
}
.fx-form-q-row .form-control {
  flex: 1;
}
.fx-form-question-card .form-control {
  border: none !important;
  border-bottom: 1px solid #dbe3ef !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 6px 0 !important;
  min-height: 34px;
  box-shadow: none !important;
}
.fx-form-question-card .form-control:focus {
  border-bottom-color: #4f46e5 !important;
}
.fx-form-question-card textarea.form-control {
  resize: vertical;
}
.fx-form-content-textarea {
  min-height: 140px;
  line-height: 1.65;
  font-size: 14px;
  color: #1f2937;
  border: 1px solid #dbe3ef !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  padding: 12px 14px !important;
  white-space: pre-wrap;
}
.fx-form-content-textarea::placeholder {
  color: #94a3b8;
  line-height: 1.5;
}
.fx-form-content-textarea:focus {
  border-color: #6366f1 !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}
.fx-form-content-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.fx-form-content-tool-btn {
  min-width: 56px;
}
.fx-form-options-area {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}
.fx-form-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.fx-form-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fx-form-option-marker {
  width: 22px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}
.fx-form-option-row .form-control {
  flex: 1;
}
.fx-form-option-row .fx-form-q-option {
  border: none !important;
  border-bottom: 1px solid #dbe3ef !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 6px 0 !important;
  box-shadow: none !important;
}
.fx-form-option-row .fx-form-q-option:focus {
  border-bottom-color: #4f46e5 !important;
}
.fx-form-q-option-remove {
  width: 28px;
  padding: 0;
  line-height: 1;
}
.fx-public-form-other-input {
  margin: 6px 0 0 26px;
}
.fx-form-question-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.fx-form-required-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}
.fx-form-palette {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.fx-form-palette-head {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}
.fx-form-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.fx-form-palette-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  color: #1e293b;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.fx-form-palette-btn:hover {
  border-color: #6366f1;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
}
.fx-form-palette-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.fx-form-palette-label {
  font-weight: 600;
}
/* Live preview pane */
.fx-form-builder-preview {
  position: sticky;
  top: 16px;
  padding: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.fx-form-preview-headerbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.fx-form-preview-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #4f46e5;
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.fx-form-preview-body {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.fx-form-preview-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.fx-form-preview-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}
.fx-form-preview-q {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.fx-form-preview-q:last-child {
  border-bottom: none;
}
.fx-form-preview-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.fx-form-preview-required {
  color: #dc2626;
}
.fx-form-preview-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin: 4px 0;
}
.fx-form-preview-rating {
  color: #f59e0b;
  font-size: 18px;
  letter-spacing: 4px;
}
.fx-form-preview-submit {
  margin-top: 14px;
  text-align: right;
}

/* ===== Marketing CRM analytics / retargeting / KPIs ===== */
.fx-mcrm-kpi {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: right;
}
.fx-an-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
/* 폼 분석: 방문·시작·제출·완료율·전환율 5카드 한 줄(넓은 화면) */
.fx-an-kpi-grid.fx-an-kpi-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.fx-an-kpi-grid.fx-an-kpi-grid--6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.fx-an-kpi-grid.fx-an-kpi-grid--7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.fx-an-kpi-grid.fx-an-kpi-grid--8 {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}
.fx-an-kpi-grid.fx-an-kpi-grid--9 {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .fx-an-kpi-grid.fx-an-kpi-grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--7 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--8 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--9 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .fx-an-kpi-grid.fx-an-kpi-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--7 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--8 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fx-an-kpi-grid.fx-an-kpi-grid--9 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.fx-an-kpi-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.fx-an-kpi-card.is-accent {
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
  border-color: #c7d2fe;
}
.fx-an-kpi-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.fx-an-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 4px;
}
.fx-an-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.fx-an-funnel-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  align-items: center;
  gap: 10px;
}
.fx-an-funnel-label {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}
.fx-an-funnel-bar-wrap {
  background: #f1f5f9;
  border-radius: 6px;
  height: 14px;
  overflow: hidden;
}
.fx-an-funnel-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 250ms ease;
}
.fx-an-funnel-value {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
}
.fx-an-platform-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  color: #334155;
  background: #f8fafc;
}
.fx-an-platform-meta {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}
.fx-an-platform-naver {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.fx-an-platform-daangn {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}
.fx-an-platform-organic {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
.fx-an-platform.is-active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #fff;
}
.fx-res-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
}
.fx-res-main,
.fx-res-side {
  min-width: 0;
}
.fx-res-section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.fx-res-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.fx-res-q-card {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fff;
}
.fx-res-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.fx-res-q-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
}
.fx-res-q-meta {
  font-size: 12px;
  color: #64748b;
}
.fx-res-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.fx-res-bar-label {
  font-size: 12px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-res-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}
.fx-res-bar-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 999px;
}
.fx-res-bar-value {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}
.fx-res-text-sample {
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
}
td[data-inferred="1"] {
  background: rgba(250, 204, 21, 0.10);
}
.fx-res-inferred {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  color: #a16207;
  font-weight: 700;
  cursor: help;
}
.fx-res-legacy-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  border: 1px solid #fde68a;
}
.fx-res-row-legacy > td {
  background: rgba(254, 243, 199, 0.18);
}
.fx-res-row-detail-tr > td {
  background: #f8fafc;
  padding: 0;
}
.fx-res-detail-box {
  padding: 12px 16px;
  border-top: 1px dashed #cbd5e1;
  border-bottom: 1px dashed #cbd5e1;
}
.fx-res-detail-warning {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.fx-res-detail-dl {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 13px;
}
.fx-res-detail-dl dt {
  font-weight: 600;
  color: #475569;
  padding: 4px 8px;
  border-right: 1px solid #e2e8f0;
  white-space: normal;
  word-break: break-word;
}
.fx-res-detail-dl dd {
  margin: 0;
  padding: 4px 8px;
  color: #0f172a;
  white-space: normal;
  word-break: break-word;
}
:root[data-formula-theme="dark"] .fx-res-row-detail-tr > td {
  background: #0f172a;
}
:root[data-formula-theme="dark"] .fx-res-detail-warning {
  background: #422006;
  color: #fde68a;
  border-color: #78350f;
}
:root[data-formula-theme="dark"] .fx-res-detail-dl dt {
  color: #cbd5e1;
  border-right-color: #334155;
}
:root[data-formula-theme="dark"] .fx-res-detail-dl dd {
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-res-legacy-badge {
  background: #422006;
  color: #fde68a;
  border-color: #78350f;
}
:root[data-formula-theme="dark"] .fx-res-row-legacy > td {
  background: rgba(120, 53, 15, 0.18);
}
:root[data-formula-theme="dark"] .fx-res-filter-row th {
  background: #1e293b;
  border-bottom-color: #334155;
}
:root[data-formula-theme="dark"] .fx-res-filter-cell:hover {
  background: rgba(59, 130, 246, 0.12);
}
:root[data-formula-theme="dark"] .fx-res-filter-cell.is-filter-active {
  background: rgba(59, 130, 246, 0.22);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.45);
}
.fx-res-individual-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.fx-res-individual-body {
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}
.fx-res-detail-item {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}
.fx-res-detail-q {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}
.fx-res-detail-a {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fx-res-detail-text {
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
}
.fx-res-option {
  font-size: 13px;
  color: #475569;
}
.fx-res-option.is-on {
  color: #0f172a;
  font-weight: 600;
}
.fx-res-section .table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  max-height: 420px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
#fx-res-table {
  min-width: 1100px;
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}
#fx-res-table th,
#fx-res-table td {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
#fx-res-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.fx-res-table-head-bar {
  flex-wrap: wrap;
  gap: 8px 12px;
}
.fx-res-table-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.fx-res-filter-row th {
  position: sticky;
  top: 34px;
  z-index: 2;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 6px;
  font-weight: 500;
}
.fx-res-col-filter {
  width: 100%;
  min-width: 88px;
  max-width: 180px;
  font-size: 11px;
  padding: 4px 6px;
  height: auto;
}
.fx-res-filter-cell {
  cursor: pointer;
}
.fx-res-filter-cell:hover {
  background: #eff6ff;
}
.fx-res-filter-cell.is-filter-active {
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px #93c5fd;
  font-weight: 600;
}
#fx-res-table th:nth-child(1),
#fx-res-table td:nth-child(1) {
  min-width: 170px;
}
#fx-res-table th:nth-child(2),
#fx-res-table td:nth-child(2) {
  min-width: 120px;
}
#fx-res-table th:nth-child(3),
#fx-res-table td:nth-child(3) {
  min-width: 90px;
}
.fx-link-qr {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 184px;
}
.fx-link-preset-btn {
  white-space: nowrap;
}

/* ===== Public form runtime ===== */
body.fx-public-form-mode {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
body.fx-public-form-mode #main-nav,
body.fx-public-form-mode #page-login,
body.fx-public-form-mode #page-signup,
body.fx-public-form-mode .branch-selector,
body.fx-public-form-mode #bemove-view-as-bar {
  display: none !important;
}
body.fx-public-form-mode #page-dashboard {
  display: block !important;
  padding-top: 0 !important;
}
body.fx-public-form-mode #page-dashboard .page-content {
  padding-top: 0 !important;
}
.fx-public-form-shell {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  min-height: 100vh;
  padding: 32px 16px 80px;
}
.fx-public-form-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 32px 32px;
  border-top: 6px solid #4f46e5;
}
.fx-public-form-title {
  font-size: 24px;
  margin: 0 0 6px;
}
.fx-public-form-desc {
  font-size: 13px;
  color: #475569;
  margin: 0 0 18px;
  line-height: 1.6;
}
.fx-public-form-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.fx-public-form-field {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.fx-public-form-field .form-control,
.fx-public-form-fields .form-control {
  display: block;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}
.fx-public-form-q-head {
  margin-bottom: 8px;
}
.fx-public-form-q-label {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.fx-public-form-q-desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.fx-public-form-required {
  color: #dc2626;
}
.fx-public-form-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fx-public-form-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.fx-public-form-option:hover {
  background: #f1f5f9;
}
.fx-public-form-rating {
  display: flex;
  gap: 6px;
}
.fx-public-form-star {
  background: transparent;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #d1d5db;
  padding: 0 2px;
  line-height: 1;
}
.fx-public-form-star.is-on,
.fx-public-form-star:hover {
  color: #f59e0b;
}
.fx-public-form-consent {
  margin-top: 18px;
  font-size: 12px;
  color: #475569;
}
.fx-public-form-submit-row {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.fx-public-form-result {
  margin-top: 12px;
  font-size: 13px;
  color: #475569;
}
.fx-public-form-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.fx-public-form-logo img {
  max-height: 56px;
  max-width: 100%;
}
.fx-public-form-pager {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 14px;
  text-align: right;
}
.fx-public-form-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fx-public-form-heading {
  margin: 6px 0 4px;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.35;
}
.fx-public-form-h1 { font-size: 28px; }
.fx-public-form-h2 { font-size: 22px; }
.fx-public-form-h3 { font-size: 18px; }
.fx-public-form-paragraph {
  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
  white-space: normal;
}
.fx-public-form-image {
  margin: 4px 0;
}
.fx-public-form-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}
.fx-public-form-image.fx-align-center { text-align: center; }
.fx-public-form-image.fx-align-center img { margin: 0 auto; }
.fx-public-form-image.fx-align-right { text-align: right; }
.fx-public-form-image.fx-align-right img { margin-left: auto; }
.fx-public-form-caption {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
  text-align: inherit;
}
.fx-public-form-video-wrap {
  margin: 4px 0;
}
.fx-public-form-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.fx-public-form-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.fx-public-form-divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 8px 0;
}

/* Builder content blocks */
.fx-form-content-card {
  border-left: 4px solid #6366f1 !important;
  background: #f8fafc !important;
}
.fx-form-content-num {
  background: #6366f1 !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700;
}
.fx-form-content-pill {
  background: #eef2ff !important;
  color: #4338ca !important;
}
.fx-form-q-image-preview {
  margin: 6px 0 8px;
}
.fx-form-palette-grid-content {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 6px;
}

/* Builder preview content blocks */
.fx-form-preview-heading {
  margin: 8px 0 4px;
  color: #0f172a;
  font-weight: 700;
}
.fx-form-preview-h1 { font-size: 22px; }
.fx-form-preview-h2 { font-size: 18px; }
.fx-form-preview-h3 { font-size: 15px; }
.fx-form-preview-paragraph {
  font-size: 13px;
  line-height: 1.6;
  color: #1f2937;
}
.fx-form-preview-image {
  margin: 4px 0;
}
.fx-form-preview-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
.fx-form-preview-image.fx-align-center { text-align: center; }
.fx-form-preview-image.fx-align-center img { margin: 0 auto; }
.fx-form-preview-image.fx-align-right { text-align: right; }
.fx-form-preview-image.fx-align-right img { margin-left: auto; }
.fx-form-preview-caption {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}
.fx-form-preview-divider {
  border: 0;
  border-top: 1px dashed #cbd5e1;
  margin: 6px 0;
}
.fx-form-preview-pagebreak {
  margin: 6px 0;
  padding: 6px 10px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}
.fx-form-preview-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}

@media (max-width: 960px) {
  .fx-form-builder-wrap {
    grid-template-columns: 1fr;
  }
  .fx-form-builder-preview {
    position: static;
    max-height: none;
  }
  .fx-res-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .fx-marketing-crm-grid {
    grid-template-columns: 1fr;
  }
  .fx-marketing-crm-field.fx-marketing-crm-span2 {
    grid-column: 1;
  }
  .fx-mcrm-db-row {
    grid-template-columns: 1fr;
  }
  .fx-public-form-card {
    padding: 22px 18px;
  }
}

/* ============================================================
   QR 캠페인 (마케팅/CRM) 스타일
   ============================================================ */
.fx-qr-card,
.fx-marketing-crm.fx-qr-card,
.fx-marketing-crm.fx-qr-analytics-card {
  max-width: none;
  width: 100%;
  padding: 18px 18px 24px;
  box-sizing: border-box;
  overflow: hidden;
}
.fx-qr-card .fx-mcrm-actions,
.fx-qr-analytics-card .fx-mcrm-actions {
  flex-wrap: wrap;
  min-width: 0;
}
.fx-qr-card .fx-marketing-crm-grid,
.fx-qr-analytics-card .fx-marketing-crm-grid {
  min-width: 0;
}
.fx-qr-card .fx-marketing-crm-grid > .fx-marketing-crm-field,
.fx-qr-analytics-card .fx-marketing-crm-grid > .fx-marketing-crm-field {
  min-width: 0;
}
.fx-qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.fx-qr-layout > * { min-width: 0; }
.fx-qr-list {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.fx-qr-list .table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.fx-qr-list .fx-res-section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.fx-qr-list-table {
  width: 100%;
  font-size: 13px;
  border-collapse: separate;
  border-spacing: 0;
}
.fx-qr-list-table th {
  position: sticky; top: 0;
  background: var(--card);
  z-index: 1;
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-sub);
  text-align: left;
  white-space: nowrap;
}
.fx-qr-list-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.fx-qr-list-row { cursor: pointer; }
.fx-qr-list-row:hover { background: rgba(99, 102, 241, 0.06); }
.fx-qr-list-row.is-active { background: rgba(99, 102, 241, 0.10); }
.fx-qr-list-row code { font-size: 11px; color: var(--text-sub); }

.fx-qr-list-table .badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.fx-qr-list-table .badge-active { background: #dcfce7; color: #14532d; }
.fx-qr-list-table .badge-paused { background: #fef3c7; color: #78350f; }
.fx-qr-list-table .badge-archived { background: #e2e8f0; color: #475569; }

.fx-qr-detail {
  padding: 14px 16px;
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.fx-qr-detail .fx-marketing-crm-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.fx-qr-detail .form-control { max-width: 100%; }
.fx-qr-detail-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.fx-qr-detail-head strong { font-size: 15px; }

.fx-qr-target-toggle {
  display: flex; gap: 14px; align-items: center;
  padding: 4px 0;
}
.fx-qr-target-toggle label {
  display: inline-flex; gap: 6px; align-items: center;
  font-size: 13px; cursor: pointer;
}

.fx-qr-preview {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.fx-qr-preview-row {
  display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: start;
}
.fx-qr-preview-img {
  width: 160px; height: 160px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.fx-qr-preview-img img { width: 100%; height: 100%; object-fit: contain; }
.fx-qr-preview-meta { display: flex; flex-direction: column; }
.fx-qr-preview-url input { font-size: 12px; }

.fx-qr-chart-block { margin-top: 16px; }
.fx-qr-chart {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px 6px; background: var(--card);
}
.fx-qr-chart-legend {
  font-size: 11px; color: var(--text-sub);
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 4px;
}
.fx-qr-legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 4px;
}
.fx-qr-chart-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 100px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}
.fx-qr-chart-col {
  flex: 1; min-width: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%;
}
.fx-qr-chart-stack {
  display: flex; flex-direction: column-reverse; justify-content: flex-start;
  width: 100%; height: 90%;
  align-items: stretch;
}
.fx-qr-chart-bar { width: 100%; min-height: 0; }
.fx-qr-chart-scan { background: #818cf8; }
.fx-qr-chart-submit { background: #22c55e; }
.fx-qr-chart-x {
  font-size: 9px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap;
}

.fx-qr-region-table th {
  position: sticky; top: 0;
  background: var(--card);
  z-index: 1;
  font-weight: 600; font-size: 12px; color: var(--text-sub);
  text-align: left; padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.fx-qr-region-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); }

/* 인쇄용 QR 카드 (A6 한 장) */
.fx-qr-print-card {
  display: none;
  padding: 24px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  background: #fff;
}
.fx-qr-print-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 12px;
}
.fx-qr-print-img {
  width: 280px; height: 280px;
  margin: 0 auto 14px;
  border: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
}
.fx-qr-print-img img { width: 100%; height: 100%; object-fit: contain; }
.fx-qr-print-loc { font-size: 14px; color: #1e293b; margin-bottom: 4px; }
.fx-qr-print-url {
  font-size: 11px; color: #64748b; word-break: break-all;
  font-family: 'Courier New', monospace;
}

@media (max-width: 1180px) {
  .fx-qr-layout { grid-template-columns: 1fr; }
  .fx-qr-preview-row { grid-template-columns: 1fr; }
  .fx-qr-preview-img { width: 100%; max-width: 240px; height: auto; aspect-ratio: 1; margin: 0 auto; }
}
@media (max-width: 720px) {
  .fx-qr-detail .fx-marketing-crm-grid { grid-template-columns: 1fr; }
}

@media print {
  body.fx-qr-print-mode * { visibility: hidden; }
  body.fx-qr-print-mode .fx-qr-print-card,
  body.fx-qr-print-mode .fx-qr-print-card * { visibility: visible; }
  body.fx-qr-print-mode .fx-qr-print-card {
    display: block !important;
    position: fixed; left: 0; top: 0;
    width: 100%; max-width: 105mm;
    margin: 0 auto;
    border: none;
  }
}

/* ============================================================
   디자인 with AI (FormulaDesignAi)
   ============================================================ */
.fx-dai-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* tab-content 직계 자식에 flex:1 + min-height:0 이 걸려 있어, 자식이 flex-shrink:1이면
   overflow:hidden 조합으로 높이가 과도하게 줄어들며 텍스트가 세로로 잘릴 수 있음 → 잘림 방지 */
.fx-dai-root > * {
  flex-shrink: 0;
  min-height: min-content;
}
/* 히어로는 항상 밝은 배경 → 전역/다크 테마의 밝은 글자색이 묻지 않도록 기본 잉크 지정 */
.fx-dai-hero.card {
  color: #0f172a;
  background: linear-gradient(135deg, #fde68a 0%, #fbcfe8 50%, #ddd6fe 100%);
}
.fx-dai-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  position: relative;
  /* overflow:hidden 은 flex 자식에서 min-height 해석과 맞물려 본문이 세로로 잘림 */
  overflow: visible;
  border-radius: var(--radius, 12px);
}
.fx-dai-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 92% 8%, rgba(255,255,255,0.35), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.fx-dai-hero-text {
  flex: 1 1 auto;
  min-width: 0;
  min-height: min-content;
  position: relative;
  z-index: 1;
}
.fx-dai-hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, #d97706, #7c3aed);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}
.fx-dai-hero-title {
  font-size: 30px;
  font-weight: 900;
  margin: 0 0 8px;
  color: #1e1b4b;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.fx-dai-hero-sub {
  margin: 0;
  padding-top: 2px;
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.65;
  max-width: 640px;
  opacity: 1;
  overflow: visible;
}
.fx-scope-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  margin: 8px 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.fx-form-scope-meta {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.fx-form-scope-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
}
.fx-form-scope-meta-row:last-of-type {
  margin-bottom: 0;
}
.fx-form-scope-meta-label {
  min-width: 72px;
  color: #64748b;
  font-weight: 600;
}
.fx-form-scope-meta-value {
  color: #0f172a;
}
.fx-form-scope-meta-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
  font-size: 11px;
}
:root[data-formula-theme="dark"] .fx-form-scope-meta {
  background: #1e293b;
  border-color: #475569;
}
:root[data-formula-theme="dark"] .fx-form-scope-meta-label {
  color: #94a3b8;
}
:root[data-formula-theme="dark"] .fx-form-scope-meta-value {
  color: #f1f5f9;
}
:root[data-formula-theme="dark"] .fx-form-scope-meta-foot {
  border-top-color: #475569;
}
.fx-dai-scope-badge {
  margin-top: 10px;
  margin-bottom: 0;
}
.fx-creator-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  white-space: nowrap;
}
.fx-creator-pill.is-branch {
  background: #ecfeff;
  color: #155e75;
  border-color: #a5f3fc;
}
.fx-creator-pill.is-brand_super {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #ddd6fe;
}
.fx-creator-pill.is-unknown {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}

/* 디자인 AI 카드 내부 텍스트 콘트라스트 강화 (마케팅/CRM 공통 클래스 재정의) */
.fx-dai-card .fx-marketing-crm-title {
  color: #0f172a;
  font-weight: 800;
  font-size: 17px;
}
.fx-dai-card .fx-marketing-crm-label {
  color: #1e293b;
  font-weight: 700;
  font-size: 13.5px;
}
.fx-dai-card .text-muted,
.fx-dai-card p.text-muted {
  color: #475569;
  font-weight: 500;
}
.fx-dai-card .form-control {
  color: #0f172a;
  font-weight: 500;
}
.fx-dai-card .form-control::placeholder {
  color: #94a3b8;
  font-weight: 400;
}
.fx-dai-card textarea.form-control { font-size: 13.5px; }
.fx-dai-convo-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fx-dai-lg-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
  font-size: 14px !important;
}
.fx-dai-wide-input {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.4;
}
.fx-dai-ref-preview {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fx-dai-ref-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #334155;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.fx-dai-dropzone {
  border: 1.5px dashed #c4b5fd;
  background: #faf5ff;
  border-radius: 12px;
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.16s ease;
  outline: none;
}
.fx-dai-dropzone:hover,
.fx-dai-dropzone.is-dragover,
.fx-dai-dropzone:focus {
  border-color: #7c3aed;
  background: #f3e8ff;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}
.fx-dai-dropzone-title {
  font-size: 14px;
  font-weight: 700;
  color: #4c1d95;
}
.fx-dai-dropzone-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}
.fx-dai-person-dropzone {
  border-color: #f59e0b;
  background: #fffbeb;
}
.fx-dai-person-dropzone .fx-dai-dropzone-title {
  color: #92400e;
}
.fx-dai-refine-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.fx-dai-hero-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.fx-dai-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}
.fx-dai-step-pill > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #e2e8f0;
}
.fx-dai-step-pill.is-active {
  background: linear-gradient(135deg, #f59e0b, #a855f7);
  color: #fff;
  border-color: transparent;
}
.fx-dai-step-pill.is-active > span {
  background: #fff;
  color: #a855f7;
  border-color: #fff;
}

.fx-dai-card { padding: 22px 24px; }
.fx-dai-step-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #a855f7);
  color: #fff;
  vertical-align: middle;
  letter-spacing: 0.04em;
}
.fx-dai-required { color: #dc2626; font-weight: 700; }

.fx-dai-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.fx-dai-media-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.fx-dai-media-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.fx-dai-media-card:hover { border-color: #c4b5fd; background: #faf5ff; }
.fx-dai-media-card.is-active {
  border-color: #a855f7;
  background: linear-gradient(135deg, #fef3c7 0%, #ede9fe 100%);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.18);
}
.fx-dai-media-icon { font-size: 22px; }
.fx-dai-media-label { font-weight: 800; font-size: 14px; color: #0f172a; }
.fx-dai-media-ratio { font-size: 11.5px; color: #475569; font-weight: 700; }
.fx-dai-media-card.is-active .fx-dai-media-label { color: #4c1d95; }
.fx-dai-media-card.is-active .fx-dai-media-ratio { color: #6d28d9; }

.fx-dai-card .fx-mcrm-chip {
  color: #1e293b;
  font-weight: 700;
}
.fx-dai-optional-wrap {
  grid-column: 1 / -1;
}
.fx-dai-optional-toggle {
  width: 100%;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}
.fx-dai-optional-toggle::after {
  content: '▾';
  font-size: 12px;
  opacity: 0.8;
}
.fx-dai-optional-toggle.is-open::after {
  content: '▴';
}
.fx-dai-optional-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  padding-top: 4px;
}
.fx-dai-optional-panel[hidden] {
  display: none !important;
}
.fx-dai-optional-panel .fx-marketing-crm-field.fx-marketing-crm-span2 {
  grid-column: 1 / -1;
}
.fx-dai-display-name-field {
  grid-column: 2;
}
.fx-dai-display-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fx-dai-display-row #fx-dai-display-name {
  flex: 1 1 auto;
}
.fx-dai-display-save-msg {
  font-size: 12px;
  color: #64748b;
  min-height: 18px;
}
.fx-dai-person-pos-wrap {
  margin-top: 10px;
}
.fx-dai-person-pos-label {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 6px;
}
.fx-dai-card .fx-mcrm-chip.is-active {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #a855f7);
  border-color: transparent;
}

.fx-dai-color-row { display: flex; gap: 10px; align-items: center; }
.fx-dai-color-row input[type="color"] {
  width: 48px; height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 4px;
}

.fx-dai-cta-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #a855f7 100%);
  border: none;
  color: #fff !important;
  font-weight: 800;
  padding: 10px 18px;
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fx-dai-cta-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.fx-dai-cta-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.fx-dai-cta-icon { font-size: 16px; }

.fx-dai-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fxDaiSpin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes fxDaiSpin { to { transform: rotate(360deg); } }

.fx-dai-error {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 13px;
}

.fx-dai-meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-dai-meta-pill {
  display: inline-block;
  padding: 4px 10px;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.fx-dai-result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 14px;
}
.fx-dai-result-img-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.fx-dai-result-img-wrap img {
  max-width: 100%;
  max-height: 640px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.fx-dai-result-meta { display: flex; flex-direction: column; gap: 8px; }
.fx-dai-result-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  align-items: flex-start;
}
.fx-dai-result-label {
  flex: 0 0 70px;
  font-weight: 700;
  color: #64748b;
}
.fx-dai-revised {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  max-height: 160px;
  overflow-y: auto;
}
.fx-dai-variant-btn.is-active {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
  font-weight: 700;
}

.fx-dai-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.fx-dai-history-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.fx-dai-history-img {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fx-dai-history-img img { width: 100%; height: 100%; object-fit: cover; }
.fx-dai-history-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.fx-dai-history-title { font-weight: 700; font-size: 13px; color: #1e293b; line-height: 1.3; }
.fx-dai-history-sub { font-size: 12px; color: #64748b; line-height: 1.4; min-height: 16px; }
.fx-dai-history-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .fx-dai-hero { flex-direction: column; align-items: flex-start; }
  .fx-dai-result-layout { grid-template-columns: 1fr; }
  .fx-dai-wide-input { min-height: 40px; }
  .fx-dai-lg-textarea { min-height: 96px; }
  .fx-dai-display-name-field { grid-column: auto; }
  .fx-dai-display-row { flex-wrap: wrap; }
}

/* Dark mode: 히어로는 밝은 그라데이션 유지 + 글자는 라이트 모드와 동일한 진한색 (밝은 글씨 덮어쓰기 제거) */
:root[data-formula-theme="dark"] .fx-dai-hero.card {
  color: #0f172a;
  background: linear-gradient(135deg, #fde68a 0%, #fbcfe8 50%, #ddd6fe 100%);
  border-color: rgba(168, 85, 247, 0.45);
}
:root[data-formula-theme="dark"] .fx-dai-hero .fx-dai-hero-title {
  color: #1e1b4b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
:root[data-formula-theme="dark"] .fx-dai-hero .fx-dai-hero-sub {
  color: #0f172a;
  font-weight: 600;
}
:root[data-formula-theme="dark"] .fx-dai-hero .fx-dai-step-pill {
  background: rgba(255, 255, 255, 0.88);
  color: #475569;
  border-color: rgba(168, 85, 247, 0.3);
}
:root[data-formula-theme="dark"] .fx-dai-hero .fx-dai-step-pill > span {
  background: #fff;
  color: #64748b;
  border-color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-dai-hero .fx-dai-step-pill.is-active {
  color: #fff;
}
:root[data-formula-theme="dark"] .fx-dai-hero .fx-dai-step-pill.is-active > span {
  color: #a855f7;
}
:root[data-formula-theme="dark"] .fx-dai-media-card {
  background: var(--card);
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .fx-dai-media-card.is-active {
  background: linear-gradient(135deg, rgba(245,158,11,0.18) 0%, rgba(168,85,247,0.22) 100%);
}
:root[data-formula-theme="dark"] .fx-dai-media-label { color: #f8fafc; }
:root[data-formula-theme="dark"] .fx-dai-media-ratio { color: #cbd5e1; }
:root[data-formula-theme="dark"] .fx-dai-media-card.is-active .fx-dai-media-label { color: #fef3c7; }
:root[data-formula-theme="dark"] .fx-dai-media-card.is-active .fx-dai-media-ratio { color: #ddd6fe; }
:root[data-formula-theme="dark"] .fx-dai-card .fx-marketing-crm-title { color: #f8fafc; }
:root[data-formula-theme="dark"] .fx-dai-card .fx-marketing-crm-label { color: #e2e8f0; }
:root[data-formula-theme="dark"] .fx-dai-card .text-muted,
:root[data-formula-theme="dark"] .fx-dai-card p.text-muted { color: #cbd5e1; }
:root[data-formula-theme="dark"] .fx-dai-card .form-control { color: #f8fafc; }
:root[data-formula-theme="dark"] .fx-dai-card .form-control::placeholder { color: #64748b; }
:root[data-formula-theme="dark"] .fx-dai-dropzone {
  background: rgba(124, 58, 237, 0.12);
  border-color: #7c3aed;
}
:root[data-formula-theme="dark"] .fx-dai-dropzone:hover,
:root[data-formula-theme="dark"] .fx-dai-dropzone.is-dragover,
:root[data-formula-theme="dark"] .fx-dai-dropzone:focus {
  background: rgba(124, 58, 237, 0.2);
}
:root[data-formula-theme="dark"] .fx-dai-dropzone-title { color: #ddd6fe; }
:root[data-formula-theme="dark"] .fx-dai-dropzone-sub { color: #cbd5e1; }
:root[data-formula-theme="dark"] .fx-dai-person-dropzone {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
}
:root[data-formula-theme="dark"] .fx-dai-person-dropzone .fx-dai-dropzone-title { color: #fcd34d; }
:root[data-formula-theme="dark"] .fx-dai-ref-chip {
  border-color: var(--border);
  background: var(--surface-2, #1e293b);
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-dai-refine-box {
  border-color: var(--border);
  background: var(--surface-2, #1e293b);
}
:root[data-formula-theme="dark"] .fx-dai-card .fx-mcrm-chip { color: #e2e8f0; }
:root[data-formula-theme="dark"] .fx-dai-optional-toggle {
  border-color: var(--border);
  color: var(--text);
  background: var(--card);
}
:root[data-formula-theme="dark"] .fx-dai-person-pos-label { color: #cbd5e1; }
:root[data-formula-theme="dark"] .fx-dai-meta-pill {
  background: rgba(99, 102, 241, 0.16);
  color: var(--text);
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .fx-dai-result-img-wrap {
  background: var(--surface-2, #1e293b);
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .fx-dai-revised {
  background: var(--surface-2, #1e293b);
  color: var(--text-sub);
}
:root[data-formula-theme="dark"] .fx-dai-history-card {
  background: var(--card);
  border-color: var(--border);
}
:root[data-formula-theme="dark"] .fx-dai-history-img { background: var(--surface-2, #1e293b); }
:root[data-formula-theme="dark"] .fx-dai-history-title { color: var(--text); }
:root[data-formula-theme="dark"] .fx-dai-history-sub { color: var(--text-sub); }
:root[data-formula-theme="dark"] .fx-scope-badge {
  background: var(--surface-2, #1e293b);
  border-color: var(--border);
  color: var(--text);
}
:root[data-formula-theme="dark"] .fx-creator-pill {
  background: var(--surface-2, #1e293b);
  border-color: var(--border);
  color: var(--text);
}
:root[data-formula-theme="dark"] .fx-creator-pill.is-branch {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(6, 182, 212, 0.32);
  color: #a5f3fc;
}
:root[data-formula-theme="dark"] .fx-creator-pill.is-brand_super {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.35);
  color: #ddd6fe;
}
:root[data-formula-theme="dark"] .fx-dai-error {
  background: rgba(220,38,38,0.12);
  border-color: rgba(220,38,38,0.4);
  color: #fca5a5;
}

/* Mobile content-first compact tune (2026-05-06) */
@media (max-width: 768px) {
  .main-nav {
    padding: 8px 10px !important;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 220;
  }
  .main-nav .nav-right {
    width: 100%;
    margin-left: 0;
    align-items: stretch;
    gap: 3px;
  }
  .main-nav .nav-right-row {
    justify-content: flex-start;
  }
  .main-nav .nav-right-main { order: 1; }
  .main-nav .branch-selector.branch-selector-in-nav { order: 2; }
  .main-nav .nav-right-mode { order: 3; }
  .main-nav #nav-right-main {
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
    align-items: center;
  }
  .main-nav #nav-right-main .nav-right-mode.mode-inline-in-main {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-height: 0;
    margin-left: auto;
    margin-right: 0;
    order: 98;
  }
  .main-nav #nav-right-main .nav-right-mode.mode-inline-in-main .app-mode-toggle-text {
    min-height: 22px;
    padding: 0;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .main-nav #nav-right-main #btn-logout {
    order: 99;
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
    margin-left: auto;
  }
  .main-nav #nav-right-main .nav-right-mode.mode-inline-in-main + #btn-logout {
    margin-left: 4px;
  }

  .main-nav .nav-right {
    gap: 2px;
  }
  .main-nav .nav-right-mode {
    min-height: 0;
  }
  .fx-scope-badge {
    padding: 4px 8px;
    margin: 6px 0 8px;
    font-size: 11px;
  }
  .main-nav .app-mode-toggle-text {
    min-height: 24px;
    padding: 0;
    font-size: 11px;
  }
  .main-nav .branch-selector.branch-selector-in-nav {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .main-nav .branch-selector.branch-selector-in-nav label,
  .main-nav .branch-selector.branch-selector-in-nav #goal-achievement-month-wrap label,
  .main-nav .branch-selector.branch-selector-in-nav #sales-period-wrap label {
    display: none !important;
  }
  .main-nav .branch-selector.branch-selector-in-nav #sel-branch-global {
    flex: 0 0 30%;
    min-width: 98px;
  }
  .main-nav .branch-selector.branch-selector-in-nav #sel-branch-category-global {
    flex: 0 0 20%;
    min-width: 72px;
  }
  .main-nav .branch-selector.branch-selector-in-nav #goal-achievement-month-wrap,
  .main-nav .branch-selector.branch-selector-in-nav #sales-period-wrap {
    flex: 0 0 auto;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .main-nav .branch-selector.branch-selector-in-nav .sales-period-toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .main-nav .branch-selector.branch-selector-in-nav .sales-period-toggle-inline .btn {
    min-height: 24px;
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
    border-radius: 7px;
  }
  .main-nav .branch-selector.branch-selector-in-nav #btn-add-branch {
    flex: 0 0 24px;
    width: 24px;
    min-width: 24px;
    min-height: 24px;
    height: 24px;
    padding: 0;
    margin-left: 1px;
    font-size: 0;
    position: relative;
  }
  .main-nav .branch-selector.branch-selector-in-nav #btn-add-branch::before {
    content: '+';
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
  }
  .main-nav .branch-selector.branch-selector-in-nav select {
    min-height: 24px;
    height: 24px;
    padding: 1px 6px;
    font-size: 11px;
    line-height: 1.2;
  }

  body.mobile-nav-enabled .page-content {
    padding: 6px;
    gap: 6px;
  }
  .main-nav {
    padding: 6px 10px;
    gap: 6px;
  }
  body.mobile-nav-enabled .dashboard-context-toolbar {
    padding: 0 0 2px;
    margin: 0 0 2px;
    gap: 4px 8px;
  }
  body.mobile-nav-enabled .dashboard-context-toolbar + .branch-selector {
    margin-top: -8px;
  }
  body.mobile-nav-enabled .app-mode-toggle-text {
    min-height: 28px;
    padding: 2px 6px;
    font-size: 11px;
  }
  body.mobile-nav-enabled .nav-right-row {
    gap: 4px;
  }
  body.mobile-nav-enabled .branch-selector:not(.branch-selector-in-nav) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 4px;
    padding: 2px 0;
    margin-top: -6px;
    margin-bottom: 3px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
  }
  body.mobile-nav-enabled .branch-selector:not(.branch-selector-in-nav) #sel-branch-global {
    grid-column: 1 / 2;
    grid-row: 1;
  }
  body.mobile-nav-enabled .branch-selector:not(.branch-selector-in-nav) #sel-branch-category-global {
    grid-column: 2 / 3;
    grid-row: 1;
  }
  body.mobile-nav-enabled .branch-selector:not(.branch-selector-in-nav) #btn-add-branch {
    grid-column: 3 / 4;
    grid-row: 1;
    min-height: 32px;
    min-width: 32px;
    width: 32px;
    padding: 0;
    font-size: 0;
    border-radius: 8px;
    position: relative;
  }
  body.mobile-nav-enabled .branch-selector:not(.branch-selector-in-nav) #btn-add-branch::before {
    content: '+';
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
  }
  body.mobile-nav-enabled .branch-selector:not(.branch-selector-in-nav) select {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .sales-tab-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: stretch;
  }
  body.mobile-nav-enabled .sales-tab-header .sales-tab-title {
    line-height: 1.25;
    font-size: 16px;
  }
  body.mobile-nav-enabled .sales-context-label {
    margin-left: 0;
    font-size: 12px;
    white-space: normal;
  }
  body.mobile-nav-enabled .sales-month-projection-slot {
    width: 100%;
    flex: 1 1 100%;
    justify-content: flex-start;
  }
  body.mobile-nav-enabled .sales-month-projection-pill {
    width: 100%;
    padding: 6px 8px;
    gap: 4px 8px;
  }
  body.mobile-nav-enabled .sales-month-projection-hint {
    white-space: normal;
  }
  body.mobile-nav-enabled .sales-upload-card {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  body.mobile-nav-enabled .sales-upload-card:not(.sales-upload-card-collapsed) {
    min-width: 0;
    max-width: none;
  }
  body.mobile-nav-enabled .sales-upload-card-header {
    min-height: 34px;
    padding: 6px 10px;
  }
  body.mobile-nav-enabled .sales-upload-card-title {
    font-size: 13px;
  }
  .knowledge-dashboard-floating-btn {
    right: 12px;
    bottom: 78px;
  }

  /* 재무관리(지출 결의) 모바일 필터 컴팩트화 + 잘림 방지 */
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar,
  .expense-requests-filter-bar.er-filter-bar {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
    padding: 4px !important;
    margin: 4px 0 6px;
    overflow: visible;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar .er-filter-label,
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar > .text-muted,
  .expense-requests-filter-bar.er-filter-bar .er-filter-label,
  .expense-requests-filter-bar.er-filter-bar > .text-muted,
  .expense-requests-filter-bar.er-filter-bar .er-filter-sep {
    display: none !important;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar .form-control,
  .expense-requests-filter-bar.er-filter-bar .form-control {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    min-height: 28px !important;
    height: 28px;
    padding: 1px 6px;
    font-size: 11px;
    text-overflow: ellipsis;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar .btn,
  .expense-requests-filter-bar.er-filter-bar .btn {
    width: 100%;
    min-width: 0;
    min-height: 28px !important;
    height: 28px;
    padding: 0 6px;
    font-size: 11px;
    white-space: nowrap;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-branch,
  .expense-requests-filter-bar.er-filter-bar #er-filter-branch {
    grid-column: 1 / span 2;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-from,
  .expense-requests-filter-bar.er-filter-bar #er-filter-from {
    grid-column: 3 / span 1;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-to,
  .expense-requests-filter-bar.er-filter-bar #er-filter-to {
    grid-column: 4 / span 1;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-status,
  .expense-requests-filter-bar.er-filter-bar #er-filter-status {
    grid-column: 1 / span 1;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-payment,
  .expense-requests-filter-bar.er-filter-bar #er-filter-payment {
    grid-column: 2 / span 1;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-memo,
  .expense-requests-filter-bar.er-filter-bar #er-filter-memo {
    grid-column: 3 / span 2;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-apply,
  .expense-requests-filter-bar.er-filter-bar #er-filter-apply {
    grid-column: 1 / span 2;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar #er-filter-reset,
  .expense-requests-filter-bar.er-filter-bar #er-filter-reset {
    grid-column: 3 / span 2;
  }
  body.mobile-nav-enabled .expense-requests-filter-bar.er-filter-bar .js-er-approve-selected,
  .expense-requests-filter-bar.er-filter-bar .js-er-approve-selected {
    grid-column: 1 / span 4;
  }
}

/* ============================================================
  F모드 모바일 사용성 개선 (공통 + 디자인 with AI 집중)
  ============================================================ */
@media (max-width: 768px) {
  body.mobile-nav-enabled .finance-main .card,
  body.mobile-nav-enabled .fx-marketing-crm.card,
  body.mobile-nav-enabled .fx-marketing-crm {
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
  }
  body.mobile-nav-enabled .finance-mobile-tabs {
    margin-bottom: 8px;
    padding: 4px;
    gap: 4px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  body.mobile-nav-enabled .finance-mobile-tab-btn {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 7px;
  }
  body.mobile-nav-enabled .fx-marketing-crm-grid {
    gap: 10px 10px;
  }
  body.mobile-nav-enabled .fx-marketing-crm-label {
    margin-bottom: 5px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .fx-marketing-crm .form-control,
  body.mobile-nav-enabled .fx-marketing-crm input,
  body.mobile-nav-enabled .fx-marketing-crm select,
  body.mobile-nav-enabled .fx-marketing-crm textarea {
    min-height: 34px;
    font-size: 12px;
    padding: 6px 8px;
  }
  body.mobile-nav-enabled .fx-mcrm-actions {
    gap: 6px;
    margin-top: 8px;
  }
  body.mobile-nav-enabled .fx-mcrm-actions .btn,
  body.mobile-nav-enabled .fx-mcrm-actions a.btn {
    min-height: 34px;
    font-size: 12px;
    padding: 6px 10px;
  }
  body.mobile-nav-enabled .fx-marketing-crm .table-wrap,
  body.mobile-nav-enabled .fx-marketing-crm .profit-table-wrap {
    overflow-x: auto;
    max-width: 100%;
  }

  /* 디자인 with AI */
  body.mobile-nav-enabled .fx-dai-root {
    gap: 10px;
  }
  body.mobile-nav-enabled .fx-dai-hero {
    padding: 14px 12px;
    gap: 10px;
  }
  body.mobile-nav-enabled .fx-dai-hero-title {
    font-size: 24px;
    margin-bottom: 4px;
  }
  body.mobile-nav-enabled .fx-dai-hero-sub {
    font-size: 12.5px;
    line-height: 1.45;
  }
  body.mobile-nav-enabled .fx-dai-hero-steps {
    width: 100%;
    gap: 4px;
  }
  body.mobile-nav-enabled .fx-dai-step-pill {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    padding: 5px 6px;
    font-size: 11px;
  }
  body.mobile-nav-enabled .fx-dai-step-pill > span {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }
  body.mobile-nav-enabled .fx-dai-card {
    padding: 12px;
  }
  body.mobile-nav-enabled .fx-dai-card .fx-marketing-crm-title {
    font-size: 15px;
  }
  body.mobile-nav-enabled .fx-dai-lg-textarea {
    min-height: 88px;
    font-size: 13px !important;
    line-height: 1.45;
  }
  body.mobile-nav-enabled .fx-dai-wide-input {
    min-height: 36px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .fx-dai-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.mobile-nav-enabled .fx-dai-media-card {
    padding: 10px 8px;
    border-radius: 10px;
  }
  body.mobile-nav-enabled .fx-dai-media-icon {
    font-size: 18px;
  }
  body.mobile-nav-enabled .fx-dai-media-label {
    font-size: 12px;
  }
  body.mobile-nav-enabled .fx-dai-media-ratio {
    font-size: 10px;
  }
  body.mobile-nav-enabled .fx-dai-dropzone {
    padding: 12px 10px;
    border-radius: 10px;
  }
  body.mobile-nav-enabled .fx-dai-dropzone-title {
    font-size: 12px;
  }
  body.mobile-nav-enabled .fx-dai-dropzone-sub {
    font-size: 10.5px;
    line-height: 1.35;
  }
  body.mobile-nav-enabled .fx-dai-display-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }
  body.mobile-nav-enabled .fx-dai-optional-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  body.mobile-nav-enabled .fx-dai-optional-toggle {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .fx-dai-display-row #fx-dai-display-save {
    min-width: 74px;
  }
  body.mobile-nav-enabled .fx-dai-card .fx-marketing-crm-toggle-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  body.mobile-nav-enabled .fx-dai-card .fx-mcrm-chip {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 11px;
  }
  body.mobile-nav-enabled .fx-dai-refine-box {
    padding: 8px;
    margin-top: 8px;
  }
  body.mobile-nav-enabled .fx-dai-meta-row {
    gap: 6px;
  }
  body.mobile-nav-enabled .fx-dai-meta-pill {
    font-size: 10px;
    padding: 4px 7px;
  }
  body.mobile-nav-enabled .fx-dai-result-layout {
    gap: 10px;
  }
  body.mobile-nav-enabled .fx-dai-result-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 12px;
  }
  body.mobile-nav-enabled .fx-dai-action-row {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 10px !important;
  }
  body.mobile-nav-enabled .fx-dai-action-row .btn,
  body.mobile-nav-enabled .fx-dai-action-row a.btn {
    width: 100%;
    min-height: 38px;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  body.mobile-nav-enabled .fx-dai-hero-title {
    font-size: 21px;
  }
  body.mobile-nav-enabled .fx-dai-media-grid {
    grid-template-columns: 1fr;
  }
  body.mobile-nav-enabled .fx-dai-display-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   응답 대시보드 (forms_dashboard) + 사이드바 NEW 배지
   ============================================================ */
.fx-mcrm-tab-btn {
  position: relative;
}
.fx-mcrm-tab-btn .fx-mcrm-tab-btn-label {
  display: inline-block;
}
.fx-mcrm-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: middle;
  box-shadow: 0 0 0 2px #fff;
  animation: fx-mcrm-tab-badge-pulse 1.6s ease-in-out infinite;
}
.fx-mcrm-tab-btn.is-active .fx-mcrm-tab-badge {
  box-shadow: 0 0 0 2px #4f46e5;
}
.fx-mcrm-tab-badge[hidden] {
  display: none !important;
}
@keyframes fx-mcrm-tab-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.fx-fd-daily-chart {
  width: 100%;
  min-width: 0;
  padding: 6px 4px 4px;
  overflow: hidden;
}
.fx-fd-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: end;
  gap: 4px;
  height: 180px;
  padding-bottom: 36px;
  position: relative;
  min-width: 0;
}
.fx-fd-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.fx-fd-bar-val {
  font-size: 10px;
  color: #475569;
  margin-bottom: 2px;
  min-height: 12px;
}
.fx-fd-bar {
  width: 100%;
  background: linear-gradient(180deg, #6366f1 0%, #a5b4fc 100%);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: filter .15s ease;
}
.fx-fd-bar-col:hover .fx-fd-bar {
  filter: brightness(1.08);
}
.fx-fd-bar-x {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 6px;
  font-size: 10px;
  line-height: 1;
  color: #94a3b8;
  white-space: nowrap;
  pointer-events: none;
}

.fx-fd-form-list {
  display: block;
  min-width: 0;
  max-width: 100%;
}
.fx-fd-form-list .table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  max-width: 100%;
}
.fx-fd-form-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 880px;
  font-size: 13px;
}
.fx-fd-form-table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.fx-fd-form-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
  white-space: nowrap;
}
.fx-fd-form-table tbody tr:last-child td {
  border-bottom: none;
}
.fx-fd-form-table tbody tr:hover td {
  background: #f8faff;
}
.fx-fd-form-table tbody tr.is-unread td {
  background: #fffbeb;
}
.fx-fd-form-table tbody tr.is-unread:hover td {
  background: #fef3c7;
}
.fx-fd-form-table .fx-fd-cell-title {
  width: 38%;
  min-width: 260px;
  white-space: normal;
}
.fx-fd-form-table .fx-fd-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #0f172a;
}
.fx-fd-form-table .fx-fd-title-line strong {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-fd-title-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px dashed transparent;
  line-height: 1.3;
}
.fx-fd-title-link:hover,
.fx-fd-title-link:focus-visible {
  color: #4338ca;
  border-bottom-color: #818cf8;
  outline: none;
}
.fx-fd-form-table .fx-fd-cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 600;
  color: #0f172a;
  width: 64px;
}
.fx-fd-form-table thead .fx-fd-cell-num {
  text-align: right;
}
.fx-fd-form-table .fx-fd-cell-total {
  color: #4338ca;
  font-weight: 700;
}
.fx-fd-form-table .fx-fd-cell-meta {
  color: #64748b;
  font-size: 12px;
  width: 140px;
}
.fx-fd-form-table .fx-fd-cell-actions {
  text-align: right;
  width: 1%;
}
.fx-fd-form-table .fx-fd-cell-actions .btn {
  margin-left: 4px;
}
.fx-fd-new-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #fef3c7;
  color: #b45309;
  border-radius: 999px;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 700;
}
.fx-fd-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.fx-fd-status-published {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.fx-fd-status-draft {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.fx-fd-status-archived {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.fx-fd-quick.is-active {
  background: #4f46e5;
  color: #fff;
  border-color: #4338ca;
}

@media (max-width: 720px) {
  .fx-marketing-crm.card {
    overflow-x: hidden;
    padding-left: 14px;
    padding-right: 14px;
  }
  .fx-marketing-crm .fx-res-section {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .fx-fd-form-table {
    font-size: 12px;
  }
  .fx-fd-form-table thead th,
  .fx-fd-form-table tbody td {
    padding: 8px 10px;
  }
  .fx-fd-bars {
    height: 150px;
    padding-bottom: 32px;
    gap: 2px;
  }
  .fx-fd-bar-x {
    font-size: 9px;
  }
}

/* ============================================================
   응답 대시보드 — 다크 테마 보정 (v2: 더 진한 카드 · 진한 인디고 강조)
   (기존 .fx-an-kpi-card / .fx-res-section 등 공유 클래스도 함께 보정)
   ============================================================ */

/* KPI 카드 — 풀 불투명 + 한 단계 더 어두운 톤 */
:root[data-formula-theme="dark"] .fx-an-kpi-card {
  background: #111b30;
  border-color: #2a3a5a;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .02);
}
/* 강조 KPI — 인디고를 또렷하게 (더 짙은 보라+인디고 글로우) */
:root[data-formula-theme="dark"] .fx-an-kpi-card.is-accent {
  background: linear-gradient(135deg, #312e81 0%, #1e1b4b 60%, #0f172a 100%);
  border-color: #6366f1;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .25), inset 0 1px 0 rgba(255, 255, 255, .04);
}
:root[data-formula-theme="dark"] .fx-an-kpi-card.is-accent .fx-an-kpi-label {
  color: #c7d2fe;
}
:root[data-formula-theme="dark"] .fx-an-kpi-card.is-accent .fx-an-kpi-value {
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
:root[data-formula-theme="dark"] .fx-an-kpi-label {
  color: #cbd5e1;
}
:root[data-formula-theme="dark"] .fx-an-kpi-value {
  color: #ffffff;
}

/* 응답·대시보드 공통 섹션 카드 — 풀 불투명 다크 */
:root[data-formula-theme="dark"] .fx-res-section {
  background: #111b30;
  border-color: #2a3a5a;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}
:root[data-formula-theme="dark"] .fx-res-section-head strong {
  color: #ffffff;
}
:root[data-formula-theme="dark"] .fx-res-section-head .text-muted {
  color: #94a3b8 !important;
}

/* 질문별 응답 카드 (응답 수집 탭) */
:root[data-formula-theme="dark"] .fx-res-q-card {
  background: #0b1426;
  border-color: #2a3a5a;
}
:root[data-formula-theme="dark"] .fx-res-q-title {
  color: #ffffff;
}
:root[data-formula-theme="dark"] .fx-res-q-meta {
  color: #cbd5e1;
}
:root[data-formula-theme="dark"] .fx-res-text-sample {
  background: #0b1426;
  border-color: #2a3a5a;
  color: #e2e8f0;
}

/* 유입 소스 막대 — 인디고를 진하게 */
:root[data-formula-theme="dark"] .fx-res-bar-label {
  color: #cbd5e1;
}
:root[data-formula-theme="dark"] .fx-res-bar-value {
  color: #ffffff;
}
:root[data-formula-theme="dark"] .fx-res-bar-track {
  background: rgba(99, 102, 241, .14);
}
:root[data-formula-theme="dark"] .fx-res-bar-fill {
  background: linear-gradient(90deg, #6366f1 0%, #a5b4fc 100%);
  box-shadow: 0 0 8px rgba(99, 102, 241, .45);
}

/* 안내/캡션 텍스트 — 다크에서도 읽히도록 */
:root[data-formula-theme="dark"] .fx-marketing-crm > .text-muted,
:root[data-formula-theme="dark"] .fx-marketing-crm .fx-an-kpi-card .text-muted,
:root[data-formula-theme="dark"] .fx-marketing-crm .fx-res-section-head .text-muted {
  color: #94a3b8;
}

/* ── 응답 대시보드 (forms_dashboard) — 테이블 보정 ── */
:root[data-formula-theme="dark"] .fx-fd-form-list .table-wrap {
  background: #0b1426;
  border-color: #2a3a5a;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
:root[data-formula-theme="dark"] .fx-fd-form-table thead th {
  background: #111b30;
  color: #cbd5e1;
  border-bottom-color: #2a3a5a;
}
:root[data-formula-theme="dark"] .fx-fd-form-table tbody td {
  border-bottom-color: rgba(42, 58, 90, .8);
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-fd-form-table tbody tr:hover td {
  background: rgba(99, 102, 241, .12);
}
:root[data-formula-theme="dark"] .fx-fd-form-table tbody tr.is-unread td {
  background: rgba(245, 158, 11, .10);
}
:root[data-formula-theme="dark"] .fx-fd-form-table tbody tr.is-unread:hover td {
  background: rgba(245, 158, 11, .18);
}
:root[data-formula-theme="dark"] .fx-fd-form-table .fx-fd-title-line,
:root[data-formula-theme="dark"] .fx-fd-form-table .fx-fd-title-line strong,
:root[data-formula-theme="dark"] .fx-fd-form-table .fx-fd-cell-num,
:root[data-formula-theme="dark"] .fx-fd-title-link {
  color: #ffffff;
}
:root[data-formula-theme="dark"] .fx-fd-title-link:hover,
:root[data-formula-theme="dark"] .fx-fd-title-link:focus-visible {
  color: #c7d2fe;
  border-bottom-color: #a5b4fc;
}
:root[data-formula-theme="dark"] .fx-fd-form-table .fx-fd-cell-total {
  color: #a5b4fc;
}
:root[data-formula-theme="dark"] .fx-fd-form-table .fx-fd-cell-meta {
  color: #94a3b8;
}

/* 일별 차트 — 인디고를 또렷하게 */
:root[data-formula-theme="dark"] .fx-fd-bar {
  background: linear-gradient(180deg, #a5b4fc 0%, #6366f1 60%, #4338ca 100%);
  box-shadow: 0 0 10px rgba(99, 102, 241, .35);
}
:root[data-formula-theme="dark"] .fx-fd-bar-col:hover .fx-fd-bar {
  filter: brightness(1.15);
  box-shadow: 0 0 14px rgba(129, 140, 248, .55);
}
:root[data-formula-theme="dark"] .fx-fd-bar-val {
  color: #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-fd-bar-x {
  color: #94a3b8;
}

/* 상태칩 — 채도 충분히 살리기 */
:root[data-formula-theme="dark"] .fx-fd-status-published {
  background: rgba(34, 197, 94, .22);
  color: #86efac;
  border-color: rgba(34, 197, 94, .55);
}
:root[data-formula-theme="dark"] .fx-fd-status-draft {
  background: rgba(148, 163, 184, .22);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, .55);
}
:root[data-formula-theme="dark"] .fx-fd-status-archived {
  background: rgba(239, 68, 68, .22);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, .55);
}

/* NEW 배지 — 앰버 톤 */
:root[data-formula-theme="dark"] .fx-fd-new-badge {
  background: rgba(245, 158, 11, .22);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, .6);
  box-shadow: 0 0 8px rgba(245, 158, 11, .25);
}

/* 빠른 기간 선택: 비활성 = 인디고 라이트 글자, 활성 = 진한 인디고 */
:root[data-formula-theme="dark"] .fx-fd-quick:not(.is-active) {
  color: #c7d2fe;
  border-color: rgba(129, 140, 248, .45);
  background: rgba(99, 102, 241, .08);
}
:root[data-formula-theme="dark"] .fx-fd-quick:not(.is-active):hover {
  background: rgba(99, 102, 241, .22);
  color: #e0e7ff;
}
:root[data-formula-theme="dark"] .fx-fd-quick.is-active {
  background: #6366f1;
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(99, 102, 241, .45);
}

/* 사이드바 NEW 펄스 배지 — 외곽 halo 색상 매칭 */
:root[data-formula-theme="dark"] .fx-mcrm-tab-badge {
  box-shadow: 0 0 0 2px var(--card);
}
:root[data-formula-theme="dark"] .fx-mcrm-tab-btn.is-active .fx-mcrm-tab-badge {
  box-shadow: 0 0 0 2px #4338ca;
}

/* ============================================================
   PT 매출 관리 (formula-pt-sales.js)
   ============================================================ */
.fx-pt {
  padding: 18px 20px 24px;
  min-width: 0;
}
.fx-pt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.fx-pt-title { margin: 0 0 4px; font-size: 20px; }
.fx-pt-sub { margin: 0; font-size: 12px; }
.fx-pt-header-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.fx-pt-field { display: flex; flex-direction: column; gap: 4px; }
.fx-pt-label { font-size: 11px; color: var(--text-muted); }
.fx-pt-field select,
.fx-pt-field input {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.fx-pt-subtabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
  padding-bottom: 4px;
  margin-bottom: 16px;
}
.fx-pt-subtab-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-sub, #f8fafc);
}
.fx-pt-subtab-group--insight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.07), rgba(236, 72, 153, 0.04));
  border-color: rgba(59, 130, 246, 0.18);
}
.fx-pt-subtab-group--detail {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.07), rgba(99, 102, 241, 0.04));
  border-color: rgba(139, 92, 246, 0.18);
}
.fx-pt-subtab-group--input {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(5, 150, 105, 0.04));
  border-color: rgba(16, 185, 129, 0.18);
}
.fx-pt-subtab-group--leads {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(234, 88, 12, 0.04));
  border-color: rgba(245, 158, 11, 0.22);
}
.fx-pt-subtab-group.has-active {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.fx-pt-subtab-group-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  line-height: 1;
}
:root[data-formula-theme="dark"] .fx-pt-subtab-group-label {
  background: rgba(15, 23, 42, 0.45);
}
.fx-pt-subtab-group--insight .fx-pt-subtab-group-label { color: #1d4ed8; }
.fx-pt-subtab-group--detail .fx-pt-subtab-group-label { color: #6d28d9; }
.fx-pt-subtab-group--input .fx-pt-subtab-group-label { color: #047857; }
.fx-pt-subtab-group--leads .fx-pt-subtab-group-label { color: #b45309; }
:root[data-formula-theme="dark"] .fx-pt-subtab-group--insight .fx-pt-subtab-group-label { color: #93c5fd; }
:root[data-formula-theme="dark"] .fx-pt-subtab-group--detail .fx-pt-subtab-group-label { color: #c4b5fd; }
:root[data-formula-theme="dark"] .fx-pt-subtab-group--input .fx-pt-subtab-group-label { color: #6ee7b7; }
.fx-pt-subtab-group-items {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
}
.fx-pt-subtab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-muted);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.2;
}
.fx-pt-subtab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}
:root[data-formula-theme="dark"] .fx-pt-subtab:hover {
  background: rgba(15, 23, 42, 0.35);
}
.fx-pt-subtab.is-active {
  color: var(--primary);
  background: var(--card);
  border-color: rgba(59, 130, 246, 0.35);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.fx-pt-subtab-group--insight .fx-pt-subtab.is-active { color: #1d4ed8; border-color: rgba(59, 130, 246, 0.45); }
.fx-pt-subtab-group--detail .fx-pt-subtab.is-active { color: #6d28d9; border-color: rgba(139, 92, 246, 0.45); }
.fx-pt-subtab-group--input .fx-pt-subtab.is-active { color: #047857; border-color: rgba(16, 185, 129, 0.45); }
.fx-pt-subtab-group--leads .fx-pt-subtab.is-active { color: #b45309; border-color: rgba(245, 158, 11, 0.45); }
:root[data-formula-theme="dark"] .fx-pt-subtab-group--insight .fx-pt-subtab.is-active { color: #93c5fd; }
:root[data-formula-theme="dark"] .fx-pt-subtab-group--detail .fx-pt-subtab.is-active { color: #c4b5fd; }
:root[data-formula-theme="dark"] .fx-pt-subtab-group--input .fx-pt-subtab.is-active { color: #6ee7b7; }
.fx-pt-body { min-width: 0; }

/* KPI 카드 */
.fx-pt-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.fx-pt-kpi {
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.fx-pt-kpi-label { font-size: 11px; color: var(--text-muted); }
.fx-pt-kpi-value { font-size: 18px; font-weight: 700; margin-top: 4px; color: var(--text); }
.fx-pt-kpi-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.fx-pt-kpi--emphasis {
  border-color: #93c5fd;
  background: #eff6ff;
}
:root[data-formula-theme="dark"] .fx-pt-kpi--emphasis {
  border-color: #3b82f6;
  background: #1e3a5f;
}

/* 표 공통 */
.fx-pt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.fx-pt-recent-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.fx-pt-recent-filters .fx-pt-recent-fname,
.fx-pt-recent-filters .fx-pt-recent-fsel { height: 34px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--text); font-size: 13px; padding: 0 10px; outline: none; }
.fx-pt-recent-filters .fx-pt-recent-fname { min-width: 150px; }
.fx-pt-recent-filters .fx-pt-recent-fsel { cursor: pointer; max-width: 200px; }
.fx-pt-recent-filters .fx-pt-recent-fname:focus,
.fx-pt-recent-filters .fx-pt-recent-fsel:focus { border-color: var(--primary, #6366f1); }
.fx-pt-recent-sum { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--primary, #6366f1) 6%, var(--card)); }
.fx-pt-recent-sum:empty { display: none; }
.fx-pt-recent-sum-lb { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.fx-pt-recent-sum-amt { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.fx-pt-recent-sum-meta { font-size: 12px; color: var(--text-muted); }
:root:not([data-formula-theme="dark"]) .fx-pt-recent-sum { background: #faf4ee; border-color: #ecdfce; }
:root:not([data-formula-theme="dark"]) .fx-pt-recent-sum-amt { color: #2b2722; }
.fx-pt-entry-recent-wrap {
  max-height: min(480px, 60vh);
  overflow-y: auto;
}
.fx-pt-entry-recent-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.fx-pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fx-pt-table th,
.fx-pt-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--text);
  white-space: nowrap;
}
.fx-pt-table thead th {
  background: var(--bg-sub);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
}
.fx-pt-table tr:last-child td { border-bottom: 0; }
.fx-pt-table .text-right { text-align: right; }
.fx-pt-table .text-center { text-align: center; }
.fx-pt-strong { font-weight: 700; color: var(--primary); }

/* 지점 색상 배지 — 엑셀 조건부 서식과 유사하게 지점별 구분 */
.fx-pt-branch-badge {
  display: inline-block;
  min-width: 4.5em;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.fx-pt-branch-badge--with-div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-align: left;
  padding-left: 6px;
}
.fx-pt-branch-badge--with-div .bemove-branch-div-icon {
  flex-shrink: 0;
}
.fx-pt-branch-badge-text {
  display: inline-block;
}
.fx-pt-branch-badge--na {
  background: transparent;
  box-shadow: none;
  font-weight: 400;
}
.fx-pt-table .fx-pt-branch-td {
  white-space: nowrap;
}
:root[data-formula-theme="dark"] .fx-pt-branch-badge {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* 입력 표 */
.fx-pt-entry-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.fx-pt-entry-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fx-pt-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.fx-pt-table--entry input.fx-pt-input,
.fx-pt-table--entry select.fx-pt-input {
  min-width: 80px;
}

/* 배지 */
.fx-pt-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.fx-pt-badge--active { background: #dcfce7; color: #166534; }
.fx-pt-badge--left { background: #fee2e2; color: #991b1b; }
:root[data-formula-theme="dark"] .fx-pt-badge--active { background: #14532d; color: #bbf7d0; }
:root[data-formula-theme="dark"] .fx-pt-badge--left { background: #7f1d1d; color: #fecaca; }

/* 트레이너 history 패널 */
.fx-pt-history {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 14px;
}
.fx-pt-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.fx-pt-history-head h4 { margin: 0; font-size: 15px; }
.fx-pt-history .fx-pt-table { background: transparent; border: 0; }
.fx-pt-history-modal-body {
  max-height: min(60vh, 480px);
  overflow-y: auto;
}

/* Placeholder */
.fx-pt-placeholder {
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
}
.fx-pt-placeholder h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; }

/* Trainers tab */
.fx-pt-trainers-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.fx-pt-trainer-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.fx-pt-trainer-filters input[type="search"],
.fx-pt-trainer-filters select {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.fx-pt-trainer-filters .fx-pt-trainer-f-name { min-width: 140px; flex: 1 1 140px; }
.fx-pt-trainer-filters .fx-pt-trainer-f-branch { min-width: 130px; }
.fx-pt-trainer-filters .fx-pt-trainer-f-position,
.fx-pt-trainer-filters .fx-pt-trainer-f-status { min-width: 100px; }
.fx-pt-trainer-f-summary { margin-left: auto; font-size: 12px; white-space: nowrap; }

/* Alerts (PT 전용 — 기존 .alert 가 없을 수 있어서 컴포넌트 차원으로) */
.fx-pt .alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 8px 0;
}
.fx-pt .alert-danger { background: #fee2e2; color: #991b1b; }
.fx-pt .alert-warn   { background: #fef3c7; color: #92400e; }
:root[data-formula-theme="dark"] .fx-pt .alert-danger { background: #7f1d1d; color: #fecaca; }
:root[data-formula-theme="dark"] .fx-pt .alert-warn   { background: #78350f; color: #fde68a; }

/* 지점 요약 카드 (대시보드) */
.fx-pt-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0;
}
.fx-pt-division-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 0;
}
.fx-pt-summary-card--division {
  border-color: color-mix(in srgb, var(--border) 70%, #ca8a04 30%);
}
.fx-pt-summary-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 12px 14px;
  min-width: 0;
}
.fx-pt-summary-card .fx-pt-table-wrap--summary {
  overflow-x: visible;
  border: none;
  border-radius: 0;
  background: transparent;
}
.fx-pt-summary-card .fx-pt-table--branches-mini {
  table-layout: fixed;
  width: 100%;
  font-size: 12px;
}
.fx-pt-summary-card .fx-pt-table--branches-mini th,
.fx-pt-summary-card .fx-pt-table--branches-mini td {
  white-space: normal;
  word-break: keep-all;
  padding: 6px 8px;
  vertical-align: middle;
}
.fx-pt-summary-card .fx-pt-table--branches-mini th:first-child,
.fx-pt-summary-card .fx-pt-table--branches-mini td:first-child {
  width: 11%;
}
.fx-pt-summary-card .fx-pt-metric-td {
  min-width: 0;
  width: auto;
}
.fx-pt-summary-card .fx-pt-metric-cell {
  max-width: none;
  margin-left: 0;
}
.fx-pt-summary-card .fx-pt-metric-track {
  min-height: 24px;
}
.fx-pt-summary-card .fx-pt-metric-text {
  font-size: 10px;
  padding: 0 4px;
}
.fx-pt-summary-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.fx-pt-summary-desc {
  font-size: 12px;
  line-height: 1.5;
  margin: -4px 0 10px;
}
/* 전사대비 뱃지 (표 셀 내) */
.fx-pt-vs-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.fx-pt-vs-badge--pos { background: #dcfce7; color: #15803d; }
.fx-pt-vs-badge--neg { background: #fee2e2; color: #b91c1c; }
.fx-pt-vs-badge--na { background: var(--bg-sub); color: var(--text-muted); font-weight: 500; }
:root[data-formula-theme="dark"] .fx-pt-vs-badge--pos { background: #14532d; color: #86efac; }
:root[data-formula-theme="dark"] .fx-pt-vs-badge--neg { background: #7f1d1d; color: #fca5a5; }

/* 구간 비율 — 지점 내 인원·비율 */
.fx-pt-bucket-legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.fx-pt-bucket-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.fx-pt-bucket-legend-item::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.fx-pt-bucket-legend-item--high::before { background: linear-gradient(135deg, #fde047, #ca8a04); }
.fx-pt-bucket-legend-item--mid::before { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.fx-pt-bucket-legend-item--low::before { background: linear-gradient(135deg, #94a3b8, #475569); }
.fx-pt-bucket-legend-note {
  font-size: 11px;
  margin-left: auto;
}

.fx-pt-table--buckets td.fx-pt-bucket-row-td {
  padding: 8px 10px !important;
}
.fx-pt-bucket-row-unified {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-sub);
}
.fx-pt-bucket-row-unified.is-empty { opacity: 0.7; }
.fx-pt-bucket-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.fx-pt-bucket-branch-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.fx-pt-bucket-branch-total {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.fx-pt-bucket-branch-total strong { color: var(--text); }
.fx-pt-bucket-stack-captions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.fx-pt-bucket-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  border-left: 4px solid #cbd5e1;
}
.fx-pt-bucket-caption--high { border-left-color: #eab308; }
.fx-pt-bucket-caption--mid { border-left-color: #3b82f6; }
.fx-pt-bucket-caption--low { border-left-color: #64748b; }
.fx-pt-bucket-caption.is-empty { opacity: 0.5; background: var(--bg-sub); }
.fx-pt-bucket-caption-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}
.fx-pt-bucket-caption-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.fx-pt-bucket-caption-value strong { font-size: 14px; font-weight: 800; }
.fx-pt-bucket-stack-empty { font-size: 11px; }

/* 월평균 + 구간 비율 단일 표 */
.fx-pt-summary-card--unified {
  padding: 12px 14px 14px;
}
.fx-pt-unified-insight-head .fx-pt-summary-desc {
  margin: -4px 0 10px;
}
.fx-pt-summary-card .fx-pt-table--unified-insight th.fx-pt-unified-th-branch,
.fx-pt-summary-card .fx-pt-table--unified-insight td.fx-pt-unified-branch-td { width: 10%; }
.fx-pt-summary-card .fx-pt-table--unified-insight th.fx-pt-unified-th-vs,
.fx-pt-summary-card .fx-pt-table--unified-insight td.fx-pt-unified-vs-td {
  width: 9%;
  padding-right: 32px !important;
  border-right: 2px solid #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-pt-summary-card .fx-pt-table--unified-insight th.fx-pt-unified-th-vs,
:root[data-formula-theme="dark"] .fx-pt-summary-card .fx-pt-table--unified-insight td.fx-pt-unified-vs-td {
  border-right-color: #334155;
}
.fx-pt-bucket-th {
  font-size: 11px;
  white-space: nowrap;
  background: #f8fafc;
}
:root[data-formula-theme="dark"] .fx-pt-bucket-th {
  background: #1e293b;
}
.fx-pt-bucket-th--high {
  color: #a16207;
  padding-left: 36px !important;
  border-left: 2px solid #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-pt-bucket-th--high {
  border-left-color: #334155;
}
.fx-pt-bucket-th--mid { color: #2563eb; }
.fx-pt-bucket-th--low { color: #64748b; }
.fx-pt-bucket-metric-td {
  text-align: center;
  vertical-align: middle;
  padding: 6px 8px !important;
  font-size: 11px;
  background: #f8fafc;
}
:root[data-formula-theme="dark"] .fx-pt-bucket-metric-td {
  background: #1e293b;
}
.fx-pt-bucket-metric-td--high {
  padding-left: 36px !important;
  border-left: 2px solid #e2e8f0;
  box-shadow: inset 3px 0 0 #eab308;
}
:root[data-formula-theme="dark"] .fx-pt-bucket-metric-td--high {
  border-left-color: #334155;
}
.fx-pt-bucket-metric-td--mid { box-shadow: inset 3px 0 0 #3b82f6; }
.fx-pt-bucket-metric-td--low { box-shadow: inset 3px 0 0 #64748b; }
.fx-pt-bucket-metric-td.is-empty,
.fx-pt-bucket-metric-td--empty { opacity: 0.55; }
.fx-pt-bucket-metric-value {
  display: inline-block;
  font-weight: 600;
  white-space: nowrap;
}
.fx-pt-bucket-metric-value strong { font-size: 12px; font-weight: 800; }

.fx-pt-row-highlight {
  background: #eff6ff;
}
:root[data-formula-theme="dark"] .fx-pt-row-highlight {
  background: #1e293b;
}

/* 월별 평균 매출 비교 (캡처 스타일) */
.fx-pt-monthly-compare-section {
  margin: 14px 0;
}
.fx-pt-monthly-compare-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}
.fx-pt-monthly-compare-card {
  border: 2px solid #1e293b;
  border-radius: 4px;
  overflow: hidden;
  background: var(--card);
  min-width: 240px;
  max-width: 320px;
  flex: 0 1 280px;
}
.fx-pt-monthly-compare-head {
  background: #facc15;
  color: #1e293b;
  font-weight: 700;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 2px solid #1e293b;
}
.fx-pt-table-wrap--monthly-compare {
  border: none;
  border-radius: 0;
}
.fx-pt-table--monthly-compare {
  font-size: 13px;
}
.fx-pt-table--monthly-compare td {
  border: 1px dotted #94a3b8;
  padding: 7px 12px;
}
.fx-pt-table--monthly-compare td:first-child {
  text-align: center;
  width: 52%;
}
.fx-pt-table--monthly-compare td:last-child {
  font-variant-numeric: tabular-nums;
}
.fx-pt-monthly-value-td {
  min-width: 108px;
  padding: 4px 8px !important;
}
.fx-pt-metric-track--monthly {
  min-height: 26px;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.fx-pt-metric-cell--monthly .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(254, 215, 170, 0.45), rgba(251, 191, 136, 0.55));
}
:root[data-formula-theme="dark"] .fx-pt-metric-cell--monthly .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(251, 146, 60, 0.22), rgba(249, 115, 22, 0.32));
}
.fx-pt-table--monthly-compare .fx-pt-metric-text {
  color: #0f172a;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.95), 0 1px 1px rgba(255, 255, 255, 0.85);
}
.fx-pt-monthly-pos-light { color: #16a34a !important; font-weight: 700; }
.fx-pt-monthly-pos-mid { color: #15803d !important; font-weight: 700; }
.fx-pt-monthly-pos-strong { color: #14532d !important; font-weight: 800; }
.fx-pt-monthly-neg-light { color: #dc2626 !important; font-weight: 700; }
.fx-pt-monthly-neg-mid { color: #b91c1c !important; font-weight: 700; }
.fx-pt-monthly-neg-strong { color: #991b1b !important; font-weight: 800; }
.fx-pt-monthly-neutral { color: #334155 !important; font-weight: 700; }
:root[data-formula-theme="dark"] .fx-pt-metric-track--monthly {
  background: #1e293b;
  border-color: #334155;
}
:root[data-formula-theme="dark"] .fx-pt-table--monthly-compare .fx-pt-metric-text {
  color: #f8fafc;
  text-shadow: 0 0 4px rgba(15, 23, 42, 0.95), 0 1px 2px rgba(15, 23, 42, 0.85);
}
:root[data-formula-theme="dark"] .fx-pt-monthly-pos-light { color: #86efac !important; }
:root[data-formula-theme="dark"] .fx-pt-monthly-pos-mid { color: #4ade80 !important; }
:root[data-formula-theme="dark"] .fx-pt-monthly-pos-strong { color: #22c55e !important; }
:root[data-formula-theme="dark"] .fx-pt-monthly-neg-light { color: #fca5a5 !important; }
:root[data-formula-theme="dark"] .fx-pt-monthly-neg-mid { color: #f87171 !important; }
:root[data-formula-theme="dark"] .fx-pt-monthly-neg-strong { color: #ef4444 !important; }
:root[data-formula-theme="dark"] .fx-pt-monthly-neutral { color: #e2e8f0 !important; }
.fx-pt-monthly-compare-overall td {
  background: #fefce8;
}
.fx-pt-monthly-compare-current td {
  background: #eff6ff;
  font-weight: 600;
}
.fx-pt-monthly-compare-branch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  flex: 1 1 480px;
  min-width: 0;
}
.fx-pt-monthly-compare-division-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  flex: 1 1 100%;
  min-width: 0;
}
.fx-pt-monthly-compare-division-grid .fx-pt-monthly-compare-card {
  flex: 1 1 280px;
  min-width: 240px;
  border-color: color-mix(in srgb, var(--border) 70%, #ca8a04 30%);
}
:root[data-formula-theme="dark"] .fx-pt-monthly-compare-head {
  background: #ca8a04;
  color: #fefce8;
  border-bottom-color: #475569;
}
:root[data-formula-theme="dark"] .fx-pt-monthly-compare-card {
  border-color: #475569;
}
:root[data-formula-theme="dark"] .fx-pt-monthly-compare-overall td {
  background: #422006;
}
:root[data-formula-theme="dark"] .fx-pt-monthly-compare-current td {
  background: #1e3a5f;
}
.fx-pt-table--branches-mini .fx-pt-progress {
  display: inline-block;
  vertical-align: middle;
  width: 80px;
  margin-right: 6px;
}

/* Progress bar */
.fx-pt-progress {
  display: inline-block;
  width: 100%;
  height: 6px;
  background: var(--bg-sub);
  border-radius: 999px;
  overflow: hidden;
}
.fx-pt-progress--lg { height: 8px; }
.fx-pt-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  border-radius: 999px;
  transition: width .3s ease;
}
.fx-pt-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: right;
}

/* Achievement coloring */
.fx-pt-ach-good { color: #15803d; font-weight: 600; }
.fx-pt-ach-mid  { color: #b45309; font-weight: 600; }
.fx-pt-ach-low  { color: #b91c1c; font-weight: 600; }
:root[data-formula-theme="dark"] .fx-pt-ach-good { color: #86efac; }
:root[data-formula-theme="dark"] .fx-pt-ach-mid  { color: #fde68a; }
:root[data-formula-theme="dark"] .fx-pt-ach-low  { color: #fca5a5; }

/* 대시보드 매출 막대 셀 — 숫자 위에 비율 fill (pill) */
.fx-pt-metric-td {
  min-width: 118px;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
.fx-pt-metric-cell {
  width: 100%;
  max-width: 132px;
  margin-left: auto;
}
.fx-pt-metric-track {
  position: relative;
  width: 100%;
  min-height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.fx-pt-metric-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 7px;
  transition: width .25s ease;
  min-width: 0;
}
.fx-pt-metric-cell--new .fx-pt-metric-fill   { background: linear-gradient(90deg, #fdba74, #f97316); }
.fx-pt-metric-cell--reg .fx-pt-metric-fill   { background: linear-gradient(90deg, #93c5fd, #3b82f6); }
.fx-pt-metric-cell--total .fx-pt-metric-fill { background: linear-gradient(90deg, #cbd5e1, #64748b); }
.fx-pt-metric-cell--ach .fx-pt-metric-fill   { background: linear-gradient(90deg, #f9a8d4, #ec4899); }
.fx-pt-table--historical-branches .fx-pt-metric-cell--total .fx-pt-metric-fill,
.fx-pt-table--historical-trainers .fx-pt-metric-cell--hist-total .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.7), rgba(148, 163, 184, 0.48));
}
.fx-pt-table--historical-trainers .fx-pt-metric-cell--hist-avg .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(191, 219, 254, 0.72), rgba(147, 197, 253, 0.5));
}
.fx-pt-table--historical-branches .fx-pt-metric-cell--ach-good .fx-pt-metric-fill,
.fx-pt-table--historical-trainers .fx-pt-metric-cell--ach-good .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(167, 243, 208, 0.72), rgba(110, 231, 183, 0.58));
}
.fx-pt-table--historical-branches .fx-pt-metric-cell--ach-warn .fx-pt-metric-fill,
.fx-pt-table--historical-trainers .fx-pt-metric-cell--ach-warn .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(253, 230, 138, 0.72), rgba(251, 191, 36, 0.5));
}
.fx-pt-table--historical-branches .fx-pt-metric-cell--ach-low .fx-pt-metric-fill,
.fx-pt-table--historical-trainers .fx-pt-metric-cell--ach-low .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(254, 202, 202, 0.72), rgba(248, 113, 113, 0.52));
}
:root[data-formula-theme="dark"] .fx-pt-table--historical-branches .fx-pt-metric-cell--total .fx-pt-metric-fill,
:root[data-formula-theme="dark"] .fx-pt-table--historical-trainers .fx-pt-metric-cell--hist-total .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(100, 116, 139, 0.42), rgba(71, 85, 105, 0.32));
}
:root[data-formula-theme="dark"] .fx-pt-table--historical-trainers .fx-pt-metric-cell--hist-avg .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.32), rgba(59, 130, 246, 0.24));
}
:root[data-formula-theme="dark"] .fx-pt-table--historical-branches .fx-pt-metric-cell--ach-good .fx-pt-metric-fill,
:root[data-formula-theme="dark"] .fx-pt-table--historical-trainers .fx-pt-metric-cell--ach-good .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.35), rgba(16, 185, 129, 0.28));
}
:root[data-formula-theme="dark"] .fx-pt-table--historical-branches .fx-pt-metric-cell--ach-warn .fx-pt-metric-fill,
:root[data-formula-theme="dark"] .fx-pt-table--historical-trainers .fx-pt-metric-cell--ach-warn .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.32), rgba(245, 158, 11, 0.24));
}
:root[data-formula-theme="dark"] .fx-pt-table--historical-branches .fx-pt-metric-cell--ach-low .fx-pt-metric-fill,
:root[data-formula-theme="dark"] .fx-pt-table--historical-trainers .fx-pt-metric-cell--ach-low .fx-pt-metric-fill {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.32), rgba(239, 68, 68, 0.24));
}
.fx-pt-metric-cell--gap-pos .fx-pt-metric-fill { background: linear-gradient(90deg, #a7f3d0, #10b981); }
.fx-pt-metric-cell--gap-neg .fx-pt-metric-fill { background: linear-gradient(90deg, #fecaca, #ef4444); }
.fx-pt-metric-text.fx-pt-gap-pos { color: #15803d; font-weight: 600; }
.fx-pt-metric-text.fx-pt-gap-neg { color: #b91c1c; font-weight: 600; }
.fx-pt-metric-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  line-height: 1.2;
}
.fx-pt-metric-text.fx-pt-total-low {
  color: #dc2626 !important;
  font-weight: 800;
}
:root[data-formula-theme="dark"] .fx-pt-metric-track {
  background: #1e293b;
  border-color: #334155;
}
:root[data-formula-theme="dark"] .fx-pt-metric-text { color: #f1f5f9; }
:root[data-formula-theme="dark"] .fx-pt-metric-text.fx-pt-total-low { color: #f87171 !important; }
:root[data-formula-theme="dark"] .fx-pt-metric-text.fx-pt-gap-pos { color: #86efac !important; }
:root[data-formula-theme="dark"] .fx-pt-metric-text.fx-pt-gap-neg { color: #fca5a5 !important; }
.fx-pt-amount-negative,
.fx-pt-metric-text.fx-pt-amount-negative {
  color: #dc2626 !important;
  font-weight: 800;
}
:root[data-formula-theme="dark"] .fx-pt-amount-negative,
:root[data-formula-theme="dark"] .fx-pt-metric-text.fx-pt-amount-negative {
  color: #f87171 !important;
}

/* 전사 순위 뱃지 */
.fx-pt-rank-td { white-space: nowrap; }
.fx-pt-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.fx-pt-rank-gold {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fbbf24;
}
.fx-pt-rank-silver {
  background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
  color: #334155;
  border: 1px solid #94a3b8;
}
.fx-pt-rank-bronze {
  background: linear-gradient(135deg, #ffedd5, #fdba74);
  color: #9a3412;
  border: 1px solid #fb923c;
}
.fx-pt-rank-top {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.fx-pt-rank-top-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #2563eb;
}
.fx-pt-rank-plain {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
:root[data-formula-theme="dark"] .fx-pt-rank-gold { background: #422006; color: #fde68a; border-color: #ca8a04; }
:root[data-formula-theme="dark"] .fx-pt-rank-silver { background: #1e293b; color: #e2e8f0; border-color: #64748b; }
:root[data-formula-theme="dark"] .fx-pt-rank-bronze { background: #431407; color: #fdba74; border-color: #ea580c; }
:root[data-formula-theme="dark"] .fx-pt-rank-top { background: #172554; color: #93c5fd; border-color: #2563eb; }
:root[data-formula-theme="dark"] .fx-pt-rank-top-label { color: #93c5fd; }

/* Targets 매트릭스 */
.fx-pt-section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fx-pt-branch-readonly {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-weight: 600;
}
.fx-pt-targets-toolbar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fx-pt-table--matrix tbody td { padding: 6px; }
.fx-pt-table--matrix tbody td input { min-width: 110px; }
.fx-pt-override-block {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.fx-pt-override-block h5 { margin: 0 0 8px; font-size: 14px; }
.fx-pt-table--override input { min-width: 130px; }

/* Pivot */
.fx-pt-pivot-hint {
  font-size: 12px;
  margin: 0 0 10px;
}
.fx-pt-table--pivot td,
.fx-pt-table--pivot th { white-space: nowrap; }
.fx-pt-pivot-row {
  cursor: pointer;
}
.fx-pt-pivot-row:hover td {
  background: #f8fafc;
}
:root[data-formula-theme="dark"] .fx-pt-pivot-row:hover td {
  background: #1e293b;
}
.fx-pt-pivot-row-branch-start td {
  border-top: 2px solid #e2e8f0;
}
:root[data-formula-theme="dark"] .fx-pt-pivot-row-branch-start td {
  border-top-color: #334155;
}
.fx-pt-pivot-branch-td {
  vertical-align: middle;
  font-weight: 700;
  background: #fafafa;
}
:root[data-formula-theme="dark"] .fx-pt-pivot-branch-td {
  background: #0f172a;
}
.fx-pt-pivot-value-td {
  min-width: 108px;
  padding: 4px 8px !important;
  vertical-align: middle;
}
.fx-pt-pivot-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.fx-pt-pivot-target-line {
  font-size: 10px;
  font-weight: 600;
  color: #b45309;
  line-height: 1.2;
  white-space: nowrap;
}
:root[data-formula-theme="dark"] .fx-pt-pivot-target-line {
  color: #fbbf24;
}
.fx-pt-metric-cell--pivot {
  min-width: 96px;
}
.fx-pt-table--pivot .fx-pt-metric-text {
  font-size: 11px;
  font-weight: 700;
}
.fx-pt-pivot-row-branch-subtotal td {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
}
:root[data-formula-theme="dark"] .fx-pt-pivot-row-branch-subtotal td {
  background: #1e293b;
  border-top-color: #334155;
}
.fx-pt-pivot-subtotal-label {
  color: #475569;
  font-size: 12px;
}
:root[data-formula-theme="dark"] .fx-pt-pivot-subtotal-label {
  color: #94a3b8;
}
.fx-pt-row-total td {
  background: var(--bg-sub);
  font-weight: 600;
}
.fx-pt-row-total {
  cursor: default;
}

/* Categories */
.fx-pt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.fx-pt-table--categories td { padding: 6px 8px; }
.fx-pt-table--categories input,
.fx-pt-table--categories select { min-width: 100px; }

/* PT 모달 (트레이너 등록/배정/카테고리) */
.fx-pt-modal .fx-modal-header {
  padding: 18px 22px 10px;
  border-bottom: 1px solid var(--border);
}
.fx-pt-modal .fx-modal-header h4 { margin: 0; font-size: 16px; }
.fx-pt-modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fx-pt-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fx-pt-modal-row--consult-fields {
  grid-template-columns: 88px 148px 1fr;
}
.fx-pt-modal-field--category {
  max-width: 88px;
}
.fx-contact-detail-modal .fx-pt-modal-field--category > select {
  padding-left: 8px;
  padding-right: 8px;
}
.fx-pt-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.fx-pt-modal-field > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}
.fx-pt-modal-field > input,
.fx-pt-modal-field > select,
.fx-pt-modal-field > textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color .15s;
  font-family: inherit;
}
.fx-pt-modal-field > textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
.fx-pt-modal-field > input:focus,
.fx-pt-modal-field > select:focus,
.fx-pt-modal-field > textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.fx-pt-modal-hint {
  font-size: 11px;
  margin: 0;
  padding: 8px 10px;
  background: var(--bg-sub);
  border-radius: 6px;
  line-height: 1.5;
}
.fx-pt-modal .fx-modal-footer {
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Mobile */
@media (max-width: 768px) {
  .fx-pt { padding: 12px; }
  .fx-pt-header-right { width: 100%; }
  .fx-pt-subtabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .fx-pt-subtab-group { flex: 0 0 auto; }
  .fx-pt-subtab { white-space: nowrap; }
  .fx-pt-table th,
  .fx-pt-table td { padding: 7px 8px; font-size: 12px; }
  .fx-pt-summary-grid { grid-template-columns: 1fr; }
  .fx-pt-table--branches-mini .fx-pt-progress { width: 60px; }
  .fx-pt-modal-row { grid-template-columns: 1fr; }
}

/* PT 트레이너 인사이트 */
.fx-pt-trainer-row {
  cursor: pointer;
  transition: background .15s ease;
}
.fx-pt-trainer-row:hover,
.fx-pt-trainer-row:focus-visible {
  background: rgba(59, 130, 246, 0.08);
  outline: none;
}
.fx-pt-insight-modal {
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.fx-pt-insight-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.fx-pt-insight-header h4 { margin: 0 0 4px; font-size: 18px; }
.fx-pt-insight-sub { margin: 0; font-size: 12px; color: var(--text-muted); }
.fx-pt-insight-body {
  overflow-y: auto;
  max-height: calc(92vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fx-pt-insight-hero {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fx-pt-insight-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.fx-pt-insight-kpi {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
:root[data-formula-theme="dark"] .fx-pt-insight-kpi { background: #0f172a; }
.fx-pt-insight-kpi-label { font-size: 11px; color: var(--text-muted); }
.fx-pt-insight-kpi strong { font-size: 14px; line-height: 1.3; }
.fx-pt-insight-ach-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}
.fx-pt-insight-ach-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.fx-pt-insight-ach-bar { width: 100%; }
.fx-pt-insight-ach-bar .fx-pt-metric-cell { max-width: none; }
.fx-pt-insight-section-desc {
  margin: -4px 0 10px;
  font-size: 12px;
}
.fx-pt-insight-paths {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.fx-pt-insight-path {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
:root[data-formula-theme="dark"] .fx-pt-insight-path { background: #0f172a; }
.fx-pt-insight-path-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.fx-pt-insight-path-name { font-size: 13px; line-height: 1.3; }
.fx-pt-insight-path-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.fx-pt-insight-path-amt { font-size: 16px; font-weight: 800; line-height: 1.2; }
.fx-pt-insight-path-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.fx-pt-insight-path-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}
.fx-pt-insight-path--new { border-color: #fdba74; }
.fx-pt-insight-path--new .fx-pt-insight-path-bar span {
  background: linear-gradient(90deg, #fdba74, #f97316);
}
.fx-pt-insight-path--reg { border-color: #93c5fd; }
.fx-pt-insight-path--reg .fx-pt-insight-path-bar span {
  background: linear-gradient(90deg, #93c5fd, #3b82f6);
}
.fx-pt-insight-path--total .fx-pt-insight-path-bar span {
  background: linear-gradient(90deg, #cbd5e1, #64748b);
}
.fx-pt-insight-subsection {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.fx-pt-insight-subsection h6 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.fx-pt-insight-path-monthly { margin-top: 4px; overflow-x: auto; }
.fx-pt-table--path-monthly th,
.fx-pt-table--path-monthly td { font-size: 11px; padding: 6px 8px; white-space: nowrap; }
.fx-pt-table--path-monthly .fx-pt-col-current {
  background: rgba(59, 130, 246, 0.06);
  font-weight: 700;
}
.fx-pt-path-month-name { font-weight: 600; }
.fx-pt-path-month-row--new .fx-pt-path-month-name { color: #c2410c; }
.fx-pt-path-month-row--reg .fx-pt-path-month-name { color: #1d4ed8; }
.fx-pt-insight-section h5 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.fx-pt-insight-notes {
  display: grid;
  gap: 8px;
}
.fx-pt-insight-note {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}
.fx-pt-insight-note strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.fx-pt-insight-note p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.fx-pt-insight-note--good { border-color: #86efac; background: #f0fdf4; }
.fx-pt-insight-note--mid  { border-color: #fde68a; background: #fffbeb; }
.fx-pt-insight-note--low  { border-color: #fecaca; background: #fef2f2; }
.fx-pt-insight-note--neutral { border-color: var(--border); }
:root[data-formula-theme="dark"] .fx-pt-insight-note--good { background: #14532d33; border-color: #166534; }
:root[data-formula-theme="dark"] .fx-pt-insight-note--mid  { background: #78350f33; border-color: #92400e; }
:root[data-formula-theme="dark"] .fx-pt-insight-note--low  { background: #7f1d1d33; border-color: #991b1b; }
.fx-pt-insight-trend-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 1100px) {
  .fx-pt-insight-trend-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.fx-pt-insight-trend-stat {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
:root[data-formula-theme="dark"] .fx-pt-insight-trend-stat { background: #0f172a; }
.fx-pt-insight-trend-stat-label { font-size: 11px; color: var(--text-muted); }
.fx-pt-insight-trend-stat strong { font-size: 15px; line-height: 1.3; }
.fx-pt-insight-trend-combo {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 4px 2px 0;
}
.fx-pt-insight-trend-combo .fx-pt-insight-trend {
  border-top: none;
}
.fx-pt-insight-trend-lines-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  height: 92px;
  width: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
.fx-pt-insight-trend-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fx-pt-trend-zero {
  stroke: rgba(148, 163, 184, 0.4);
  stroke-width: 0.4;
  stroke-dasharray: 2 2;
}
.fx-pt-trend-line {
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}
.fx-pt-trend-line--momPct { stroke: rgba(249, 115, 22, 0.85); }
.fx-pt-trend-line--yoyPct { stroke: rgba(139, 92, 246, 0.85); }
.fx-pt-trend-points-html {
  position: absolute;
  inset: 0;
}
.fx-pt-trend-point-html {
  position: absolute;
  transform: translate(-50%, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  white-space: nowrap;
}
.fx-pt-trend-point-html.is-low {
  transform: translate(-50%, -4px);
}
.fx-pt-trend-point-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: var(--card, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}
.fx-pt-trend-point-html--momPct { color: #ea580c; }
.fx-pt-trend-point-html--yoyPct { color: #7c3aed; }
.fx-pt-trend-point-label {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  color: inherit;
}
.fx-pt-trend-point-html--pos .fx-pt-trend-point-label { color: #15803d; }
.fx-pt-trend-point-html--neg .fx-pt-trend-point-label { color: #b91c1c; }
:root[data-formula-theme="dark"] .fx-pt-trend-point-label {
  background: rgba(15, 23, 42, 0.82);
}
:root[data-formula-theme="dark"] .fx-pt-trend-point-html--pos .fx-pt-trend-point-label { color: #86efac; }
:root[data-formula-theme="dark"] .fx-pt-trend-point-html--neg .fx-pt-trend-point-label { color: #fca5a5; }
.fx-pt-insight-trend-ach--ach-good { color: #15803d; }
.fx-pt-insight-trend-ach--ach-warn { color: #b45309; }
.fx-pt-insight-trend-ach--ach-low { color: #b91c1c; }
:root[data-formula-theme="dark"] .fx-pt-insight-trend-ach--ach-good { color: #86efac; }
:root[data-formula-theme="dark"] .fx-pt-insight-trend-ach--ach-warn { color: #fbbf24; }
:root[data-formula-theme="dark"] .fx-pt-insight-trend-ach--ach-low { color: #fca5a5; }
.fx-pt-insight-trend-line-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 6px 4px 2px;
  font-size: 10px;
  color: var(--text-muted);
}
.fx-pt-trend-legend-item::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px solid currentColor;
  margin-right: 5px;
  vertical-align: middle;
}
.fx-pt-trend-legend-item--mom { color: #f97316; }
.fx-pt-trend-legend-item--mom::before { border-top-color: #f97316; }
.fx-pt-trend-legend-item--yoy { color: #8b5cf6; }
.fx-pt-trend-legend-item--yoy::before { border-top-color: #8b5cf6; }
.fx-pt-insight-trend {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 180px;
  padding: 4px 2px 0;
  border-top: 1px solid var(--border);
}
.fx-pt-insight-trend-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.fx-pt-insight-trend-amt {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  min-height: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.fx-pt-insight-trend-ach {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}
.fx-pt-insight-trend-target {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.1;
}
.fx-pt-insight-trend-growths {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 22px;
}
.fx-pt-insight-trend-growth-item {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}
.fx-pt-insight-trend-growth--pending {
  font-size: 9px;
  line-height: 1.15;
  min-height: 22px;
}
.fx-pt-insight-trend-col.is-current .fx-pt-insight-trend-label {
  font-weight: 700;
  color: var(--primary);
}
.fx-pt-insight-trend-col.is-current .fx-pt-insight-trend-amt {
  color: var(--text);
}
.fx-pt-insight-trend-col.is-current .fx-pt-insight-trend-bar {
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.35);
}
.fx-pt-insight-trend-bar-wrap {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.fx-pt-insight-trend-bar {
  width: 72%;
  max-width: 56px;
  min-height: 4px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
}
.fx-pt-insight-trend-col.is-current .fx-pt-insight-trend-bar {
  background: linear-gradient(180deg, #f9a8d4, #ec4899);
}
.fx-pt-insight-trend-bar.is-negative {
  background: linear-gradient(180deg, #fca5a5, #ef4444);
}
.fx-pt-insight-trend-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  min-height: 16px;
  line-height: 1.2;
}
.fx-pt-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.fx-pt-table--insight th,
.fx-pt-table--insight td { font-size: 12px; padding: 7px 10px; }
.fx-pt-insight-cat-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.fx-pt-insight-cat-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #cbd5e1, #64748b);
  min-width: 4px;
}
@media (max-width: 720px) {
  .fx-pt-insight-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-pt-insight-grid { grid-template-columns: 1fr; }
  .fx-pt-insight-trend-summary { grid-template-columns: 1fr; }
  .fx-pt-insight-paths { grid-template-columns: 1fr; }
  .fx-pt-insight-trend-ach { font-size: 12px; }
}

/* 기간 인사이트 */
.fx-pt-historical-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(236, 72, 153, 0.04));
}
.fx-pt-historical-mode-field { flex: 1 1 280px; }
.fx-pt-historical-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fx-pt-historical-mode {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.fx-pt-historical-mode.is-active {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #dbeafe, #fce7f3);
  color: #1d4ed8;
}
:root[data-formula-theme="dark"] .fx-pt-historical-mode.is-active {
  background: linear-gradient(135deg, #1e3a8a, #831843);
  color: #bfdbfe;
}
.fx-pt-historical-hero {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.05));
}
.fx-pt-historical-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
}
.fx-pt-historical-sub { margin: 0; font-size: 12px; }
.fx-pt-historical-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.fx-pt-historical-kpi {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
}
.fx-pt-historical-kpi--total { border-top: 3px solid #3b82f6; }
.fx-pt-historical-kpi--avg { border-top: 3px solid #8b5cf6; }
.fx-pt-historical-kpi--ach { border-top: 3px solid #10b981; }
.fx-pt-historical-kpi--yoy { border-top: 3px solid #f59e0b; }
.fx-pt-historical-kpi--peak { border-top: 3px solid #ec4899; }
.fx-pt-historical-kpi--mix { border-top: 3px solid #06b6d4; }
.fx-pt-historical-kpi-label { font-size: 11px; color: var(--text-muted); }
.fx-pt-historical-kpi-value { font-size: 18px; line-height: 1.25; }
.fx-pt-historical-kpi-hint { font-size: 10px; color: var(--text-muted); }
.fx-pt-historical-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.fx-pt-historical-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 14px 16px;
}
.fx-pt-historical-card--wide { grid-column: 1 / -1; }
.fx-pt-historical-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.fx-pt-historical-card-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.fx-pt-historical-card-head .text-muted { font-size: 11px; }
.fx-pt-historical-charts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
  align-items: stretch;
}
.fx-pt-historical-charts-row .fx-pt-historical-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fx-pt-historical-charts-row .fx-pt-historical-compose,
.fx-pt-historical-charts-row .fx-pt-historical-bucket-trend {
  flex: 1;
  min-height: 220px;
  height: auto;
}
.fx-pt-historical-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.fx-pt-historical-legend-new::before,
.fx-pt-historical-legend-reg::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.fx-pt-historical-legend-new::before { background: #f97316; }
.fx-pt-historical-legend-reg::before { background: #3b82f6; }
.fx-pt-historical-compose,
.fx-pt-historical-bucket-trend {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 220px;
  height: 220px;
  padding: 8px 4px 0;
}
.fx-pt-historical-compose-col,
.fx-pt-historical-bucket-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.fx-pt-historical-compose-bar,
.fx-pt-historical-bucket-bar {
  width: 72%;
  max-width: 48px;
  min-height: 36px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
  background: var(--border);
}
.fx-pt-historical-compose-bar.is-empty,
.fx-pt-historical-bucket-bar.is-empty {
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.15);
}
.fx-pt-historical-compose-new,
.fx-pt-historical-compose-reg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3px;
  overflow: hidden;
}
.fx-pt-historical-compose-new {
  background: linear-gradient(180deg, #fdba74, #f97316);
}
.fx-pt-historical-compose-reg {
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
}
.fx-pt-historical-compose-seg-label {
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
  letter-spacing: -0.02em;
  pointer-events: none;
}
.fx-pt-historical-bucket-bar {
  flex-direction: column;
}
.fx-pt-historical-bucket-high {
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  border-radius: 8px 8px 4px 4px;
}
.fx-pt-historical-bucket-pct {
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  line-height: 1.1;
}
.fx-pt-historical-bucket-col.is-current .fx-pt-historical-bucket-pct {
  color: var(--primary);
}
.fx-pt-historical-bucket-meta {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.1;
}
:root[data-formula-theme="dark"] .fx-pt-historical-bucket-pct {
  color: #fbbf24;
}
.fx-pt-historical-compose-label,
.fx-pt-historical-bucket-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}
.fx-pt-historical-compose-col.is-current .fx-pt-historical-compose-label,
.fx-pt-historical-bucket-col.is-current .fx-pt-historical-bucket-label {
  color: var(--primary);
  font-weight: 700;
}
.fx-pt-table--historical th,
.fx-pt-table--historical td { font-size: 12px; }
.fx-pt-historical-trainer-row { cursor: pointer; }
.fx-pt-historical-trainer-row:hover td { background: rgba(59, 130, 246, 0.06); }
.fx-pt-table-wrap--historical-trainers {
  max-height: min(72vh, 720px);
  overflow-y: auto;
}
.fx-pt-table-wrap--historical-trainers .fx-pt-table--historical thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}
@media (max-width: 1100px) {
  .fx-pt-historical-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .fx-pt-historical-charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .fx-pt-historical-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-pt-historical-grid { grid-template-columns: 1fr; }
  .fx-pt-historical-card--wide { grid-column: auto; }
}

/* ============================================================
   고객 DB
   ============================================================ */
.fx-customer-wrap { padding: 16px 20px; }
.fx-customer-toolbar {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.fx-customer-title h3 { margin: 0 0 4px; font-size: 18px; }
.fx-customer-title p { margin: 0; font-size: 13px; }
.fx-customer-controls {
  display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto;
  align-items: flex-end;
}
.fx-customer-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-customer-label { font-size: 11px; color: var(--text-muted); line-height: 1.2; }
.fx-customer-brand-select,
.fx-customer-form-select,
.fx-customer-form-reg-branch-select,
.fx-inquiry-toolbar-branch-select {
  height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 13px; min-width: 200px; max-width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.fx-customer-subtabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; overflow-x: auto;
}
.fx-customer-subtab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 14px; color: var(--text-muted); cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.fx-customer-subtab:hover { color: var(--text); }
.fx-customer-subtab.active { color: var(--primary); border-bottom-color: var(--primary); }

.fx-customer-filterbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 0;
}
.fx-customer-filterbar input[type="search"],
.fx-customer-filterbar select,
.fx-contact-search-bar input[type="search"] {
  height: 34px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 13px; min-width: 150px;
}
.fx-contact-search-panel {
  margin: 12px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.fx-contact-search-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.fx-contact-search-bar input[type="search"],
.fx-contact-search-bar select {
  height: 34px;
  min-width: 0;
  flex: 1 1 120px;
  max-width: 200px;
}
.fx-contact-search-bar .fx-contact-f-memo {
  flex: 1 1 160px;
  max-width: 280px;
}
.fx-contact-search-bar .fx-customer-f-branch,
.fx-contact-search-bar .fx-customer-f-lead-path,
.fx-contact-search-bar .fx-contact-f-form,
.fx-contact-search-bar .fx-contact-f-category,
.fx-contact-search-bar .fx-contact-f-status,
.fx-contact-search-bar .fx-contact-f-follow-preset,
.fx-contact-search-bar .fx-customer-f-assignee {
  flex: 0 1 118px;
  max-width: 140px;
}
.fx-contact-follow-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.fx-contact-follow-quick-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
}
.fx-contact-follow-chip {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.3;
  border-radius: 999px;
}
.fx-contact-follow-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.fx-contact-follow-quick-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.fx-contact-follow-quick-range .fx-contact-f-follow-from,
.fx-contact-follow-quick-range .fx-contact-f-follow-to {
  height: 32px;
  min-width: 132px;
  max-width: 148px;
}
.fx-contact-search-bar .fx-contact-filter-sep {
  flex: 0 0 auto;
  font-size: 12px;
}
.fx-contact-search-bar .fx-contact-search-btn {
  flex: 0 0 auto;
}
.fx-filter-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.fx-filter-field--grow { flex: 1 1 200px; min-width: 160px; }
.fx-filter-field--grow input { width: 100%; max-width: 360px; }
.fx-filter-field--select select { min-width: 120px; }
.fx-filter-date-range { display: inline-flex; align-items: center; gap: 6px; }
.fx-filter-date-range input[type="date"] { min-width: 132px; }
.fx-filter-date-sep { color: var(--text-muted); font-size: 12px; }
.fx-filter-bar-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-left: auto;
}
.fx-contact-filter-hint {
  margin-top: 8px; font-size: 12px; line-height: 1.4;
}
.fx-contact-pending-resp {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sub);
}
.fx-contact-pending-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 8px; font-size: 13px;
}
.fx-contact-pending-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.fx-contact-pending-resp-list .fx-customer-table-wrap { border: 0; }
.fx-customer-table-resp--compact { min-width: 0; font-size: 12px; }
.fx-customer-table-resp--compact thead th,
.fx-customer-table-resp--compact tbody td { padding: 6px 8px; }

.fx-customer-summary {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 8px; font-size: 13px;
}
.fx-contacts-export-btn { margin-left: auto; }

.fx-customer-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.fx-customer-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  table-layout: fixed;
}
.fx-customer-table thead th {
  position: sticky; top: 0;
  background: var(--bg-sub); padding: 10px 12px;
  font-weight: 600; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.fx-customer-table tbody td {
  padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle;
  text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fx-customer-table tbody tr:hover { background: var(--bg-sub); }
.fx-customer-table tbody tr.is-registered { opacity: 0.72; background: var(--bg-sub); }
.fx-customer-table tbody tr.is-registered:hover { background: var(--bg-sub); }
.fx-customer-table tbody tr.is-registered .fx-customer-resp-check:disabled { cursor: not-allowed; }
.fx-customer-col-actions { white-space: nowrap; text-align: right; }
.fx-customer-col-check { width: 38px; text-align: center; }

/* 목록 표 컬럼 폭 (체크박스 / 이름 / 전화 / …) */
.fx-customer-table-list th:nth-child(1),
.fx-customer-table-list td:nth-child(1) { width: 38px; min-width: 38px; text-align: center; }
.fx-customer-table-list th:nth-child(2),
.fx-customer-table-list td:nth-child(2) { width: 14%; min-width: 110px; }
.fx-customer-table-list th:nth-child(3),
.fx-customer-table-list td:nth-child(3) { width: 130px; }
.fx-customer-table-list th:nth-child(4),
.fx-customer-table-list td:nth-child(4) { width: 14%; min-width: 140px; }
.fx-customer-table-list th:nth-child(5),
.fx-customer-table-list td:nth-child(5) { width: 100px; }
.fx-customer-table-list th:nth-child(6),
.fx-customer-table-list td:nth-child(6) { width: 110px; }
.fx-customer-table-list th:nth-child(7),
.fx-customer-table-list td:nth-child(7) { width: 92px; }
.fx-customer-table-list th:nth-child(8),
.fx-customer-table-list td:nth-child(8) { width: 102px; }
.fx-customer-table-list th:nth-child(9),
.fx-customer-table-list td:nth-child(9) { width: 14%; min-width: 130px; }
.fx-customer-table-list th:nth-child(10),
.fx-customer-table-list td:nth-child(10) { width: 102px; }
.fx-customer-table-list th:nth-child(11),
.fx-customer-table-list td:nth-child(11) { width: 200px; }

/* 구 목록 표 (체크박스 없음) — 하위 호환 */
.fx-customer-table:not(.fx-customer-table-resp):not(.fx-customer-table-list):not(.fx-contacts-table) th:nth-child(1),
.fx-customer-table:not(.fx-customer-table-resp):not(.fx-customer-table-list):not(.fx-contacts-table) td:nth-child(1) { width: 14%; min-width: 110px; }

/* 폼 응답 표 컬럼 폭 (체크박스 / 제출시각 / 이름 / 전화 / 이메일 / 상태 / 액션) */
.fx-customer-table-resp th:nth-child(1),
.fx-customer-table-resp td:nth-child(1) { width: 38px; }
.fx-customer-table-resp th:nth-child(2),
.fx-customer-table-resp td:nth-child(2) { width: 150px; }
.fx-customer-table-resp th:nth-child(3),
.fx-customer-table-resp td:nth-child(3) { width: 18%; min-width: 120px; }
.fx-customer-table-resp th:nth-child(4),
.fx-customer-table-resp td:nth-child(4) { width: 150px; }
.fx-customer-table-resp th:nth-child(5),
.fx-customer-table-resp td:nth-child(5) { width: 22%; }
.fx-customer-table-resp th:nth-child(6),
.fx-customer-table-resp td:nth-child(6) { width: 90px; text-align: center; }
.fx-customer-table-resp th:nth-child(7),
.fx-customer-table-resp td:nth-child(7) { width: 140px; text-align: right; }

.fx-customer-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.fx-customer-link:hover { text-decoration: underline; }
.fx-customer-tel { color: var(--text); text-decoration: none; }
.fx-customer-tel:hover { color: var(--primary); text-decoration: underline; }

.fx-customer-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.3;
  background: rgba(148,163,184,.15); color: var(--text-muted);
}
.fx-customer-badge-untouched { background: rgba(148,163,184,.18); color: #64748b; }
.fx-customer-badge-contacted { background: rgba(59,130,246,.15); color: #2563eb; }
.fx-customer-badge-sms { background: rgba(20,184,166,.18); color: #0d9488; }
.fx-customer-badge-appointment { background: rgba(245,158,11,.18); color: #d97706; }
.fx-customer-badge-registered { background: rgba(59,130,246,.15); color: #2563eb; }
.fx-customer-badge-payment { background: rgba(16,185,129,.18); color: #059669; }
.fx-customer-badge-payment_hold { background: rgba(245,158,11,.18); color: #b45309; }
.fx-customer-badge-rejected { background: rgba(239,68,68,.15); color: #dc2626; }
.fx-customer-badge-experience_cancelled { background: rgba(251,146,60,.18); color: #c2410c; }
.fx-customer-badge-hold { background: rgba(168,85,247,.15); color: #9333ea; }
.fx-customer-badge-tm_1 { background: rgba(59,130,246,.15); color: #2563eb; }
.fx-customer-badge-tm_2 { background: rgba(37,99,235,.18); color: #1d4ed8; }
.fx-customer-badge-tm_3 { background: rgba(29,78,216,.2); color: #1e40af; }

:root[data-formula-theme="dark"] .fx-customer-badge-untouched { background: rgba(148,163,184,.22); color: #cbd5e1; }
:root[data-formula-theme="dark"] .fx-customer-badge-contacted { background: rgba(59,130,246,.25); color: #93c5fd; }
:root[data-formula-theme="dark"] .fx-customer-badge-sms { background: rgba(20,184,166,.28); color: #5eead4; }
:root[data-formula-theme="dark"] .fx-customer-badge-appointment { background: rgba(245,158,11,.28); color: #fbbf24; }
:root[data-formula-theme="dark"] .fx-customer-badge-registered { background: rgba(59,130,246,.25); color: #93c5fd; }
:root[data-formula-theme="dark"] .fx-customer-badge-payment { background: rgba(16,185,129,.28); color: #6ee7b7; }
:root[data-formula-theme="dark"] .fx-customer-badge-payment_hold { background: rgba(245,158,11,.28); color: #fcd34d; }
:root[data-formula-theme="dark"] .fx-customer-badge-rejected { background: rgba(239,68,68,.25); color: #fca5a5; }
:root[data-formula-theme="dark"] .fx-customer-badge-experience_cancelled { background: rgba(251,146,60,.28); color: #fdba74; }
:root[data-formula-theme="dark"] .fx-customer-badge-hold { background: rgba(168,85,247,.25); color: #d8b4fe; }
:root[data-formula-theme="dark"] .fx-customer-badge-tm_1 { background: rgba(59,130,246,.25); color: #93c5fd; }
:root[data-formula-theme="dark"] .fx-customer-badge-tm_2 { background: rgba(37,99,235,.28); color: #7dd3fc; }
:root[data-formula-theme="dark"] .fx-customer-badge-tm_3 { background: rgba(29,78,216,.3); color: #60a5fa; }

.fx-contact-status-select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  cursor: pointer;
  padding: 3px 20px 3px 10px;
  max-width: 100%;
  line-height: 1.3;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 10px;
}
.fx-contact-status-select:hover { filter: brightness(0.96); }
.fx-contact-status-select:disabled { opacity: 0.65; cursor: wait; }
.fx-cd-period-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fx-cd-period-controls .fx-cd-period-select { min-width: 88px; }
.fx-cd-period-controls .fx-cd-month-input { min-width: 140px; }
.fx-cd-kpi-sub { font-size: 11px; margin-top: 4px; line-height: 1.3; }
.fx-cd-rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}
.fx-cd-rate-grid.fx-cd-rate-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fx-cd-rate-grid.fx-cd-rate-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.fx-cd-rate-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--card);
}
.fx-cd-rate-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.fx-cd-rate-value { font-size: 20px; font-weight: 700; color: var(--primary); }
.fx-cd-rate-card--money {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, var(--card) 100%);
}
.fx-cd-rate-card--money .fx-cd-rate-value { color: #15803d; }
:root[data-formula-theme="dark"] .fx-cd-rate-card--money {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, var(--card) 100%);
}
:root[data-formula-theme="dark"] .fx-cd-rate-card--money .fx-cd-rate-value { color: #6ee7b7; }
.fx-cd-rate-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fx-cd-rate-card--clickable:hover,
.fx-cd-rate-card--clickable:focus-visible {
  border-color: #4ade80;
  box-shadow: 0 2px 10px rgba(21, 128, 61, 0.14);
  outline: none;
}
.fx-cd-payment-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fx-cd-payment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fx-cd-payment-table th,
.fx-cd-payment-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.fx-cd-payment-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}
.fx-cd-payment-table tbody tr.fx-cd-payment-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.fx-cd-payment-table tbody tr.fx-cd-payment-row:hover,
.fx-cd-payment-table tbody tr.fx-cd-payment-row:focus-visible {
  background: #f0fdf4;
  outline: none;
}
.fx-cd-payment-table .fx-cd-payment-amt {
  font-variant-numeric: tabular-nums;
  color: #15803d;
  font-weight: 600;
}
.fx-cd-payment-table tfoot .fx-cd-payment-total-row td {
  background: #f8fafc;
  border-bottom: none;
}
:root[data-formula-theme="dark"] .fx-cd-payment-table th,
:root[data-formula-theme="dark"] .fx-cd-payment-table tfoot .fx-cd-payment-total-row td {
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-muted);
}
:root[data-formula-theme="dark"] .fx-cd-payment-table tbody tr.fx-cd-payment-row:hover,
:root[data-formula-theme="dark"] .fx-cd-payment-table tbody tr.fx-cd-payment-row:focus-visible {
  background: rgba(6, 78, 59, 0.25);
}
:root[data-formula-theme="dark"] .fx-cd-payment-table .fx-cd-payment-amt { color: #6ee7b7; }
.fx-cd-rate-card--cancel {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, var(--card) 100%);
}
.fx-cd-rate-card--cancel .fx-cd-rate-value { color: #c2410c; }
:root[data-formula-theme="dark"] .fx-cd-rate-card--cancel {
  border-color: rgba(251, 146, 60, 0.35);
  background: linear-gradient(180deg, rgba(251, 146, 60, 0.12) 0%, var(--card) 100%);
}
:root[data-formula-theme="dark"] .fx-cd-rate-card--cancel .fx-cd-rate-value { color: #fdba74; }
.fx-contacts-table tbody tr.fx-contacts-row-exp-cancelled > td {
  background: #fff7ed;
}
:root[data-formula-theme="dark"] .fx-contacts-table tbody tr.fx-contacts-row-exp-cancelled > td {
  background: rgba(251, 146, 60, 0.12);
}
.fx-cd-rate-card--pay-hold {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, var(--card) 100%);
}
.fx-cd-rate-card--pay-hold .fx-cd-rate-value { color: #b45309; }
.fx-cd-rate-card--pay-hold-rate {
  border-color: #fcd34d;
}
.fx-cd-rate-card--pay-hold-rate .fx-cd-rate-value { color: #b45309; }
:root[data-formula-theme="dark"] .fx-cd-rate-card--pay-hold {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, var(--card) 100%);
}
:root[data-formula-theme="dark"] .fx-cd-rate-card--pay-hold .fx-cd-rate-value,
:root[data-formula-theme="dark"] .fx-cd-rate-card--pay-hold-rate .fx-cd-rate-value { color: #fcd34d; }
.fx-contacts-table tbody tr.fx-contacts-row-payment-hold > td {
  background: #fffbeb;
}
:root[data-formula-theme="dark"] .fx-contacts-table tbody tr.fx-contacts-row-payment-hold > td {
  background: rgba(245, 158, 11, 0.12);
}
@media (max-width: 768px) {
  .fx-cd-rate-grid { grid-template-columns: 1fr; }
  .fx-cd-rate-grid.fx-cd-rate-grid--4 { grid-template-columns: 1fr; }
  .fx-cd-rate-grid.fx-cd-rate-grid--5 { grid-template-columns: 1fr; }
}
.fx-contacts-table .fx-contacts-col-category {
  width: 52px;
  min-width: 48px;
  max-width: 60px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.fx-contacts-table .fx-contacts-col-category .fx-inquiry-cat {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  padding: 2px 5px;
}
.fx-contacts-table .fx-contacts-col-follow-up {
  width: 72px;
  min-width: 68px;
  max-width: 80px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.fx-contacts-table .fx-contacts-col-reservation,
.fx-contacts-table .fx-contacts-col-experience-date {
  width: 96px;
  min-width: 88px;
  max-width: 104px;
  white-space: nowrap;
  font-size: 12px;
}
.fx-contacts-table td.fx-follow-up-today {
  color: #2563eb;
  font-weight: 600;
}
.fx-contacts-table td.fx-follow-up-overdue {
  color: #dc2626;
  font-weight: 600;
}
/* 결제 상태 행: 연한 초록 음영 (기존 등록 회원) */
.fx-contacts-table tbody tr.fx-contacts-row-payment > td {
  background: #ecfdf5;
}
:root[data-formula-theme="dark"] .fx-contacts-table tbody tr.fx-contacts-row-payment > td {
  background: rgba(16, 185, 129, 0.12);
}
/* 신규 등록 상태 행: 연한 파란 음영 */
.fx-contacts-table tbody tr.fx-contacts-row-registered > td {
  background: #eff6ff;
}
:root[data-formula-theme="dark"] .fx-contacts-table tbody tr.fx-contacts-row-registered > td {
  background: rgba(59, 130, 246, 0.12);
}
/* 체험 종료 · 결제 미처리 행 */
.fx-contacts-table tbody tr.fx-contacts-row-post-exp-pending > td {
  background: #fff7ed;
}
:root[data-formula-theme="dark"] .fx-contacts-table tbody tr.fx-contacts-row-post-exp-pending > td {
  background: rgba(249, 115, 22, 0.12);
}
.fx-cd-post-exp-alert,
.fx-cd-post-exp-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
}
:root[data-formula-theme="dark"] .fx-cd-post-exp-alert,
:root[data-formula-theme="dark"] .fx-cd-post-exp-banner {
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(249, 115, 22, 0.14);
  color: #fed7aa;
}
.fx-cd-post-exp-banner {
  margin-bottom: 10px;
}
/* 행 호버: 올린 행 노란 음영 (등록 행 포함, 호버 시 우선) */
.fx-contacts-table tbody tr.fx-contacts-row-detail:hover > td {
  background: #fffbeb;
}
:root[data-formula-theme="dark"] .fx-contacts-table tbody tr.fx-contacts-row-detail:hover > td {
  background: rgba(254, 243, 199, 0.18);
}

.fx-customer-pager {
  display: flex; justify-content: center; gap: 12px; align-items: center;
  margin: 14px 0; font-size: 13px;
}

.fx-customer-empty { padding: 30px 0; }

.fx-customer-resp-toolbar {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 8px;
}
.fx-customer-resp-hint {
  margin: 0 0 12px;
  font-size: 12px;
}
.fx-customer-resp-toolbar .fx-customer-form-select { max-width: 420px; min-width: 220px; }
.fx-customer-controls .fx-customer-form-reg-branch-select { min-width: 200px; max-width: 280px; }
.fx-customer-bulk-register { flex-shrink: 0; }
.fx-customer-bulk-register:disabled,
.fx-customer-bulk-assign-list:disabled,
.fx-customer-bulk-del-list:disabled { opacity: 0.45; cursor: not-allowed; }

.fx-customer-modal .fx-modal-body { max-height: 70vh; overflow-y: auto; }

.fx-customer-response-section {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-sub);
}
.fx-customer-response-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.fx-customer-response-header strong { font-size: 13px; }
.fx-customer-response-meta { font-size: 11px; }
.fx-customer-response-dl {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 6px 14px; margin: 0; font-size: 13px;
}
.fx-customer-response-dl dt {
  color: var(--text-muted); font-weight: 500;
  word-break: keep-all;
}
.fx-customer-response-dl dd {
  margin: 0; color: var(--text); word-break: break-word;
}

.fx-customer-resp-detail-row > td {
  background: var(--bg-sub);
  padding: 14px 20px 16px;
  border-top: 0 !important;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.fx-customer-resp-detail-row .fx-customer-response-dl {
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 10px 20px;
  align-items: start;
  font-size: 13px;
}
.fx-customer-resp-detail-row .fx-customer-response-dl dt,
.fx-customer-resp-detail-row .fx-customer-response-dl dd {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.5;
  padding: 2px 0;
}
.fx-customer-resp-detail-row .fx-customer-response-dl dt {
  font-weight: 500;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  padding-right: 12px;
}

.fx-customer-resp-warning {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.4);
  color: #b45309;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
}
:root[data-formula-theme="dark"] .fx-customer-resp-warning {
  color: #fbbf24;
  background: rgba(245,158,11,0.18);
}

/* 고객 DB 대시보드 */
.fx-customer-dashboard { margin-top: 4px; }
.fx-customer-dashboard .fx-an-kpi-grid { margin-bottom: 8px; }
.fx-cd-month-caption { font-size: 12px; margin: 0 0 14px; }
.fx-customer-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fx-customer-dashboard .fx-res-section { padding: 12px 14px; }
.fx-cd-bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 140px) 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.fx-cd-bar-row:last-child { margin-bottom: 0; }
.fx-cd-bar-label { font-size: 12px; color: var(--text-muted); }
.fx-cd-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-sub);
  overflow: hidden;
}
.fx-cd-action-followup-section { border-color: #c7d2fe; }
.fx-cd-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.fx-cd-action-block {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}
.fx-cd-action-title { font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.fx-cd-action-hint { font-size: 11px; margin: 0 0 10px; line-height: 1.35; }
.fx-cd-action-row {
  display: grid;
  grid-template-columns: minmax(88px, 1.1fr) 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 4px 0;
  cursor: default;
  font-family: inherit;
}
button.fx-cd-action-row--pending {
  cursor: pointer;
  border-radius: 6px;
}
button.fx-cd-action-row--pending:hover { background: #fff7ed; }
.fx-cd-action-row--pending .fx-cd-action-row-fill { background: #f59e0b; }
.fx-cd-action-row--paid .fx-cd-action-row-fill { background: #22c55e; }
.fx-cd-action-row-track {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
}
.fx-cd-action-row-fill { height: 100%; border-radius: 4px; min-width: 2px; }
.fx-cd-action-row-count { font-weight: 700; min-width: 2.5em; text-align: right; }
.fx-cd-action-row-label { color: var(--text-muted); }
@media (max-width: 900px) {
  .fx-cd-action-grid { grid-template-columns: 1fr; }
}
.fx-cd-payment-prior-section .fx-cd-bar-fill {
  background: linear-gradient(90deg, #86efac, #15803d);
}
.fx-cd-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  min-width: 2px;
}
.fx-cd-bar-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 2.5em;
  text-align: right;
}
.fx-cd-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.fx-cd-trend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}
.fx-cd-trend-swatch--new { background: #6366f1; }
.fx-cd-trend-swatch--contact { background: #22c55e; }
.fx-cd-trend-swatch--rate { background: #7c3aed; border-radius: 50%; }
.fx-cd-trend-chart .fx-fd-bars { min-height: 140px; }
.fx-cd-trend-chart-wrap {
  position: relative;
  padding-top: 4px;
}
.fx-cd-trend-rate-svg {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 22px;
  height: 100px;
  width: calc(100% - 16px);
  pointer-events: none;
  z-index: 2;
}
.fx-cd-trend-col { min-width: 0; position: relative; z-index: 1; }
.fx-cd-trend-rate-val {
  min-height: 16px;
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  line-height: 1.2;
  margin-bottom: 2px;
}
.fx-cd-trend-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100px;
}
.fx-cd-trend-bar {
  flex: 1;
  max-width: 14px;
  border-radius: 3px 3px 0 0;
  min-height: 0;
}
.fx-cd-trend-bar--new { background: #6366f1; }
.fx-cd-trend-bar--contact { background: #22c55e; }

/* 고객 DB — 문자 발송 (템플릿 · 캠페인) */
.fx-csms-wrap {
  padding: 0 4px 20px;
  max-width: 1200px;
}
.fx-csms-legal {
  font-size: 12px;
  margin: 0 0 14px;
  line-height: 1.45;
}

/* 템플릿 편집 (사이드바, + 새 템플릿 / 편집 시에만 표시) */
.fx-csms-editor-panel.is-hidden { display: none !important; }
.fx-csms-editor-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.fx-csms-editor-panel--aside .fx-csms-body {
  min-height: 220px;
}
.fx-csms-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.fx-csms-template-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.fx-csms-template-toolbar .fx-csms-new-template { flex: 1; min-width: 0; }
.fx-csms-active-template { padding-bottom: 12px; }
.fx-csms-selected-hint {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.fx-csms-editor-title {
  font-size: 17px;
  font-weight: 700;
}
.fx-csms-editor-hint { font-size: 13px; }
.fx-csms-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-muted);
}
.fx-csms-input-title {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 16px;
  border-radius: 8px;
}
.fx-csms-body {
  display: block;
  width: 100%;
  min-height: min(42vh, 380px);
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.65;
  font-family: inherit;
  resize: vertical;
  border-radius: 8px;
  box-sizing: border-box;
}
.fx-csms-editor-actions {
  margin-top: 14px;
  gap: 10px;
}
.fx-csms-editor-actions .btn {
  min-height: 42px;
  padding: 10px 22px;
  font-size: 14px;
}

.fx-csms-control-lg {
  min-height: 42px;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
}

.fx-csms-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) 1fr;
  gap: 20px;
  align-items: start;
}
.fx-csms-aside {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}
.fx-csms-aside-head { margin-bottom: 12px; }
.fx-csms-folder-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.fx-csms-folder-row select { flex: 1; min-width: 0; }
.fx-csms-new-template {
  width: 100%;
  margin-top: 6px;
  min-height: 40px;
}
.fx-csms-template-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(50vh, 480px);
  overflow-y: auto;
}
.fx-csms-template-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fx-csms-template-card:hover { border-color: var(--primary); }
.fx-csms-template-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.fx-csms-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.fx-csms-card-preview { font-size: 12px; line-height: 1.4; }
.fx-csms-card-date { font-size: 11px; margin-top: 8px; }
.fx-csms-empty { font-size: 13px; margin: 10px 0; }
.fx-csms-main .fx-csms-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.fx-csms-main .fx-csms-section:last-child { border-bottom: 0; }
.fx-csms-main .fx-customer-label {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}
.fx-csms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.fx-csms-actions .btn {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}
.fx-csms-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.fx-csms-manual-panel {
  margin: 16px 0 14px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.fx-csms-manual-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.fx-csms-manual-title {
  font-size: 14px;
  font-weight: 700;
}
.fx-csms-manual-hint { font-size: 12px; }
.fx-csms-manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}
@media (min-width: 720px) {
  .fx-csms-manual-grid {
    grid-template-columns: 1fr 1fr 1fr minmax(140px, 180px);
  }
}
.fx-csms-manual-actions { margin-top: 10px; }
.fx-csms-row-manual td:first-child + td { white-space: nowrap; }
.fx-csms-row-remove {
  margin-left: 6px;
  min-width: 28px;
  padding: 2px 8px;
  line-height: 1.2;
  vertical-align: middle;
}
.fx-csms-recipients-table { font-size: 13px; }
.fx-csms-msg-preview {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-csms-count { font-size: 13px; margin: 10px 0 0; }
.fx-csms-preview {
  margin: 0;
  padding: 16px 18px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 120px;
}
.fx-csms-send-section { margin-bottom: 8px; }
.fx-csms-parallels-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #c9a227;
  background: rgba(201, 162, 39, 0.12);
  font-size: 13px;
  line-height: 1.5;
}
.fx-csms-phonelink-callout {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}
.fx-csms-parallels-url {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}
.fx-csms-parallels-url code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
}
.fx-csms-phonelink-guide {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.fx-csms-phonelink-guide summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.fx-csms-phonelink-body {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}
.fx-csms-phonelink-steps {
  margin: 0;
  padding-left: 1.2rem;
}
.fx-csms-phonelink-steps li { margin-bottom: 6px; }
.fx-csms-send-actions .btn-primary {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
}
.fx-csms-send-note {
  font-size: 13px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  line-height: 1.45;
}
.fx-csms-send-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 720px) {
  .fx-csms-send-modes { grid-template-columns: 1fr; }
}
.fx-csms-send-mode-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.fx-csms-send-mode-card strong { display: block; margin-bottom: 6px; font-size: 14px; }
.fx-csms-send-mode-card p { font-size: 12px; margin: 0 0 10px; line-height: 1.4; }
.fx-csms-send-mode-card--auto { border-color: var(--primary); }
.fx-csms-send-hint {
  font-size: 12px;
  margin: 10px 0 0;
  line-height: 1.45;
}
.fx-csms-send-hint code { font-size: 11px; }
.fx-csms-send-row {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 960px) {
  .fx-csms-body { min-height: 280px; }
  .fx-csms-layout { grid-template-columns: 1fr; }
  .fx-csms-template-grid { max-height: 240px; }
  .fx-csms-send-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .fx-customer-dashboard-grid { grid-template-columns: 1fr; }
  .fx-cd-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .fx-cd-bar-count { text-align: left; }
}

.btn-xs {
  font-size: 11px; padding: 3px 8px; height: 24px; line-height: 1;
  border-radius: 4px;
}

/* Mobile */
@media (max-width: 768px) {
  .fx-customer-wrap { padding: 10px 12px; }
  .fx-customer-controls { width: 100%; margin-left: 0; }
  .fx-customer-brand-select,
  .fx-customer-form-select,
  .fx-inquiry-toolbar-branch-select { min-width: 0; width: 100%; }
  .fx-customer-filterbar input[type="search"],
  .fx-customer-filterbar select,
  .fx-contact-search-bar input[type="search"] { min-width: 0; flex: 1 1 140px; }
  .fx-filter-bar-actions { margin-left: 0; width: 100%; }

  /* 카드형 변환 */
  .fx-customer-table-wrap { border: 0; }
  .fx-customer-table thead { display: none; }
  .fx-customer-table,
  .fx-customer-table tbody,
  .fx-customer-table tr,
  .fx-customer-table td { display: block; width: 100%; box-sizing: border-box; }
  .fx-customer-table tr {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; margin-bottom: 10px; background: var(--card);
  }
  .fx-customer-table tbody td {
    border: 0; padding: 4px 0; display: flex; gap: 8px;
    justify-content: space-between; align-items: center;
  }
  .fx-customer-table tbody td::before {
    content: attr(data-label);
    font-size: 11px; color: var(--text-muted);
    flex-shrink: 0;
  }
  .fx-customer-col-actions { justify-content: flex-end; text-align: right; }
  .fx-customer-col-check { display: none !important; }
}

/* 지점 문의 (전화/워크인) */
.fx-inquiry-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.fx-inquiry-table { min-width: 1280px; table-layout: fixed; width: 100%; }
.fx-inquiry-entry { margin-bottom: 20px; }
.fx-inquiry-entry-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.fx-inquiry-entry-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fx-inquiry-entry-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.fx-inquiry-list-title {
  margin: 8px 0 10px; font-size: 15px; font-weight: 600;
}
.fx-inquiry-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  box-sizing: border-box;
}
.fx-inquiry-table--entry input.fx-inquiry-input,
.fx-inquiry-table--entry select.fx-inquiry-input {
  min-width: 72px;
}
.fx-inquiry-entry-row { background: #fffbeb; }
:root[data-formula-theme="dark"] .fx-inquiry-entry-row { background: rgba(251, 191, 36, 0.08); }
.fx-inquiry-row-editing { background: #eff6ff !important; }
:root[data-formula-theme="dark"] .fx-inquiry-row-editing { background: rgba(59, 130, 246, 0.12) !important; }
.fx-inquiry-entry-wrap { margin-bottom: 4px; }
.fx-inquiry-table thead th {
  background: #f97316;
  color: #fff;
  font-size: 12px;
  padding: 8px 10px;
  white-space: nowrap;
}
:root[data-formula-theme="dark"] .fx-inquiry-table thead th {
  background: #c2410c;
}
.fx-inquiry-table tbody td {
  font-size: 12px;
  padding: 8px 10px;
  white-space: nowrap;
  vertical-align: middle;
  border-top: none;
  overflow: visible;
  text-overflow: clip;
}
.fx-contacts-table tbody td.fx-contacts-col-memo {
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-contacts-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.fx-contacts-table.fx-contacts-table--experience th.fx-contacts-col-experience-date,
.fx-contacts-table.fx-contacts-table--experience td.fx-contacts-col-experience-date {
  border-left: 1px solid var(--border);
}
.fx-contacts-table.fx-contacts-table--experience th.fx-contacts-col-status,
.fx-contacts-table.fx-contacts-table--experience td.fx-contacts-col-status {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.fx-inquiry-table tbody tr.fx-inquiry-row-registered {
  background: #ecfdf5;
}
:root[data-formula-theme="dark"] .fx-inquiry-table tbody tr.fx-inquiry-row-registered {
  background: rgba(16, 185, 129, 0.12);
}
.fx-inquiry-notes {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-inquiry-phone {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.fx-inquiry-phone:hover { text-decoration: underline; }
.fx-inquiry-tm-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 11px;
}
.fx-inquiry-tm-cell .btn-link { padding: 0; font-size: 11px; }
.fx-inquiry-col-actions { white-space: nowrap; text-align: right; }
.fx-inquiry-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.fx-inquiry-badge-pending { background: #f1f5f9; color: #64748b; }
.fx-inquiry-badge-hold { background: #dbeafe; color: #1d4ed8; }
.fx-inquiry-badge-registered { background: #dcfce7; color: #15803d; }
.fx-inquiry-badge-rejected { background: #fee2e2; color: #b91c1c; }
.fx-inquiry-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.fx-inquiry-cat-health { background: #dcfce7; color: #15803d; }
.fx-inquiry-cat-pt { background: #ffedd5; color: #c2410c; }
.fx-inquiry-cat-group_pt { background: #e0e7ff; color: #4338ca; }
:root[data-formula-theme="dark"] .fx-inquiry-cat-group_pt { background: rgba(99, 102, 241, 0.22); color: #a5b4fc; }
.fx-inquiry-cat-other { background: #f1f5f9; color: #475569; }

.fx-lead-path-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.fx-lead-path-ad_direct { background: #e0f2fe; color: #0369a1; }
.fx-lead-path-ad_ig { background: #fce7f3; color: #be185d; }
.fx-lead-path-ad_meta { background: #dbeafe; color: #1d4ed8; }
.fx-lead-path-phone { background: #fef3c7; color: #b45309; }
.fx-lead-path-walkin { background: #ede9fe; color: #6d28d9; }
:root[data-formula-theme="dark"] .fx-lead-path-ad_direct { background: rgba(14, 165, 233, 0.22); color: #7dd3fc; }
:root[data-formula-theme="dark"] .fx-lead-path-ad_ig { background: rgba(236, 72, 153, 0.22); color: #f9a8d4; }
:root[data-formula-theme="dark"] .fx-lead-path-ad_meta { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
:root[data-formula-theme="dark"] .fx-lead-path-phone { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }
:root[data-formula-theme="dark"] .fx-lead-path-walkin { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
.fx-lead-path-blog { background: #ecfdf5; color: #047857; }
.fx-lead-path-flyer { background: #fff7ed; color: #c2410c; }
.fx-lead-path-place { background: #f0fdf4; color: #15803d; }
.fx-lead-path-banner { background: #fef2f2; color: #b91c1c; }
.fx-lead-path-signboard { background: #f5f3ff; color: #6d28d9; }
.fx-lead-path-naver { background: #e8f5e9; color: #2e7d32; }
:root[data-formula-theme="dark"] .fx-lead-path-blog { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
:root[data-formula-theme="dark"] .fx-lead-path-flyer { background: rgba(249, 115, 22, 0.22); color: #fdba74; }
:root[data-formula-theme="dark"] .fx-lead-path-place { background: rgba(34, 197, 94, 0.22); color: #86efac; }
:root[data-formula-theme="dark"] .fx-lead-path-banner { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
:root[data-formula-theme="dark"] .fx-lead-path-signboard { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
:root[data-formula-theme="dark"] .fx-lead-path-naver { background: rgba(46, 125, 50, 0.22); color: #86efac; }

.fx-inquiry-type-badge,
.fx-inflow-channel-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.fx-inquiry-type-phone { background: #fef3c7; color: #b45309; }
.fx-inquiry-type-walkin { background: #ede9fe; color: #6d28d9; }
.fx-inquiry-type-naver { background: #dcfce7; color: #15803d; }
.fx-inflow-blog { background: #ecfdf5; color: #047857; }
.fx-inflow-flyer { background: #fff7ed; color: #c2410c; }
.fx-inflow-place { background: #f0fdf4; color: #15803d; }
.fx-inflow-banner { background: #fef2f2; color: #b91c1c; }
.fx-inflow-signboard { background: #f5f3ff; color: #6d28d9; }
.fx-inflow-naver { background: #e8f5e9; color: #2e7d32; }
.fx-inquiry-path-cell { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
:root[data-formula-theme="dark"] .fx-inquiry-type-phone { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }
:root[data-formula-theme="dark"] .fx-inquiry-type-walkin { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
:root[data-formula-theme="dark"] .fx-inquiry-type-naver { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
:root[data-formula-theme="dark"] .fx-inflow-blog { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
:root[data-formula-theme="dark"] .fx-inflow-flyer { background: rgba(249, 115, 22, 0.22); color: #fdba74; }
:root[data-formula-theme="dark"] .fx-inflow-place { background: rgba(34, 197, 94, 0.22); color: #86efac; }
:root[data-formula-theme="dark"] .fx-inflow-banner { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
:root[data-formula-theme="dark"] .fx-inflow-signboard { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
:root[data-formula-theme="dark"] .fx-inflow-naver { background: rgba(46, 125, 50, 0.22); color: #a5d6a7; }

.fx-naver-import-modal .fx-naver-import-table-wrap {
  overflow-x: auto;
  max-height: 52vh;
  margin-top: 8px;
}
.fx-naver-import-table { font-size: 12px; }
.fx-naver-import-table th,
.fx-naver-import-table td { vertical-align: top; padding: 8px 6px; }
.fx-naver-import-row-off { opacity: 0.45; }
.fx-naver-import-conflict {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
}
.fx-naver-import-new { color: #15803d; font-weight: 600; }
.fx-naver-import-ambiguous { font-size: 10px; color: #b45309; }
.fx-naver-import-cancelled { color: #b91c1c; font-weight: 600; }
.fx-naver-import-radio {
  display: block;
  font-size: 11px;
  margin: 2px 0;
  white-space: nowrap;
}
.fx-naver-import-radio-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.fx-naver-import-candidate {
  display: block;
  margin-top: 4px;
  max-width: 100%;
  font-size: 11px;
}
.fx-naver-import-preview-meta { margin: 0 0 8px; font-size: 13px; }

.fx-naver-inquiry-meta {
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--fx-border, #e5e7eb);
}
.fx-naver-meta-line {
  font-size: 11px;
  line-height: 1.45;
  color: var(--fx-text-muted, #6b7280);
}
.fx-naver-meta-k {
  display: inline-block;
  min-width: 2.2em;
  font-weight: 600;
  color: #2e7d32;
}
.fx-inquiry-consultation-text {
  font-size: 12px;
  line-height: 1.4;
}
.fx-naver-inquiry-meta-section .fx-naver-meta-row {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 4px;
}
.fx-naver-inquiry-meta-section .fx-naver-meta-label {
  display: inline-block;
  min-width: 4.5em;
  font-weight: 600;
  color: #2e7d32;
}
:root[data-formula-theme="dark"] .fx-naver-meta-k,
:root[data-formula-theme="dark"] .fx-naver-inquiry-meta-section .fx-naver-meta-label {
  color: #86efac;
}
:root[data-formula-theme="dark"] .fx-naver-import-conflict {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}

/* 통합 문의·고객 표 컬럼 폭 (체크 / 지점 / 문의경로 / … / 담당) */
.fx-contacts-table th.fx-customer-col-check,
.fx-contacts-table td.fx-customer-col-check {
  width: 36px;
  min-width: 36px;
  max-width: 40px;
  padding-left: 6px;
  padding-right: 6px;
  box-sizing: border-box;
}
.fx-contacts-table th:nth-child(2),
.fx-contacts-table td:nth-child(2) { width: 92px; min-width: 72px; max-width: 108px; }
.fx-contacts-table th:nth-child(3),
.fx-contacts-table td:nth-child(3) { width: 140px; min-width: 120px; }
.fx-contacts-table th:nth-child(4),
.fx-contacts-table td:nth-child(4) { width: 96px; min-width: 88px; }
.fx-contacts-table th:nth-child(5),
.fx-contacts-table td:nth-child(5) { width: 88px; min-width: 72px; }
.fx-contacts-table th:nth-child(6),
.fx-contacts-table td:nth-child(6) { width: 108px; min-width: 96px; max-width: 116px; }
.fx-contacts-table .fx-contacts-col-memo {
  width: 120px;
  min-width: 100px;
  max-width: 128px;
  overflow: hidden;
}
.fx-contacts-table .fx-contacts-col-memo .fx-inquiry-notes-cell,
.fx-contacts-table .fx-contacts-col-memo .fx-inquiry-notes,
.fx-contacts-table .fx-contacts-col-memo .fx-inquiry-consultation-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-contacts-table .fx-contacts-col-status {
  width: 80px;
  min-width: 72px;
  max-width: 88px;
  padding-left: 4px;
  padding-right: 4px;
}
.fx-contacts-table .fx-contacts-col-status .fx-contact-status-select {
  width: 100%;
  padding: 2px 16px 2px 4px;
  font-size: 11px;
}
.fx-contacts-table .fx-contacts-col-tm {
  width: 108px;
  min-width: 96px;
}
.fx-contacts-table .fx-contacts-col-assignee {
  width: 88px;
  min-width: 72px;
}
.fx-contacts-table .fx-contacts-col-payment {
  width: 88px;
  min-width: 72px;
}

.fx-contacts-table .fx-contacts-col-lead-path {
  min-width: 108px;
  white-space: nowrap;
}
.fx-contacts-table tbody tr.fx-contacts-row-detail { cursor: pointer; }
.fx-contact-detail-modal .fx-modal-body { max-height: 75vh; overflow-y: auto; }
.fx-contact-detail-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.fx-contact-detail-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.fx-contact-detail-section h5 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.fx-contact-detail-form-source .fx-form-source-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.fx-contact-detail-form-source .fx-form-source-at {
  color: var(--text-muted);
  font-size: 13px;
}
.fx-contact-detail-form-response .fx-customer-response-section {
  margin-top: 0;
  padding: 12px 14px;
  background: var(--bg-sub);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.fx-contact-detail-form-response .fx-customer-response-dl {
  margin: 0;
}
.fx-contact-detail-meta { margin-bottom: 12px; }
.fx-tm-undo-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 12px;
}
.fx-tm-undo-msg { flex: 1; min-width: 180px; }
.fx-tm-undo-bar--fixed {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  max-width: min(520px, calc(100vw - 24px));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.fx-tm-modal-hint {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.4;
}
.fx-contact-detail-tm-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.fx-contact-detail-tm-actions .fx-tm-clear {
  border-color: #fca5a5;
  color: #b91c1c;
}
.fx-inquiry-tm-cell .fx-tm-clear { margin-left: 2px; }
.fx-contact-detail-tm { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fx-contact-detail-tm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.fx-contact-detail-tm-label { min-width: 56px; color: var(--text-muted); font-weight: 500; }
.fx-contacts-table tbody tr.fx-contacts-row-form td:nth-child(5) { font-weight: 600; }

.fx-inquiry-modal { max-width: 560px; width: 96vw; }
.fx-inquiry-modal-body { max-height: 70vh; overflow-y: auto; }
.fx-inquiry-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.fx-inquiry-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.fx-inquiry-form-grid input,
.fx-inquiry-form-grid select,
.fx-inquiry-form-grid textarea {
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.fx-inquiry-form-grid textarea { height: auto; padding: 8px 10px; resize: vertical; }
.fx-i-notes-label { grid-column: 1 / -1; }

@media (max-width: 768px) {
  .fx-inquiry-form-grid { grid-template-columns: 1fr; }
}

/* ───────────────── Naver SearchAd 운영 (.fx-na-*) ───────────────── */
.fx-na-root .fx-na-toolbar { align-items: center; }
.fx-na-root .fx-na-toolbar .form-control { width: auto; }
.fx-na-tree-table tbody tr { transition: background 0.12s; }
.fx-na-tree-table tbody tr:hover { background: rgba(99, 102, 241, 0.04); }
.fx-na-tree-table tbody tr[data-na-level="campaign"] td { background: rgba(99, 102, 241, 0.04); font-weight: 600; }
.fx-na-tree-table tbody tr[data-na-level="adgroup"] td { background: rgba(99, 102, 241, 0.02); }
.fx-na-tree-table tbody tr[data-na-level="keyword"] td,
.fx-na-tree-table tbody tr[data-na-level="ad"] td { font-weight: 400; }
.fx-na-tree-table .btn-xs { padding: 2px 6px; font-size: 11px; line-height: 1.4; }
:root[data-formula-theme="dark"] .fx-na-tree-table tbody tr[data-na-level="campaign"] td { background: rgba(99, 102, 241, 0.12); }
:root[data-formula-theme="dark"] .fx-na-tree-table tbody tr[data-na-level="adgroup"] td { background: rgba(99, 102, 241, 0.06); }
@media (max-width: 1024px) {
  .fx-na-root .fx-marketing-crm-grid[style*="360px"] { grid-template-columns: 1fr !important; }
}

/* ───────────────── Design Studio (.fx-ds-* / .fx-dc-*) — premium ───────────────── */
.fx-ds-loading { padding: 64px; text-align: center; color: var(--text-muted); font-family: 'Newsreader', serif; font-size: 17px; }

/* Home — Claude Design 스타일 (따뜻한 에디토리얼 톤) */
.fx-ds-home {
  --ds-surface: #ffffff;
  --ds-ink: #2b2622;
  --ds-muted: #8a8076;
  --ds-line: #ebe4d9;
  --ds-soft: #f6f2ea;
  --ds-accent: #cf8a64;
  --ds-accent-strong: #bb724b;
  max-width: none; margin: 0; width: 100%; padding: 22px clamp(20px, 4vw, 64px) 64px; color: var(--ds-ink);
  font-family: 'Noto Sans KR', sans-serif;
  background:
    radial-gradient(1100px 380px at 50% -160px, #ffffff 0%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #faf8f3 0%, #f4f0e8 100%);
  border: 0; border-radius: 0;
}
/* 디자인 탭: 페이지 좌우 패딩 제거(풀폭), 상단 툴바만 들여쓰기 유지 */
body.fx-design-tab #page-dashboard .page-content { padding-left: 0; padding-right: 0; }
body.fx-design-tab #page-dashboard .page-content > #dashboard-context-toolbar,
body.fx-design-tab #page-dashboard .page-content > #branch-selector,
body.fx-design-tab #page-dashboard .page-content > #bemove-view-as-bar { padding-left: 24px; padding-right: 24px; }
.fx-ds-topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 2px; }
.fx-ds-brandmark { display: flex; align-items: center; gap: 9px; font-family: 'Newsreader', serif; font-size: 20px; font-weight: 600; color: var(--ds-ink); letter-spacing: .2px; }
.fx-ds-brandmark-dot { width: 18px; height: 18px; border-radius: 6px; background: linear-gradient(135deg, var(--ds-accent), #e6b48f); box-shadow: 0 2px 7px rgba(207,138,100,.45); }
.fx-ds-brandmark-beta { font-family: 'Noto Sans KR', sans-serif; font-size: 10px; font-weight: 700; color: var(--ds-muted); border: 1px solid var(--ds-line); border-radius: 999px; padding: 1px 8px; }
.fx-ds-home-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-ds-ghost-btn { font-size: 13px; font-weight: 600; color: var(--ds-ink); background: transparent; border: 1px solid var(--ds-line); border-radius: 999px; padding: 7px 15px; cursor: pointer; transition: all .15s; }
.fx-ds-ghost-btn:hover { background: #fff; border-color: #d8cfc1; box-shadow: 0 1px 4px rgba(0,0,0,.05); }

.fx-ds-hero { text-align: center; padding: 46px 16px 26px; }
.fx-ds-hero-title { font-family: 'Newsreader', 'Nanum Myeongjo', serif; font-weight: 500; font-size: clamp(34px, 5vw, 48px); line-height: 1.08; color: var(--ds-ink); letter-spacing: -.5px; }
.fx-ds-hero-sub { margin-top: 14px; font-size: 14.5px; line-height: 1.6; color: var(--ds-muted); }

.fx-ds-prompt { max-width: 760px; margin: 0 auto 38px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 24px; box-shadow: 0 14px 44px rgba(43,38,34,.09), 0 2px 6px rgba(43,38,34,.04); padding: 18px 18px 12px; transition: box-shadow .2s; }
.fx-ds-prompt:focus-within { box-shadow: 0 20px 56px rgba(43,38,34,.13), 0 0 0 1px var(--ds-accent); }
.fx-ds-prompt-input { width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-family: 'Noto Sans KR', sans-serif; font-size: 15.5px; line-height: 1.6; color: var(--ds-ink); min-height: 56px; padding: 4px 8px; }
.fx-ds-prompt-input::placeholder { color: #b6ad9f; }
.fx-ds-prompt-bar { display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.fx-ds-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--ds-soft); border: 1px solid var(--ds-line); border-radius: 999px; padding: 6px 12px; }
.fx-ds-pill-label { font-size: 11px; font-weight: 700; color: var(--ds-muted); }
.fx-ds-pill-select { border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--ds-ink); cursor: pointer; outline: 0; font-family: inherit; }
.fx-ds-pill-input { flex: 0 1 230px; min-width: 110px; background: var(--ds-soft); border: 1px solid var(--ds-line); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--ds-ink); outline: 0; font-family: inherit; }
.fx-ds-pill-input::placeholder { color: #b6ad9f; }
.fx-ds-pill-input:focus { border-color: #d8cfc1; background: #fff; }
.fx-ds-prompt-spacer { flex: 1; }
.fx-ds-prompt-submit { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: 19px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ds-accent), var(--ds-accent-strong)); box-shadow: 0 6px 16px rgba(187,114,75,.42); transition: transform .12s, box-shadow .2s, opacity .2s; }
.fx-ds-prompt-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(187,114,75,.52); }
.fx-ds-prompt-submit:disabled { opacity: .55; cursor: default; transform: none; }

.fx-ds-tpl-section { text-align: center; margin-bottom: 44px; }
.fx-ds-tpl-caption { font-family: 'Newsreader', serif; font-size: 15px; color: var(--ds-muted); margin-bottom: 20px; }
.fx-ds-tpl-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.fx-ds-tpl-card { width: 150px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 14px; cursor: pointer; overflow: hidden; padding-bottom: 12px; box-shadow: 0 6px 18px rgba(43,38,34,.07); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; }
.fx-ds-tpl-row .fx-ds-tpl-card:nth-child(odd) { transform: rotate(-2deg); }
.fx-ds-tpl-row .fx-ds-tpl-card:nth-child(even) { transform: rotate(1.8deg); }
.fx-ds-tpl-row .fx-ds-tpl-card:hover { transform: rotate(0deg) translateY(-7px); box-shadow: 0 18px 38px rgba(43,38,34,.18); }
.fx-ds-tpl-card strong { display: block; font-size: 12.5px; padding: 0 8px; color: var(--ds-ink); font-weight: 700; }
.fx-ds-tpl-thumb { height: 90px; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #fff; margin-bottom: 10px; }
.fx-ds-tpl-business_card { background: linear-gradient(135deg,#6366f1,#0ea5e9); }
.fx-ds-tpl-flyer { background: linear-gradient(135deg,#0f172a,#334155); }
.fx-ds-tpl-x_banner { background: linear-gradient(180deg,#6366f1,#0ea5e9); }
.fx-ds-tpl-place_banner { background: linear-gradient(135deg,#f59e0b,#ef4444); }
.fx-ds-tpl-smartplace { background: linear-gradient(135deg,#10b981,#0ea5e9); }
.fx-ds-tpl-square { background: linear-gradient(135deg,#8b5cf6,#ec4899); }

.fx-ds-recent { max-width: none; margin: 0; }
.fx-ds-recent-head { display: flex; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--ds-line); }
.fx-ds-recent-head span { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 600; color: var(--ds-ink); }
.fx-ds-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.fx-ds-home-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--ds-line); background: var(--ds-surface); cursor: pointer; box-shadow: 0 2px 8px rgba(43,38,34,.05); transition: transform .15s, box-shadow .15s; }
.fx-ds-home-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(43,38,34,.13); }
.fx-ds-home-card strong { font-size: 13.5px; color: var(--ds-ink); }
.fx-ds-home-card .text-muted { font-size: 11.5px; color: var(--ds-muted); }
.fx-ds-home-card-icon { font-size: 26px; height: 110px; display: flex; align-items: center; justify-content: center; background: var(--ds-soft); border-radius: 10px; }
.fx-ds-home-card-thumb { width: 100%; height: 110px; border-radius: 10px; background-size: cover; background-position: center; background-color: #ece6dc; }
.fx-ds-home-del { position: absolute; top: 8px; right: 8px; border: 0; background: rgba(255,255,255,.92); border-radius: 8px; cursor: pointer; font-size: 13px; padding: 4px 7px; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.fx-ds-home-card:hover .fx-ds-home-del { opacity: 1; }

/* Home — 다크 테마 */
:root[data-formula-theme="dark"] .fx-ds-home {
  --ds-surface: #1c1a17; --ds-ink: #f3ede3; --ds-muted: #9a9082; --ds-line: #2e2a24; --ds-soft: #23201b;
  background: linear-gradient(180deg, #1a1714 0%, #141210 100%); border-color: #2a2620;
}

/* Studio shell — premium */
.fx-ds-studio { display: flex; flex-direction: column; height: calc(100vh - 130px); min-height: 560px; font-family: 'Noto Sans KR', sans-serif; }
.fx-ds-studio-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 12px rgba(15,23,42,.05); }
.fx-ds-studio-title { font-weight: 700; font-size: 14.5px; letter-spacing: -.2px; border-radius: 6px; }
.fx-ds-studio-title:hover { background: rgba(204,122,78,.12); box-shadow: 0 0 0 4px rgba(204,122,78,.12); }
.fx-ds-title-input { font-weight: 700; font-size: 14.5px; letter-spacing: -.2px; color: #2b2722; background: #fff; border: 1px solid #cc7a4e; border-radius: 6px; padding: 2px 8px; min-width: 140px; max-width: 320px; outline: none; }
/* QR 코드 모달(마케팅 QR 연동) */
.fx-qrm-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.fx-qrm-tabs button { flex: 1; padding: 8px 6px; font-size: 13px; font-weight: 600; border: 1px solid #e2cdbb; background: #fff; color: #6b5d4d; border-radius: 8px; cursor: pointer; }
.fx-qrm-tabs button.is-on { background: #cc7a4e; color: #fff; border-color: #cc7a4e; }
.fx-qrm-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.fx-qrm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #e7dccf; background: #fff; border-radius: 10px; cursor: pointer; text-align: left; }
.fx-qrm-item:hover { border-color: #cc7a4e; background: #fdf6f0; }
.fx-qrm-item img { width: 40px; height: 40px; flex: none; background: #fff; border-radius: 6px; }
.fx-qrm-item-t { display: flex; flex-direction: column; min-width: 0; }
.fx-qrm-item-t strong { font-size: 13px; color: #2b2722; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-qrm-item-t em { font-size: 11px; color: #94857a; font-style: normal; }
/* 기능 권한 매트릭스 */
.fx-pm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fx-pm-head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fx-pm-scroll { overflow-x: auto; border: 1px solid rgba(148,163,184,.18); border-radius: 12px; }
.fx-pm-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.fx-pm-table th { text-align: center; padding: 10px 12px; color: #94a3b8; font-weight: 700; border-bottom: 1px solid rgba(148,163,184,.25); white-space: nowrap; background: rgba(148,163,184,.06); }
.fx-pm-table th:first-child, .fx-pm-table th:nth-child(2) { text-align: left; }
.fx-pm-table td { padding: 8px 12px; border-bottom: 1px solid rgba(148,163,184,.1); vertical-align: middle; }
.fx-pm-table tr:last-child td { border-bottom: 0; }
.fx-pm-area { font-weight: 700; color: var(--text, #cbd5e1); white-space: nowrap; }
.fx-pm-feat { white-space: nowrap; }
.fx-pm-feat span { display: block; color: var(--text, #e2e8f0); }
.fx-pm-feat code { font-size: 11px; color: #94a3b8; }
.fx-pm-td { text-align: center; }
.fx-pm-cell { min-width: 58px; border: 1px solid transparent; border-radius: 8px; font-size: 12.5px; font-weight: 700; padding: 6px 12px; cursor: pointer; transition: filter .1s; }
.fx-pm-cell:hover { filter: brightness(1.12); }
.fx-pm-cell.is-allow { background: rgba(22,163,74,.14); color: #22c55e; border-color: rgba(22,163,74,.35); }
.fx-pm-cell.is-deny { background: rgba(148,163,184,.1); color: #94a3b8; border-color: rgba(148,163,184,.25); }
.fx-pm-cell.is-ov { box-shadow: 0 0 0 2px rgba(99,102,241,.5); } /* 직접 지정된 셀 강조 */
/* 설정 페이지 정돈: 폭 모음 + 그룹 헤더 + 접이식 */
.settings-page { max-width: 1040px; margin: 0 auto; }
.settings-page-head { margin: 4px 0 22px; }
.settings-page-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.settings-page-head p { margin: 0; font-size: 13px; }
.settings-group { margin: 0 0 28px; }
.settings-group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(148,163,184,.22); }
.settings-group-title { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.settings-group-tag { font-size: 11px; font-weight: 700; color: #6366f1; background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.25); border-radius: 999px; padding: 2px 9px; }
.settings-group-body > .card { margin-bottom: 14px; }
.settings-group-body > .card:last-child { margin-bottom: 0; }
/* 접이식 카드(개발/운영 안내 등) */
.settings-collapse { padding: 0; overflow: hidden; }
.settings-collapse > .settings-collapse-summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-size: 16px; font-weight: 700; }
.settings-collapse > .settings-collapse-summary::-webkit-details-marker { display: none; }
.settings-collapse > .settings-collapse-summary::after { content: '▾'; color: #94a3b8; font-size: 13px; transition: transform .15s; }
.settings-collapse[open] > .settings-collapse-summary::after { transform: rotate(180deg); }
.settings-collapse-summary:hover { background: rgba(148,163,184,.06); }
.settings-collapse-tag { font-size: 11px; font-weight: 700; color: #94a3b8; }
.settings-collapse-body { padding: 4px 18px 18px; border-top: 1px solid rgba(148,163,184,.16); }
/* 관리자 활동 인사이트 */
.admin-insight-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-insight-periods { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.admin-insight-period { border: 1px solid #334155; background: transparent; color: #94a3b8; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.admin-insight-period.is-on { background: #fff; color: #0f172a; border-color: #fff; }
.admin-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-kpi { border: 1px solid rgba(148,163,184,.22); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: rgba(148,163,184,.05); }
.admin-kpi-label { font-size: 13px; color: #94a3b8; }
.admin-kpi-value { font-size: 26px; font-weight: 800; color: var(--text, #e2e8f0); }
.admin-kpi-value em { font-size: 14px; font-weight: 600; color: #94a3b8; font-style: normal; margin-left: 3px; }
.admin-kpi-up { border-color: rgba(34,197,94,.4); } .admin-kpi-up .admin-kpi-value { color: #4ade80; }
.admin-kpi-down .admin-kpi-value { color: #f87171; }
.admin-insight-chart { border: 1px solid rgba(148,163,184,.18); border-radius: 14px; padding: 16px; margin-bottom: 4px; }
.admin-bars { display: flex; align-items: flex-end; gap: 8px; min-height: 150px; padding-top: 6px; }
.admin-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 28px; }
.admin-bar-val { font-size: 12px; font-weight: 700; color: var(--text, #cbd5e1); }
.admin-bar { width: 60%; max-width: 46px; min-height: 3px; background: linear-gradient(180deg, #818cf8, #6366f1); border-radius: 6px 6px 0 0; }
.admin-bar-lbl { font-size: 11px; color: #94a3b8; }
.admin-insight-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-insight-table th { text-align: left; padding: 8px 10px; color: #94a3b8; font-weight: 700; border-bottom: 1px solid rgba(148,163,184,.25); white-space: nowrap; position: sticky; top: 0; background: var(--card-bg, #fff); z-index: 1; }
.admin-insight-table td { padding: 9px 10px; border-bottom: 1px solid rgba(148,163,184,.12); white-space: nowrap; }
.fx-ds-top-tools { display: flex; gap: 4px; }

/* ===== Claude Code식 상단 툴바 (2줄 제목 + 텍스트 액션 + 아바타) ===== */
.fx-ds-studio-top { gap: 6px; }
.fx-ds-titleblock { display: flex; flex-direction: column; gap: 0; line-height: 1.18; min-width: 0; margin-right: 2px; }
.fx-ds-titleblock .fx-ds-studio-title { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-ds-studio-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
#fx-ds-pagecount:not(:empty)::after { content: " · "; opacity: .6; }
.fx-ds-topback { width: 32px; height: 32px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--text-sub); font-size: 17px; line-height: 1; }
.fx-ds-topback:hover { background: rgba(120,100,80,.10); color: var(--text); }
.fx-ds-actrow, .fx-ds-iconrow { display: inline-flex; align-items: center; gap: 1px; }
.fx-ds-act { border: 0; background: transparent; cursor: pointer; padding: 6px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-sub); font-family: inherit; white-space: nowrap; transition: background .12s, color .12s; }
.fx-ds-act:hover { background: rgba(120,100,80,.10); color: var(--text); }
.fx-ds-act:disabled { opacity: .45; cursor: default; }
.fx-ds-act.is-on { background: rgba(204,122,78,.14); color: #bd6f44; }
.fx-ds-act-strong { color: var(--text); font-weight: 700; }
.fx-ds-icon { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-sub); font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.fx-ds-icon:hover { background: rgba(120,100,80,.10); color: var(--text); }
.fx-ds-icon:disabled { opacity: .4; cursor: default; }
.fx-ds-avatar { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--card); border: 1px solid var(--border); color: var(--text); margin-left: 4px; }
:root:not([data-formula-theme="dark"]) .fx-ds-avatar,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-avatar { background: #efe7da; border-color: #e3ddd0; color: #5b5347; }
.fx-ds-export-wrap { position: relative; }
.fx-ds-export-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 6px; min-width: 188px; display: flex; flex-direction: column; }
.fx-ds-export-menu[hidden] { display: none; }
.fx-ds-export-menu button { text-align: left; padding: 10px 12px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.fx-ds-export-menu button:hover { background: #f1f5f9; }

.fx-ds-studio-body { position: relative; display: block; flex: 1; min-height: 0; overflow: hidden; border-radius: 14px; }
.fx-ds-chat-col { position: absolute; left: 12px; top: 12px; bottom: 12px; width: 308px; z-index: 20; min-height: 0; display: flex; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 12px 40px rgba(15,23,42,.16); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.fx-ds-studio-body .fx-ds-stage { position: absolute; inset: 0; z-index: 0; border: none; border-radius: 14px; min-height: 0; box-shadow: none; }
.fx-ds-inspector { position: absolute; right: 12px; top: 12px; bottom: 12px; width: 300px; z-index: 20; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 0 2px 0 0; transition: transform .22s cubic-bezier(.2,.8,.2,1); }
/* 접이식 드로어 토글 핸들(접혔을 때만 표시) */
.fx-ds-studio .fx-ds-drawer-handle { position: absolute; z-index: 21; top: 12px; width: 34px; height: 34px; display: none; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--card) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(15,23,42,.14); cursor: pointer; color: var(--text); font-size: 16px; line-height: 1; }
.fx-ds-studio #fx-ds-chat-handle { left: 12px; }
.fx-ds-studio #fx-ds-insp-handle { right: 12px; }
.fx-ds-studio.chat-collapsed #fx-ds-chat-handle { display: flex; }
.fx-ds-studio.insp-collapsed #fx-ds-insp-handle { display: flex; }
.fx-ds-insp-section { border: 1px solid var(--border); border-radius: 16px; background: var(--card); padding: 14px 16px; box-shadow: 0 2px 12px rgba(15,23,42,.05); }
.fx-ds-insp-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 12px; }
.fx-ds-layers { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }

/* Chat panel (.fx-dc-*) — premium */
.fx-dc { position: relative; z-index: 1; display: flex; flex-direction: column; width: 100%; min-height: 0; }
.fx-dc-head { padding: 14px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 9px; }
.fx-dc-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,0.16); }
.fx-dc-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.fx-dc-empty { color: var(--text-muted); font-size: 13px; line-height: 1.7; text-align: center; margin: auto 0; }
.fx-dc-msg { max-width: 92%; }
.fx-dc-msg.is-user { align-self: flex-end; text-align: right; }
.fx-dc-msg-role { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.fx-dc-msg-body { display: inline-block; padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.fx-dc-msg.is-ai .fx-dc-msg-body { background: #f4f5f7; color: var(--text); border-bottom-left-radius: 5px; }
.fx-dc-msg.is-user .fx-dc-msg-body { background: linear-gradient(135deg,#6366f1,#7c6ff0); color: #fff; border-bottom-right-radius: 5px; }
.fx-dc-msg.is-pending .fx-dc-msg-body { opacity: .85; font-style: italic; }
.fx-dc-msg.is-pending .fx-dc-msg-body::after { content: ''; display: inline-block; width: 14px; text-align: left; animation: fx-dc-dots 1.2s steps(4,end) infinite; }
@keyframes fx-dc-dots { 0% { content: ''; } 25% { content: '·'; } 50% { content: '··'; } 75% { content: '···'; } 100% { content: ''; } }
.fx-dc-msg.is-error .fx-dc-msg-body { background: #fee2e2; color: #b91c1c; }
/* 캔버스: AI 가 실시간으로 그리는 중 표시 */
.fx-ds-stage.is-building { box-shadow: 0 0 0 1px rgba(99,102,241,.16), 0 10px 44px rgba(99,102,241,.16); animation: fx-ds-building 1.4s ease-in-out infinite; }
@keyframes fx-ds-building { 0%,100% { box-shadow: inset 0 2px 8px rgba(15,23,42,.04), 0 0 0 2px rgba(99,102,241,.22); } 50% { box-shadow: inset 0 2px 8px rgba(15,23,42,.04), 0 0 0 3px rgba(99,102,241,.5); } }
.fx-dc-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.fx-dc-chip { font-size: 11.5px; padding: 6px 11px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; cursor: pointer; color: var(--text); transition: all .12s; }
.fx-dc-chip:hover { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.fx-dc-input-row { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--border); position: relative; z-index: 2; }
.fx-dc-input-row textarea { width: 100%; min-height: 96px; max-height: 220px; resize: none; pointer-events: auto; padding: 13px 14px; border: 1px solid var(--border); border-radius: 14px; font-size: 14px; line-height: 1.6; font-family: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; overflow-y: auto; }
.fx-dc-drag-over textarea { border-color: #cc7a4e; box-shadow: 0 0 0 3px rgba(204,122,78,.18); pointer-events: none; }
.fx-dc-drag-over::after { content: '🖼  이미지 또는 PDF를 여기에 놓으세요'; position: absolute; inset: 12px; display: flex; align-items: center; justify-content: center; border: 2px dashed #cc7a4e; border-radius: 14px; background: rgba(246,236,227,.88); color: #b45309; font-size: 15px; font-weight: 700; pointer-events: none; z-index: 10; }
.fx-dc-input-row textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.fx-dc-send-row { display: flex; justify-content: flex-end; }
.fx-dc-send-row .btn { width: auto; padding: 9px 26px; border-radius: 12px; }

/* 폼 컨트롤 정규화 ( .form-control 은 .form-group 밖에서 기본 스타일이 없음 ) */
.fx-dc .form-control,
.fx-ds-inspector .form-control {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text); background: #fff; font-family: inherit;
}
.fx-dc .form-control:focus,
.fx-ds-inspector .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
:root[data-formula-theme="dark"] .fx-dc .form-control,
:root[data-formula-theme="dark"] .fx-ds-inspector .form-control,
:root[data-formula-theme="dark"] .fx-dc-input-row textarea { background: #0f172a; color: #f8fafc; }
/* btn-primary 가 width:100% 라서 가로 행에서 레이아웃을 밀어내는 문제 방지 */
.fx-ds-home-actions .btn,
.fx-ds-studio-top .btn { width: auto; }

:root[data-formula-theme="dark"] .fx-dc-msg.is-ai .fx-dc-msg-body { background: #1e293b; }
:root[data-formula-theme="dark"] .fx-ds-export-menu button:hover { background: #1e293b; }

/* ===== Claude DESIGN 베타 스타일 패리티 UI ===== */

/* 상단 버전 히스토리 바 */
.fx-ds-version { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 2px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; }
.fx-ds-vbtn { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 999px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--text); }
.fx-ds-vbtn:hover:not(:disabled) { background: #eef2ff; color: #4338ca; }
.fx-ds-vbtn:disabled { opacity: .35; cursor: default; }
.fx-ds-vlabel { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 0 6px; min-width: 64px; text-align: center; white-space: nowrap; }

/* 줌 컨트롤 */
.fx-ds-zoom-ctrl { display: inline-flex; align-items: center; gap: 1px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 2px 5px; margin: 0 4px; }
.fx-ds-zoom-btn { width: 24px; height: 24px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; font-size: 17px; line-height: 1; color: var(--text); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.fx-ds-zoom-btn:hover { background: #eef2ff; color: #4338ca; }
.fx-ds-zoom-lbl { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 42px; text-align: center; cursor: pointer; letter-spacing: -.2px; }
.fx-ds-zoom-fit { border: 0; background: transparent; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.fx-ds-zoom-fit:hover { background: #eef2ff; color: #4338ca; }

/* 인스펙터 접기 */
.fx-ds-studio.insp-collapsed .fx-ds-inspector { transform: translateX(calc(100% + 16px)); pointer-events: none; }
.fx-ds-studio.chat-collapsed .fx-ds-chat-col { transform: translateX(calc(-100% - 16px)); pointer-events: none; }
/* 떠 있는 채팅/편집 패널이 캔버스(작품)를 가리지 않도록, 패널이 열려 있으면
   스테이지를 그 폭만큼 안쪽으로 좁힌다 → 캔버스가 '보이는 영역'에 맞춰 중앙정렬.
   패널을 접거나 발표 모드면 전체 폭 사용. (토글 시 editor.relayout 이 재배치) */
@media (min-width: 1001px) {
  .fx-ds-studio:not(.fx-ds-present):not(.chat-collapsed) .fx-ds-studio-body .fx-ds-stage { left: 332px; }
  .fx-ds-studio:not(.fx-ds-present):not(.insp-collapsed) .fx-ds-studio-body .fx-ds-stage { right: 324px; }
}

/* 작업 단계(PLAN) 체크리스트 */
.fx-dc-reply { display: block; }
.fx-dc-steps { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 5px; }
.fx-dc-steps[hidden] { display: none; }
.fx-dc-steps li { display: flex; align-items: center; gap: 7px; font-size: 12px; font-style: normal; color: var(--text-muted); opacity: .7; transition: opacity .2s, color .2s; }
.fx-dc-step-mark { width: 13px; height: 13px; border-radius: 999px; border: 1.5px solid #c7ccd6; flex: 0 0 auto; position: relative; }
.fx-dc-steps li.is-active { opacity: 1; color: var(--text); font-weight: 600; }
.fx-dc-steps li.is-active .fx-dc-step-mark { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.18); animation: fx-dc-pulse 1.1s ease-in-out infinite; }
.fx-dc-steps li.is-done { opacity: 1; color: var(--text-muted); }
.fx-dc-steps li.is-done .fx-dc-step-mark { border-color: #22c55e; background: #22c55e; }
.fx-dc-steps li.is-done .fx-dc-step-mark::after { content: '✓'; position: absolute; inset: -2px 0 0 0; color: #fff; font-size: 10px; text-align: center; line-height: 13px; }
@keyframes fx-dc-pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(99,102,241,.14); } 50% { box-shadow: 0 0 0 4px rgba(99,102,241,.28); } }

/* 디자인 시안(방향) 카드 */
.fx-dc-dir-intro { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.fx-dc-dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-dc-dir { text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: 12px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; transition: border-color .12s, transform .08s, box-shadow .12s; }
.fx-dc-dir:hover:not(:disabled) { border-color: #c7d2fe; box-shadow: 0 4px 12px rgba(99,102,241,.14); transform: translateY(-1px); }
.fx-dc-dir:disabled { opacity: .5; cursor: default; }
.fx-dc-dir.is-chosen { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.3); opacity: 1; }
.fx-dc-dir-sw { display: flex; gap: 3px; }
.fx-dc-dir-sw i { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,.08); }
.fx-dc-dir strong { font-size: 13px; color: var(--text); }
.fx-dc-dir span { font-size: 11px; color: var(--text-muted); line-height: 1.45; }

/* 선택(요소) 칩 */
.fx-dc-selchip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px 0; }
.fx-dc-selchip[hidden] { display: none; }
.fx-dc-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 999px; padding: 4px 6px 4px 11px; }
.fx-dc-sel-x { border: 0; background: rgba(99,102,241,.16); color: #4338ca; width: 18px; height: 18px; border-radius: 999px; cursor: pointer; font-size: 11px; line-height: 1; }
.fx-dc-sel-x:hover { background: rgba(99,102,241,.32); }
.fx-dc-sel-hint { font-size: 11px; color: var(--text-muted); }

/* 시안 제안 토글 버튼 */
.fx-dc-send-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.fx-dc-propose { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: all .12s; }
.fx-dc-propose:hover { border-color: #c7d2fe; color: #4338ca; }
.fx-dc-propose.is-on { background: #6366f1; border-color: #6366f1; color: #fff; }
.fx-dc-photo { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: all .12s; }
/* 입력 하단 액션 버튼: 한 줄 유지(줄바꿈 방지), 좁은 폭에서 축약 */
.fx-dc-photo, .fx-dc-propose { white-space: nowrap; flex: 0 0 auto; padding: 6px 10px; }
.fx-dc-send-row .btn-primary { white-space: nowrap; flex: 0 0 auto; padding-left: 14px; padding-right: 14px; }
@media (max-width: 380px) {
  .fx-dc-photo, .fx-dc-propose { padding: 6px 8px; font-size: 11px; }
}
.fx-dc-photo:hover { border-color: #e6c9b3; color: #bd6f44; background: #f6ece3; }
.fx-dc-photo.is-on { background: #f6ece3; border-color: #cc7a4e; color: #bd6f44; }

:root[data-formula-theme="dark"] .fx-dc-dir,
:root[data-formula-theme="dark"] .fx-dc-propose,
:root[data-formula-theme="dark"] .fx-ds-version { background: #1e293b; }
:root[data-formula-theme="dark"] .fx-dc-sel { background: #312e81; border-color: #4338ca; color: #c7d2fe; }

/* ===== Claude Design 베타 스타일 홈 ===== */
.fx-cd-home { max-width: none; width: 100%; margin: 0; padding: 22px clamp(20px, 4vw, 56px) 64px; }
.fx-cd-home > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.fx-cd-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.fx-cd-brand { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.fx-cd-beta { font-size: 11px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.fx-cd-ghost { font-size: 13px; font-weight: 600; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 7px 14px; cursor: pointer; }
.fx-cd-ghost:hover { border-color: #c7d2fe; color: #4338ca; }
.fx-cd-title { font-family: Georgia, 'Times New Roman', 'Noto Serif KR', serif; font-size: 46px; font-weight: 600; letter-spacing: -.02em; text-align: center; color: var(--text); margin: 26px 0 10px; }
.fx-cd-sub { text-align: center; font-size: 14px; color: var(--text-muted); margin: 0 0 22px; }

/* 맥락(컨텍스트) 카드 행 */
.fx-cd-context { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 0 14px; }
.fx-cd-ctx { display: inline-flex; align-items: center; gap: 9px; padding: 7px 16px 7px 7px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); transition: border-color .12s, box-shadow .12s, background .12s; }
.fx-cd-ctx:hover { border-color: #cc7a4e; box-shadow: 0 3px 12px rgba(80,60,40,.07); }
.fx-cd-ctx.has-on { border-color: #cc7a4e; background: #f6ece3; }
.fx-cd-ctx-ic { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.fx-cd-ctx-ic svg { width: 16px; height: 16px; }
.fx-cd-ctx--system .fx-cd-ctx-ic { background: linear-gradient(135deg, #e08a4f, #cc7a4e); }
.fx-cd-ctx--image .fx-cd-ctx-ic { background: linear-gradient(135deg, #5aa873, #4f9d69); }
.fx-cd-ctx--pdf .fx-cd-ctx-ic { background: linear-gradient(135deg, #8b6fd0, #7c5cbf); }
.fx-cd-ctx-lb { line-height: 1; }
.fx-cd-ctx select { border: 0; outline: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 700; color: #b45309; cursor: pointer; padding: 0; max-width: 150px; }
.fx-cd-ctx-sw { display: inline-flex; gap: 3px; align-items: center; }
.fx-cd-ctx-sw:empty { display: none; }
.fx-cd-ctx-sw i { width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.06) inset; }
.fx-cd-ctx-thumb { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset; }

/* 스튜디오 브랜드 자료(로고·이미지) 삽입 */
.fx-ds-brandassets { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-ds-brandasset { position: relative; width: 56px; height: 56px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #0f172a; cursor: pointer; padding: 0; }
.fx-ds-brandasset:hover { border-color: #6366f1; box-shadow: 0 2px 10px rgba(99,102,241,.25); }
.fx-ds-brandasset img { width: 100%; height: 100%; object-fit: contain; }
.fx-ds-ba-logo { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(99,102,241,.92); color: #fff; font-size: 9px; font-weight: 800; text-align: center; padding: 1px 0; }

/* 디자인 시스템 에셋(로고·참고) 업로더 */
.fx-asset-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.fx-asset-empty { font-size: 12px; color: var(--text-muted); padding: 14px; border: 1px dashed var(--border); border-radius: 10px; width: 100%; text-align: center; }
.fx-asset { position: relative; width: 64px; height: 64px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.fx-asset img { width: 100%; height: 100%; object-fit: cover; }
.fx-asset-ext { font-size: 12px; font-weight: 800; color: #475569; }
.fx-asset-role { position: absolute; left: 0; bottom: 0; right: 0; background: rgba(99,102,241,.92); color: #fff; font-size: 10px; font-weight: 800; text-align: center; padding: 1px 0; }
.fx-asset-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 999px; background: rgba(15,23,42,.65); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; padding: 0; }
.fx-asset-mk { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border: 0; border-radius: 999px; background: rgba(245,158,11,.92); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; padding: 0; }
.fx-asset-add { font-size: 13px; font-weight: 700; color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 9px; padding: 8px 14px; cursor: pointer; }
.fx-asset-add:hover { background: #e0e7ff; }
.fx-asset-add:disabled { opacity: .6; cursor: default; }
.fx-asset-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fx-asset-rmbg { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.fx-asset-rmbg input { margin: 0; }

/* 디자인 시스템 추천 팔레트 */
.fx-pal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.fx-pal-preset { display: inline-flex; padding: 3px; border: 1px solid var(--border); background: var(--card); border-radius: 8px; cursor: pointer; gap: 0; }
.fx-pal-preset:hover { border-color: #cc7a4e; }
.fx-pal-preset i { width: 16px; height: 18px; display: block; }
.fx-pal-preset i:first-child { border-radius: 4px 0 0 4px; }
.fx-pal-preset i:last-child { border-radius: 0 4px 4px 0; }
.fx-pal-suggest { margin-left: auto; font-size: 12px; font-weight: 700; color: #b45309; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.fx-pal-suggest:hover { background: #ffedd5; }

/* 웹 문의(접수) 목록 */
.fx-cd-tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle; }
.fx-cd-leads { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.fx-cd-lead { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--card); }
.fx-cd-lead-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fx-cd-lead-h strong { font-size: 15px; color: var(--text); }
.fx-cd-lead-tel { font-size: 14px; font-weight: 700; color: #4338ca; text-decoration: none; }
.fx-cd-lead-tel:hover { text-decoration: underline; }
.fx-cd-lead-date { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.fx-cd-lead-msg { margin-top: 8px; font-size: 14px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }
:root:not([data-formula-theme="dark"]) .fx-cd-lead { background: #fff; border-color: #e7e1d5; }

/* 2단 레이아웃: 좌측 맥락+프롬프트 / 우측 작업 갤러리 */
.fx-cd-2col { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 30px; align-items: start; max-width: none; margin: 0; }
/* .fx-cd-home > * 의 max-width/auto-margin 가 그리드 아이템에 끼어들지 않게 해제 */
.fx-cd-2col > * { max-width: none; margin: 0; }
.fx-cd-2col .fx-cd-left { position: sticky; top: 16px; display: flex; flex-direction: column; }
/* 우측 템플릿: 부채꼴 대신 줄바꿈되는 카드 그리드로 */
.fx-cd-2col .fx-cd-types { flex-wrap: wrap; justify-content: flex-start; align-items: stretch; gap: 12px; padding: 0; perspective: none; }
.fx-cd-2col .fx-cd-typecard { width: 140px; transform: none; box-shadow: 0 2px 10px rgba(15,23,42,.05); justify-content: flex-start; }
.fx-cd-2col .fx-cd-typecard:hover { transform: translateY(-4px) scale(1.02); }
.fx-cd-2col .fx-cd-right { min-width: 0; }
.fx-cd-2col .fx-cd-topbar { margin-bottom: 10px; }
.fx-cd-2col .fx-cd-title { font-size: 34px; line-height: 1.12; text-align: left; margin: 8px 0 8px; }
.fx-cd-2col .fx-cd-sub { text-align: left; margin: 0 0 18px; }
.fx-cd-context--col { flex-direction: column; align-items: stretch; gap: 8px; }
.fx-cd-context--col .fx-cd-ctx { width: 100%; justify-content: flex-start; }
.fx-cd-context--col .fx-cd-ctx--system { padding-right: 10px; }
.fx-cd-context--col .fx-cd-ctx--system select { margin-left: auto; }
.fx-cd-2col .fx-cd-prompt { margin-top: 12px; }
.fx-cd-2col .fx-cd-blank { margin: 12px 0 0; }
.fx-cd-2col .fx-cd-right { min-width: 0; }
.fx-cd-2col .fx-cd-types-cap { margin: 4px 0 14px; text-align: left; }
.fx-cd-2col .fx-cd-recent { margin-top: 30px; }
@media (max-width: 940px) {
  .fx-cd-2col { grid-template-columns: 1fr; gap: 8px; }
  .fx-cd-2col .fx-cd-left { position: static; }
  .fx-cd-2col .fx-cd-title { text-align: center; }
  .fx-cd-2col .fx-cd-sub { text-align: center; }
  .fx-cd-2col .fx-cd-title br { display: none; }
  .fx-cd-context--col { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .fx-cd-context--col .fx-cd-ctx { width: auto; }
}

/* 프롬프트 카드 */
.fx-cd-prompt { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 18px 18px 14px; box-shadow: 0 8px 30px rgba(15,23,42,.07); max-width: none; margin: 0; }
.fx-cd-textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; font-family: inherit; font-size: 16px; line-height: 1.6; color: var(--text); min-height: 56px; max-height: 220px; padding: 4px 6px; }
.fx-cd-textarea::placeholder { color: var(--text-muted); }
.fx-cd-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.fx-cd-barspacer { flex: 1 1 20px; }
.fx-cd-attach { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text-muted); font-size: 20px; cursor: pointer; flex: 0 0 auto; }
.fx-cd-attach:hover { border-color: #c7d2fe; color: #4338ca; }
.fx-cd-sel { display: inline-flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: 12px; padding: 5px 10px; background: var(--card); cursor: pointer; transition: border-color .12s; }
.fx-cd-sel:hover { border-color: #c7d2fe; }
.fx-cd-sel > span { font-size: 10px; color: var(--text-muted); line-height: 1.2; }
.fx-cd-sel select { border: 0; outline: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--text); font-family: inherit; cursor: pointer; padding: 0; max-width: 150px; }
.fx-cd-sel-model { border-color: #c7d2fe; background: #eef2ff; }
.fx-cd-sel-model > span { color: #6366f1; }
.fx-cd-send { width: 44px; height: 44px; border-radius: 14px; border: 0; cursor: pointer; flex: 0 0 auto; background: linear-gradient(135deg,#6366f1,#7c6ff0); color: #fff; font-size: 20px; box-shadow: 0 4px 12px rgba(99,102,241,.32); transition: transform .08s, box-shadow .12s; }
.fx-cd-send:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(99,102,241,.4); }
.fx-cd-send:disabled { opacity: .5; cursor: default; transform: none; }

/* 부채꼴 매체 카드 */
.fx-cd-types-cap { text-align: center; font-size: 13px; color: var(--text-muted); margin: 34px 0 16px; }
.fx-cd-types { display: flex; justify-content: center; align-items: flex-end; gap: 2px; padding: 14px 0 6px; perspective: 900px; }
.fx-cd-typecard { width: 150px; border: 1px solid var(--border); background: var(--card); border-radius: 14px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 9px; transform: rotate(var(--rot,0deg)) translateY(var(--dy,0px)); transform-origin: bottom center; transition: transform .16s ease, box-shadow .16s, border-color .12s; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.fx-cd-typecard:hover { transform: rotate(0deg) translateY(-8px) scale(1.04); box-shadow: 0 16px 34px rgba(15,23,42,.16); border-color: #c7d2fe; z-index: 2; }
.fx-cd-typecard:disabled { opacity: .55; cursor: default; }
.fx-cd-typethumb { width: 100%; height: 78px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: #f1f2f5; }
.fx-cd-typecard strong { font-size: 13px; font-weight: 700; color: var(--text); }
.fx-cd-typedesc { font-size: 10.5px; color: var(--text-muted); line-height: 1.3; text-align: center; }
.fx-cd-blank { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0; padding: 9px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; transition: border-color .12s, background .12s, transform .12s; }
.fx-cd-blank:hover { border-color: #c7d2fe; background: #f8fafc; transform: translateY(-1px); }
.fx-cd-blank .fx-cd-blank-ic { font-size: 15px; line-height: 1; color: var(--text-muted); }

/* ===================== Claude Design 중앙 단일 컬럼 ===================== */
/* 따뜻한 크림/아이보리 배경 (Claude Design 톤) */
:root:not([data-formula-theme="dark"]) .fx-cd-home { background: #faf8f3; min-height: 100%; }
:root:not([data-formula-theme="dark"]) .fx-cd-home .fx-cd-prompt { background: #fffdfa; }
.fx-cd-center { padding-top: 0; }
/* 모든 직속 자식 중앙정렬 — 옛 2단용 .fx-cd-prompt{margin:0;max-width:none} 등을 확실히 덮어씀 */
.fx-cd-center > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
.fx-cd-center .fx-cd-types,
.fx-cd-center .fx-cd-recent { max-width: 1080px; }
/* 상단 워드마크 헤더 + 적갈색 헤어라인 */
.fx-cd-center .fx-cd-topbar { padding: 22px 4px 16px; margin: 0 auto 30px; border-top: 3px solid #6e2a24; }
:root[data-formula-theme="dark"] .fx-cd-center .fx-cd-topbar { border-top-color: #7a3c34; }
.fx-cd-center .fx-cd-brand { font-family: 'Newsreader', 'Nanum Myeongjo', Georgia, serif; font-size: 23px; font-weight: 600; letter-spacing: -.01em; gap: 10px; }
.fx-cd-center .fx-cd-beta { align-self: flex-start; transform: translateY(3px); }
.fx-cd-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--card); border: 1px solid var(--border); color: var(--text); flex: 0 0 auto; }
:root:not([data-formula-theme="dark"]) .fx-cd-avatar { background: #efe7da; border-color: #e3ddd0; color: #5b5347; }
/* 히어로 */
.fx-cd-center .fx-cd-title { font-size: clamp(38px, 5vw, 54px); line-height: 1.05; margin: 44px auto 12px; }
.fx-cd-center .fx-cd-sub { margin: 0 auto 24px; font-size: 15px; }
/* 프롬프트(넓은 중앙 박스) */
.fx-cd-center .fx-cd-prompt { border-radius: 20px; padding: 16px 16px 12px; }
.fx-cd-center .fx-cd-textarea { font-size: 16px; min-height: 46px; }
/* 프롬프트 바에 통합된 컨텍스트 칩(컴팩트) */
.fx-cd-bar .fx-cd-ctx { gap: 7px; padding: 5px 12px 5px 5px; font-size: 13px; font-weight: 600; }
.fx-cd-bar .fx-cd-ctx-ic { width: 24px; height: 24px; }
.fx-cd-bar .fx-cd-ctx-ic svg { width: 13px; height: 13px; }
.fx-cd-bar .fx-cd-ctx-thumb { width: 24px; height: 24px; }
.fx-cd-bar .fx-cd-ctx select { font-size: 12px; max-width: 116px; }
.fx-cd-bar .fx-cd-ctx-sw i { width: 11px; height: 11px; }
.fx-cd-bardiv { width: 1px; align-self: stretch; min-height: 26px; background: var(--border); margin: 0 3px; flex: 0 0 auto; }
/* 빈 프로젝트 → 텍스트 링크 스타일 */
.fx-cd-center .fx-cd-blank { display: flex; margin: 18px auto 0; padding: 8px 14px; border: 0; background: transparent; box-shadow: none; color: var(--text-muted); font-size: 13.5px; }
.fx-cd-center .fx-cd-blank:hover { background: transparent; transform: none; color: #cc7a4e; }
.fx-cd-blank-ar { transition: transform .14s ease; }
.fx-cd-center .fx-cd-blank:hover .fx-cd-blank-ar { transform: translateX(4px); }
/* 부채꼴: 카드끼리 살짝 겹치게 */
.fx-cd-center .fx-cd-types { gap: 0; padding: 18px 0 10px; }
.fx-cd-center .fx-cd-typecard { margin: 0 -8px; }
/* 최근 영역 간격 */
.fx-cd-center .fx-cd-types-cap { margin: 40px auto 6px; }
.fx-cd-center .fx-cd-recent { margin: 46px auto 0; }
@media (max-width: 640px) {
  .fx-cd-center .fx-cd-title { font-size: 32px; margin: 26px 0 10px; }
  .fx-cd-center .fx-cd-types { flex-wrap: wrap; gap: 8px; }
  .fx-cd-center .fx-cd-typecard { width: 132px; margin: 0; transform: none; }
}

/* 최근 디자인 */
.fx-cd-recent { margin-top: 48px; }
.fx-cd-recent-head { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.fx-cd-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 14px; }
.fx-cd-proj { position: relative; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--card); transition: border-color .12s, box-shadow .12s, transform .08s; }
.fx-cd-proj:hover { border-color: #c7d2fe; box-shadow: 0 8px 20px rgba(15,23,42,.1); transform: translateY(-2px); }
.fx-cd-proj-thumb { height: 116px; background-size: cover; background-position: center; background-color: #0f172a; }
.fx-cd-proj-noimg { display: flex; align-items: center; justify-content: center; font-size: 30px; background: #f1f2f5; }
.fx-cd-proj-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.fx-cd-proj-meta strong { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-cd-proj-meta span { font-size: 11px; color: var(--text-muted); }
.fx-cd-proj-del { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(15,23,42,.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .12s; }
.fx-cd-proj:hover .fx-cd-proj-del { opacity: 1; }
.fx-cd-proj-del:hover { background: #ef4444; }

/* 최근 디자인 — 리스트 뷰(이미지 미리보기 포함) */
.fx-cd-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); }
/* 담당자별 보기 — 소유자별 그룹 헤더 */
.fx-cd-owner-group { border-top: 1px solid var(--border); }
.fx-cd-owner-group:first-child { border-top: 0; }
.fx-cd-owner-head { display: flex; align-items: center; gap: 9px; padding: 12px 18px; background: #faf9f6; font-weight: 800; font-size: 13px; color: var(--text); }
.fx-cd-owner-cnt { font-size: 11px; font-weight: 700; color: #6366f1; background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.22); border-radius: 999px; padding: 1px 9px; }
.fx-cd-list-owner .fx-cd-owner-group .fx-cd-row:first-of-type { border-top: 1px solid var(--border); }
.fx-cd-list-head, .fx-cd-row { display: grid; grid-template-columns: minmax(0,1fr) 160px 100px 100px 36px; align-items: center; gap: 14px; padding: 11px 18px; }
.fx-cd-list-head { font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.fx-cd-row { border-top: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.fx-cd-row:first-of-type { border-top: 0; }
.fx-cd-row:hover { background: #f6f5f2; }
.fx-cd-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fx-cd-thumb { width: 66px; height: 46px; border-radius: 8px; overflow: hidden; position: relative; flex: 0 0 auto; border: 1px solid var(--border); }
.fx-cd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-cd-thumb.is-live { background: #fff; }
.fx-cd-row-main strong { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-cd-row .fx-cd-c-media, .fx-cd-row .fx-cd-c-date, .fx-cd-row .fx-cd-c-owner { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-cd-row-del { border: 0; background: transparent; cursor: pointer; opacity: 0; font-size: 14px; transition: opacity .1s; justify-self: center; }
.fx-cd-row:hover .fx-cd-row-del { opacity: .65; }
.fx-cd-row-del:hover { opacity: 1; }
:root[data-formula-theme="dark"] .fx-cd-row:hover { background: #1e293b; }
@media (max-width: 720px) {
  .fx-cd-list-head, .fx-cd-row { grid-template-columns: 1fr 36px; }
  .fx-cd-list-head .fx-cd-c-media, .fx-cd-list-head .fx-cd-c-date, .fx-cd-list-head .fx-cd-c-owner,
  .fx-cd-row .fx-cd-c-media, .fx-cd-row .fx-cd-c-date, .fx-cd-row .fx-cd-c-owner { display: none; }
}

/* 최근 디자인 — 상단 바 + 뷰 토글 */
.fx-cd-recent-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.fx-cd-recent-bar .fx-cd-recent-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.fx-cd-viewtoggle { display: inline-flex; gap: 2px; border: 1px solid var(--border); border-radius: 9px; padding: 2px; background: var(--card); }
.fx-cd-viewtoggle button { border: 0; background: transparent; width: 32px; height: 28px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--text-muted); }
.fx-cd-viewtoggle button.is-on { background: rgba(15,23,42,.06); color: var(--text); }

/* 디자인 시스템 탭 + 카드 */
.fx-cd-tabs { display: flex; gap: 4px; }
.fx-cd-tabs button { border: 0; background: transparent; font-size: 14px; font-weight: 600; color: var(--text-muted); padding: 6px 12px; border-radius: 9px; cursor: pointer; transition: background .12s, color .12s; }
.fx-cd-tabs button.is-on { color: var(--text); background: rgba(15,23,42,.06); font-weight: 700; }
.fx-cd-tabs button:hover { color: var(--text); background: rgba(15,23,42,.04); }
.fx-cd-systems { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.fx-cd-syscard { position: relative; text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .12s, box-shadow .12s, transform .08s; min-height: 116px; }
.fx-cd-syscard:hover { border-color: #e6c9b3; box-shadow: 0 8px 20px rgba(80,60,40,.1); transform: translateY(-2px); }
.fx-cd-sys-sw { display: flex; gap: 5px; }
.fx-cd-sys-sw i { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,.08); }
.fx-cd-syscard strong { font-size: 14px; color: var(--text); }
.fx-cd-sys-brand { font-size: 12px; color: var(--text); }
.fx-cd-sys-meta { font-size: 11px; color: var(--text-muted); }
.fx-cd-sys-del { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; opacity: 0; }
.fx-cd-syscard:hover .fx-cd-sys-del { opacity: .6; }
.fx-cd-sys-del:hover { opacity: 1; background: rgba(239,68,68,.12); }
.fx-cd-sys-edit { position: absolute; top: 10px; right: 40px; width: 26px; height: 26px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; opacity: .45; font-size: 13px; line-height: 1; }
.fx-cd-syscard:hover .fx-cd-sys-edit { opacity: .85; }
.fx-cd-sys-edit:hover { opacity: 1; background: rgba(204,122,78,.14); }
.fx-cd-sys-new { align-items: center; justify-content: center; flex-direction: row; gap: 8px; color: var(--text-muted); font-weight: 600; font-size: 14px; border-style: dashed; }
.fx-cd-sys-new:hover { color: #bd6f44; border-color: #cc7a4e; }
.fx-cd-sys-plus { font-size: 18px; }
:root[data-formula-theme="dark"] .fx-cd-syscard { background: #1e293b; }

/* 격자 뷰 카드 */
.fx-cd-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.fx-cd-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .08s; }
.fx-cd-card:hover { border-color: #e6c9b3; box-shadow: 0 8px 22px rgba(80,60,40,.1); transform: translateY(-2px); }
.fx-cd-grid2 .fx-cd-thumb { width: 100%; height: 152px; border-radius: 0; border: 0; border-bottom: 1px solid var(--border); }
.fx-cd-card-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.fx-cd-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fx-cd-card-info strong { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-cd-card-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ⋯ 더보기 버튼 + 메뉴 */
.fx-cd-more { border: 0; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; color: var(--text-muted); width: 28px; height: 28px; border-radius: 7px; flex: 0 0 auto; justify-self: center; }
.fx-cd-more:hover { background: rgba(15,23,42,.06); color: var(--text); }
.fx-cd-row .fx-cd-more { opacity: 0; }
.fx-cd-row:hover .fx-cd-more { opacity: 1; }
/* 터치 기기(hover 불가): 호버로만 뜨던 ⋯·삭제 트리거를 항상 보이게 */
@media (hover: none) {
  .fx-cd-proj .fx-cd-proj-del,
  .fx-cd-row .fx-cd-row-del,
  .fx-cd-row .fx-cd-more { opacity: .7; }
}
.fx-cd-menu { position: fixed; z-index: 1000; min-width: 190px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 6px; }
.fx-cd-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.fx-cd-menu button:hover { background: #f1f5f9; }
.fx-cd-menu button.is-danger { color: #dc2626; }
.fx-cd-menu button.is-danger:hover { background: #fef2f2; }
.fx-cd-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
:root[data-formula-theme="dark"] .fx-cd-menu button:hover { background: #1e293b; }
:root[data-formula-theme="dark"] .fx-cd-menu button.is-danger:hover { background: #3f1d1d; }

:root[data-formula-theme="dark"] .fx-cd-prompt,
:root[data-formula-theme="dark"] .fx-cd-sel,
:root[data-formula-theme="dark"] .fx-cd-attach,
:root[data-formula-theme="dark"] .fx-cd-ctx,
:root[data-formula-theme="dark"] .fx-cd-typecard,
:root[data-formula-theme="dark"] .fx-cd-proj { background: #1e293b; }
:root[data-formula-theme="dark"] .fx-cd-ctx.has-on { background: #312e81; }
:root[data-formula-theme="dark"] .fx-cd-sel-model { background: #312e81; }
:root[data-formula-theme="dark"] .fx-cd-typethumb,
:root[data-formula-theme="dark"] .fx-cd-proj-noimg { background: #0f172a; }

/* ===== Claude Design 크림/serif 테마 (디자인 탭, 라이트 모드 한정) ===== */
:root:not([data-formula-theme="dark"]) body.fx-design-tab #page-dashboard .page-content { background: #f7f7f8; }
:root:not([data-formula-theme="dark"]) .fx-cd-title { font-family: 'Newsreader', 'Nanum Myeongjo', Georgia, serif; font-weight: 500; color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-brand { color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-beta { border-color: #e3ddd0; color: #8c846f; }
:root:not([data-formula-theme="dark"]) .fx-cd-ghost { background: #fff; border-color: #e3ddd0; color: #6b6454; }
:root:not([data-formula-theme="dark"]) .fx-cd-ghost:hover { border-color: #cc7a4e; color: #cc7a4e; }
:root:not([data-formula-theme="dark"]) .fx-cd-prompt { background: #fff; border-color: #e7e1d5; box-shadow: 0 10px 34px rgba(80,60,40,.08); }
:root:not([data-formula-theme="dark"]) .fx-cd-textarea { color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-textarea::placeholder { color: #a39b88; }
:root:not([data-formula-theme="dark"]) .fx-cd-attach,
:root:not([data-formula-theme="dark"]) .fx-cd-ctx,
:root:not([data-formula-theme="dark"]) .fx-cd-sel { background: #fff; border-color: #e7e1d5; }
:root:not([data-formula-theme="dark"]) .fx-cd-ctx.has-on { background: #f6ece3; border-color: #e6c9b3; }
:root:not([data-formula-theme="dark"]) .fx-cd-sel > span { color: #a39b88; }
:root:not([data-formula-theme="dark"]) .fx-cd-sel select { color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-attach:hover,
:root:not([data-formula-theme="dark"]) .fx-cd-sel:hover { border-color: #cc7a4e; color: #cc7a4e; }
:root:not([data-formula-theme="dark"]) .fx-cd-sel-model { background: #f6ece3; border-color: #e6c9b3; }
:root:not([data-formula-theme="dark"]) .fx-cd-sel-model > span { color: #bd6f44; }
:root:not([data-formula-theme="dark"]) .fx-cd-send { background: linear-gradient(135deg,#e0986a,#cc7a4e); box-shadow: 0 4px 12px rgba(204,122,78,.34); }
:root:not([data-formula-theme="dark"]) .fx-cd-send:hover { box-shadow: 0 7px 18px rgba(204,122,78,.45); }
:root:not([data-formula-theme="dark"]) .fx-cd-types-cap { color: #8c846f; }
:root:not([data-formula-theme="dark"]) .fx-cd-blank { color: #2b2722; background: #fff; border-color: #e7e1d5; }
:root:not([data-formula-theme="dark"]) .fx-cd-blank:hover { color: #2b2722; border-color: #cc7a4e; background: #fbf7f1; }
:root:not([data-formula-theme="dark"]) .fx-cd-typedesc { color: #9b927f; }
:root:not([data-formula-theme="dark"]) .fx-cd-typecard { background: #fff; border-color: #e7e1d5; box-shadow: 0 4px 14px rgba(80,60,40,.06); }
:root:not([data-formula-theme="dark"]) .fx-cd-typecard:hover { border-color: #cc7a4e; }
:root:not([data-formula-theme="dark"]) .fx-cd-typethumb { background: #f4f1ea; }
:root:not([data-formula-theme="dark"]) .fx-cd-typecard strong { color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-recent-head { color: #2b2722; border-color: #e7e1d5; }
:root:not([data-formula-theme="dark"]) .fx-cd-tabs button.is-on { background: #f3ece2; color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-tabs button:hover { background: #f7f2ea; color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-row:hover { background: #faf7f2; }
:root:not([data-formula-theme="dark"]) .fx-cd-viewtoggle button.is-on { background: #f3ece2; color: #2b2722; }

/* ── 다크 테마 누락 보정 (Formula X 감사 반영) ── */
:root[data-formula-theme="dark"] .fx-ds-zoom-btn:hover,
:root[data-formula-theme="dark"] .fx-ds-zoom-fit:hover { background: rgba(99,102,241,.18); color: #c7d2fe; }
:root[data-formula-theme="dark"] .fx-cd-lead-tel { color: #a5b4fc; }
:root[data-formula-theme="dark"] .fx-pal-suggest { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.34); color: #fdba74; }
:root[data-formula-theme="dark"] .fx-pal-suggest:hover { background: rgba(245,158,11,.22); }
:root[data-formula-theme="dark"] .fx-dc-chip:hover { background: rgba(99,102,241,.18); border-color: rgba(99,102,241,.4); color: #c7d2fe; }
:root[data-formula-theme="dark"] .fx-cd-blank:hover { background: #1e293b; border-color: rgba(99,102,241,.4); }
:root[data-formula-theme="dark"] .fx-cd-attach:hover { color: #c7d2fe; border-color: rgba(99,102,241,.4); }
:root[data-formula-theme="dark"] .fx-cd-sel-model > span { color: #c7d2fe; }
:root[data-formula-theme="dark"] .fx-dc-msg.is-error .fx-dc-msg-body { background: rgba(127,29,29,.4); color: #fca5a5; }
:root[data-formula-theme="dark"] .fx-cd-thumb.is-live { background: var(--card); }
:root[data-formula-theme="dark"] .fx-customer-trunc-banner { color: #fbbf24 !important; background: rgba(245,158,11,.15) !important; border-color: rgba(245,158,11,.35) !important; }
:root:not([data-formula-theme="dark"]) .fx-cd-proj { background: #fff; border-color: #e7e1d5; }
:root:not([data-formula-theme="dark"]) .fx-cd-proj:hover { border-color: #cc7a4e; box-shadow: 0 8px 20px rgba(80,60,40,.1); }
:root:not([data-formula-theme="dark"]) .fx-cd-proj-meta strong { color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-cd-proj-meta span { color: #8c846f; }
:root:not([data-formula-theme="dark"]) .fx-cd-typethumb { background: #efe9dd; }

/* ===== 편집 스튜디오 크림 톤 통일 (라이트 모드) — 인디고→테라코타 ===== */
:root:not([data-formula-theme="dark"]) .fx-dc-msg.is-user .fx-dc-msg-body { background: linear-gradient(135deg,#e0986a,#cc7a4e); }
:root:not([data-formula-theme="dark"]) .fx-dc .btn-primary { background: linear-gradient(135deg,#e0986a,#cc7a4e); border-color: #cc7a4e; box-shadow: 0 2px 8px rgba(204,122,78,.28); }
:root:not([data-formula-theme="dark"]) .fx-dc-chip:hover { background: #f6ece3; border-color: #e6c9b3; color: #bd6f44; }
:root:not([data-formula-theme="dark"]) .fx-dc-input-row textarea:focus { border-color: #cc7a4e; box-shadow: 0 0 0 3px rgba(204,122,78,.14); }
:root:not([data-formula-theme="dark"]) .fx-dc-propose:hover { border-color: #e6c9b3; color: #bd6f44; }
:root:not([data-formula-theme="dark"]) .fx-dc-propose.is-on { background: #cc7a4e; border-color: #cc7a4e; color: #fff; }
:root:not([data-formula-theme="dark"]) .fx-dc-sel { background: #f6ece3; border-color: #e6c9b3; color: #bd6f44; }
:root:not([data-formula-theme="dark"]) .fx-dc-sel-x { background: rgba(204,122,78,.16); color: #bd6f44; }
:root:not([data-formula-theme="dark"]) .fx-dc-sel-x:hover { background: rgba(204,122,78,.3); }
:root:not([data-formula-theme="dark"]) .fx-dc-steps li.is-active { color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-dc-steps li.is-active .fx-dc-step-mark { border-color: #cc7a4e; box-shadow: 0 0 0 3px rgba(204,122,78,.2); }
:root:not([data-formula-theme="dark"]) .fx-dc-dir:hover { border-color: #e6c9b3; box-shadow: 0 4px 12px rgba(204,122,78,.16); }
:root:not([data-formula-theme="dark"]) .fx-dc-dir.is-chosen { border-color: #cc7a4e; box-shadow: 0 0 0 2px rgba(204,122,78,.32); }
:root:not([data-formula-theme="dark"]) .fx-ds-vbtn:hover:not(:disabled) { background: #f6ece3; color: #bd6f44; }
:root:not([data-formula-theme="dark"]) .fx-ds-stage.is-building { box-shadow: 0 0 0 1px rgba(204,122,78,.18), 0 10px 44px rgba(204,122,78,.18); animation: fx-ds-building-warm 1.4s ease-in-out infinite; }
@keyframes fx-ds-building-warm { 0%,100% { box-shadow: inset 0 2px 8px rgba(15,23,42,.04), 0 0 0 2px rgba(204,122,78,.24); } 50% { box-shadow: inset 0 2px 8px rgba(15,23,42,.04), 0 0 0 3px rgba(204,122,78,.5); } }

/* 참고 이미지 첨부 칩 */
.fx-cd-prompt { position: relative; }
.fx-cd-drag-over .fx-cd-textarea { border-color: #cc7a4e !important; box-shadow: 0 0 0 3px rgba(204,122,78,.18) !important; pointer-events: none; }
.fx-cd-drag-over::after { content: '🖼  이미지 또는 PDF를 여기에 놓으세요'; position: absolute; inset: 12px; display: flex; align-items: center; justify-content: center; border: 2px dashed #cc7a4e; border-radius: 14px; background: rgba(246,236,227,.92); color: #b45309; font-size: 15px; font-weight: 700; pointer-events: none; z-index: 10; }
.fx-cd-refchip { padding: 10px 6px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fx-cd-refchip[hidden] { display: none; }
.fx-cd-ref { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #6b6454; background: #f6ece3; border: 1px solid #e6c9b3; border-radius: 999px; padding: 4px 8px 4px 4px; }
.fx-cd-ref-n { display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; color: #fff; background: #cc7a4e; border-radius: 999px; padding: 2px 7px; letter-spacing: -.3px; }
.fx-cd-ref--doc .fx-cd-ref-n { background: #2563eb; }
.fx-cd-ref img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }
.fx-cd-ref--doc { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; padding-left: 10px; }
.fx-cd-ref--doc .fx-cd-ref-x { background: rgba(59,130,246,.15); color: #1d4ed8; }
.fx-cd-ref--doc .fx-cd-ref-x:hover { background: rgba(59,130,246,.3); }
.fx-cd-ref-x { border: 0; background: rgba(204,122,78,.18); color: #bd6f44; width: 18px; height: 18px; border-radius: 999px; cursor: pointer; font-size: 11px; line-height: 1; }
.fx-cd-ref-x:hover { background: rgba(204,122,78,.34); }
.fx-cd-attach.has-ref { border-color: #cc7a4e; color: #cc7a4e; background: #f6ece3; }

/* 편집 스튜디오: 상단 전역 컨텍스트 바 숨기고 위 여백 제거 → 캔버스 영역 최대화 */
body.fx-ds-studio-active #page-dashboard #dashboard-context-toolbar,
body.fx-ds-studio-active #page-dashboard #branch-selector,
body.fx-ds-studio-active #page-dashboard #bemove-view-as-bar { display: none !important; }
body.fx-ds-studio-active #page-dashboard .page-content { padding-top: 0; }
body.fx-ds-studio-active #page-dashboard #tab-content { padding-top: 0; }
body.fx-ds-studio-active .fx-ds-studio { height: calc(100vh - 72px); min-height: 480px; }

/* 상단 툴바를 평평·깔끔하게(라이트 모드) + 내보내기 테라코타 */
:root:not([data-formula-theme="dark"]) body.fx-ds-studio-active .fx-ds-studio-top {
  background: transparent; border: 0; border-bottom: 1px solid #e7e1d5; border-radius: 0;
  box-shadow: none; padding: 10px 8px; margin-bottom: 12px;
}
:root:not([data-formula-theme="dark"]) .fx-ds-studio-title { color: #2b2722; }
:root:not([data-formula-theme="dark"]) .fx-ds-studio-top .btn-primary {
  background: linear-gradient(135deg,#e0986a,#cc7a4e); border-color: #cc7a4e; box-shadow: 0 2px 8px rgba(204,122,78,.28);
}
:root:not([data-formula-theme="dark"]) .fx-ds-studio-top .btn-outline:hover { border-color: #cc7a4e; color: #bd6f44; }

/* ===== 디자인 에디터는 앱이 다크여도 항상 라이트(Claude Code 톤) ===== */
/* 에디터 하위 트리에 라이트 토큰을 주입 → var(--card/border/text…) 사용처 자동 라이트화 */
:root[data-formula-theme="dark"] .fx-ds-studio {
  --card: #ffffff; --bg: #faf8f3; --border: #e7e1d5;
  --text: #2b2722; --text-sub: #574f43; --text-muted: #8c846f;
  background: #faf8f3;
  color-scheme: light; /* 네이티브 select/드롭다운이 검게 렌더되지 않도록 */
}
:root[data-formula-theme="dark"] .fx-ds-studio-top {
  background: #fff; border-color: #e7e1d5; box-shadow: 0 2px 12px rgba(80,60,40,.06);
}
:root[data-formula-theme="dark"] body.fx-ds-studio-active .fx-ds-studio-top {
  background: transparent; border: 0; border-bottom: 1px solid #e7e1d5; border-radius: 0; box-shadow: none;
}
:root[data-formula-theme="dark"] .fx-ds-studio-title { color: #2b2722; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-chat-col,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-inspector {
  background: rgba(255,253,250,.94); border-color: #e7e1d5; box-shadow: 0 12px 40px rgba(80,60,40,.12);
}
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-drawer-handle {
  background: rgba(255,253,250,.92); border-color: #e7e1d5; color: #2b2722; box-shadow: 0 6px 18px rgba(80,60,40,.12);
}
:root[data-formula-theme="dark"] .fx-ds-studio .btn-outline { background: #fff; border-color: #e7e1d5; color: #2b2722; }
:root[data-formula-theme="dark"] .fx-ds-studio .btn-outline:hover { border-color: #cc7a4e; color: #bd6f44; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-studio-top .btn-primary,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc .btn-primary {
  background: linear-gradient(135deg,#e0986a,#cc7a4e); border-color: #cc7a4e; color: #fff; box-shadow: 0 2px 8px rgba(204,122,78,.28);
}
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-zoom-ctrl { background: #f6f1ea; border-color: #e7e1d5; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-zoom-btn,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-zoom-lbl,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-zoom-fit { color: #2b2722; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-zoom-btn:hover,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-zoom-fit:hover { background: #f1e7da; color: #bd6f44; }
/* 채팅/인스펙터 내부 다크 규칙 무력화 */
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc .form-control,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-inspector .form-control,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-input-row textarea { background: #fff; color: #2b2722; border-color: #e7e1d5; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-msg.is-ai .fx-dc-msg-body { background: #f3ece2; color: #2b2722; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-msg.is-user .fx-dc-msg-body { background: linear-gradient(135deg,#e0986a,#cc7a4e); color: #fff; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-msg.is-error .fx-dc-msg-body { background: #fdecea; color: #b3261e; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-dir,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-propose,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-version { background: #f6f1ea; color: #2b2722; }
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-sel,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-chip:hover { background: #f6ece3; border-color: #e6c9b3; color: #bd6f44; }
/* 마지막 다크 잔재: 내보내기 메뉴 hover */
:root[data-formula-theme="dark"] .fx-ds-studio .fx-ds-export-menu button:hover { background: #f1e7da; }

/* ===== 에디터 채팅/인스펙터 인디고 액센트 → 테라코타(Claude 톤) · 라이트/다크 공통 ===== */
.fx-ds-studio .fx-dc-msg.is-user .fx-dc-msg-body { background: linear-gradient(135deg,#e0986a,#cc7a4e); color: #fff; }
.fx-ds-studio .fx-dc-chip:hover { background: #f6ece3; border-color: #e6c9b3; color: #bd6f44; }
.fx-ds-studio .fx-dc-input-row textarea:focus,
.fx-ds-studio .fx-ds-inspector .form-control:focus { border-color: #cc7a4e; box-shadow: 0 0 0 3px rgba(204,122,78,.16); }
.fx-ds-studio .fx-ds-vbtn:hover:not(:disabled) { background: #f6ece3; color: #bd6f44; }
.fx-ds-studio .fx-dc-steps li.is-active .fx-dc-step-mark { border-color: #cc7a4e; box-shadow: 0 0 0 3px rgba(204,122,78,.18); }
.fx-ds-studio .fx-dc-dir:hover:not(:disabled) { border-color: #e6c9b3; box-shadow: 0 4px 12px rgba(204,122,78,.14); }
.fx-ds-studio .fx-dc-dir.is-chosen { border-color: #cc7a4e; box-shadow: 0 0 0 2px rgba(204,122,78,.30); }
.fx-ds-studio .fx-dc-sel { color: #bd6f44; background: #f6ece3; border-color: #e6c9b3; }
.fx-ds-studio .fx-dc-sel-x { background: rgba(204,122,78,.16); color: #bd6f44; }
.fx-ds-studio .fx-dc-sel-x:hover { background: rgba(204,122,78,.30); }
.fx-ds-studio .fx-dc-propose:hover { border-color: #e6c9b3; color: #bd6f44; }
.fx-ds-studio .fx-dc-propose.is-on,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-propose.is-on { background: #cc7a4e; border-color: #cc7a4e; color: #fff; }
/* 하단 변형(시안) 필름스트립 — 인디고 → 테라코타 (#1 톤) */
.fx-ds-studio .fx-ds-film-no { background: rgba(204,122,78,.14); color: #bd6f44; }
.fx-ds-studio .fx-ds-film-chip.is-active { border-color: #cc7a4e; box-shadow: 0 0 0 2px rgba(204,122,78,.28); }
.fx-ds-studio .fx-ds-film-chip.is-active .fx-ds-film-no { background: #cc7a4e; color: #fff; }
.fx-ds-studio .fx-ds-film-add:hover { border-color: #cc7a4e; color: #bd6f44; }

/* ============================================================
   Claude Code 스타일 채팅 패널 (후순위 — 기존 규칙을 깔끔히 덮음)
   ============================================================ */
/* 패널이 채팅 컬럼 높이를 꽉 채워 입력 바를 항상 하단 고정(잘림 방지) */
.fx-dc { height: 100%; }
.fx-dc-input-row textarea { min-height: 60px; }
/* 패널 헤더: 초록 점 → 테라코타, 가볍게 */
.fx-dc-head { font-weight: 600; }
.fx-dc-dot { background: #cc7a4e; box-shadow: 0 0 0 4px rgba(204,122,78,.14); }
/* 빈 상태: 좌측 정렬 인사 + 스타터 칩 */
.fx-dc-empty { color: var(--text-muted); text-align: left; margin: 6px 2px 4px; padding: 0; }
.fx-dc-empty-spark { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: #f6ece3; color: #cc7a4e; font-size: 15px; margin-bottom: 12px; }
.fx-dc-empty-h { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.3px; margin-bottom: 4px; }
.fx-dc-empty-sub { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.fx-dc-suggest { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 0 0; }
.fx-dc-suggest .fx-dc-chip { text-align: left; font-size: 12.5px; padding: 9px 12px; border: 1px solid var(--border); background: var(--card); border-radius: 10px; color: var(--text); }
.fx-dc-suggest .fx-dc-chip:hover { background: #f6ece3; border-color: #e6c9b3; color: #bd6f44; }
/* AI 메시지 = 평문(버블 제거), 역할 라벨 숨김. 사용자 메시지만 버블 유지 */
.fx-dc-msg.is-ai .fx-dc-msg-role,
.fx-dc-msg.is-user .fx-dc-msg-role { display: none; }
.fx-dc-msg.is-ai { max-width: 100%; }
.fx-dc-msg.is-ai .fx-dc-msg-body,
:root[data-formula-theme="dark"] .fx-ds-studio .fx-dc-msg.is-ai .fx-dc-msg-body { display: block; background: none; box-shadow: none; border-radius: 0; padding: 0; color: var(--text); }
.fx-dc-msg.is-error .fx-dc-msg-body { background: none; color: var(--text); }
.fx-dc-msg.is-error .fx-dc-reply, .fx-dc-msg.is-error .fx-dc-prog-label { color: #b3261e; }
.fx-dc-msg.is-error .fx-dc-prog { border-color: #f3c9c4; background: #fdecea; }
/* 접이식 진행 단계 그룹 (⚡ 디자인 중 ▸) */
.fx-dc-prog { border: 1px solid var(--border); border-radius: 12px; background: #fbf7f2; overflow: hidden; margin-top: 2px; }
.fx-dc-prog-sum { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--text); user-select: none; }
.fx-dc-prog-sum::-webkit-details-marker { display: none; }
.fx-dc-prog-spark { color: #cc7a4e; font-size: 13px; }
.fx-dc-prog-label { flex: 1; }
.fx-dc-prog-chev { color: var(--text-muted); transition: transform .15s; }
.fx-dc-prog[open] .fx-dc-prog-chev { transform: rotate(90deg); }
.fx-dc-prog-body { padding: 2px 12px 12px; }
.fx-dc-prog-body .fx-dc-reply { display: block; font-size: 13px; color: var(--text-sub, var(--text-muted)); line-height: 1.6; }
.fx-dc-prog-body .fx-dc-steps { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.fx-dc-prog-body .fx-dc-steps[hidden] { display: none; }
.fx-dc-msg.is-pending .fx-dc-prog-spark { animation: fx-dc-pulse 1.1s ease-in-out infinite; }
/* 단계 마크: 활성 = 테라코타, 완료 = 중립 체크(초록 제거) */
.fx-dc-step-mark { border-color: #cabfac; }
.fx-dc-steps li.is-active .fx-dc-step-mark { border-color: #cc7a4e; box-shadow: 0 0 0 3px rgba(204,122,78,.18); }
.fx-dc-steps li.is-done .fx-dc-step-mark { border-color: #cc7a4e; background: #cc7a4e; }
/* 생성 결과 파일 아티팩트 + 피드백 */
.fx-dc-artifact { display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s; }
.fx-dc-artifact:hover { border-color: #e6c9b3; box-shadow: 0 2px 10px rgba(204,122,78,.12); }
.fx-dc-art-ic { font-size: 15px; }
.fx-dc-art-name { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-dc-art-open { color: #cc7a4e; font-size: 13px; }
.fx-dc-feedback { display: flex; gap: 4px; margin-top: 8px; }
.fx-dc-fb { border: 1px solid transparent; background: none; border-radius: 8px; padding: 3px 7px; cursor: pointer; font-size: 13px; opacity: .55; transition: opacity .12s, background .12s; }
.fx-dc-fb:hover { opacity: 1; background: #f6ece3; }
.fx-dc-fb.is-on { opacity: 1; background: #f6ece3; border-color: #e6c9b3; }
/* 하단 바: 디자인시스템 핀 + 모델·추론강도 핀 */
.fx-dc-send-row { flex-wrap: wrap; gap: 6px; }
.fx-dc-dspill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 2px 6px 2px 9px; font-size: 11.5px; font-weight: 600; color: var(--text-sub, var(--text)); flex: 0 0 auto; max-width: 160px; }
.fx-dc-ds-sel { max-width: 120px; padding-left: 2px; padding-right: 2px; }
.fx-dc-dspill:hover { border-color: #e6c9b3; color: #bd6f44; }
.fx-dc-ds-dot { width: 9px; height: 9px; border-radius: 50%; background: #cc7a4e; flex: 0 0 auto; }
.fx-dc-ds-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-dc-modelpill { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 2px 4px; flex: 0 0 auto; }
.fx-dc-modelpill:hover { border-color: #e6c9b3; }
.fx-dc-msel { border: 0; background-color: #fff !important; background-image: none; font-size: 11.5px; font-weight: 600; color: #2b2722 !important; padding: 4px 6px; cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none; outline: none; font-family: inherit; color-scheme: light !important; border-radius: 999px; }
.fx-dc-msel option { color: #2b2722; background-color: #fff; }
/* 핀 컨테이너도 흰 배경 명시(다크 테마에서 select 가 검게 비치지 않도록) */
.fx-dc-dspill, .fx-dc-modelpill { background-color: #fff !important; color-scheme: light !important; color: var(--text-sub, #5a4d3e) !important; }
.fx-dc-msel:focus { outline: none; }
.fx-dc-pilldiv { width: 1px; height: 13px; background: var(--border); }
/* 인디고 잔재 정리: form-control 포커스 링 → 테라코타 */
.fx-dc .form-control:focus { border-color: #cc7a4e; box-shadow: 0 0 0 3px rgba(204,122,78,.16); }

@media (max-width: 720px) {
  .fx-cd-title { font-size: 32px; }
  .fx-cd-types { flex-wrap: wrap; }
  .fx-cd-typecard { transform: none; width: 132px; }
}

@media (max-width: 1000px) {
  .fx-ds-studio-body { display: flex; flex-direction: column; overflow: visible; border-radius: 0; }
  .fx-ds-studio { height: auto; }
  .fx-ds-chat-col, .fx-ds-inspector { position: static; transform: none !important; inset: auto; width: auto; z-index: auto; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .fx-ds-chat-col { height: auto; min-height: 240px; max-height: 50vh; }
  .fx-ds-studio-body .fx-ds-stage { position: relative; inset: auto; height: min(60vh, 460px); }
  #fx-ds-chat-handle, #fx-ds-insp-handle { display: none !important; }
  .fx-ds-home { padding: 14px 16px 40px; }
}

/* ── 발표(Present/Focus) 모드: 출력물이 주인공, 크롬 전부 숨김, 전체화면 캔버스 ── */
.fx-ds-present-bar { display: none; }
.fx-ds-studio.fx-ds-present {
  position: fixed; inset: 0; z-index: 1200;
  height: 100vh; min-height: 0; margin: 0; padding: 0;
  background: var(--ds-canvas-bg, #faf9f6);
}
.fx-ds-studio.fx-ds-present .fx-ds-studio-top,
.fx-ds-studio.fx-ds-present .fx-ds-chat-col,
.fx-ds-studio.fx-ds-present .fx-ds-inspector,
.fx-ds-studio.fx-ds-present #fx-ds-chat-handle,
.fx-ds-studio.fx-ds-present #fx-ds-insp-handle { display: none !important; }
.fx-ds-studio.fx-ds-present .fx-ds-stage { border-radius: 0; }
.fx-ds-studio.fx-ds-present .fx-ds-present-bar {
  display: flex; align-items: center; gap: 8px;
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 1300; padding: 7px 10px;
  background: color-mix(in srgb, var(--card, #fff) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border, rgba(15,23,42,.1)); border-radius: 999px;
  box-shadow: 0 8px 30px rgba(15,23,42,.16);
}
.fx-ds-present-bar button {
  border: none; background: transparent; cursor: pointer;
  font: 600 13px/1 'Noto Sans KR', sans-serif; color: var(--text, #2b2722);
  padding: 7px 11px; border-radius: 999px;
}
.fx-ds-present-bar button:hover { background: rgba(15,23,42,.06); }
.fx-ds-present-bar .fx-ds-present-zoom { min-width: 46px; text-align: center; font-size: 12px; color: var(--text-muted, #6b7280); }
.fx-ds-present-slidenav { display: inline-flex; align-items: center; gap: 4px; }
.fx-ds-present-slidenav button { font-size: 18px; line-height: 1; padding: 5px 12px; }
.fx-ds-present-count { min-width: 52px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text, #2b2722); }
.fx-ds-present-div { width: 1px; height: 20px; background: var(--border, rgba(15,23,42,.14)); margin: 0 4px; }

/* 슬라이드 필름스트립(덱 장별 편집) — 캔버스 하단 플로팅 */
.fx-ds-filmstrip { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 19; display: flex; gap: 8px; align-items: center; justify-content: center; overflow-x: auto; padding: 8px 10px; background: color-mix(in srgb, var(--card) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 34px rgba(15,23,42,.16); }
.fx-ds-film-chip { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--text); font: 600 12px/1 'Noto Sans KR', sans-serif; max-width: 180px; }
.fx-ds-film-chip.is-active { border-color: var(--primary, #6366f1); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #6366f1) 30%, transparent); }
.fx-ds-film-no { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--primary, #6366f1) 14%, transparent); color: var(--primary, #6366f1); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.fx-ds-film-ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-ds-film-del { flex: 0 0 auto; opacity: .45; font-size: 14px; padding: 0 2px; border-radius: 4px; }
.fx-ds-film-del:hover { opacity: 1; color: #dc2626; background: rgba(220,38,38,.1); }
.fx-ds-film-add { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; border: 1px dashed var(--border); background: transparent; color: var(--text-muted, #6b7280); cursor: pointer; font-size: 18px; }
.fx-ds-film-add:hover { color: var(--text); border-color: var(--primary, #6366f1); }
.fx-ds-studio.fx-ds-present .fx-ds-filmstrip { display: none !important; }
@media (max-width: 1000px) { .fx-ds-filmstrip { position: static; inset: auto; margin: 8px 0; } }
.fx-ds-present-bar .fx-ds-present-exit { background: var(--primary, #6366f1); color: #fff; }
.fx-ds-present-bar .fx-ds-present-exit:hover { filter: brightness(1.05); background: var(--primary, #6366f1); }
:root:not([data-formula-theme="dark"]) .fx-ds-present-bar .fx-ds-present-exit { background: #cc7a4e; }
:root:not([data-formula-theme="dark"]) .fx-ds-present-bar .fx-ds-present-exit:hover { background: #bd6f44; }


/* ── PT 고객 DB (OT 전환 퍼널) ─────────────────────────── */
.fx-pt-cust-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fx-pt-cust-toolbar .form-control { width: 220px; flex: 0 0 auto; }
.fx-pt-leads-table td { font-size: 13px; vertical-align: middle; }
.fx-pt-leads-table .fx-lead-datecell { cursor: pointer; min-width: 100px; white-space: nowrap; }
.fx-pt-leads-table .fx-lead-datecell:hover { background: var(--hover); }
.fx-lead-date-val   { font-size: 12px; font-weight: 600; color: var(--text); }
.fx-lead-date-empty { font-size: 12px; color: var(--text-muted); }
.fx-lead-date-input { font-size: 12px; padding: 2px 6px; border: 1px solid var(--primary); border-radius: 6px; background: var(--card); color: var(--text); width: 130px; }
.fx-lead-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.fx-lead-badge-new     { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.fx-lead-badge-tmdone  { background: #e8f0fe; color: #1a56db; }
.fx-lead-badge-ot1done { background: #fef3c7; color: #92400e; }
.fx-lead-badge-ot2done { background: #d1fae5; color: #065f46; }
.fx-lead-badge-pt      { background: var(--primary); color: #fff; }
.fx-lead-badge-pt_conv { background: var(--primary); color: #fff; }
.fx-lead-badge-pt_fail { background: #fee2e2; color: #991b1b; }
.fx-lead-actions { white-space: nowrap; }
.fx-lead-done    { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.fx-lead-fail    { font-size: 11px; color: #991b1b; font-weight: 600; }
.fx-lead-empty   { text-align: center; padding: 32px !important; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.btn-xs { font-size: 11px; padding: 2px 10px; line-height: 1.6; border-radius: 6px; }
@media (max-width: 768px) {
  .fx-pt-cust-toolbar .form-control { width: 100%; flex: 1 1 auto; }
}
