/* ==========================================================================
   dark.css: dark tokens. Loaded after theme.css. Activated by <html data-bs-theme="dark">.
   Backgrounds come only from this set: #000000 #181818 #1f1f1f #272727 #313131 #131209.
   The accent flips: a light spruce fill carries dark ink, so contrast stays above 4.5:1.
   ========================================================================== */
[data-bs-theme="dark"] {
  color-scheme: dark;

  --pos-primary: var(--pos-primary-400);
  --pos-primary-hover: var(--pos-primary-300);
  --pos-primary-soft: rgba(var(--pos-p300-rgb), 0.12);
  --pos-primary-soft-strong: rgba(var(--pos-p300-rgb), 0.22);
  --pos-primary-text: var(--pos-primary-300);
  --pos-primary-text-rgb: var(--pos-p300-rgb);
  --pos-on-primary: #06201b;
  --pos-focus: var(--pos-primary-300);

  --pos-success: #7dc36c;  --pos-success-500: #7dc36c; --pos-success-rgb: 125, 195, 108; --pos-success-soft: rgba(125, 195, 108, 0.14); --pos-success-text: #a7db98; --pos-on-success: #0e1f0a;
  --pos-warning: #e3a83a;  --pos-warning-rgb: 227, 168, 58;  --pos-warning-soft: rgba(227, 168, 58, 0.14);  --pos-warning-text: #f0c46e; --pos-on-warning: #2a1a00;
  --pos-danger: #f0837a;   --pos-danger-rgb: 240, 131, 122;  --pos-danger-soft: rgba(240, 131, 122, 0.14);  --pos-danger-text: #f7a9a2;  --pos-on-danger: #2b0805;
  --pos-info: #7fb0dd;     --pos-info-rgb: 127, 176, 221;    --pos-info-soft: rgba(127, 176, 221, 0.14);    --pos-info-text: #a9cdee;    --pos-on-info: #0b2236;

  --pos-bg: #131209;
  --pos-bg-rgb: 19, 18, 9;
  --pos-surface: #181818;
  --pos-surface-rgb: 24, 24, 24;
  --pos-surface-2: #1f1f1f;
  --pos-surface-3: #272727;
  --pos-surface-4: #313131;
  --pos-border: #313131;
  --pos-border-strong: #454545;
  --pos-input-border: #77736a;
  --pos-text: #f2f0e9;
  --pos-text-rgb: 242, 240, 233;
  --pos-text-muted: #bdb9ab;
  --pos-text-faint: #a39f91;

  --pos-panel: rgba(31, 31, 31, 0.74);
  --pos-panel-solid: #1f1f1f;
  --pos-panel-edge: rgba(255, 255, 255, 0.1);
  --pos-edge-hi: rgba(255, 255, 255, 0.07);
  --pos-plane-1: rgba(70, 160, 146, 0.09);
  --pos-plane-2: rgba(255, 255, 255, 0.035);
  --pos-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --pos-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 18px -8px rgba(0, 0, 0, 0.6);
  --pos-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 32px -10px rgba(0, 0, 0, 0.7);
  --pos-shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.45), 0 30px 60px -18px rgba(0, 0, 0, 0.85);
  --pos-ring: 0 0 0 3px rgba(var(--pos-p300-rgb), 0.38);

  --bs-primary-border-subtle: rgba(var(--pos-p300-rgb), 0.4);
}
[data-bs-theme="dark"] .btn-primary {
  --bs-btn-active-bg: var(--pos-primary-400); --bs-btn-active-border-color: var(--pos-primary-400);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-border-color: rgba(var(--pos-p300-rgb), 0.5); }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-bg: var(--pos-surface-2); }
[data-bs-theme="dark"] .btn-outline-secondary:hover { --bs-btn-hover-bg: var(--pos-surface-4); }
[data-bs-theme="dark"] .modal-content { background: var(--pos-surface-2); }
[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-bg: var(--pos-surface-2); --bs-dropdown-link-hover-bg: var(--pos-surface-4); --bs-dropdown-divider-bg: var(--pos-border); --bs-dropdown-color: var(--pos-text); }
[data-bs-theme="dark"] .dropdown-item:hover { background: var(--pos-surface-4); }
[data-bs-theme="dark"] .dropdown-divider { border-color: var(--pos-border); }
[data-bs-theme="dark"] option { background: var(--pos-surface-2); color: var(--pos-text); }
[data-bs-theme="dark"] .table > thead > tr > th { background: var(--pos-surface-3); }
[data-bs-theme="dark"] .table { --bs-table-hover-bg: rgba(var(--pos-p300-rgb), 0.07); }
[data-bs-theme="dark"] .kbd { background: var(--pos-surface-4); }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--pos-primary); border-color: var(--pos-primary); }
[data-bs-theme="dark"] .form-check-input:checked[type="checkbox"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2306201b' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* ---------- searchable dropdowns (Select2) ---------- */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection { background-color: var(--pos-surface); border-color: var(--pos-input-border); color: var(--pos-text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23bdb9ab' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--disabled .select2-selection { background-color: var(--pos-surface-3); opacity: 0.6; }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__placeholder,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder { color: var(--pos-text-faint); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__clear { filter: invert(0.85); opacity: 0.8; }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown { background: var(--pos-surface-2); border-color: var(--pos-border-strong); box-shadow: var(--pos-shadow-lg); color: var(--pos-text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field { background: var(--pos-surface); color: var(--pos-text); border-color: var(--pos-input-border); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option { color: var(--pos-text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted { background: var(--pos-surface-4); color: var(--pos-text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--selected { background: var(--pos-primary-soft-strong); color: var(--pos-primary-text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--disabled,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__message { color: var(--pos-text-faint); }
