:root {
    color-scheme: light;
    --theme-bg-body: #f5f5f5;
    --theme-bg-main: #f5f6f9;
    --theme-bg-surface: #ffffff;
    --theme-bg-surface-alt: #f8fafc;
    --theme-bg-subtle: #f1f3f5;
    --theme-bg-hover: #e2e8f0;
    --theme-border: #e2e8f0;
    --theme-border-strong: #cbd5e1;
    --theme-text-primary: #1f2937;
    --theme-text-secondary: #334155;
    --theme-text-muted: #64748b;
    --theme-accent: #3182ce;
    --theme-accent-strong: #2c5aa0;
    --theme-accent-soft: #ebf8ff;
    --theme-header-bg: #4a5568;
    --theme-header-text: #f7fafc;
    --theme-header-muted: #cbd5e0;
    --theme-overlay: rgba(15, 23, 42, 0.45);
    --theme-loading-overlay: rgba(255, 255, 255, 0.72);
    --theme-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --theme-shadow-md: 0 6px 16px rgba(15, 23, 42, 0.12);
    --theme-shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.16);
}

html[data-theme='dark'] {
    color-scheme: dark;
    --theme-bg-body: #111827;
    --theme-bg-main: #0f172a;
    --theme-bg-surface: #1f2937;
    --theme-bg-surface-alt: #111827;
    --theme-bg-subtle: #273449;
    --theme-bg-hover: #334155;
    --theme-border: #334155;
    --theme-border-strong: #475569;
    --theme-text-primary: #e2e8f0;
    --theme-text-secondary: #cbd5e1;
    --theme-text-muted: #94a3b8;
    --theme-accent: #60a5fa;
    --theme-accent-strong: #3b82f6;
    --theme-accent-soft: rgba(96, 165, 250, 0.2);
    --theme-header-bg: #0b1220;
    --theme-header-text: #e2e8f0;
    --theme-header-muted: #9fb3cc;
    --theme-overlay: rgba(2, 6, 23, 0.72);
    --theme-loading-overlay: rgba(2, 6, 23, 0.68);
    --theme-shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.45);
    --theme-shadow-md: 0 8px 20px rgba(2, 6, 23, 0.5);
    --theme-shadow-lg: 0 16px 28px rgba(2, 6, 23, 0.58);
    --selected-bg: rgba(96, 165, 250, 0.22);
}

:root,
html[data-theme='dark'] {
    --primary-color: var(--theme-accent);
    --secondary-color: var(--theme-text-secondary);
    --light-bg: var(--theme-bg-subtle);
    --border-color: var(--theme-border);
    --text-primary: var(--theme-text-primary);
    --text-secondary: var(--theme-text-secondary);
    --text-muted: var(--theme-text-muted);
    --bg-light: var(--theme-bg-subtle);
    --bg-gray: var(--theme-bg-main);
    --hover-bg: var(--theme-bg-hover);
}

html,
body {
    background-color: var(--theme-bg-body);
    color: var(--theme-text-primary);
}

body {
    transition: background-color 0.2s ease, color 0.2s ease;
}

html[data-theme] *,
html[data-theme] *::before,
html[data-theme] *::after {
    transition: none !important;
}

a {
    color: var(--theme-accent);
}

.container {
    background: transparent;
}

.main-content {
    background: var(--theme-bg-main);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .content-area,
html[data-theme='dark'] .page-header,
html[data-theme='dark'] .content-card,
html[data-theme='dark'] .panel-header,
html[data-theme='dark'] .search-toolbar,
html[data-theme='dark'] .preset-toolbar,
html[data-theme='dark'] .left-sidebar,
html[data-theme='dark'] .user-menu,
html[data-theme='dark'] .header-notification-dropdown,
html[data-theme='dark'] .unified-modal-content,
html[data-theme='dark'] .comment-input-area,
html[data-theme='dark'] .split-content-area,
html[data-theme='dark'] .messenger-input-deck {
    background: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border);
}

.top-header {
    background: var(--theme-header-bg);
    color: var(--theme-header-text);
}

.system-name,
.user-name,
.connection-time,
.user-info,
.header-theme-label {
    color: var(--theme-header-text);
}

.user-dept,
.header-notification-btn {
    color: var(--theme-header-muted);
}

.header-notification-btn:hover,
.user-btn:hover {
    background: rgba(148, 163, 184, 0.18);
    color: var(--theme-header-text);
}

.header-theme-select {
    border-color: var(--theme-border-strong);
}

html[data-theme='light'] .header-theme-select {
    background-color: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23e2e8f0' viewBox='0 0 16 16'><path d='M3.204 5h9.592L8 10.481 3.204 5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 24px;
}

html[data-theme='dark'] .header-theme-select {
    background-color: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    border-color: #475569;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239fb3cc' viewBox='0 0 16 16'><path d='M3.204 5h9.592L8 10.481 3.204 5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 24px;
}

html[data-theme='dark'] .header-theme-select option {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-theme='dark'] .header-notification-header,
html[data-theme='dark'] .header-notification-filter-row,
html[data-theme='dark'] .header-notification-item,
html[data-theme='dark'] .header-notification-item:hover,
html[data-theme='dark'] .header-notification-item.read,
html[data-theme='dark'] .header-notification-item.read:hover {
    background: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .header-notification-item.unread {
    background: var(--theme-accent-soft);
    border-left-color: var(--theme-accent);
}

html[data-theme='dark'] .header-notification-title,
html[data-theme='dark'] .header-notification-message .notification-message-header,
html[data-theme='dark'] .header-notification-message .notification-message-detail {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .header-notification-time,
html[data-theme='dark'] .header-notification-item.read .header-notification-title {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .header-notification-list {
    background: var(--theme-bg-surface-alt);
}

html[data-theme='dark'] .header-notification-item {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
    border-left-color: transparent;
}

html[data-theme='dark'] .header-notification-item:hover {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .header-notification-item.read,
html[data-theme='dark'] .header-notification-item:not(.unread) {
    background: var(--theme-bg-surface-alt);
    border-left-color: var(--theme-border-strong);
}

html[data-theme='dark'] .header-notification-item.read:hover {
    background: var(--theme-bg-subtle);
}

html[data-theme='dark'] .header-notification-message {
    border-top-color: var(--theme-border-strong);
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .header-notification-message .notification-message-divider {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .header-notification-message .notification-message-detail {
    border-left-color: var(--theme-border-strong);
}

html[data-theme='dark'] .header-select select,
html[data-theme='dark'] .user-menu-item,
html[data-theme='dark'] .quick-btn,
html[data-theme='dark'] .fixed-search-container input,
html[data-theme='dark'] .fixed-search-container button,
html[data-theme='dark'] .global-search-dropdown,
html[data-theme='dark'] .search-result-item {
    background: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .fixed-search-container input::placeholder {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .quick-btn:hover,
html[data-theme='dark'] .user-menu-item:hover,
html[data-theme='dark'] .search-result-item:hover {
    background: var(--theme-bg-subtle);
}

html[data-theme='dark'] .compact-nav-bar {
    background: var(--theme-bg-surface-alt);
    border-bottom-color: var(--theme-border);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .sidebar-toggle-compact {
    background: var(--theme-bg-surface);
    border: 1px solid var(--theme-border);
    box-shadow: var(--theme-shadow-sm);
}

html[data-theme='dark'] .sidebar-toggle-compact:hover {
    box-shadow: var(--theme-shadow-md);
}

html[data-theme='dark'] .compact-nav-bar .hamburger span {
    background: var(--theme-text-secondary);
}

html[data-theme='dark'] .breadcrumb-container,
html[data-theme='dark'] .breadcrumb-item,
html[data-theme='dark'] .breadcrumb-item.category,
html[data-theme='dark'] .breadcrumb-separator {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .breadcrumb-item.current {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .breadcrumb-item.home {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .breadcrumb-item.home:hover {
    color: var(--theme-accent);
    background: var(--theme-accent-soft);
}

html[data-theme='dark'] .fixed-search-container {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border-strong);
}

html[data-theme='dark'] .fixed-search-container:focus-within {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.16);
}

html[data-theme='dark'] .fixed-search-container button {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .fixed-search-container button:hover {
    background: var(--theme-bg-subtle);
    color: var(--theme-accent);
    border-left-color: var(--theme-border);
}

html[data-theme='dark'] .global-search-dropdown {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .search-result-group {
    background: var(--theme-bg-surface-alt);
    color: var(--theme-text-muted);
    border-bottom-color: var(--theme-border);
}

html[data-theme='dark'] .search-result-icon {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .search-result-title {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .search-result-sub,
html[data-theme='dark'] .no-search-result {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .header-select select {
    background-color: var(--theme-bg-surface);
    border-color: var(--theme-border);
    color: var(--theme-text-secondary);
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 24px;
}

html[data-theme='dark'] .header-select select:hover {
    background-color: var(--theme-bg-surface-alt);
    border-color: var(--theme-border-strong);
}

html[data-theme='dark'] .header-select select:focus {
    background-color: var(--theme-bg-surface);
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
}

html[data-theme='dark'] .header-notification-filter-row:focus-within {
    background: var(--theme-bg-surface-alt);
}

html[data-theme='dark'] .left-sidebar {
    border-right-color: var(--theme-border);
}

html[data-theme='dark'] .menu-header {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-primary);
    border-bottom-color: var(--theme-border);
}

html[data-theme='dark'] .menu-header:hover,
html[data-theme='dark'] .menu-item a:hover {
    background: var(--theme-bg-hover);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .menu-group.expanded .menu-header {
    background: var(--theme-bg-hover);
}

html[data-theme='dark'] .menu-group.active-module .menu-header {
    background: var(--theme-bg-hover);
    color: var(--theme-text-primary);
    border-left: 3px solid var(--theme-accent);
}

html[data-theme='dark'] .menu-group.active-module .expand-icon {
    color: var(--theme-accent);
}

html[data-theme='dark'] .menu-item {
    border-bottom-color: var(--theme-border);
}

html[data-theme='dark'] .menu-item a {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .menu-item.active a {
    background: var(--theme-accent-soft);
    color: var(--theme-accent-strong);
    border-left: 3px solid var(--theme-accent);
}

html[data-theme='dark'] .menu-item.active a:hover {
    background: rgba(96, 165, 250, 0.18);
    color: var(--theme-accent-strong);
}

html[data-theme='dark'] .menu-header:focus,
html[data-theme='dark'] .menu-item a:focus {
    outline: 1px solid rgba(96, 165, 250, 0.42);
    outline-offset: 1px;
    background: var(--theme-bg-subtle);
}

html[data-theme='dark'] :is(.left-sidebar.collapsed, .sidebar-collapsed-pref .left-sidebar) .menu-header:hover,
html[data-theme='dark'] :is(.left-sidebar.collapsed, .sidebar-collapsed-pref .left-sidebar) .menu-header:focus,
html[data-theme='dark'] :is(.left-sidebar.collapsed, .sidebar-collapsed-pref .left-sidebar) .menu-item a:hover,
html[data-theme='dark'] :is(.left-sidebar.collapsed, .sidebar-collapsed-pref .left-sidebar) .menu-item a:focus {
    background: var(--theme-bg-hover);
}

html[data-theme='dark'] .tree-header {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .tree-header:hover {
    background-color: var(--theme-bg-hover);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .tree-header.selected {
    background-color: var(--theme-accent-soft);
    color: var(--theme-accent);
}

html[data-theme='dark'] .tree-children {
    border-left-color: var(--theme-border);
}

.page-title,
.breadcrumb-page,
.unified-modal-title {
    color: var(--theme-text-primary);
}

.breadcrumb,
.breadcrumb-category,
.breadcrumb-separator,
.unified-modal-close,
.helper-text {
    color: var(--theme-text-muted);
}

.unified-modal {
    background: var(--theme-overlay);
}

.loading-overlay {
    background: var(--theme-loading-overlay) !important;
}

.loading-content {
    color: var(--theme-text-secondary);
}

.loading-spinner {
    border-color: var(--theme-border);
    border-top-color: var(--theme-accent);
}

.unified-modal-header,
.unified-modal-footer {
    background: var(--theme-bg-subtle);
    border-color: var(--theme-border);
}

.unified-modal-close:hover {
    background: var(--theme-bg-hover);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea,
html[data-theme='dark'] .form-control,
html[data-theme='dark'] .input-control,
html[data-theme='dark'] .input-sm {
    background: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border-strong);
}

html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] input:focus,
html[data-theme='dark'] select:focus,
html[data-theme='dark'] textarea:focus,
html[data-theme='dark'] .form-control:focus,
html[data-theme='dark'] .input-control:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

html[data-theme='dark'] .btn {
    background: var(--theme-bg-surface);
    color: var(--theme-text-secondary);
    border-color: var(--theme-border-strong);
}

html[data-theme='dark'] .btn:hover {
    background: var(--theme-bg-subtle);
}

html[data-theme='dark'] .btn-primary {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #ffffff;
}

html[data-theme='dark'] .btn-primary:hover {
    background: var(--theme-accent-strong);
    border-color: var(--theme-accent-strong);
}

html[data-theme='dark'] table,
html[data-theme='dark'] .table,
html[data-theme='dark'] .data-grid,
html[data-theme='dark'] .ag-theme-alpine,
html[data-theme='dark'] .ag-theme-alpine .ag-root-wrapper {
    background: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border);
}

html[data-theme='dark'] th,
html[data-theme='dark'] td,
html[data-theme='dark'] .data-grid th,
html[data-theme='dark'] .data-grid td {
    border-color: var(--theme-border);
}

html[data-theme='dark'] thead th,
html[data-theme='dark'] .data-grid thead th {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] tbody tr:hover,
html[data-theme='dark'] .data-grid tbody tr:hover {
    background: var(--theme-bg-subtle);
}

.global-search-dropdown,
.header-notification-dropdown,
.user-menu,
.mini-popover {
    box-shadow: var(--theme-shadow-md);
}

.content-area,
.page-header,
.unified-modal-content,
.auth-card,
.change-container {
    box-shadow: var(--theme-shadow-sm);
}

.auth-body {
    background: var(--theme-bg-main);
}

.auth-card,
.change-container {
    background: var(--theme-bg-surface);
    border: 1px solid var(--theme-border);
    color: var(--theme-text-primary);
}

.auth-subtitle,
.label,
.change-body .helper-text {
    color: var(--theme-text-secondary);
}

.change-header {
    background: var(--theme-header-bg) !important;
    color: var(--theme-header-text) !important;
}

html[data-theme='dark'] .change-body .form-control,
html[data-theme='dark'] .change-body .btn-outline-secondary {
    background: var(--theme-bg-surface-alt);
    color: var(--theme-text-primary);
    border-color: var(--theme-border-strong);
}

.main-wrapper {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .main-wrapper .sidebar,
html[data-theme='dark'] .main-wrapper .sidebar-header,
html[data-theme='dark'] .main-wrapper .sidebar-body,
html[data-theme='dark'] .main-wrapper .filter-section,
html[data-theme='dark'] .main-wrapper .sales-summary,
html[data-theme='dark'] .main-wrapper .summary-card,
html[data-theme='dark'] .main-wrapper .project-status-header,
html[data-theme='dark'] .main-wrapper .project-status-table-section,
html[data-theme='dark'] .main-wrapper .project-status-table-wrapper,
html[data-theme='dark'] .main-wrapper .as-report-sidebar,
html[data-theme='dark'] .main-wrapper .as-report-sidebar-header,
html[data-theme='dark'] .main-wrapper .content-card,
html[data-theme='dark'] .main-wrapper .roles-list,
html[data-theme='dark'] .main-wrapper .role-item,
html[data-theme='dark'] .main-wrapper .detail-section,
html[data-theme='dark'] .main-wrapper .table-container,
html[data-theme='dark'] .main-wrapper .access-log-tabs,
html[data-theme='dark'] .main-wrapper .access-log-tab,
html[data-theme='dark'] .main-wrapper .upper-section,
html[data-theme='dark'] .main-wrapper .lower-section {
    background: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .main-wrapper .section-header-row,
html[data-theme='dark'] .main-wrapper .sales-summary-header,
html[data-theme='dark'] .main-wrapper .as-report-tree,
html[data-theme='dark'] .main-wrapper .tree-container {
    background: var(--theme-bg-surface-alt);
    color: var(--theme-text-primary);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .main-wrapper .access-log-tab {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .main-wrapper .access-log-tab.active {
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
}

html[data-theme='dark'] .main-wrapper .sidebar-title,
html[data-theme='dark'] .main-wrapper .panel-title,
html[data-theme='dark'] .main-wrapper .section-title,
html[data-theme='dark'] .main-wrapper .summary-value,
html[data-theme='dark'] .main-wrapper .project-status-title h2 {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .main-wrapper .summary-label,
html[data-theme='dark'] .main-wrapper .summary-subtext,
html[data-theme='dark'] .main-wrapper .project-status-table-label {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .main-wrapper .sidebar-toggle-compact,
html[data-theme='dark'] .main-wrapper .btn-icon-ghost,
html[data-theme='dark'] .main-wrapper .btn-icon-primary {
    background: var(--theme-bg-surface-alt);
    color: var(--theme-text-primary);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .main-wrapper .sidebar-toggle-compact:hover,
html[data-theme='dark'] .main-wrapper .btn-icon-ghost:hover,
html[data-theme='dark'] .main-wrapper .btn-icon-primary:hover {
    background: var(--theme-bg-hover);
}

html[data-theme='dark'] .stats-card,
html[data-theme='dark'] .main-notification-panel,
html[data-theme='dark'] .recent-activities,
html[data-theme='dark'] .quick-actions-section,
html[data-theme='dark'] .dashboard-notification-item,
html[data-theme='dark'] .activity-item,
html[data-theme='dark'] .quick-action-card {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
    box-shadow: var(--theme-shadow-sm);
}

html[data-theme='dark'] .notification-header,
html[data-theme='dark'] .activity-header,
html[data-theme='dark'] .notification-controls-bar,
html[data-theme='dark'] .dashboard-notification-list,
html[data-theme='dark'] .notification-category {
    background: var(--theme-bg-surface-alt);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .stats-title,
html[data-theme='dark'] .activity-desc,
html[data-theme='dark'] .quick-action-desc,
html[data-theme='dark'] .empty-state,
html[data-theme='dark'] .btn-text-mark-read,
html[data-theme='dark'] .unread-toggle-group label {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .stats-number,
html[data-theme='dark'] .notification-title,
html[data-theme='dark'] .activity-title,
html[data-theme='dark'] .quick-action-title,
html[data-theme='dark'] .section-title,
html[data-theme='dark'] .dashboard-notification-title-text {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .dashboard-notification-message {
    border-top-color: var(--theme-border-strong);
}

html[data-theme='dark'] .dashboard-notification-message .notification-message-header {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .dashboard-notification-message .notification-message-divider,
html[data-theme='dark'] .dashboard-notification-message .notification-message-detail,
html[data-theme='dark'] .dashboard-notification-time,
html[data-theme='dark'] .activity-time {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .dashboard-notification-item:not(.unread) {
    background: var(--theme-bg-surface-alt);
}

html[data-theme='dark'] .dashboard-notification-item.read:hover {
    background: var(--theme-bg-surface);
}

html[data-theme='dark'] .dashboard-notification-item.unread {
    background: var(--theme-accent-soft);
    border-left-color: var(--theme-accent);
}

html[data-theme='dark'] .dashboard-notification-item.unread:has(.dashboard-notification-icon.error) {
    background: rgba(239, 68, 68, 0.18);
}

html[data-theme='dark'] .dashboard-notification-item.unread:has(.dashboard-notification-icon.warning) {
    background: rgba(245, 158, 11, 0.18);
}

html[data-theme='dark'] .dashboard-notification-item.unread:has(.dashboard-notification-icon.system) {
    background: rgba(20, 184, 166, 0.18);
}

html[data-theme='dark'] .dashboard-notification-item.unread:has(.dashboard-notification-icon.comment) {
    background: rgba(14, 165, 233, 0.18);
}

html[data-theme='dark'] .dashboard-notification-icon.error,
html[data-theme='dark'] .dashboard-notification-icon.urgent {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}

html[data-theme='dark'] .dashboard-notification-icon.warning {
    background: rgba(245, 158, 11, 0.25);
    color: #fde68a;
}

html[data-theme='dark'] .dashboard-notification-icon.info {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}

html[data-theme='dark'] .dashboard-notification-icon.success {
    background: rgba(34, 197, 94, 0.25);
    color: #bbf7d0;
}

html[data-theme='dark'] .dashboard-notification-icon.system {
    background: rgba(20, 184, 166, 0.25);
    color: #99f6e4;
}

html[data-theme='dark'] .header-notification-filter-row {
    background: var(--theme-bg-surface-alt);
}

html[data-theme='dark'] .header-notification-list {
    background: var(--theme-bg-surface-alt);
}

html[data-theme='dark'] .header-select select {
    background-color: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border-strong);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239fb3cc' viewBox='0 0 16 16'><path d='M3.204 5h9.592L8 10.481 3.204 5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 24px;
}

html[data-theme='dark'] .header-select select:hover {
    background-color: var(--theme-bg-subtle);
    border-color: var(--theme-border-strong);
}

html[data-theme='dark'] .header-select select:focus {
    background-color: var(--theme-bg-surface);
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

html[data-theme='dark'] .header-select select option {
    background: var(--theme-bg-surface-alt);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .header-notification-item {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .header-notification-item:not(.unread),
html[data-theme='dark'] .header-notification-item.read {
    background: var(--theme-bg-surface-alt);
    border-left-color: var(--theme-border-strong);
}

html[data-theme='dark'] .header-notification-item.read:hover {
    background: var(--theme-bg-surface);
}

html[data-theme='dark'] .header-notification-item.unread {
    background: var(--theme-accent-soft);
    border-left-color: var(--theme-accent);
}

html[data-theme='dark'] .header-notification-item.unread:has(.header-notification-icon.error) {
    background: rgba(239, 68, 68, 0.18);
}

html[data-theme='dark'] .header-notification-item.unread:has(.header-notification-icon.warning) {
    background: rgba(245, 158, 11, 0.18);
}

html[data-theme='dark'] .header-notification-item.unread:has(.header-notification-icon.system) {
    background: rgba(20, 184, 166, 0.18);
}

html[data-theme='dark'] .header-notification-item.unread:has(.header-notification-icon.comment) {
    background: rgba(14, 165, 233, 0.18);
}

html[data-theme='dark'] .header-notification-icon.error {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}

html[data-theme='dark'] .header-notification-icon.warning {
    background: rgba(245, 158, 11, 0.25);
    color: #fde68a;
}

html[data-theme='dark'] .header-notification-icon.info {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}

html[data-theme='dark'] .header-notification-icon.success {
    background: rgba(34, 197, 94, 0.25);
    color: #bbf7d0;
}

html[data-theme='dark'] .header-notification-icon.comment {
    background: rgba(14, 165, 233, 0.25);
    color: #bae6fd;
}

html[data-theme='dark'] .header-notification-icon.system {
    background: rgba(20, 184, 166, 0.25);
    color: #99f6e4;
}

html[data-theme='dark'] .notification-sort-select select,
html[data-theme='dark'] #dashboardKindSelect,
html[data-theme='dark'] #dashboardTypeSelect,
html[data-theme='dark'] #dashboardSortSelect {
    background-color: var(--theme-bg-surface);
    color: var(--theme-text-primary);
    border-color: var(--theme-border-strong);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239fb3cc' viewBox='0 0 16 16'><path d='M3.204 5h9.592L8 10.481 3.204 5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 24px;
}

html[data-theme='dark'] .tab-btn {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .tab-btn.active {
    color: var(--theme-accent);
    border-bottom-color: var(--theme-accent);
}

html[data-theme='dark'] .badge-secondary {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .filter-tab {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .filter-tab:hover {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .filter-tab.active {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #ffffff;
}

html[data-theme='dark'] .type-dropdown {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
    box-shadow: var(--theme-shadow-md);
}

html[data-theme='dark'] .type-option {
    background: var(--theme-bg-surface);
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .type-option:hover {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .type-option.active {
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
}

html[data-theme='dark'] .unread-toggle-group:hover {
    background-color: var(--theme-bg-subtle);
}

html[data-theme='dark'] .dashboard-notification-list::-webkit-scrollbar-track,
html[data-theme='dark'] .activity-list::-webkit-scrollbar-track {
    background: var(--theme-bg-surface-alt);
}

html[data-theme='dark'] .dashboard-notification-list::-webkit-scrollbar-thumb,
html[data-theme='dark'] .activity-list::-webkit-scrollbar-thumb {
    background: var(--theme-border-strong);
}

html[data-theme='dark'] .help-modal-container {
    background: var(--theme-bg-surface);
    border: 1px solid var(--theme-border);
    box-shadow: var(--theme-shadow-lg);
}

html[data-theme='dark'] .help-modal-header,
html[data-theme='dark'] .help-modal-footer {
    background: var(--theme-bg-surface-alt);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .help-modal-header h3,
html[data-theme='dark'] .inquiry-form label {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .help-modal-close {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .help-modal-close:hover {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .manual-download-section {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.32);
}

html[data-theme='dark'] .help-desc {
    color: #93c5fd;
}

html[data-theme='dark'] .btn-manual-download {
    background: var(--theme-bg-surface);
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}

html[data-theme='dark'] .btn-manual-download:hover {
    background: var(--theme-accent-soft);
}

html[data-theme='dark'] .inquiry-divider {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .inquiry-divider::before,
html[data-theme='dark'] .inquiry-divider::after {
    border-bottom-color: var(--theme-border);
}

html[data-theme='dark'] .help-input,
html[data-theme='dark'] .help-textarea {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border-strong);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .help-input:focus,
html[data-theme='dark'] .help-textarea:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

html[data-theme='dark'] .btn-help-cancel {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border-strong);
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .btn-help-cancel:hover {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .table {
    background: var(--theme-bg-surface);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .table th {
    background: var(--theme-bg-subtle);
    border-bottom-color: var(--theme-border);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .table td {
    border-bottom-color: var(--theme-border);
}

html[data-theme='dark'] .table tbody tr:hover {
    background: var(--theme-bg-subtle);
}

html[data-theme='dark'] .form-label {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .form-control:disabled {
    background: var(--theme-bg-surface-alt);
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .status-pill.status-pending {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

html[data-theme='dark'] .status-pill.status-in_progress {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.45);
    color: #93c5fd;
}

html[data-theme='dark'] .status-pill.status-paid {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}

html[data-theme='dark'] .currency-pill:not(.currency-krw) {
    background: rgba(249, 115, 22, 0.16);
    border-color: rgba(249, 115, 22, 0.45);
    color: #fdba74;
}

html[data-theme='dark'] .import-result-card.success {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.12);
}

html[data-theme='dark'] .import-result-card.skipped,
html[data-theme='dark'] .import-result-card.warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.12);
}

html[data-theme='dark'] .import-result-card.errors {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.12);
}

html[data-theme='dark'] .import-warning-wrapper .import-error-header {
    color: #fcd34d;
}

html[data-theme='dark'] .import-warning-wrapper .import-error-table thead {
    background: rgba(245, 158, 11, 0.12);
}

html[data-theme='dark'] .sidebar-presence-container {
    background: var(--theme-bg-surface-alt);
    border-top-color: var(--theme-border);
}

html[data-theme='dark'] .presence-title {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .presence-main-icon {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .presence-count-text {
    color: var(--theme-accent);
}

html[data-theme='dark'] .presence-refresh-btn {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .presence-refresh-btn:hover {
    color: var(--theme-accent);
    background: var(--theme-bg-hover);
}

html[data-theme='dark'] .presence-list::-webkit-scrollbar-thumb {
    background: var(--theme-border-strong);
}

html[data-theme='dark'] .presence-item {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .presence-dot.offline {
    background: #64748b;
}

html[data-theme='dark'] .presence-name {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .presence-time,
html[data-theme='dark'] .presence-empty {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .presence-collapsed-badge {
    border-color: var(--theme-bg-surface-alt);
}

html[data-theme='dark'] :is(.left-sidebar.collapsed, .sidebar-collapsed-pref .left-sidebar) .sidebar-presence-container {
    border-top-color: var(--theme-border);
}

/* Toast */
html[data-theme='dark'] .toast {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .toast-title {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .toast-message {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .toast-close {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .toast-close:hover {
    color: var(--theme-text-primary);
    background: var(--theme-bg-subtle);
}

html[data-theme='dark'] .toast-input {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border-strong);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .toast-action-cancel {
    background: var(--theme-bg-surface);
    color: var(--theme-text-secondary);
    border-color: var(--theme-border-strong);
}

html[data-theme='dark'] .toast-action-cancel:hover {
    background: var(--theme-bg-subtle);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .toast-container-center {
    background-color: var(--theme-overlay);
}

html[data-theme='dark'] .toast-confirm,
html[data-theme='dark'] .toast-prompt,
html[data-theme='dark'] .toast-select {
    background: var(--theme-bg-surface);
    border: 1px solid var(--theme-border);
    box-shadow: var(--theme-shadow-lg);
}

html[data-theme='dark'] .toast-confirm .toast-title,
html[data-theme='dark'] .toast-prompt .toast-title,
html[data-theme='dark'] .toast-select .toast-title {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .toast-confirm .toast-message,
html[data-theme='dark'] .toast-prompt .toast-message,
html[data-theme='dark'] .toast-select .toast-message {
    color: var(--theme-text-secondary);
}

html[data-theme='dark'] .toast-confirm .toast-icon,
html[data-theme='dark'] .toast-prompt .toast-icon {
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
}

html[data-theme='dark'] .toast-select .toast-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

html[data-theme='dark'] .toast-prompt .toast-input {
    background: var(--theme-bg-surface-alt);
    border-color: var(--theme-border-strong);
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .toast-prompt .toast-input:focus {
    background: var(--theme-bg-surface);
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

html[data-theme='dark'] .toast-select-option {
    background: var(--theme-bg-surface);
    border-color: var(--theme-border);
}

html[data-theme='dark'] .toast-select-option:hover {
    background: var(--theme-bg-subtle);
    border-color: var(--theme-border-strong);
}

html[data-theme='dark'] .toast-select-option:has(input:checked) {
    background: var(--theme-accent-soft);
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 1px var(--theme-accent);
}

html[data-theme='dark'] .toast-select-label {
    color: var(--theme-text-primary);
}

html[data-theme='dark'] .toast-select-desc {
    color: var(--theme-text-muted);
}

html[data-theme='dark'] .toast-select-warning {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

html[data-theme='dark'] .toast-select-warning:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.45);
}

html[data-theme='dark'] .toast-select-warning:has(input:checked) {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}

html[data-theme='dark'] .toast-select-warning .toast-select-label {
    color: #fecaca;
}

html[data-theme='dark'] .toast-select-warning .toast-select-desc {
    color: #fca5a5;
}

html[data-theme='dark'] .toast-success .toast-icon {
    color: #86efac;
    background: rgba(34, 197, 94, 0.22);
}

html[data-theme='dark'] .toast-error .toast-icon {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.22);
}

html[data-theme='dark'] .toast-warning .toast-icon {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.22);
}

html[data-theme='dark'] .toast-info .toast-icon {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.22);
}
