/* ============================================
   MONFFICE - Theme System v2.0
   테마별 전체 색상 시스템 (배경/글자/카드/폼 전부 제어)
   ============================================ */

/* ── 공통 기본값 (라이트 테마 기반) ─────────────────── */
:root {
  --primary: #E87400;
  --primary-light: #FF9A33;
  --primary-dark: #C56200;
  --primary-bg: #FFF8F0;
  --primary-surface: #FEF3E2;

  /* 배경 */
  --body-bg: #F3F4F6;
  --content-bg: #F3F4F6;

  /* 카드 */
  --card-bg: #FFFFFF;
  --card-border: #E5E7EB;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.07);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.10);

  /* 텍스트 */
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --text-placeholder: #9CA3AF;

  /* 헤더 */
  --header-bg: rgba(255,255,255,0.85);
  --header-border: rgba(232,116,0,0.3);
  --header-backdrop: blur(12px);

  /* 사이드바 */
  --sidebar-bg: #4A2C1A;
  --sidebar-text: #FEF3E2;
  --sidebar-active: #E87400;
  --sidebar-hover: rgba(232,116,0,0.15);

  /* 폼 */
  --input-bg: #FFFFFF;
  --input-border: #D1D5DB;
  --input-text: #111827;
  --input-focus-border: var(--primary);
  --input-focus-shadow: rgba(232,116,0,0.12);

  /* 테이블 */
  --table-header-bg: #F9FAFB;
  --table-header-text: #6B7280;
  --table-row-border: #F3F4F6;
  --table-row-hover: var(--primary-surface);
  --table-border: #E5E7EB;

  /* 모달 */
  --modal-bg: #FFFFFF;
  --modal-overlay: rgba(0,0,0,0.45);
  --modal-border: #E5E7EB;

  /* 뱃지 */
  --badge-bg: var(--primary);
  --badge-text: #FFFFFF;
  --badge-success-bg: #D1FAE5; --badge-success-text: #065F46;
  --badge-warning-bg: #FEF3C7; --badge-warning-text: #92400E;
  --badge-danger-bg:  #FEE2E2; --badge-danger-text:  #991B1B;
  --badge-info-bg:    #DBEAFE; --badge-info-text:    #1E40AF;
  --badge-gray-bg:    #F3F4F6; --badge-gray-text:    #4B5563;

  /* 버튼 */
  --btn-primary: var(--primary);
  --btn-primary-hover: var(--primary-dark);

  /* 스크롤바 */
  --scrollbar-thumb: #CBD5E1;

  /* 글래스모피즘 (라이트에선 약하게) */
  --glass-bg: rgba(255,255,255,0.7);
  --glass-border: rgba(255,255,255,0.5);
  --glass-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --glass-blur: blur(12px);

  /* TinyMCE */
  --tinymce-skin: oxide;
  --tinymce-toolbar-bg: #F9FAFB;
  --tinymce-border: #D1D5DB;

}

/* ============================================
   Pilot. Moncher Warm Preview (운영 영향 없는 테스트 테마)
   ============================================ */
[data-theme="moncher-warm-preview"] {
  --primary: #C95F00;
  --primary-light: #F18A26;
  --primary-dark: #8F3F00;
  --primary-bg: #FFF4E8;
  --primary-surface: #FFE1BD;
  --primary-rgb: 201,95,0;

  --body-bg: #F5F7FA;
  --content-bg: #F5F7FA;
  --card-bg: #FFFFFF;
  --card-border: #DCE5EE;
  --card-shadow: 0 1px 2px rgba(17,24,39,0.04), 0 10px 24px rgba(17,24,39,0.06);
  --card-shadow-hover: 0 16px 36px rgba(17,24,39,0.10);

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-placeholder: #94A3B8;

  --header-bg: rgba(255,255,255,0.86);
  --header-border: rgba(220,229,238,0.92);
  --header-backdrop: blur(16px);
  --sidebar-bg: #241C18;
  --sidebar-text: #E8E1D9;
  --sidebar-active: rgba(201,95,0,0.94);
  --sidebar-hover: rgba(255,244,232,0.11);

  --input-bg: #FFFFFF;
  --input-border: #C8D4E2;
  --input-text: #0F172A;
  --input-focus-border: #C95F00;
  --input-focus-shadow: rgba(201,95,0,0.15);

  --table-header-bg: #EEF3F8;
  --table-header-text: #475569;
  --table-row-border: #DCE5EE;
  --table-row-hover: #FFF4E8;
  --table-border: #DCE5EE;

  --modal-bg: #FFFFFF;
  --modal-overlay: rgba(15,23,42,0.48);
  --modal-border: #DCE5EE;

  --badge-bg: #C95F00;
  --badge-text: #FFFFFF;
  --badge-success-bg: #DCFCE7; --badge-success-text: #166534;
  --badge-warning-bg: #FEF3C7; --badge-warning-text: #92400E;
  --badge-danger-bg: #FEE2E2; --badge-danger-text: #991B1B;
  --badge-info-bg: #DBEAFE; --badge-info-text: #1D4ED8;
  --badge-gray-bg: #F1F5F9; --badge-gray-text: #475569;
  --semantic-info-bg: #EFF6FF;
  --semantic-info-border: #BFDBFE;
  --semantic-info-text: #1D4ED8;
  --semantic-success-bg: #ECFDF5;
  --semantic-success-border: #A7F3D0;
  --semantic-success-text: #047857;
  --semantic-warning-bg: #FFFBEB;
  --semantic-warning-border: #FDE68A;
  --semantic-warning-text: #B45309;
  --semantic-danger-bg: #FEF2F2;
  --semantic-danger-border: #FECACA;
  --semantic-danger-text: #B91C1C;
  --semantic-neutral-bg: #F8FAFC;
  --semantic-neutral-border: #E2E8F0;
  --semantic-neutral-text: #475569;
  --semantic-accent-bg: #F5F3FF;
  --semantic-accent-border: #DDD6FE;
  --semantic-accent-text: #6D28D9;

  --btn-primary: #C95F00;
  --btn-primary-hover: #8F3F00;
  --scrollbar-thumb: #BFCAD8;

  --glass-bg: rgba(255,255,255,0.78);
  --glass-border: rgba(220,229,238,0.9);
  --glass-shadow: 0 18px 42px rgba(17,24,39,0.10);
  --glass-blur: blur(16px);

  --tinymce-skin: oxide;
  --tinymce-toolbar-bg: #F5F7FA;
  --tinymce-border: #C8D4E2;

  --surface-canvas: #F5F7FA;
  --surface-panel: #EEF3F8;
  --surface-card: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --surface-glass: rgba(255,255,255,0.78);
  --surface-hover: #FFF4E8;
  --surface-selected: #FFE1BD;
  --surface-pressed: #F7C985;
  --text-main: #0F172A;
  --text-sub: #334155;
  --text-disabled: #94A3B8;
  --text-inverse: #FFFFFF;
  --text-link: #A74F00;
  --border: #DCE5EE;
  --border-subtle: #EAF0F6;
  --border-strong: #BFCAD8;
  --divider: #DCE5EE;
  --focus-ring: rgba(201,95,0,0.18);
  --overlay: rgba(15,23,42,0.48);
  --dropdown-bg: #FFFFFF;
  --dropdown-border: #DCE5EE;
  --dropdown-hover: #FFF4E8;
  --chat-bg: #F3F6F9;
  --chat-panel-bg: #FFFFFF;
  --chat-bubble-in: #FFFFFF;
  --chat-bubble-out: #C95F00;
  --chat-bubble-out-text: #FFFFFF;
  --reply-quote-bg: #FFF4E8;
  --reply-quote-border: #F18A26;
  --dropzone-bg: #FFF4E8;
  --dropzone-border: #F7C985;
  --dropzone-hover: #FFE1BD;
  --button-primary-bg: #C95F00;
  --button-primary-hover: #8F3F00;
  --button-primary-text: #FFFFFF;
  --button-secondary-bg: #FFFFFF;
  --button-secondary-hover: #FFF4E8;
  --button-ghost-hover: #EEF3F8;
  --button-danger-bg: #DC2626;
  --button-danger-hover: #B91C1C;
  --nav-bg: #241C18;
  --nav-text: #E8E1D9;
  --nav-hover: rgba(255,244,232,0.11);
  --nav-active-bg: #C95F00;
  --nav-active-text: #FFFFFF;
  --topbar-bg: rgba(255,255,255,0.88);
  --topbar-border: rgba(220,229,238,0.92);
  --topbar-icon-hover: #FFF4E8;
  --dropdown-shadow: 0 18px 42px rgba(17,24,39,0.16);
  --modal-surface: #FFFFFF;
  --modal-shadow: 0 28px 72px rgba(17,24,39,0.24);
  --modal-close-hover: #EEF3F8;
  --table-row-selected: #FFE1BD;
  --table-sticky-bg: #F5F7FA;
  --editor-bg: #FFFFFF;
  --editor-toolbar-bg: #F5F7FA;
  --editor-border: #C8D4E2;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(17,24,39,0.04);
  --shadow-sm: var(--card-shadow);
  --shadow-md: var(--card-shadow-hover);
  --shadow-popover: 0 18px 42px rgba(17,24,39,0.16);
  --shadow-modal: 0 28px 72px rgba(17,24,39,0.24);
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(.2,0,0,1);
}

/* ============================================
   1. MC Orange (몽슈슈 메인 컬러) — 기본
   ============================================ */
[data-theme="mc-orange"] {
  --primary: #E87400;
  --primary-light: #FF9A33;
  --primary-dark: #C56200;
  --primary-bg: #FFF8F0;
  --primary-surface: #FEF3E2;

  --body-bg: #FFF3E6;
  --content-bg: #FFF3E6;
  --card-bg: #FFFFFF;
  --card-border: #F0D9B5;
  --card-shadow: 0 1px 4px rgba(232,116,0,0.06);
  --card-shadow-hover: 0 6px 20px rgba(232,116,0,0.12);

  --text-primary: #1A0F00;
  --text-secondary: #4A2C1A;
  --text-muted: #8B6040;

  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(232,116,0,0.25);
  --sidebar-bg: #4A2C1A;
  --sidebar-text: #FEF3E2;
  --sidebar-active: #E87400;
  --sidebar-hover: rgba(232,116,0,0.18);

  --input-bg: #FFFFFF;
  --input-border: #E8C89A;
  --input-text: #1A0F00;
  --input-focus-shadow: rgba(232,116,0,0.15);

  --table-header-bg: #FFF3E6;
  --table-header-text: #8B6040;
  --table-row-border: #FDE8C8;
  --table-row-hover: #FEF3E2;

  --modal-bg: #FFFFFF;
  --modal-border: #F0D9B5;

  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(232,116,0,0.15);
  --glass-shadow: 0 4px 24px rgba(232,116,0,0.10);

  --badge-bg: #E87400; --badge-text: #fff;
  --btn-primary: #E87400;
  --btn-primary-hover: #C56200;
  --tinymce-skin: oxide;
  --tinymce-toolbar-bg: #FFF8F0;
  --tinymce-border: #E8C89A;
}

/* ============================================
   2. Dark Brown (몽슈슈 서브 컬러)
   ============================================ */
[data-theme="dark-brown"] {
  --primary: #4A2C1A;
  --primary-light: #6B4530;
  --primary-dark: #2E1A0F;
  --primary-bg: #FAF5F0;
  --primary-surface: #F0E6D9;

  --body-bg: #EDE3D8;
  --content-bg: #EDE3D8;
  --card-bg: #FAF5F0;
  --card-border: #D4C4B0;
  --card-shadow: 0 1px 4px rgba(74,44,26,0.08);
  --card-shadow-hover: 0 6px 20px rgba(74,44,26,0.14);

  --text-primary: #1A0D05;
  --text-secondary: #3D2010;
  --text-muted: #7A5C44;

  --header-bg: rgba(250,245,240,0.90);
  --header-border: rgba(74,44,26,0.2);
  --sidebar-bg: #2E1A0F;
  --sidebar-text: #F0E6D9;
  --sidebar-active: #E87400;
  --sidebar-hover: rgba(232,116,0,0.15);

  --input-bg: #FAF5F0;
  --input-border: #C4A882;
  --input-text: #1A0D05;
  --input-focus-shadow: rgba(74,44,26,0.12);

  --table-header-bg: #EDE3D8;
  --table-header-text: #7A5C44;
  --table-row-border: #E0D0BC;
  --table-row-hover: #F0E6D9;

  --modal-bg: #FAF5F0;
  --modal-border: #D4C4B0;

  --glass-bg: rgba(250,245,240,0.75);
  --glass-border: rgba(74,44,26,0.12);
  --glass-shadow: 0 4px 24px rgba(74,44,26,0.10);

  --badge-bg: #4A2C1A; --badge-text: #F0E6D9;
  --btn-primary: #4A2C1A;
  --btn-primary-hover: #2E1A0F;
  --tinymce-skin: oxide;
  --tinymce-toolbar-bg: #F0E6D9;
  --tinymce-border: #C4A882;
}

/* ============================================
   3. Dark (풀 다크모드)
   ============================================ */
[data-theme="dark"] {
  --primary: #FF9A33;
  --primary-light: #FFB366;
  --primary-dark: #E87400;
  --primary-bg: #1F2937;
  --primary-surface: #374151;

  --body-bg: #0F172A;
  --content-bg: #0F172A;
  --card-bg: #1E293B;
  --card-border: #334155;
  --card-shadow: 0 1px 4px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 6px 24px rgba(0,0,0,0.4);

  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --text-placeholder: #475569;

  --header-bg: rgba(15,23,42,0.85);
  --header-border: rgba(255,154,51,0.2);
  --sidebar-bg: #0F172A;
  --sidebar-text: #CBD5E1;
  --sidebar-active: rgba(255,154,51,0.25);
  --sidebar-hover: rgba(255,255,255,0.05);

  --input-bg: #1E293B;
  --input-border: #475569;
  --input-text: #F1F5F9;
  --input-focus-border: #FF9A33;
  --input-focus-shadow: rgba(255,154,51,0.15);

  --table-header-bg: #1E293B;
  --table-header-text: #94A3B8;
  --table-row-border: #1E293B;
  --table-row-hover: #263248;
  --table-border: #334155;

  --modal-bg: #1E293B;
  --modal-overlay: rgba(0,0,0,0.7);
  --modal-border: #334155;

  /* 글래스모피즘 - 다크에서 강하게 */
  --glass-bg: rgba(30,41,59,0.75);
  --glass-border: rgba(255,255,255,0.08);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.4);
  --glass-blur: blur(16px);

  --badge-bg: #FF9A33; --badge-text: #0F172A;
  --badge-success-bg: #064E3B; --badge-success-text: #6EE7B7;
  --badge-warning-bg: #78350F; --badge-warning-text: #FDE68A;
  --badge-danger-bg:  #7F1D1D; --badge-danger-text:  #FCA5A5;
  --badge-info-bg:    #1E3A5F; --badge-info-text:    #93C5FD;
  --badge-gray-bg:    #374151; --badge-gray-text:    #9CA3AF;

  --btn-primary: #FF9A33;
  --btn-primary-hover: #E87400;
  --scrollbar-thumb: #475569;

  --tinymce-skin: oxide-dark;
  --tinymce-toolbar-bg: #1E293B;
  --tinymce-border: #475569;
}

/* ============================================
   4. Mint (청록/민트)
   ============================================ */
[data-theme="mint"] {
  --primary: #0D9488;
  --primary-light: #14B8A6;
  --primary-dark: #0F766E;
  --primary-bg: #F0FDFA;
  --primary-surface: #CCFBF1;

  --body-bg: #E6FAF8;
  --content-bg: #E6FAF8;
  --card-bg: #FFFFFF;
  --card-border: #99F6E4;
  --card-shadow: 0 1px 4px rgba(13,148,136,0.07);
  --card-shadow-hover: 0 6px 20px rgba(13,148,136,0.13);

  --text-primary: #042F2E;
  --text-secondary: #134E4A;
  --text-muted: #2D7570;

  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(13,148,136,0.25);
  --sidebar-bg: #134E4A;
  --sidebar-text: #CCFBF1;
  --sidebar-active: rgba(20,184,166,0.3);
  --sidebar-hover: rgba(20,184,166,0.15);

  --input-bg: #FFFFFF;
  --input-border: #5EEAD4;
  --input-text: #042F2E;
  --input-focus-border: #0D9488;
  --input-focus-shadow: rgba(13,148,136,0.12);

  --table-header-bg: #F0FDFA;
  --table-header-text: #2D7570;
  --table-row-border: #CCFBF1;
  --table-row-hover: #F0FDFA;

  --modal-bg: #FFFFFF;
  --modal-border: #99F6E4;

  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(13,148,136,0.15);
  --glass-shadow: 0 4px 24px rgba(13,148,136,0.10);

  --badge-bg: #0D9488; --badge-text: #fff;
  --btn-primary: #0D9488;
  --btn-primary-hover: #0F766E;
  --tinymce-skin: oxide;
  --tinymce-toolbar-bg: #F0FDFA;
  --tinymce-border: #5EEAD4;
}

/* ============================================
   5. Navy (네이비)
   ============================================ */
[data-theme="navy"] {
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --primary-bg: #EFF6FF;
  --primary-surface: #DBEAFE;

  --body-bg: #E8F0FE;
  --content-bg: #E8F0FE;
  --card-bg: #FFFFFF;
  --card-border: #BFDBFE;
  --card-shadow: 0 1px 4px rgba(37,99,235,0.07);
  --card-shadow-hover: 0 6px 20px rgba(37,99,235,0.13);

  --text-primary: #0F1B3D;
  --text-secondary: #1E3A8A;
  --text-muted: #3B5AA0;

  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(37,99,235,0.22);
  --sidebar-bg: #1E3A8A;
  --sidebar-text: #DBEAFE;
  --sidebar-active: rgba(59,130,246,0.3);
  --sidebar-hover: rgba(59,130,246,0.15);

  --input-bg: #FFFFFF;
  --input-border: #93C5FD;
  --input-text: #0F1B3D;
  --input-focus-border: #2563EB;
  --input-focus-shadow: rgba(37,99,235,0.12);

  --table-header-bg: #EFF6FF;
  --table-header-text: #3B5AA0;
  --table-row-border: #DBEAFE;
  --table-row-hover: #EFF6FF;

  --modal-bg: #FFFFFF;
  --modal-border: #BFDBFE;

  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(37,99,235,0.14);
  --glass-shadow: 0 4px 24px rgba(37,99,235,0.10);

  --badge-bg: #2563EB; --badge-text: #fff;
  --btn-primary: #2563EB;
  --btn-primary-hover: #1D4ED8;
  --tinymce-skin: oxide;
  --tinymce-toolbar-bg: #EFF6FF;
  --tinymce-border: #93C5FD;
}

/* ============================================
   6. Rose Gold (로즈골드)
   ============================================ */
[data-theme="rose-gold"] {
  --primary: #BE7088;
  --primary-light: #D4919A;
  --primary-dark: #9A5862;
  --primary-bg: #FFF5F7;
  --primary-surface: #FFE4E9;

  --body-bg: #FDEEF1;
  --content-bg: #FDEEF1;
  --card-bg: #FFFFFF;
  --card-border: #FECDD3;
  --card-shadow: 0 1px 4px rgba(190,112,136,0.07);
  --card-shadow-hover: 0 6px 20px rgba(190,112,136,0.13);

  --text-primary: #3B0D18;
  --text-secondary: #7F2233;
  --text-muted: #A05068;

  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(190,112,136,0.22);
  --sidebar-bg: #7F1D1D;
  --sidebar-text: #FFE4E9;
  --sidebar-active: rgba(212,145,154,0.3);
  --sidebar-hover: rgba(212,145,154,0.15);

  --input-bg: #FFFFFF;
  --input-border: #FECDD3;
  --input-text: #3B0D18;
  --input-focus-border: #BE7088;
  --input-focus-shadow: rgba(190,112,136,0.12);

  --table-header-bg: #FFF5F7;
  --table-header-text: #A05068;
  --table-row-border: #FFE4E9;
  --table-row-hover: #FFF5F7;

  --modal-bg: #FFFFFF;
  --modal-border: #FECDD3;

  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(190,112,136,0.15);
  --glass-shadow: 0 4px 24px rgba(190,112,136,0.10);

  --badge-bg: #BE7088; --badge-text: #fff;
  --btn-primary: #BE7088;
  --btn-primary-hover: #9A5862;
  --tinymce-skin: oxide;
  --tinymce-toolbar-bg: #FFF5F7;
  --tinymce-border: #FECDD3;
}

/* ============================================
   v3.83.34 Modernized legacy theme aliases
   기존 테마 ID는 유지하고 색상·표면 토큰만 현대화한다.
   ============================================ */
[data-theme="mc-orange"] {
  --primary: #C95F00;
  --primary-light: #F18A26;
  --primary-dark: #8F3F00;
  --primary-bg: #FFF4E8;
  --primary-surface: #FFE1BD;
  --primary-rgb: 201,95,0;
  --body-bg: #F6F7F9;
  --content-bg: #F6F7F9;
  --card-bg: #FFFFFF;
  --card-border: #DCE5EE;
  --card-shadow: 0 1px 2px rgba(17,24,39,0.04), 0 10px 24px rgba(17,24,39,0.06);
  --card-shadow-hover: 0 16px 36px rgba(17,24,39,0.10);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-placeholder: #94A3B8;
  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(220,229,238,0.92);
  --sidebar-bg: #3A2417;
  --sidebar-text: #E8E1D9;
  --sidebar-active: #C95F00;
  --sidebar-hover: rgba(255,244,232,0.11);
  --input-bg: #FFFFFF;
  --input-border: #C8D4E2;
  --input-text: #0F172A;
  --input-focus-border: #C95F00;
  --input-focus-shadow: rgba(201,95,0,0.15);
  --table-header-bg: #EEF3F8;
  --table-header-text: #475569;
  --table-row-border: #DCE5EE;
  --table-row-hover: #FFF4E8;
  --table-border: #DCE5EE;
  --modal-bg: #FFFFFF;
  --modal-border: #DCE5EE;
  --glass-bg: rgba(255,255,255,0.78);
  --glass-border: rgba(220,229,238,0.9);
  --glass-shadow: 0 18px 42px rgba(17,24,39,0.10);
  --badge-bg: #C95F00; --badge-text: #FFFFFF;
  --btn-primary: #C95F00;
  --btn-primary-hover: #8F3F00;
  --tinymce-toolbar-bg: #F6F7F9;
  --tinymce-border: #C8D4E2;
}

[data-theme="dark-brown"] {
  --primary: #8B5E34;
  --primary-light: #B7804A;
  --primary-dark: #5A3A22;
  --primary-bg: #F6EEE7;
  --primary-surface: #EAD9C8;
  --primary-rgb: 139,94,52;
  --body-bg: #F5F4F2;
  --content-bg: #F5F4F2;
  --card-bg: #FFFFFF;
  --card-border: #DED7CF;
  --card-shadow: 0 1px 2px rgba(31,28,25,0.04), 0 10px 24px rgba(31,28,25,0.07);
  --card-shadow-hover: 0 16px 36px rgba(31,28,25,0.11);
  --text-primary: #1C1713;
  --text-secondary: #3B332D;
  --text-muted: #76695F;
  --text-placeholder: #A79C92;
  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(222,215,207,0.92);
  --sidebar-bg: #2A211A;
  --sidebar-text: #E8DED4;
  --sidebar-active: #8B5E34;
  --sidebar-hover: rgba(246,238,231,0.11);
  --input-bg: #FFFFFF;
  --input-border: #CFC4B8;
  --input-text: #1C1713;
  --input-focus-border: #8B5E34;
  --input-focus-shadow: rgba(139,94,52,0.14);
  --table-header-bg: #EEEAE6;
  --table-header-text: #65584D;
  --table-row-border: #E5DED7;
  --table-row-hover: #F6EEE7;
  --table-border: #DED7CF;
  --modal-bg: #FFFFFF;
  --modal-border: #DED7CF;
  --glass-bg: rgba(255,255,255,0.78);
  --glass-border: rgba(222,215,207,0.9);
  --glass-shadow: 0 18px 42px rgba(31,28,25,0.10);
  --badge-bg: #8B5E34; --badge-text: #FFFFFF;
  --btn-primary: #8B5E34;
  --btn-primary-hover: #5A3A22;
  --tinymce-toolbar-bg: #F5F4F2;
  --tinymce-border: #CFC4B8;
}

[data-theme="dark"] {
  --primary: #F59E0B;
  --primary-light: #FBBF24;
  --primary-dark: #D97706;
  --primary-bg: #2B2114;
  --primary-surface: #3A2B16;
  --primary-rgb: 245,158,11;
  --body-bg: #0B1120;
  --content-bg: #0B1120;
  --card-bg: #111827;
  --card-border: #263244;
  --card-shadow: 0 1px 2px rgba(0,0,0,0.20), 0 12px 28px rgba(0,0,0,0.28);
  --card-shadow-hover: 0 18px 44px rgba(0,0,0,0.36);
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-placeholder: #64748B;
  --header-bg: rgba(11,17,32,0.88);
  --header-border: rgba(38,50,68,0.92);
  --sidebar-bg: #080D18;
  --sidebar-text: #CBD5E1;
  --sidebar-active: #D97706;
  --sidebar-hover: rgba(255,255,255,0.07);
  --input-bg: #111827;
  --input-border: #334155;
  --input-text: #F8FAFC;
  --input-focus-border: #F59E0B;
  --input-focus-shadow: rgba(245,158,11,0.18);
  --table-header-bg: #162033;
  --table-header-text: #CBD5E1;
  --table-row-border: #263244;
  --table-row-hover: #1B2537;
  --table-border: #263244;
  --modal-bg: #111827;
  --modal-border: #263244;
  --modal-overlay: rgba(0,0,0,0.72);
  --glass-bg: rgba(17,24,39,0.78);
  --glass-border: rgba(148,163,184,0.14);
  --glass-shadow: 0 20px 48px rgba(0,0,0,0.36);
  --badge-bg: #F59E0B; --badge-text: #111827;
  --btn-primary: #F59E0B;
  --btn-primary-hover: #D97706;
  --tinymce-toolbar-bg: #162033;
  --tinymce-border: #334155;
}

[data-theme="mint"] {
  --primary: #0F766E;
  --primary-light: #14B8A6;
  --primary-dark: #115E59;
  --primary-bg: #ECFDF5;
  --primary-surface: #CCFBF1;
  --primary-rgb: 15,118,110;
  --body-bg: #F6F8F7;
  --content-bg: #F6F8F7;
  --card-bg: #FFFFFF;
  --card-border: #D9E5E1;
  --card-shadow: 0 1px 2px rgba(20,32,31,0.04), 0 10px 24px rgba(20,32,31,0.06);
  --card-shadow-hover: 0 16px 36px rgba(20,32,31,0.10);
  --text-primary: #10201F;
  --text-secondary: #2F4F4B;
  --text-muted: #647873;
  --text-placeholder: #96A7A3;
  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(217,229,225,0.92);
  --sidebar-bg: #073B36;
  --sidebar-text: #DDF7EF;
  --sidebar-active: #0F766E;
  --sidebar-hover: rgba(221,247,239,0.11);
  --input-bg: #FFFFFF;
  --input-border: #BDD5CE;
  --input-text: #10201F;
  --input-focus-border: #0F766E;
  --input-focus-shadow: rgba(15,118,110,0.14);
  --table-header-bg: #EEF5F2;
  --table-header-text: #4B665F;
  --table-row-border: #D9E5E1;
  --table-row-hover: #ECFDF5;
  --table-border: #D9E5E1;
  --modal-bg: #FFFFFF;
  --modal-border: #D9E5E1;
  --glass-bg: rgba(255,255,255,0.78);
  --glass-border: rgba(217,229,225,0.9);
  --glass-shadow: 0 18px 42px rgba(20,32,31,0.10);
  --badge-bg: #0F766E; --badge-text: #FFFFFF;
  --btn-primary: #0F766E;
  --btn-primary-hover: #115E59;
  --tinymce-toolbar-bg: #F6F8F7;
  --tinymce-border: #BDD5CE;
}

[data-theme="navy"] {
  --primary: #2563EB;
  --primary-light: #60A5FA;
  --primary-dark: #1D4ED8;
  --primary-bg: #EFF6FF;
  --primary-surface: #DBEAFE;
  --primary-rgb: 37,99,235;
  --body-bg: #F6F8FB;
  --content-bg: #F6F8FB;
  --card-bg: #FFFFFF;
  --card-border: #DCE5F2;
  --card-shadow: 0 1px 2px rgba(16,24,39,0.04), 0 10px 24px rgba(16,24,39,0.06);
  --card-shadow-hover: 0 16px 36px rgba(16,24,39,0.10);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-placeholder: #94A3B8;
  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(220,229,242,0.92);
  --sidebar-bg: #0B2A55;
  --sidebar-text: #DBEAFE;
  --sidebar-active: #2563EB;
  --sidebar-hover: rgba(219,234,254,0.10);
  --input-bg: #FFFFFF;
  --input-border: #C5D3E8;
  --input-text: #0F172A;
  --input-focus-border: #2563EB;
  --input-focus-shadow: rgba(37,99,235,0.14);
  --table-header-bg: #EEF4FB;
  --table-header-text: #475569;
  --table-row-border: #DCE5F2;
  --table-row-hover: #EFF6FF;
  --table-border: #DCE5F2;
  --modal-bg: #FFFFFF;
  --modal-border: #DCE5F2;
  --glass-bg: rgba(255,255,255,0.78);
  --glass-border: rgba(220,229,242,0.9);
  --glass-shadow: 0 18px 42px rgba(16,24,39,0.10);
  --badge-bg: #2563EB; --badge-text: #FFFFFF;
  --btn-primary: #2563EB;
  --btn-primary-hover: #1D4ED8;
  --tinymce-toolbar-bg: #F6F8FB;
  --tinymce-border: #C5D3E8;
}

[data-theme="rose-gold"] {
  --primary: #B76E79;
  --primary-light: #D69AA4;
  --primary-dark: #8A4B56;
  --primary-bg: #FFF3F5;
  --primary-surface: #F8DDE3;
  --primary-rgb: 183,110,121;
  --body-bg: #F8F6F5;
  --content-bg: #F8F6F5;
  --card-bg: #FFFFFF;
  --card-border: #E7D8DB;
  --card-shadow: 0 1px 2px rgba(36,27,31,0.04), 0 10px 24px rgba(36,27,31,0.06);
  --card-shadow-hover: 0 16px 36px rgba(36,27,31,0.10);
  --text-primary: #241B1F;
  --text-secondary: #513D44;
  --text-muted: #7C6570;
  --text-placeholder: #AA9AA2;
  --header-bg: rgba(255,255,255,0.88);
  --header-border: rgba(231,216,219,0.92);
  --sidebar-bg: #3A1725;
  --sidebar-text: #F4E6EA;
  --sidebar-active: #B76E79;
  --sidebar-hover: rgba(244,230,234,0.11);
  --input-bg: #FFFFFF;
  --input-border: #D9C3C9;
  --input-text: #241B1F;
  --input-focus-border: #B76E79;
  --input-focus-shadow: rgba(183,110,121,0.14);
  --table-header-bg: #F2ECEE;
  --table-header-text: #6B5560;
  --table-row-border: #E7D8DB;
  --table-row-hover: #FFF3F5;
  --table-border: #E7D8DB;
  --modal-bg: #FFFFFF;
  --modal-border: #E7D8DB;
  --glass-bg: rgba(255,255,255,0.78);
  --glass-border: rgba(231,216,219,0.9);
  --glass-shadow: 0 18px 42px rgba(36,27,31,0.10);
  --badge-bg: #B76E79; --badge-text: #FFFFFF;
  --btn-primary: #B76E79;
  --btn-primary-hover: #8A4B56;
  --tinymce-toolbar-bg: #F8F6F5;
  --tinymce-border: #D9C3C9;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"]
) {
  --surface-canvas: var(--content-bg);
  --surface-panel: var(--table-header-bg);
  --surface-card: var(--card-bg);
  --surface-elevated: #FFFFFF;
  --surface-glass: var(--glass-bg);
  --surface-hover: var(--table-row-hover);
  --surface-selected: var(--primary-surface);
  --surface-pressed: var(--primary-surface);
  --text-main: var(--text-primary);
  --text-sub: var(--text-secondary);
  --text-disabled: var(--text-placeholder);
  --text-inverse: #FFFFFF;
  --text-link: var(--primary-dark);
  --border: var(--card-border);
  --border-subtle: var(--table-row-border);
  --border-strong: var(--input-border);
  --divider: var(--card-border);
  --focus-ring: var(--input-focus-shadow);
  --overlay: rgba(17,24,39,0.44);
  --dropdown-bg: #FFFFFF;
  --dropdown-border: var(--card-border);
  --dropdown-hover: var(--table-row-hover);
  --dropdown-shadow: 0 18px 42px rgba(17,24,39,0.14);
  --chat-bg: var(--content-bg);
  --chat-panel-bg: #FFFFFF;
  --chat-bubble-in: #FFFFFF;
  --chat-bubble-out: var(--primary);
  --chat-bubble-out-text: #FFFFFF;
  --reply-quote-bg: var(--primary-bg);
  --reply-quote-border: var(--primary-light);
  --dropzone-bg: var(--primary-bg);
  --dropzone-border: var(--primary-surface);
  --dropzone-hover: var(--primary-surface);
  --button-primary-bg: var(--primary);
  --button-primary-hover: var(--primary-dark);
  --button-primary-text: #FFFFFF;
  --button-secondary-bg: #FFFFFF;
  --button-secondary-hover: var(--table-row-hover);
  --button-ghost-hover: var(--table-header-bg);
  --button-danger-bg: #DC2626;
  --button-danger-hover: #B91C1C;
  --nav-bg: var(--sidebar-bg);
  --nav-text: var(--sidebar-text);
  --nav-hover: var(--sidebar-hover);
  --nav-active-bg: var(--primary);
  --nav-active-text: #FFFFFF;
  --topbar-bg: var(--header-bg);
  --topbar-border: var(--header-border);
  --topbar-icon-hover: var(--table-row-hover);
  --modal-surface: #FFFFFF;
  --modal-shadow: 0 28px 72px rgba(17,24,39,0.22);
  --modal-close-hover: var(--table-header-bg);
  --table-row-selected: var(--primary-surface);
  --table-sticky-bg: var(--content-bg);
  --editor-bg: #FFFFFF;
  --editor-toolbar-bg: var(--tinymce-toolbar-bg);
  --editor-border: var(--tinymce-border);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(17,24,39,0.04);
  --shadow-sm: var(--card-shadow);
  --shadow-md: var(--card-shadow-hover);
  --shadow-popover: var(--dropdown-shadow);
  --shadow-modal: var(--modal-shadow);
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(.2,0,0,1);
  --theme-page-bg: linear-gradient(180deg, rgba(248,250,252,0.96) 0%, var(--surface-canvas) 42%, var(--table-header-bg) 100%);
  --theme-card-bg: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, #FFFFFF 72%, rgba(248,250,252,0.82) 100%);
  --theme-panel-head-bg: linear-gradient(180deg, rgba(248,250,252,0.95), rgba(255,255,255,0.82));
  --theme-control-bg: rgba(255,255,255,0.86);
  --theme-input-bg: rgba(255,255,255,0.94);
  --theme-popover-bg: rgba(255,255,255,0.97);
  --theme-sidebar-bg: linear-gradient(180deg, var(--sidebar-bg) 0%, color-mix(in srgb, var(--sidebar-bg) 82%, #000 18%) 58%, color-mix(in srgb, var(--sidebar-bg) 70%, #000 30%) 100%);
  --theme-sidebar-panel-bg: rgba(255,255,255,0.035);
  --theme-sidebar-border: rgba(255,255,255,0.10);
  --theme-nav-icon: rgba(255,255,255,0.72);
  --theme-shadow-ambient: rgba(17,24,39,0.08);
}

[data-theme="dark"] {
  --surface-canvas: #0B1120;
  --surface-panel: #162033;
  --surface-card: #111827;
  --surface-elevated: #1B2537;
  --surface-glass: rgba(17,24,39,0.78);
  --surface-hover: #1B2537;
  --surface-selected: #2B2114;
  --surface-pressed: #3A2B16;
  --text-main: #F8FAFC;
  --text-sub: #CBD5E1;
  --text-disabled: #64748B;
  --text-inverse: #111827;
  --text-link: #FBBF24;
  --border: #263244;
  --border-subtle: #202B3C;
  --border-strong: #334155;
  --divider: #263244;
  --focus-ring: rgba(245,158,11,0.18);
  --overlay: rgba(0,0,0,0.72);
  --dropdown-bg: #111827;
  --dropdown-border: #263244;
  --dropdown-hover: #1B2537;
  --dropdown-shadow: 0 22px 54px rgba(0,0,0,0.42);
  --chat-bg: #0B1120;
  --chat-panel-bg: #111827;
  --chat-bubble-in: #1B2537;
  --chat-bubble-out: #D97706;
  --chat-bubble-out-text: #FFFFFF;
  --reply-quote-bg: #2B2114;
  --reply-quote-border: #F59E0B;
  --dropzone-bg: #1B2537;
  --dropzone-border: #334155;
  --dropzone-hover: #2B2114;
  --button-primary-bg: #F59E0B;
  --button-primary-hover: #D97706;
  --button-primary-text: #111827;
  --button-secondary-bg: #111827;
  --button-secondary-hover: #1B2537;
  --button-ghost-hover: #162033;
  --button-danger-bg: #DC2626;
  --button-danger-hover: #B91C1C;
  --nav-bg: #080D18;
  --nav-text: #CBD5E1;
  --nav-hover: rgba(255,255,255,0.07);
  --nav-active-bg: #D97706;
  --nav-active-text: #FFFFFF;
  --topbar-bg: rgba(11,17,32,0.88);
  --topbar-border: rgba(38,50,68,0.92);
  --topbar-icon-hover: #1B2537;
  --modal-surface: #111827;
  --modal-shadow: 0 30px 80px rgba(0,0,0,0.48);
  --modal-close-hover: #1B2537;
  --table-row-selected: #2B2114;
  --table-sticky-bg: #0B1120;
  --editor-bg: #111827;
  --editor-toolbar-bg: #162033;
  --editor-border: #334155;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.24);
  --shadow-sm: var(--card-shadow);
  --shadow-md: var(--card-shadow-hover);
  --shadow-popover: var(--dropdown-shadow);
  --shadow-modal: var(--modal-shadow);
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(.2,0,0,1);
  --theme-page-bg: linear-gradient(180deg, #0B1120 0%, #0E1728 52%, #111827 100%);
  --theme-card-bg: linear-gradient(180deg, rgba(17,24,39,0.98) 0%, #111827 72%, rgba(15,23,42,0.92) 100%);
  --theme-panel-head-bg: linear-gradient(180deg, rgba(22,32,51,0.98), rgba(17,24,39,0.86));
  --theme-control-bg: rgba(17,24,39,0.86);
  --theme-input-bg: rgba(17,24,39,0.94);
  --theme-popover-bg: rgba(17,24,39,0.98);
  --theme-sidebar-bg: linear-gradient(180deg, #0B1120 0%, #080D18 64%, #050915 100%);
  --theme-sidebar-panel-bg: rgba(255,255,255,0.035);
  --theme-sidebar-border: rgba(148,163,184,0.12);
  --theme-nav-icon: rgba(203,213,225,0.76);
  --theme-shadow-ambient: rgba(0,0,0,0.30);
}

[data-theme="mc-orange"] {
  --theme-sidebar-bg: linear-gradient(180deg, #4A2B17 0%, #2E1F16 54%, #1B1714 100%);
}

[data-theme="moncher-warm-preview"] {
  --theme-sidebar-bg: linear-gradient(180deg, #2B211C 0%, #1E1916 58%, #151412 100%);
}

[data-theme="dark-brown"] {
  --theme-sidebar-bg: linear-gradient(180deg, #34281E 0%, #261E18 56%, #171310 100%);
}

[data-theme="mint"] {
  --theme-sidebar-bg: linear-gradient(180deg, #074B43 0%, #06342F 58%, #041F1C 100%);
}

[data-theme="navy"] {
  --theme-sidebar-bg: linear-gradient(180deg, #0C3266 0%, #0A244A 58%, #07152C 100%);
}

[data-theme="rose-gold"] {
  --theme-sidebar-bg: linear-gradient(180deg, #4A1D30 0%, #321724 58%, #1E1018 100%);
}

[data-theme="liquid-glass"] {
  --primary: #67E8F9;
  --primary-light: #A78BFA;
  --primary-dark: #22D3EE;
  --primary-bg: rgba(103,232,249,0.14);
  --primary-surface: rgba(167,139,250,0.20);
  --primary-rgb: 103,232,249;
  --body-bg: #090E1A;
  --content-bg: #090E1A;
  --card-bg: rgba(13,20,38,0.78);
  --card-border: rgba(148,163,184,0.22);
  --card-shadow: 0 1px 2px rgba(255,255,255,0.06) inset, 0 18px 42px rgba(0,0,0,0.26);
  --card-shadow-hover: 0 1px 2px rgba(255,255,255,0.08) inset, 0 24px 58px rgba(20,184,166,0.16);
  --text-primary: #F8FAFC;
  --text-secondary: #C7D2FE;
  --text-muted: #94A3B8;
  --text-placeholder: #64748B;
  --header-bg: rgba(9,14,26,0.68);
  --header-border: rgba(148,163,184,0.18);
  --sidebar-bg: #080B16;
  --sidebar-text: #DDFBFF;
  --sidebar-active: #67E8F9;
  --sidebar-hover: rgba(103,232,249,0.13);
  --input-bg: rgba(13,20,38,0.72);
  --input-border: rgba(148,163,184,0.28);
  --input-text: #F8FAFC;
  --input-focus-border: #67E8F9;
  --input-focus-shadow: rgba(103,232,249,0.22);
  --table-header-bg: rgba(15,23,42,0.72);
  --table-header-text: #C7D2FE;
  --table-row-border: rgba(148,163,184,0.16);
  --table-row-hover: rgba(103,232,249,0.10);
  --table-border: rgba(148,163,184,0.20);
  --modal-bg: rgba(13,20,38,0.88);
  --modal-border: rgba(148,163,184,0.24);
  --modal-overlay: rgba(2,6,23,0.70);
  --glass-bg: rgba(13,20,38,0.58);
  --glass-border: rgba(255,255,255,0.14);
  --glass-shadow: 0 24px 72px rgba(0,0,0,0.40);
  --badge-bg: #67E8F9; --badge-text: #07111F;
  --btn-primary: #67E8F9;
  --btn-primary-hover: #22D3EE;
  --tinymce-toolbar-bg: rgba(15,23,42,0.84);
  --tinymce-border: rgba(148,163,184,0.28);

  --surface-canvas: #090E1A;
  --surface-panel: rgba(15,23,42,0.72);
  --surface-card: rgba(13,20,38,0.78);
  --surface-elevated: rgba(18,27,49,0.88);
  --surface-glass: rgba(13,20,38,0.58);
  --surface-hover: rgba(103,232,249,0.10);
  --surface-selected: rgba(103,232,249,0.16);
  --surface-pressed: rgba(167,139,250,0.18);
  --text-main: #F8FAFC;
  --text-sub: #C7D2FE;
  --text-disabled: #64748B;
  --text-inverse: #07111F;
  --text-link: #67E8F9;
  --border: rgba(148,163,184,0.22);
  --border-subtle: rgba(148,163,184,0.14);
  --border-strong: rgba(103,232,249,0.34);
  --divider: rgba(148,163,184,0.16);
  --focus-ring: rgba(103,232,249,0.24);
  --overlay: rgba(2,6,23,0.70);
  --dropdown-bg: rgba(13,20,38,0.92);
  --dropdown-border: rgba(148,163,184,0.22);
  --dropdown-hover: rgba(103,232,249,0.12);
  --dropdown-shadow: 0 28px 78px rgba(0,0,0,0.44);
  --chat-bg: #090E1A;
  --chat-panel-bg: rgba(13,20,38,0.72);
  --chat-bubble-in: rgba(30,41,59,0.78);
  --chat-bubble-out: linear-gradient(135deg, #22D3EE, #A78BFA);
  --chat-bubble-out-text: #07111F;
  --reply-quote-bg: rgba(103,232,249,0.12);
  --reply-quote-border: #67E8F9;
  --dropzone-bg: rgba(103,232,249,0.10);
  --dropzone-border: rgba(103,232,249,0.28);
  --dropzone-hover: rgba(167,139,250,0.18);
  --button-primary-bg: #67E8F9;
  --button-primary-hover: #22D3EE;
  --button-primary-text: #07111F;
  --button-secondary-bg: rgba(13,20,38,0.76);
  --button-secondary-hover: rgba(103,232,249,0.12);
  --button-ghost-hover: rgba(103,232,249,0.10);
  --button-danger-bg: #FB7185;
  --button-danger-hover: #F43F5E;
  --nav-bg: #080B16;
  --nav-text: #DDFBFF;
  --nav-hover: rgba(103,232,249,0.13);
  --nav-active-bg: #67E8F9;
  --nav-active-text: #07111F;
  --topbar-bg: rgba(9,14,26,0.68);
  --topbar-border: rgba(148,163,184,0.18);
  --topbar-icon-hover: rgba(103,232,249,0.12);
  --modal-surface: rgba(13,20,38,0.88);
  --modal-shadow: 0 34px 92px rgba(0,0,0,0.52);
  --modal-close-hover: rgba(103,232,249,0.12);
  --table-row-selected: rgba(103,232,249,0.14);
  --table-sticky-bg: rgba(9,14,26,0.96);
  --editor-bg: rgba(13,20,38,0.76);
  --editor-toolbar-bg: rgba(15,23,42,0.84);
  --editor-border: rgba(148,163,184,0.28);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(255,255,255,0.06) inset;
  --shadow-sm: var(--card-shadow);
  --shadow-md: var(--card-shadow-hover);
  --shadow-popover: var(--dropdown-shadow);
  --shadow-modal: var(--modal-shadow);
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(.2,0,0,1);
  --theme-page-bg:
    radial-gradient(circle at 18% 12%, rgba(103,232,249,0.20), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(167,139,250,0.20), transparent 30%),
    linear-gradient(180deg, #090E1A 0%, #0D1324 52%, #070B14 100%);
  --theme-card-bg: linear-gradient(180deg, rgba(18,27,49,0.82), rgba(13,20,38,0.66));
  --theme-panel-head-bg: linear-gradient(180deg, rgba(30,41,59,0.78), rgba(13,20,38,0.44));
  --theme-control-bg: rgba(13,20,38,0.72);
  --theme-input-bg: rgba(13,20,38,0.72);
  --theme-popover-bg: rgba(13,20,38,0.92);
  --theme-sidebar-bg:
    radial-gradient(circle at 20% 12%, rgba(103,232,249,0.22), transparent 30%),
    linear-gradient(180deg, rgba(8,11,22,0.88), rgba(7,10,20,0.74) 58%, rgba(3,7,18,0.92));
  --theme-sidebar-panel-bg: rgba(255,255,255,0.055);
  --theme-sidebar-border: rgba(255,255,255,0.16);
  --theme-nav-icon: rgba(221,251,255,0.78);
  --theme-shadow-ambient: rgba(0,0,0,0.34);
}

/* ============================================
   글래스모피즘 유틸리티 클래스
   ============================================ */
.glass {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
}
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
}
.glass-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

/* ============================================
   전역 테마 오버라이드 - 모든 테마에서 Tailwind 하드코딩 색상 교체
   ============================================ */

/* ─── bg-white / bg-gray-* → 테마 카드 배경 ─── */
[data-theme] .bg-white { background-color: var(--card-bg) !important; }
[data-theme] .bg-gray-50 { background-color: var(--table-header-bg) !important; }
[data-theme] .bg-gray-100 { background-color: var(--primary-surface) !important; }

/* ─── 텍스트 색상 ─── */
[data-theme] .text-gray-900 { color: var(--text-primary) !important; }
[data-theme] .text-gray-800 { color: var(--text-primary) !important; }
[data-theme] .text-gray-700 { color: var(--text-secondary) !important; }
[data-theme] .text-gray-600 { color: var(--text-secondary) !important; }
[data-theme] .text-gray-500 { color: var(--text-muted) !important; }

/* ─── 테두리 색상 ─── */
[data-theme] .border-gray-200 { border-color: var(--card-border) !important; }
[data-theme] .border-gray-100 { border-color: var(--table-row-border) !important; }

/* ─── 폼 요소 ─── */
[data-theme] input:not([type="radio"]):not([type="checkbox"]),
[data-theme] textarea,
[data-theme] select {
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--input-border) !important;
}

/* ─── hover 상태 ─── */
[data-theme] .hover\:bg-gray-50:hover { background-color: var(--table-row-hover) !important; }
[data-theme] .hover\:bg-gray-100:hover { background-color: var(--primary-surface) !important; }

/* ─── Kanban 컬럼 배경 ─── */
[data-theme] .bg-gray-50.rounded-xl,
[data-theme] .rounded-xl.bg-gray-50 { background-color: var(--body-bg) !important; }

/* ─── 분리선 ─── */
[data-theme] .divide-gray-100 > * + * { border-color: var(--card-border) !important; }

/* ============================================
   다크 테마 전역 오버라이드 (강화판)
   ============================================ */
[data-theme="dark"] body { background-color: var(--body-bg); color: var(--text-primary); }
[data-theme="dark"] .bg-white { background-color: var(--card-bg) !important; }
[data-theme="dark"] .bg-gray-50 { background-color: #1a2234 !important; }
[data-theme="dark"] .bg-gray-100 { background-color: #263248 !important; }
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800 { color: var(--text-primary) !important; }
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400 { color: var(--text-muted) !important; }
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 { border-color: var(--card-border) !important; }
[data-theme="dark"] .border-gray-100 { border-color: #263248 !important; }
[data-theme="dark"] input:not([type="radio"]):not([type="checkbox"]),
[data-theme="dark"] textarea,
[data-theme="dark"] select { background-color: var(--input-bg) !important; color: var(--input-text) !important; border-color: var(--input-border) !important; }
[data-theme="dark"] .divide-gray-100 > * + * { border-color: #263248 !important; }
[data-theme="dark"] .hover\:bg-gray-50:hover { background-color: #263248 !important; }
[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: #2D3A50 !important; }


/* ============================================
   TinyMCE — 모든 테마에서 테마 변수 통일 적용
   (툴바/상태바/테두리는 테마 변수, 편집 본문은 흰 문서 표면)
   ============================================ */
[data-theme] .tox-tinymce {
  border-color: var(--tinymce-border, #d1d5db) !important;
  border-radius: 10px !important;
}
[data-theme] .tox .tox-toolbar__primary,
[data-theme] .tox .tox-toolbar-overlord {
  background: var(--tinymce-toolbar-bg) !important;
  border-bottom-color: var(--tinymce-border) !important;
}
[data-theme] .tox .tox-statusbar {
  background: var(--tinymce-toolbar-bg) !important;
  border-top-color: var(--tinymce-border) !important;
  color: var(--text-muted) !important;
}
[data-theme] .tox .tox-statusbar__text-container,
[data-theme] .tox .tox-statusbar__branding { color: var(--text-muted) !important; }
/* 편집 영역 컨테이너 배경 (iframe 주변 패딩 영역) */
[data-theme] .tox .tox-edit-area {
  background: #ffffff !important;
  color-scheme: light;
}
/* iframe 자체의 background 속성 — JS(content_style)가 내부를 담당하므로 컨테이너만 맞춤 */
[data-theme] .tox .tox-edit-area__iframe {
  background: #ffffff !important;
  color-scheme: light;
}
/* 다크 테마: 툴바 버튼/메뉴 텍스트 색상 보정 */
[data-theme="dark"] .tox .tox-tbtn { color: var(--text-secondary) !important; }
[data-theme="dark"] .tox .tox-tbtn svg { fill: var(--text-secondary) !important; }
[data-theme="dark"] .tox .tox-tbtn:hover { background: var(--primary-surface) !important; }
[data-theme="dark"] .tox-editor-header { background: var(--tinymce-toolbar-bg) !important; }
[data-theme="dark"] .tox .tox-menubar { background: var(--tinymce-toolbar-bg) !important; }
[data-theme="dark"] .tox .tox-mbtn { color: var(--text-secondary) !important; }
