/* Panel - dark theme (deduplicated) */

html[data-theme="dark"] .file-field-picker {
  background: #111827;
  border-color: var(--line);
}

html[data-theme="dark"] .file-field-name {
  color: #94a3b8;
}

html[data-theme="dark"] .file-field-preview {
  background: #111827;
  border-color: var(--line);
}

html[data-theme="dark"] .file-field-preview-warn {
  background: #f87171;
}

html[data-theme="dark"] .rich-editor-surface a.bbcode-link,
html[data-theme="dark"] .entry-modal-description-body a.bbcode-link,
html[data-theme="dark"] .bbcode-link {
  color: #60a5fa;
}

html[data-theme="dark"] .entry-modal-meta-item {
  background: color-mix(in srgb, var(--panel) 88%, #0f172a);
}

html[data-theme="dark"] .entry-modal-description-body,
html[data-theme="dark"] .entry-modal-description-body .bbcode-list,
html[data-theme="dark"] .entry-modal-description-body blockquote {
  color: var(--text);
}

html[data-theme="dark"] .entry-file-card {
  background: color-mix(in srgb, var(--panel) 90%, #0f172a);
}

html[data-theme="dark"] .entry-modal-items-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--line) 18%, transparent);
}

html[data-theme="dark"] .dash-budget-legend-row span {
  color: #cbd5e1;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #111827;
  --text: #e5eef9;
  --muted: #94a3b8;
  --line: #2e3d56;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
  --sidebar-bg-top: #002046;
  --sidebar-bg-bottom: #001530;
  --sidebar-active-start: #286fcf;
  --sidebar-active-end: #1d5fc4;
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #0f172a, var(--bg));
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .user-menu-trigger,
html[data-theme="dark"] .topbar-icon-btn,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #111827;
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="dark"] .user-menu-panel a.user-menu-admin-link {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
}

html[data-theme="dark"] .shopping-preview-photo {
  background: #111827;
  border-color: var(--line);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .project-card-v2,
html[data-theme="dark"] .projects-stat-card {
  background: var(--panel);
  border-color: var(--line);
}

html[data-theme="dark"] .menu-button {
  color: #e2e8f0;
}

html[data-theme="dark"] .action-button.secondary,
html[data-theme="dark"] .secondary-button {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  box-shadow: none;
}
html[data-theme="dark"] .action-button.secondary:hover,
html[data-theme="dark"] .secondary-button:hover {
  filter: brightness(0.9);
  background: var(--brand-gradient);
}

html[data-theme="dark"] .projects-hub-search input {
  background: #111827 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
}

html[data-theme="dark"] .project-card-v2-footer {
  background: #0f172a;
}

html[data-theme="dark"] .project-card-v2-finance div {
  background: #0b1220;
  border-color: var(--line);
}

html[data-theme="dark"] .project-card-menu-btn,
html[data-theme="dark"] .project-card-icon-btn {
  background: #1e293b;
  color: #cbd5e1;
  border-color: var(--line);
}

html[data-theme="dark"] .project-card-menu-panel {
  background: #111827;
  border-color: var(--line);
}

html[data-theme="dark"] .project-card-menu-panel a,
html[data-theme="dark"] .project-card-menu-panel .menu-link-btn {
  color: var(--text);
}

html[data-theme="dark"] .project-card-menu-panel a:hover,
html[data-theme="dark"] .project-card-menu-panel .menu-link-btn:hover {
  background: #1e293b;
}

html[data-theme="dark"] .projects-filter-tabs a,
html[data-theme="dark"] .projects-filter-tabs button {
  background: #1e293b;
  color: var(--muted);
  border-color: var(--line);
}

html[data-theme="dark"] .projects-filter-tabs a.active,
html[data-theme="dark"] .projects-filter-tabs button.active {
  background: linear-gradient(135deg, var(--brand-primary-dark), color-mix(in srgb, var(--brand-primary-dark) 65%, #1e293b));
  color: #fff;
  border-color: transparent;
}

html[data-theme="dark"] .projects-toolbar-select select,
html[data-theme="dark"] .projects-view-toggle button {
  background: #1e293b;
  color: #cbd5e1;
  border-color: var(--line);
}

html[data-theme="dark"] .projects-view-toggle button.active {
  background: var(--brand-gradient);
  color: #fff;
}

html[data-theme="dark"] .project-status-workflow {
  background: #1e293b;
  border-color: var(--line);
}

html[data-theme="dark"] .expense-items-box {
  background: #1e293b;
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="dark"] .expense-items-box > label {
  color: var(--text);
}

html[data-theme="dark"] label,
html[data-theme="dark"] .file-field-label,
html[data-theme="dark"] .checkbox-row span {
  color: #cbd5e1;
}

html[data-theme="dark"] .topbar-project-currency {
  background: #1e293b;
  color: #bfdbfe;
  border: 1px solid var(--line);
  font-size: 12px;
}

html[data-theme="dark"] .topbar-project-menu {
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .topbar-project-option button,
html[data-theme="dark"] .topbar-project-option-copy strong {
  color: #e2e8f0;
}

html[data-theme="dark"] .topbar-project-option-copy small {
  color: #94a3b8;
}

html[data-theme="dark"] .topbar-project-option.is-active button {
  background: rgba(59, 130, 246, 0.16);
}

html[data-theme="dark"] .topbar-icon-btn {
  background: #1e293b;
  color: #e2e8f0;
}

html[data-theme="dark"] .topbar-icon-btn:disabled {
  opacity: 0.72;
  color: #94a3b8;
}

html[data-theme="dark"] .user-menu-panel a:hover,
html[data-theme="dark"] .user-menu-panel button:hover,
html[data-theme="dark"] .user-menu-logout button:hover {
  background: #1e293b;
}

html[data-theme="dark"] .projects-recent-table th {
  color: var(--muted);
}

html[data-theme="dark"] .projects-recent-table tr {
  border-color: var(--line);
}

html[data-theme="dark"] .toggle-field {
  background: #1e293b;
  border-color: var(--line);
}

html[data-theme="dark"] .toggle-switch-track {
  background: #475569;
}

html[data-theme="dark"] .toggle-switch-state {
  color: #94a3b8;
}

html[data-theme="dark"] .maintenance-banner {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.28);
  color: #fdba74;
}

html[data-theme="dark"] .maintenance-banner strong {
  color: #fed7aa;
}

html[data-theme="dark"] .maintenance-banner a {
  color: #fdba74;
}

html[data-theme="dark"] .activity-log-row {
  background: var(--panel);
  border-color: var(--line);
}

html[data-theme="dark"] .settings-tabs a,
html[data-theme="dark"] .admin-tabs a.admin-tab-trigger,
html[data-theme="dark"] .admin-tabs button.admin-tab-trigger {
  background: color-mix(in srgb, var(--panel) 68%, #1e293b);
  border: 1px solid var(--line);
  color: #cbd5e1;
  box-shadow: none;
}

html[data-theme="dark"] .settings-tabs a:hover,
html[data-theme="dark"] .admin-tabs a.admin-tab-trigger:hover,
html[data-theme="dark"] .admin-tabs button.admin-tab-trigger:hover {
  background: color-mix(in srgb, var(--panel) 52%, #334155);
  color: var(--text);
}

html[data-theme="dark"] .settings-tabs a.active,
html[data-theme="dark"] .admin-tabs a.admin-tab-trigger.active,
html[data-theme="dark"] .admin-tabs button.admin-tab-trigger.active {
  background: linear-gradient(135deg, var(--brand-primary-dark), color-mix(in srgb, var(--brand-primary-dark) 65%, #1e293b));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--brand-shadow);
}

html[data-theme="dark"] .admin-list-search input {
  background: #111827 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="dark"] .admin-row-toggle-icon {
  background: #334155;
  color: #cbd5e1;
}

html[data-theme="dark"] .admin-row-details {
  background: #0f172a;
  border-color: var(--line);
}

html[data-theme="dark"] .admin-collapsible {
  background: #0f172a;
  border-color: var(--line);
}

html[data-theme="dark"] .modal-box {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .modal-box h2,
html[data-theme="dark"] .modal-box h3 {
  color: var(--text);
}

html[data-theme="dark"] .modal-box label {
  color: var(--text);
}

html[data-theme="dark"] .modal-box input,
html[data-theme="dark"] .modal-box select,
html[data-theme="dark"] .modal-box textarea {
  background: #111827;
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="dark"] .modal-box .form-message.success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

html[data-theme="dark"] .modal-box .form-message.error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

html[data-theme="dark"] .settings-code-lock-alert.form-message.error {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

html[data-theme="dark"] .side-nav a:hover,
html[data-theme="dark"] .side-nav a.active {
  background: linear-gradient(135deg, var(--sidebar-active-start), var(--sidebar-active-end));
  box-shadow: inset 3px 0 0 #5b9cff;
}

html[data-theme="dark"] .logo-box span {
  color: #94a3b8;
}

html[data-theme="dark"] .timeline-item.js-entry-open:hover,
html[data-theme="dark"] .timeline-item.js-entry-open:focus-visible,
html[data-theme="dark"] .entry-row.js-entry-open:hover,
html[data-theme="dark"] .entry-row.js-entry-open:focus-visible,
html[data-theme="dark"] .expense-item.js-entry-open:hover,
html[data-theme="dark"] .dashboard-expense-item.js-entry-open:hover,
html[data-theme="dark"] .dashboard-expense-item.js-entry-open:focus-visible {
  background: #1e293b;
  border-radius: 12px;
}

html[data-theme="dark"] .timeline-photo {
  background: #1e293b;
}

html[data-theme="dark"] .mini-card {
  background: var(--panel);
  border-color: var(--line);
}

html[data-theme="dark"] .badge {
  background: color-mix(in srgb, #3b82f6 22%, var(--panel));
  color: #93c5fd;
}

html[data-theme="dark"] .summary-schedule-item {
  background: color-mix(in srgb, var(--panel) 82%, #0f172a);
  border-color: var(--line);
}

html[data-theme="dark"] .stat-card {
  background: var(--panel);
  border-color: var(--line);
}

html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .plan-empty {
  background: #1e293b;
  border-color: var(--line);
  color: var(--muted);
}

html[data-theme="dark"] .project-summary-stat {
  background: #1e293b;
  border-color: var(--line);
}

html[data-theme="dark"] .project-summary-list {
  background: var(--panel);
}

html[data-theme="dark"] .project-stats li {
  background: #1e293b;
  border-color: var(--line);
}

html[data-theme="dark"] .oauth-google-badge {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .settings-oauth-status-connected {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

html[data-theme="dark"] .settings-oauth-status-disconnected {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

html[data-theme="dark"] .settings-oauth-connect {
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .settings-oauth-connect:hover {
  background: #1f2937;
}

html[data-theme="dark"] .plans-page-stat-icon {
  background: rgba(91, 156, 255, 0.14);
  border: 1px solid rgba(91, 156, 255, 0.22);
}

html[data-theme="dark"] .plans-page-stat-icon img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

html[data-theme="dark"] .plans-page-stat-card {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] .attachments-filter-select,
html[data-theme="dark"] .plans-sort-select {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .attachments-page-stat-card {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] .attachments-page-stat-card small {
  color: #94a3b8;
}

html[data-theme="dark"] .attachments-page-stat-card strong {
  color: #f1f5f9;
}

html[data-theme="dark"] .attachments-page-stat-icon {
  background: rgba(91, 156, 255, 0.14);
  border: 1px solid rgba(91, 156, 255, 0.22);
}

html[data-theme="dark"] .attachments-page-stat-icon img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

html[data-theme="dark"] .attachments-item-linked-badge {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

html[data-theme="dark"] .attachments-item-category {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

html[data-theme="dark"] .attachments-item-linked-btn {
  color: #93c5fd;
}

html[data-theme="dark"] .entry-modal-linked-banner {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(96, 165, 250, 0.28);
}

html[data-theme="dark"] .plans-page-stat-card small {
  color: #94a3b8;
}

html[data-theme="dark"] .plans-page-stat-card strong {
  color: #f1f5f9;
}

html[data-theme="dark"] .plans-page-stat-icon.is-done {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.28);
}

html[data-theme="dark"] .dash-task-priority.is-high {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35), 0 0 16px rgba(239, 68, 68, 0.28);
}

html[data-theme="dark"] .dash-task-priority.is-medium {
  background: rgba(249, 115, 22, 0.16);
  color: #fdba74;
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.32), 0 0 16px rgba(249, 115, 22, 0.22);
}

html[data-theme="dark"] .dash-task-priority.is-low {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

html[data-theme="dark"] .shopping-chip.is-qty {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

html[data-theme="dark"] .shopping-chip.is-spare-qty {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
}

html[data-theme="dark"] .shopping-chip.is-unit {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

html[data-theme="dark"] .shopping-chip.is-needed {
  background: rgba(249, 115, 22, 0.18);
  color: #fdba74;
}

html[data-theme="dark"] .shopping-chip.is-total {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

html[data-theme="dark"] .shopping-chip-btn.is-link {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

html[data-theme="dark"] .shopping-chip-btn.is-edit {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

html[data-theme="dark"] .shopping-chip-btn.is-delete {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

html[data-theme="dark"] .shopping-chip-btn.is-add {
  background: rgba(249, 115, 22, 0.18);
  color: #fdba74;
}

html[data-theme="dark"] .shopping-shipping-ok {
  color: #86efac;
}

html[data-theme="dark"] .shopping-shipping-missing {
  color: #fca5a5;
}

html[data-theme="dark"] .shopping-shipping-label {
  color: var(--text);
}

html[data-theme="dark"] .shopping-seller-subgroup {
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
  border-color: var(--line);
}

html[data-theme="dark"] .shopping-seller-link,
html[data-theme="dark"] a.shopping-seller-badge,
html[data-theme="dark"] .shopping-preview-meta a {
  color: #93c5fd;
}

html[data-theme="dark"] .dash-task-status.is-todo {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

html[data-theme="dark"] .dash-task-status.is-active {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

html[data-theme="dark"] .dash-task-status.is-done {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

html[data-theme="dark"] .email-verify-badge.is-verified {
  background: #14532d;
  border-color: #166534;
  color: #bbf7d0;
}

html[data-theme="dark"] .email-verify-badge.is-unverified {
  background: #7c2d12;
  border-color: #9a3412;
  color: #fed7aa;
}

html[data-theme="dark"] .admin-info-box,
html[data-theme="dark"] .settings-pwa-step,
html[data-theme="dark"] .email-template-panel,
html[data-theme="dark"] .admin-backup-row,
html[data-theme="dark"] .admin-stats-kpi-card,
html[data-theme="dark"] .admin-stats-chart-card,
html[data-theme="dark"] .admin-stats-recent-row {
  background: #1e293b;
  border-color: #334155;
}

html[data-theme="dark"] .admin-stats-kpi-card strong,
html[data-theme="dark"] .admin-stats-recent-row time {
  color: #e2e8f0;
}

html[data-theme="dark"] .admin-stats-kpi-card span,
html[data-theme="dark"] .admin-stats-kpi-card small,
html[data-theme="dark"] .admin-stats-daily-date,
html[data-theme="dark"] .admin-stats-chart-y-labels,
html[data-theme="dark"] .admin-stats-chart-x-labels,
html[data-theme="dark"] .admin-stats-chart-legend,
html[data-theme="dark"] .admin-stats-recent-row time small {
  color: #94a3b8;
}

html[data-theme="dark"] .admin-stats-daily-bar {
  background: #334155;
}

html[data-theme="dark"] .admin-stats-table th,
html[data-theme="dark"] .admin-stats-table td {
  border-bottom-color: #334155;
}

html[data-theme="dark"] .admin-stats-chart-grid span {
  border-top-color: #334155;
}

html[data-theme="dark"] .admin-stats-heatmap-day,
html[data-theme="dark"] .admin-stats-heatmap-hour {
  color: #94a3b8;
}

html[data-theme="dark"] .admin-stats-heatmap-cell {
  background: color-mix(in srgb, #4ec4ae calc(var(--heat, 0.06) * 100%), #1e293b);
  border-color: color-mix(in srgb, #4ec4ae 10%, transparent);
}

html[data-theme="dark"] .admin-stats-heatmap-peaks {
  border-top-color: #334155;
  color: #94a3b8;
}

html[data-theme="dark"] .admin-stats-heatmap-peaks li strong {
  color: #e2e8f0;
}

html[data-theme="dark"] .email-placeholder-help {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] .email-placeholder-help dd {
  color: #94a3b8;
}

html[data-theme="dark"] .plan-badge-free,
html[data-theme="dark"] .admin-plan-free {
  background: #e2e8f0;
  color: #0f172a;
}

html[data-theme="dark"] .js-schedule-set-status.is-tone-planned {
  background: color-mix(in srgb, #94a3b8 14%, #1e293b);
  border-color: #94a3b8;
  color: #cbd5e1;
}

html[data-theme="dark"] .js-schedule-set-status.is-tone-progress {
  background: color-mix(in srgb, #f97316 14%, #1e293b);
  border-color: #f97316;
  color: #fdba74;
}

html[data-theme="dark"] .js-schedule-set-status.is-tone-done {
  background: color-mix(in srgb, #16a34a 14%, #1e293b);
  border-color: #16a34a;
  color: #86efac;
}

html[data-theme="dark"] .js-schedule-set-status.is-tone-planned.is-active {
  color: #e2e8f0;
  background: color-mix(in srgb, #94a3b8 22%, #1e293b);
  border-color: #94a3b8;
  box-shadow:
    0 0 0 2px rgba(148, 163, 184, 0.55),
    0 0 20px rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .js-schedule-set-status.is-tone-progress.is-active {
  color: #fdba74;
  box-shadow:
    0 0 0 2px rgba(249, 115, 22, 0.55),
    0 0 20px rgba(249, 115, 22, 0.28);
}

html[data-theme="dark"] .js-schedule-set-status.is-tone-done.is-active {
  color: #86efac;
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.55),
    0 0 20px rgba(34, 197, 94, 0.28);
}

html[data-theme="dark"] .topbar-search-trigger,
html[data-theme="dark"] .dash-quick-action,
html[data-theme="dark"] .dash-receipt-card,
html[data-theme="dark"] .dash-kpi-card-rich,
html[data-theme="dark"] .dash-kpi-card-budget,
html[data-theme="dark"] .dash-schedule-categories li {
  background: #1e293b;
}

html[data-theme="dark"] .dash-quick-action {
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

html[data-theme="dark"] .dash-quick-action-expense .dash-quick-action-icon { background: rgba(34, 197, 94, 0.18); }

html[data-theme="dark"] .dash-quick-action-receipt .dash-quick-action-icon { background: rgba(251, 146, 60, 0.18); }

html[data-theme="dark"] .dash-quick-action-task .dash-quick-action-icon { background: rgba(59, 130, 246, 0.2); }

html[data-theme="dark"] .dash-quick-action-photo .dash-quick-action-icon { background: rgba(99, 102, 241, 0.2); }

html[data-theme="dark"] .dash-quick-action-note .dash-quick-action-icon { background: rgba(167, 139, 250, 0.2); }

html[data-theme="dark"] .dash-kpi-icon img,
html[data-theme="dark"] .dash-quick-action-icon img,
html[data-theme="dark"] .projects-stat-icon img,
html[data-theme="dark"] .project-card-inline-icon,
html[data-theme="dark"] .stat-card .stat-icon img,
html[data-theme="dark"] .auth-feature-icon img {
  filter: brightness(0) invert(1);
  opacity: 0.94;
}

html[data-theme="dark"] .journal-stat-card,
html[data-theme="dark"] .journal-entry-body,
html[data-theme="dark"] .journal-quick-action,
html[data-theme="dark"] .journal-sort-select,
html[data-theme="dark"] .journal-attach-grid div {
  background: #1e293b;
  border-color: #334155;
}

html[data-theme="dark"] .journal-sort-select {
  color: #e2e8f0;
}

html[data-theme="dark"] .journal-entry-card::before {
  background: #334155;
}

html[data-theme="dark"] .journal-entry-date-text,
html[data-theme="dark"] .journal-entry-time-text {
  color: #94a3b8;
}

html[data-theme="dark"] .journal-entry-meta-key {
  color: #94a3b8;
}

html[data-theme="dark"] .journal-entry-meta-val {
  color: #e2e8f0;
}

html[data-theme="dark"] .journal-entry-dot {
  box-shadow: 0 0 0 2px #334155;
  border-color: #0f172a;
}

html[data-theme="dark"] .journal-entry-title {
  color: #e2e8f0;
}

html[data-theme="dark"] .journal-entry-desc {
  color: #94a3b8;
}

html[data-theme="dark"] .journal-entry-photo-btn img {
  border-color: #334155;
}

html[data-theme="dark"] .journal-entry-menu-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

html[data-theme="dark"] .journal-entry-menu-item {
  color: #e2e8f0;
}

html[data-theme="dark"] .journal-entry-menu-item:hover {
  background: #334155;
}

html[data-theme="dark"] .journal-entry-menu-item.is-danger:hover {
  background: rgba(239,68,68,0.15);
}

html[data-theme="dark"] .journal-entry-menu-btn {
  color: #94a3b8;
}

html[data-theme="dark"] .journal-entry-menu-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .journal-entry-photos-more {
  border-color: #334155;
}

html[data-theme="dark"] .journal-stat-icon {
  background: color-mix(in srgb, var(--blue) 28%, #0f172a);
}

html[data-theme="dark"] .journal-stat-icon img {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

html[data-theme="dark"] .journal-stat-label,
html[data-theme="dark"] .journal-side-task-list small {
  color: #94a3b8;
}

html[data-theme="dark"] .journal-quick-action em {
  color: #e2e8f0;
}

html[data-theme="dark"] .journal-filter-tab {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

html[data-theme="dark"] .journal-filter-tab.is-active {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}

html[data-theme="dark"] .journal-date-filters,
html[data-theme="dark"] .journal-date-filters input[type="date"],
html[data-theme="dark"] .journal-page-select {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

html[data-theme="dark"] .journal-date-group-label {
  color: #64748b;
}

html[data-theme="dark"] .dash-timeline::before {
  background: #334155;
}

html[data-theme="dark"] .dash-timeline-item.is-past .dash-timeline-dot,
html[data-theme="dark"] .dash-timeline-dot {
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.22);
}

html[data-theme="dark"] .dash-timeline-item.is-today .dash-timeline-dot {
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.22);
}

html[data-theme="dark"] .dash-timeline-item.is-important .dash-timeline-dot {
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.22);
}

html[data-theme="dark"] .dash-timeline-item.is-important .dash-timeline-head strong {
  color: #fca5a5;
}

html[data-theme="dark"] .journal-important-banner {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

html[data-theme="dark"] .dash-kpi-card-deadline {
  background: linear-gradient(135deg, #1e293b 0%, #172554 100%);
}

html[data-theme="dark"] .dash-donut-wrap,
html[data-theme="dark"] .dash-budget-legend-row,
html[data-theme="dark"] .dash-gantt-week {
  background: #1e293b;
}

html[data-theme="dark"] .dash-budget-tip {
  background: color-mix(in srgb, var(--blue) 12%, #1e293b);
}

html[data-theme="dark"] .dash-kpi-icon-budget { background: rgba(37, 99, 235, 0.22); }

html[data-theme="dark"] .dash-kpi-icon-expense { background: rgba(34, 197, 94, 0.18); }

html[data-theme="dark"] .dash-kpi-icon-tasks { background: rgba(249, 115, 22, 0.18); }

html[data-theme="dark"] .dash-kpi-icon-date { background: rgba(139, 92, 246, 0.2); }

html[data-theme="dark"] .dash-kpi-icon-progress { background: rgba(99, 102, 241, 0.2); }

html[data-theme="dark"] .dash-kpi-icon-journal { background: rgba(250, 204, 21, 0.18); }

html[data-theme="dark"] .expense-ocr-debug {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="dark"] .expense-ocr-debug pre {
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--line);
}

html[data-theme="dark"] .notes-card,
html[data-theme="dark"] .notes-detail-panel,
html[data-theme="dark"] .notes-recent-item,
html[data-theme="dark"] .notes-quick-action {
  background: #1e293b;
}

html[data-theme="dark"] .notes-filter-tab.is-active {
  background: color-mix(in srgb, var(--blue) 18%, #1e293b);
}

html[data-theme="dark"] .notes-kpi-card--total .projects-stat-icon { background: rgba(37, 99, 235, 0.22); color: #93c5fd; }
html[data-theme="dark"] .notes-kpi-card--important .projects-stat-icon { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
html[data-theme="dark"] .notes-kpi-card--pinned .projects-stat-icon { background: rgba(34, 197, 94, 0.18); color: #86efac; }
html[data-theme="dark"] .notes-kpi-card--week .projects-stat-icon { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
html[data-theme="dark"] .notes-kpi-card--updated .projects-stat-icon { background: rgba(14, 165, 233, 0.2); color: #7dd3fc; }

html[data-theme="dark"] .dash-budget-legend-row.is-spent {
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.28);
}

html[data-theme="dark"] .dash-budget-legend-row.is-remain {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
}

html[data-theme="dark"] .dash-budget-legend-row.is-remain.is-warn {
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.28);
}

html[data-theme="dark"] .dash-budget-legend-row.is-remain.is-over {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

html[data-theme="dark"] .entry-modal-meta-item,
html[data-theme="dark"] .entry-file-card {
  background: #1e293b;
}

html[data-theme="dark"] .dash-gantt-week-head {
  background: #0f172a;
}

html[data-theme="dark"] .dash-gantt-week-head-row {
  background: #0f172a;
}

html[data-theme="dark"] .dash-gantt-week-track {
  background: #334155;
}

html[data-theme="dark"] .dash-task-check-ui {
  background: #0f172a;
  border-color: #475569;
}

html[data-theme="dark"] .dash-gantt-row {
  background: #334155;
}

html[data-theme="dark"] .topbar-project-progress-bar,
html[data-theme="dark"] .dash-kpi-progress {
  background: #334155;
}

html[data-theme="dark"] .dash-donut::after {
  background: var(--panel);
}

/* ── Ogólne poprawki dark mode ──────────────────────────────────── */
html[data-theme="dark"] .thumb {
  background: #1e3a5f;
}

html[data-theme="dark"] .tickets-message.is-admin {
  background: rgba(40, 111, 207, 0.18);
}

html[data-theme="dark"] .admin-promo-tag.is-pro {
  background: rgba(37, 99, 235, 0.28);
  color: #93c5fd;
}

html[data-theme="dark"] .admin-promo-tag.is-max {
  background: rgba(109, 40, 217, 0.28);
  color: #c4b5fd;
}

html[data-theme="dark"] .confirm-plan-name.is-pro {
  color: #93c5fd;
}

html[data-theme="dark"] .confirm-plan-name.is-max {
  color: #c4b5fd;
}

html[data-theme="dark"] .confirm-plan-name.is-free {
  color: #e2e8f0;
}

html[data-theme="dark"] .confirm-plan-days {
  color: #f87171;
}

html[data-theme="dark"] .tickets-message.is-user {
  background: #1e293b;
}

html[data-theme="dark"] .tickets-status.is-closed,
html[data-theme="dark"] .tickets-closed-banner {
  background: rgba(220, 38, 38, 0.22);
  color: #fecaca;
}
