/* ================================================
   ORDARS Dark Mode Styles
   다크모드 전용 스타일 - 인라인 스타일 오버라이드
   ================================================ */

/* ------------------------------------------------
   Color Variables
   ------------------------------------------------ */
html.dark {
  --dark-bg-primary: #0f172a;
  --dark-bg-secondary: #1e293b;
  --dark-bg-tertiary: #334155;
  --dark-border: #334155;
  --dark-border-light: #475569;
  --dark-text-primary: #f1f5f9;
  --dark-text-secondary: #cbd5e1;
  --dark-text-muted: #94a3b8;
}

/* ------------------------------------------------
   Global Overrides - Background colors
   ------------------------------------------------ */
html.dark [style*="background: white"],
html.dark [style*="background-color: white"],
html.dark [style*="background:#fff"],
html.dark [style*="background-color:#fff"],
html.dark [style*="background: #fff"],
html.dark [style*="background-color: #fff"],
html.dark [style*="background:#ffffff"],
html.dark [style*="background-color:#ffffff"],
html.dark [style*="background: #ffffff"],
html.dark [style*="background-color: #ffffff"] {
  background: #1e293b !important;
}

html.dark [style*="background: #f9fafb"],
html.dark [style*="background-color: #f9fafb"],
html.dark [style*="background:#f9fafb"],
html.dark [style*="background-color:#f9fafb"] {
  background: #0f172a !important;
}

html.dark [style*="background: #f3f4f6"],
html.dark [style*="background-color: #f3f4f6"],
html.dark [style*="background:#f3f4f6"],
html.dark [style*="background-color:#f3f4f6"] {
  background: #1e293b !important;
}

html.dark [style*="background: #f8fafc"],
html.dark [style*="background-color: #f8fafc"] {
  background: #0f172a !important;
}

/* ------------------------------------------------
   Global Overrides - Border colors
   ------------------------------------------------ */
html.dark [style*="border: 1px solid #e5e7eb"],
html.dark [style*="border-bottom: 1px solid #e5e7eb"],
html.dark [style*="border-top: 1px solid #e5e7eb"],
html.dark [style*="border-color: #e5e7eb"],
html.dark [style*="border-color:#e5e7eb"] {
  border-color: #334155 !important;
}

html.dark [style*="border: 1px solid #f3f4f6"],
html.dark [style*="border-color: #f3f4f6"],
html.dark [style*="border-color:#f3f4f6"],
html.dark [style*="border-bottom: 1px solid #f3f4f6"],
html.dark [style*="border-top: 1px solid #f3f4f6"] {
  border-color: #334155 !important;
}

html.dark [style*="border: 1px solid #d1d5db"],
html.dark [style*="border-color: #d1d5db"] {
  border-color: #475569 !important;
}

/* ------------------------------------------------
   Global Overrides - Text colors
   ------------------------------------------------ */
html.dark [style*="color: #111827"],
html.dark [style*="color:#111827"] {
  color: #f1f5f9 !important;
}

html.dark [style*="color: #374151"],
html.dark [style*="color:#374151"] {
  color: #cbd5e1 !important;
}

html.dark [style*="color: #4b5563"],
html.dark [style*="color:#4b5563"] {
  color: #94a3b8 !important;
}

html.dark [style*="color: #6b7280"],
html.dark [style*="color:#6b7280"] {
  color: #94a3b8 !important;
}

html.dark [style*="color: #9ca3af"],
html.dark [style*="color:#9ca3af"] {
  color: #64748b !important;
}

/* ------------------------------------------------
   Cards
   ------------------------------------------------ */
html.dark .company-card,
html.dark .member-company-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html.dark .company-card:hover,
html.dark .member-company-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html.dark .company-card h3,
html.dark .member-company-card h3 {
  color: #f1f5f9 !important;
}

html.dark .company-card span,
html.dark .member-company-card span {
  color: #cbd5e1;
}

html.dark .company-card svg,
html.dark .member-company-card svg {
  stroke: #64748b !important;
}

/* Card footer */
html.dark .company-card > div:last-child,
html.dark .member-company-card > div:last-child {
  background: #0f172a !important;
  border-top-color: #334155 !important;
}

/* ------------------------------------------------
   Buttons
   ------------------------------------------------ */
/* Primary buttons - keep original colors */
html.dark button[style*="background: #3b82f6"],
html.dark button[style*="background-color: #3b82f6"],
html.dark [style*="background: #2563eb"],
html.dark [style*="background-color: #2563eb"] {
  background: #2563eb !important;
}

/* Secondary/Cancel buttons */
html.dark button[style*="background: white"],
html.dark button[style*="background-color: white"] {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* Danger buttons - keep original */
html.dark button[style*="background: #dc2626"],
html.dark button[style*="background-color: #dc2626"],
html.dark button[style*="background: #ef4444"],
html.dark button[style*="background-color: #ef4444"] {
  background: #dc2626 !important;
}

/* ------------------------------------------------
   Forms and Inputs
   ------------------------------------------------ */
html.dark input:not([type="color"]),
html.dark select,
html.dark textarea {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark input:disabled,
html.dark select:disabled,
html.dark textarea:disabled {
  background: #1e293b !important;
  color: #64748b !important;
}

/* Read-only inputs */
html.dark input[readonly],
html.dark div[style*="background: #f9fafb"][style*="border"] {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* ------------------------------------------------
   Labels and text
   ------------------------------------------------ */
html.dark label {
  color: #cbd5e1 !important;
}

html.dark p {
  color: #94a3b8;
}

/* ------------------------------------------------
   Info boxes
   ------------------------------------------------ */
html.dark [style*="background: #eff6ff"],
html.dark [style*="background-color: #eff6ff"] {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Gradient info boxes (linear-gradient with #eff6ff or #f0fdf4) */
html.dark [style*="linear-gradient"][style*="#eff6ff"],
html.dark [style*="linear-gradient"][style*="#f0fdf4"] {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

html.dark [style*="color: #1e40af"] {
  color: #93c5fd !important;
}

/* Success boxes */
html.dark [style*="background: #f0fdf4"],
html.dark [style*="background-color: #f0fdf4"] {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}

html.dark [style*="color: #166534"] {
  color: #4ade80 !important;
}

/* Warning boxes */
html.dark [style*="background: #fef3c7"],
html.dark [style*="background-color: #fef3c7"] {
  background: rgba(245, 158, 11, 0.15) !important;
}

html.dark [style*="color: #b45309"] {
  color: #fbbf24 !important;
}

/* Error boxes */
html.dark [style*="background: #fef2f2"],
html.dark [style*="background-color: #fef2f2"] {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

/* ------------------------------------------------
   Tables
   ------------------------------------------------ */
html.dark table {
  border-color: #334155 !important;
}

html.dark th {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

html.dark td {
  border-color: #334155 !important;
  color: #cbd5e1 !important;
  background: transparent !important;
}

html.dark tr:hover td {
  background: rgba(59, 130, 246, 0.05) !important;
}

html.dark tbody tr:nth-child(even) td {
  background: rgba(30, 41, 59, 0.5) !important;
}

/* ------------------------------------------------
   Modals (Rails Modal Manager)
   ------------------------------------------------ */
html.dark .rmm-modal {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html.dark .rmm-modal .rmm-header {
  background: inherit;
  border-bottom-color: #334155 !important;
}

html.dark .rmm-modal .rmm-body {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

html.dark .rmm-modal .rmm-body > div:not(.rmm-sidebar):not(.rmm-sidebar-overlay) {
  background: transparent !important;
}

html.dark .rmm-modal .rmm-footer {
  background: #0f172a !important;
  border-top-color: #334155 !important;
}

/* Modal sidebar */
html.dark .rmm-modal .rmm-sidebar,
html.dark .rmm-modal .rmm-body > .rmm-sidebar {
  background: #0f172a !important;
  border-right-color: #334155 !important;
}

/* Modal sidebar overlay (mobile) */
html.dark .rmm-sidebar-overlay {
  background: rgba(0, 0, 0, 0.5) !important;
}

html.dark .rmm-modal .rmm-sidebar-item {
  color: #cbd5e1 !important;
}

html.dark .rmm-modal .rmm-sidebar-item:hover {
  background: #1e293b !important;
}

html.dark .rmm-modal .rmm-sidebar-item.rmm-active {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

/* Modal submenu */
html.dark .rmm-modal .rmm-submenu {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}

html.dark .rmm-modal .rmm-submenu-inner {
  background: #1e293b !important;
}

html.dark .rmm-modal .rmm-submenu-item {
  color: #94a3b8 !important;
}

html.dark .rmm-modal .rmm-submenu-item:hover {
  color: #e2e8f0 !important;
}

html.dark .rmm-modal .rmm-submenu-item.rmm-active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3) !important;
}

/* Modal tab panels */
html.dark .rmm-modal .rmm-tab-panel {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

/* Modal overlay */
html.dark .rmm-overlay {
  background: rgba(0, 0, 0, 0.75) !important;
}

/* ------------------------------------------------
   Modal content specific
   ------------------------------------------------ */
html.dark .rmm-modal h3,
html.dark .rmm-modal h4 {
  color: #f1f5f9 !important;
}

html.dark .rmm-modal label {
  color: #cbd5e1 !important;
}

html.dark .rmm-modal p {
  color: #94a3b8 !important;
}

/* Modal buttons */
html.dark .rmm-modal .rmm-footer button[style*="background: white"],
html.dark .rmm-modal .rmm-footer button[style*="background-color: white"],
html.dark .rmm-modal button[style*="background: #f3f4f6"],
html.dark .rmm-modal button[style*="background-color: #f3f4f6"] {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* ------------------------------------------------
   Color settings panel in profile modal
   ------------------------------------------------ */
html.dark .color-section {
  border-color: #334155 !important;
}

html.dark .color-section-header {
  background: #0f172a !important;
}

html.dark .color-section-header:hover {
  background: #1e293b !important;
}

html.dark .color-section-title {
  color: #e2e8f0 !important;
}

html.dark .color-section-body {
  background: #1e293b !important;
  border-top-color: #334155 !important;
}

html.dark .color-label {
  color: #94a3b8 !important;
}

html.dark .color-input {
  border-color: #475569 !important;
}

html.dark .color-text {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .color-type-btn {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
}

html.dark .color-type-btn.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: white !important;
}

html.dark .gradient-settings {
  background: #0f172a !important;
}

html.dark .recommended-section {
  border-top-color: #334155 !important;
}

html.dark .recommended-title {
  color: #e2e8f0 !important;
}

html.dark .mode-toggle-container {
  background: #0f172a !important;
  border-color: #334155 !important;
}

html.dark .mode-toggle-btn {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
}

html.dark .mode-toggle-btn:hover {
  background: #334155 !important;
  color: #e2e8f0 !important;
}

html.dark .mode-toggle-btn.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: white !important;
}

html.dark .mode-toggle-btn.active.dark-btn {
  background: #475569 !important;
  border-color: #64748b !important;
}

/* ------------------------------------------------
   Taskbar
   ------------------------------------------------ */
html.dark .rmm-taskbar {
  background: #1e293b !important;
  border-top-color: #334155 !important;
}

html.dark .rmm-taskbar-item {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

html.dark .rmm-taskbar-item:hover {
  background: #475569 !important;
}

html.dark .rmm-taskbar-item.active {
  background: #3b82f6 !important;
}

/* ------------------------------------------------
   Scrollbar
   ------------------------------------------------ */
html.dark ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ------------------------------------------------
   Snackbar
   ------------------------------------------------ */
html.dark .snackbar {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* ------------------------------------------------
   Badges and tags
   ------------------------------------------------ */
/* Keep colored badges mostly as-is but adjust for readability */
html.dark .company-type-badge.company-type-individual {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

html.dark .company-type-badge.company-type-sole_proprietor {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fcd34d !important;
}

html.dark .company-type-badge.company-type-corporation {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #86efac !important;
}

/* Status badges */
html.dark [style*="background: #dbeafe"] {
  background: rgba(59, 130, 246, 0.2) !important;
}

html.dark [style*="color: #1d4ed8"] {
  color: #93c5fd !important;
}

html.dark [style*="background: #dcfce7"] {
  background: rgba(34, 197, 94, 0.2) !important;
}

html.dark [style*="color: #15803d"] {
  color: #86efac !important;
}

/* ------------------------------------------------
   General Chat (일반 채팅)
   ------------------------------------------------ */
/* 채팅 목록 모달 */
html.dark .general-chat-list-header {
  border-bottom-color: #334155 !important;
}

html.dark .general-chat-list-item {
  border-bottom-color: #334155 !important;
}

html.dark .general-chat-list-item:hover {
  background: #334155 !important;
}

html.dark .general-chat-list-item-name {
  color: #f1f5f9 !important;
}

html.dark .general-chat-list-item-preview {
  color: #94a3b8 !important;
}

html.dark .general-chat-list-item-time {
  color: #64748b !important;
}

html.dark .general-chat-list-company-tag {
  background: #334155 !important;
  color: #94a3b8 !important;
}

html.dark .general-chat-list-secure-tag {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
}

html.dark .general-chat-list-empty {
  color: #64748b !important;
}

html.dark .general-chat-list-empty svg {
  color: #475569 !important;
}

/* 새 대화 모달 */
html.dark .general-chat-new-search-area {
  border-bottom-color: #334155 !important;
}

html.dark .general-chat-new-company-select label {
  color: #94a3b8 !important;
}

html.dark .general-chat-new-company-select select {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .general-chat-new-search-input-wrapper {
  background: #1e293b !important;
}

html.dark .general-chat-new-search-input-wrapper input {
  color: #e2e8f0 !important;
}

html.dark .general-chat-new-search-input-wrapper input::placeholder {
  color: #64748b !important;
}

html.dark .general-chat-new-e2e-option {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: #e2e8f0 !important;
}

html.dark .general-chat-new-e2e-option:hover {
  background: rgba(34, 197, 94, 0.2) !important;
}

html.dark .general-chat-new-hint {
  color: #64748b !important;
}

html.dark .general-chat-new-user-item {
  border-bottom-color: #334155 !important;
}

html.dark .general-chat-new-user-item:hover {
  background: #334155 !important;
}

html.dark .general-chat-new-user-avatar {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
}

html.dark .general-chat-new-user-name {
  color: #f1f5f9 !important;
}

html.dark .general-chat-new-user-email {
  color: #94a3b8 !important;
}

html.dark .general-chat-new-online-indicator {
  border-color: #1e293b !important;
}

/* 대화 모달 (C 모달) */
html.dark .general-chat-room-messages {
  background: #1e293b !important;
}

html.dark .general-chat-room-loading,
html.dark .general-chat-room-error {
  color: #64748b !important;
}

/* 메시지 버블 - 상대방 */
html.dark [id^="general-chat-room-content-"] .general-chat-message.theirs .general-chat-message-bubble {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* 시스템 메시지 */
html.dark [id^="general-chat-room-content-"] .general-chat-message.system .general-chat-message-bubble {
  background: #334155 !important;
  color: #94a3b8 !important;
}

/* 메시지 발신자 */
html.dark [id^="general-chat-room-content-"] .general-chat-message-sender {
  color: #94a3b8 !important;
}

/* 입력 영역 */
html.dark .general-chat-room-input {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .general-chat-room-input:focus {
  background: #0f172a !important;
}

html.dark .general-chat-room-input::placeholder {
  color: #64748b !important;
}

/* ------------------------------------------------
   Support Chat (고객지원 채팅)
   ------------------------------------------------ */
/* 공통 배경 */
html.dark .support-chat-user,
html.dark .support-chat-admin,
html.dark .support-chat-room-messages,
html.dark .support-chat-messages,
html.dark .support-chat-admin-messages {
  background: #1e293b !important;
}

/* 문의 목록 모달 */
html.dark .support-chat-list-item {
  border-bottom-color: #334155 !important;
}

html.dark .support-chat-list-item:hover {
  background: #334155 !important;
}

html.dark .support-chat-list-item-name {
  color: #f1f5f9 !important;
}

html.dark .support-chat-list-item-preview {
  color: #94a3b8 !important;
}

/* 운영진용 채팅 사이드바 */
html.dark .support-chat-admin-sidebar {
  background: #0f172a !important;
  border-right-color: #334155 !important;
}

html.dark .support-chat-admin-sidebar-header {
  border-bottom-color: #334155 !important;
}

html.dark .support-chat-admin-sidebar-header h3 {
  color: #f1f5f9 !important;
}

html.dark .support-chat-admin-refresh {
  background: #334155 !important;
  color: #94a3b8 !important;
}

html.dark .support-chat-admin-refresh:hover {
  background: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .support-chat-admin-room-item {
  border-bottom-color: #334155 !important;
}

html.dark .support-chat-admin-room-item:hover {
  background: #334155 !important;
}

html.dark .support-chat-admin-room-item.active {
  background: rgba(59, 130, 246, 0.2) !important;
}

html.dark .support-chat-admin-room-item-name {
  color: #f1f5f9 !important;
}

html.dark .support-chat-admin-room-item-preview {
  color: #94a3b8 !important;
}

html.dark .support-chat-admin-room-item-time,
html.dark .support-chat-admin-room-item-email {
  color: #64748b !important;
}

html.dark .support-chat-admin-loading,
html.dark .support-chat-admin-no-rooms,
html.dark .support-chat-admin-empty {
  color: #64748b !important;
}

html.dark .support-chat-admin-no-rooms svg,
html.dark .support-chat-admin-empty svg {
  color: #475569 !important;
}

/* 운영진용 채팅 메인 영역 */
html.dark .support-chat-admin-chat-header {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}

html.dark .support-chat-admin-chat-header-name {
  color: #f1f5f9 !important;
}

html.dark .support-chat-admin-chat-header-email {
  color: #94a3b8 !important;
}

/* 채팅 입력 영역 */
html.dark .support-chat-input-area,
html.dark .support-chat-admin-input-area {
  background: #0f172a !important;
  border-top-color: #334155 !important;
}

/* 일반 회원용 고객지원 입력 (새 구조) */
html.dark .support-chat-input {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .support-chat-input:focus {
  background: #0f172a !important;
  border-color: #3b82f6 !important;
}

html.dark .support-chat-input::placeholder {
  color: #64748b !important;
}

/* 운영진용 입력 (기존 wrapper 구조) */
html.dark .support-chat-admin-input-wrapper {
  background: #1e293b !important;
}

html.dark .support-chat-admin-input-wrapper textarea {
  color: #e2e8f0 !important;
  background: transparent !important;
}

html.dark .support-chat-admin-input-wrapper textarea::placeholder {
  color: #64748b !important;
}

/* 채팅 룸 헤더 (동적 모달) */
html.dark .support-chat-room-header {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}

html.dark .support-chat-room-header-name {
  color: #f1f5f9 !important;
}

html.dark .support-chat-room-header-email {
  color: #94a3b8 !important;
}

/* 채팅 룸 입력 */
html.dark .support-chat-room-input {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .support-chat-room-input:focus {
  background: #0f172a !important;
}

/* 메시지 버블 - 상대방 메시지 */
html.dark .support-chat-message.theirs .support-chat-message-bubble,
html.dark .support-chat-admin-messages .support-chat-message.theirs .support-chat-message-bubble,
html.dark [id^="support-chat-room-content-"] .support-chat-message.theirs .support-chat-message-bubble {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* 시스템 메시지 */
html.dark .support-chat-message.system .support-chat-message-bubble,
html.dark [id^="support-chat-room-content-"] .support-chat-message.system .support-chat-message-bubble {
  background: #334155 !important;
  color: #94a3b8 !important;
}

/* 메시지 발신자 */
html.dark .support-chat-message-sender,
html.dark .support-chat-admin-messages .support-chat-message-sender,
html.dark [id^="support-chat-room-content-"] .support-chat-message-sender {
  color: #94a3b8 !important;
}

/* 환영 메시지 */
html.dark .support-chat-welcome {
  color: #94a3b8 !important;
}

html.dark .support-chat-welcome-icon {
  background: rgba(59, 130, 246, 0.2) !important;
}

html.dark .support-chat-welcome-title {
  color: #f1f5f9 !important;
}

html.dark .support-chat-welcome-desc {
  color: #94a3b8 !important;
}

/* 날짜 구분선 */
html.dark .support-chat-date-divider span {
  background: #1e293b !important;
  color: #64748b !important;
}

html.dark .support-chat-date-divider::before {
  background: #334155 !important;
}

/* 로딩/에러 상태 */
html.dark .support-chat-room-loading,
html.dark .support-chat-room-error,
html.dark .support-chat-loading {
  color: #64748b !important;
}

html.dark .support-chat-list-empty {
  color: #64748b !important;
}

html.dark .support-chat-list-empty svg {
  color: #475569 !important;
}

/* ------------------------------------------------
   Misc
   ------------------------------------------------ */
/* Dividers */
html.dark hr {
  border-color: #334155 !important;
}

/* Selection */
html.dark ::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #f1f5f9;
}

/* Tooltips */
html.dark [data-tooltip]::after {
  background: #475569 !important;
  color: #e2e8f0 !important;
}

/* Empty states */
html.dark .empty-state {
  color: #64748b !important;
}

/* Links */
html.dark a:not(.ordars-logo):not(.ordars-sidebar-link) {
  color: #60a5fa;
}

html.dark a:not(.ordars-logo):not(.ordars-sidebar-link):hover {
  color: #93c5fd;
}

/* ------------------------------------------------
   System Settings - Sessions (접속현황)
   ------------------------------------------------ */

/* 제목/설명 */
html.dark .sessions-title {
  color: #f1f5f9 !important;
}

html.dark .sessions-desc {
  color: #94a3b8 !important;
}

/* 접속자 수 배지 */
html.dark .sessions-count-badge {
  background: rgba(16, 185, 129, 0.15) !important;
}

html.dark .sessions-online-count {
  color: #34d399 !important;
}

html.dark .sessions-total-count {
  color: #94a3b8 !important;
}

/* 새로고침 버튼 */
html.dark .sessions-refresh-btn {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .sessions-refresh-btn:hover {
  background: #475569 !important;
}

/* 팁 박스 */
html.dark .sessions-tip-box {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

html.dark .sessions-tip-icon {
  stroke: #60a5fa !important;
}

html.dark .sessions-tip-text {
  color: #93c5fd !important;
}

/* 테이블 */
html.dark .sessions-table-wrapper {
  border-color: #334155 !important;
}

html.dark .sessions-table th {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}

html.dark .sessions-table td {
  border-bottom-color: #334155 !important;
}

html.dark .sessions-user-name {
  color: #f1f5f9 !important;
}

html.dark .sessions-user-email {
  color: #94a3b8 !important;
}

html.dark .sessions-ip,
html.dark .sessions-time,
html.dark .sessions-datetime,
html.dark .sessions-duration {
  color: #94a3b8 !important;
}

/* 기기 배지 */
html.dark .sessions-device-badge {
  background: #334155 !important;
  color: #e2e8f0 !important;
}

/* 역할 배지 */
html.dark .sessions-role-developer {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}

html.dark .sessions-role-admin {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
}

/* 상태 배지 */
html.dark .sessions-status-active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
}

html.dark .sessions-status-logged-out {
  background: #334155 !important;
  color: #94a3b8 !important;
}

html.dark .sessions-status-inactive {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

/* 차단됨 배지 */
html.dark .sessions-blocked-badge {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

/* 액션 버튼 */
html.dark .sessions-action-logout {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

html.dark .sessions-action-logout:hover {
  background: rgba(245, 158, 11, 0.25) !important;
}

html.dark .sessions-action-block {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

html.dark .sessions-action-block:hover {
  background: rgba(239, 68, 68, 0.25) !important;
}

html.dark .sessions-action-unblock {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
}

html.dark .sessions-action-unblock:hover {
  background: rgba(16, 185, 129, 0.25) !important;
}

/* 빈 상태 */
html.dark .sessions-empty {
  background: #1e293b !important;
  color: #94a3b8 !important;
}

html.dark .sessions-empty-icon {
  opacity: 0.6 !important;
}

/* 카드 뷰 (모바일) */
html.dark .sessions-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html.dark .sessions-card-header {
  background: #0f172a !important;
  border-bottom-color: #334155 !important;
}

html.dark .sessions-card-body {
  background: #1e293b !important;
}

html.dark .sessions-card-row {
  border-bottom-color: #334155 !important;
}

html.dark .sessions-card-label {
  color: #94a3b8 !important;
}

html.dark .sessions-card-value {
  color: #e2e8f0 !important;
}

html.dark .sessions-card-footer {
  border-top-color: #334155 !important;
}

/* ------------------------------------------------
   System Settings - Database (DB 관리)
   ------------------------------------------------ */

/* DB 정보 박스 */
html.dark .rmm-content [style*="background: #f9fafb"] {
  background: #1e293b !important;
}

/* DB 정보 제목 */
html.dark .rmm-content [style*="color: #111827"] {
  color: #f1f5f9 !important;
}

/* DB 정보 라벨 */
html.dark .rmm-content [style*="color: #6b7280"] {
  color: #94a3b8 !important;
}

/* DB 정보 값 */
html.dark .rmm-content [style*="color: #374151"] {
  color: #cbd5e1 !important;
}

/* 섹션 구분선 */
html.dark .rmm-content [style*="border-top: 1px solid #e5e7eb"] {
  border-top-color: #334155 !important;
}

/* 백업/최적화 카드 */
html.dark .rmm-content [style*="border: 1px solid #e5e7eb"][style*="border-radius: 8px"] {
  border-color: #334155 !important;
  background: #1e293b !important;
}

/* 주의사항 박스 (빨간색) */
html.dark .rmm-content [style*="background: #fef2f2"] {
  background: rgba(239, 68, 68, 0.1) !important;
}

html.dark .rmm-content [style*="border: 1px solid #fecaca"] {
  border-color: rgba(239, 68, 68, 0.3) !important;
}

html.dark .rmm-content [style*="color: #991b1b"] {
  color: #fca5a5 !important;
}

/* 경고 텍스트 */
html.dark .rmm-content [style*="color: #f59e0b"] {
  color: #fbbf24 !important;
}

/* DB 테이블 목록 */
html.dark .db-table-list {
  border-color: #334155 !important;
  background: #1e293b !important;
}

html.dark .db-table-item {
  border-bottom-color: #334155 !important;
}

html.dark .db-table-item:hover {
  background: #334155 !important;
}

html.dark .db-table-item.active {
  background: rgba(59, 130, 246, 0.15) !important;
  border-left-color: #3b82f6 !important;
}

html.dark .db-table-detail {
  border-color: #334155 !important;
  background: #1e293b !important;
}

html.dark .db-table-detail.mobile-active {
  background: #0f172a !important;
}

html.dark .db-select-hint {
  color: #64748b !important;
}

/* DB 쿼리 탭 - 입력 영역 */
html.dark .rmm-content textarea[data-database-manager-target="queryInput"] {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .rmm-content textarea[data-database-manager-target="queryInput"]::placeholder {
  color: #64748b !important;
}

/* 컬럼 구조 섹션 (노란색) */
html.dark .rmm-content [style*="background: #fefce8"] {
  background: rgba(234, 179, 8, 0.1) !important;
}

html.dark .rmm-content [style*="border: 1px solid #fde047"] {
  border-color: rgba(234, 179, 8, 0.3) !important;
}

html.dark .rmm-content [style*="color: #854d0e"] {
  color: #fbbf24 !important;
}

/* 인덱스 섹션 (녹색) */
html.dark .rmm-content [style*="background: #f0fdf4"] {
  background: rgba(34, 197, 94, 0.1) !important;
}

html.dark .rmm-content [style*="border: 1px solid #86efac"] {
  border-color: rgba(34, 197, 94, 0.3) !important;
}

html.dark .rmm-content [style*="color: #166534"] {
  color: #4ade80 !important;
}

/* 모바일 뒤로가기 버튼 */
html.dark .db-mobile-back-btn {
  background: #334155 !important;
  border-color: #475569 !important;
}

html.dark .db-mobile-back-btn svg {
  stroke: #e2e8f0 !important;
}

/* 지우기/이전/다음 버튼 */
html.dark .rmm-content button[style*="background: white"][style*="border: 1px solid #d1d5db"] {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .rmm-content button[style*="background: white"][style*="border: 1px solid #d1d5db"]:hover {
  background: #475569 !important;
}

/* 쿼리 결과 영역 */
html.dark [data-database-manager-target="queryResult"] {
  background: #1e293b !important;
}

/* 결과 안내 텍스트 */
html.dark .rmm-content [style*="color: #9ca3af"] {
  color: #64748b !important;
}

/* 데이터 테이블 */
html.dark .rmm-content table thead[style*="background: #f9fafb"] {
  background: #0f172a !important;
}

html.dark .rmm-content table th[style*="color: #374151"] {
  color: #cbd5e1 !important;
}

html.dark .rmm-content table tr[style*="background: white"] {
  background: #1e293b !important;
}

html.dark .rmm-content table td {
  color: #e2e8f0 !important;
}

/* ------------------------------------------------
   Search Dropdowns (검색 드롭다운)
   ------------------------------------------------ */

/* 검색 결과 드롭다운 컨테이너 */
html.dark [data-company-search-form-target="searchResults"],
html.dark [data-user-search-target="results"],
html.dark [data-manager-appointment-target="searchResults"],
html.dark [data-member-invitation-target="searchResults"],
html.dark [data-member-invite-target="searchResults"] {
  background: #1e293b !important;
  border-color: #475569 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* 검색 결과 아이템 */
html.dark .company-search-result,
html.dark .user-search-result {
  border-bottom-color: #334155 !important;
}

/* 검색 결과 아이템 텍스트 */
html.dark .company-search-result [style*="color: #111827"],
html.dark .user-search-result [style*="color: #111827"] {
  color: #f1f5f9 !important;
}

html.dark .company-search-result [style*="color: #6b7280"],
html.dark .user-search-result [style*="color: #6b7280"] {
  color: #94a3b8 !important;
}

/* 검색 결과 업체 타입 배지 */
html.dark .company-search-result [style*="background: #f3f4f6"][style*="color: #6b7280"] {
  background: #334155 !important;
  color: #cbd5e1 !important;
}

/* 검색 결과 없음 메시지 */
html.dark [data-company-search-form-target="searchResults"] [style*="color: #9ca3af"],
html.dark [data-user-search-target="results"] [style*="color: #9ca3af"],
html.dark [data-manager-appointment-target="searchResults"] [style*="color: #9ca3af"] {
  color: #64748b !important;
}

/* ------------------------------------------------
   Form Inputs (폼 입력 요소)
   ------------------------------------------------ */

/* 입력 필드 */
html.dark .rmm-content input[type="text"][style*="border: 1px solid #d1d5db"],
html.dark .rmm-content input[type="date"][style*="border: 1px solid #d1d5db"],
html.dark .rmm-content input[type="number"][style*="border: 1px solid #d1d5db"],
html.dark .rmm-content textarea[style*="border: 1px solid #d1d5db"],
html.dark .rmm-content select[style*="border: 1px solid #d1d5db"] {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .rmm-content input::placeholder,
html.dark .rmm-content textarea::placeholder {
  color: #64748b !important;
}

/* ------------------------------------------------
   Modal Buttons (모달 버튼)
   ------------------------------------------------ */

/* 취소/변경 버튼 (흰색 배경, 회색 테두리) */
html.dark .rmm-content button[style*="background: white"][style*="border: 1px solid #d1d5db"],
html.dark .rmm-content button[style*="background: white"][style*="color: #374151"],
html.dark .rmm-content button[style*="background: white"][style*="color: #6b7280"] {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html.dark .rmm-content button[style*="background: white"][style*="border: 1px solid #d1d5db"]:hover {
  background: #475569 !important;
}

/* 비활성 제출 버튼 (회색 배경) */
html.dark .rmm-content button[style*="background: #d1d5db"] {
  background: #475569 !important;
}

/* 권한양도 버튼 */
html.dark .rmm-content button[style*="background: #f3f4f6"][style*="color: #374151"],
html.dark .rmm-content input[type="submit"][style*="background: #f3f4f6"] {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

/* 박탈/해임 버튼 (빨간색 계열) */
html.dark .rmm-content button[style*="color: #ef4444"][style*="border: 1px solid #fecaca"],
html.dark .rmm-content input[type="submit"][style*="color: #ef4444"][style*="border: 1px solid #fecaca"] {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}

/* 정지 버튼 (주황색 계열) */
html.dark .rmm-content button[style*="color: #f97316"][style*="border: 1px solid #fed7aa"],
html.dark .rmm-content input[type="submit"][style*="color: #f97316"][style*="border: 1px solid #fed7aa"] {
  background: rgba(249, 115, 22, 0.1) !important;
  border-color: rgba(249, 115, 22, 0.3) !important;
  color: #fb923c !important;
}

/* 정지해제 버튼 (녹색 계열) */
html.dark .rmm-content button[style*="color: #16a34a"][style*="border: 1px solid #bbf7d0"],
html.dark .rmm-content input[type="submit"][style*="color: #16a34a"][style*="border: 1px solid #bbf7d0"] {
  background: rgba(22, 163, 74, 0.1) !important;
  border-color: rgba(22, 163, 74, 0.3) !important;
  color: #4ade80 !important;
}

/* ------------------------------------------------
   Manager/Owner Cards (관리자/소유자 카드)
   ------------------------------------------------ */

/* 카드 배경 (흰색) */
html.dark .rmm-content [style*="background: white"][style*="border: 1px solid #e5e7eb"][style*="border-radius"] {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* 카드 내 아바타 배경 */
html.dark .rmm-content [style*="background: #e5e7eb"][style*="border-radius: 50%"] {
  background: #475569 !important;
}

html.dark .rmm-content [style*="background: #dbeafe"][style*="border-radius: 50%"] {
  background: rgba(59, 130, 246, 0.2) !important;
}

html.dark .rmm-content [style*="background: #fed7aa"][style*="border-radius: 50%"] {
  background: rgba(251, 146, 60, 0.2) !important;
}

html.dark .rmm-content [style*="background: #f3f4f6"][style*="border-radius: 50%"] {
  background: #334155 !important;
}

/* 카드 내 구분선 */
html.dark .rmm-content [style*="border-top: 1px solid #f3f4f6"] {
  border-top-color: #334155 !important;
}

/* 임기변경 버튼 */
html.dark .rmm-content button[style*="background: #f3f4f6"][style*="color: #6b7280"][style*="border: 1px solid #e5e7eb"] {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
}

/* ------------------------------------------------
   Selected Company/User (선택된 업체/사용자)
   ------------------------------------------------ */

/* 선택된 업체 (녹색 테마) */
html.dark .rmm-content [style*="background: #f0fdf4"][style*="border: 1px solid #bbf7d0"] {
  background: rgba(22, 163, 74, 0.15) !important;
  border-color: rgba(22, 163, 74, 0.3) !important;
}

html.dark .rmm-content [style*="color: #166534"] {
  color: #4ade80 !important;
}

html.dark .rmm-content [style*="color: #16a34a"] {
  color: #4ade80 !important;
}

html.dark .rmm-content [style*="background: #dcfce7"][style*="color: #15803d"] {
  background: rgba(22, 163, 74, 0.2) !important;
  color: #4ade80 !important;
}

/* 빈 상태 영역 */
html.dark .rmm-content [style*="background: #f9fafb"][style*="border: 2px dashed #e5e7eb"] {
  background: #0f172a !important;
  border-color: #334155 !important;
}

/* ------------------------------------------------
   Company Membership Modals (업체 관련 모달)
   ------------------------------------------------ */

/* 소유자/관리자 초대 섹션 배경 */
html.dark #company-owners-content [style*="background: #f9fafb"],
html.dark #company-managers-content [style*="background: #f9fafb"] {
  background: #0f172a !important;
}

/* 선택된 사용자 텍스트 */
html.dark [data-user-search-target="selectedUser"] {
  color: #94a3b8 !important;
}

/* 임기 종료일 표시 영역 */
html.dark .rmm-content [style*="background: #f9fafb"][style*="border: 1px solid #e5e7eb"][style*="border-radius: 8px"] {
  background: #0f172a !important;
  border-color: #334155 !important;
}

/* 선택된 사용자 칩 (파란색 테마) */
html.dark .rmm-content [style*="background: #eff6ff"][style*="border: 1px solid #bfdbfe"] {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

html.dark .rmm-content [style*="color: #1e40af"] {
  color: #93c5fd !important;
}

html.dark .rmm-content [style*="color: #3b82f6"] {
  color: #60a5fa !important;
}

/* 개발자 검색 드롭다운 */
html.dark [data-developer-search-target="results"] {
  background: #1e293b !important;
  border-color: #475569 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html.dark .developer-search-result {
  border-bottom-color: #334155 !important;
}

html.dark .developer-search-result [style*="color: #111827"] {
  color: #f1f5f9 !important;
}

html.dark .developer-search-result [style*="color: #6b7280"] {
  color: #94a3b8 !important;
}
