/* NextSens OPEN — System / Light / Dark Theme Switcher (Matches Vault & CRM) */
@media screen {
  .nst-open-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font: 600 12.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
  }
  .nst-open-theme-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
  }
  .nst-open-theme-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #243fb5;
  }

  html.dark { color-scheme: dark; }
  html.dark body,
  html.dark body.public-site {
    background: #0b1120 !important;
    color: #f1f5f9 !important;
  }
  html.dark .sidebar,
  html.dark .topbar,
  html.dark .site-header,
  html.dark .site-footer,
  html.dark .page-footer {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
  }
  html.dark .workspace,
  html.dark .container,
  html.dark main {
    background: #0b1120 !important;
    color: #f1f5f9 !important;
  }
  html.dark .card,
  html.dark .panel,
  html.dark .metric-card,
  html.dark .plan-card,
  html.dark .feature-card,
  html.dark .auth-card,
  html.dark .table-card,
  html.dark .local-panel,
  html.dark .flash,
  html.dark .notice,
  html.dark article {
    background: #111827 !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
  }
  html.dark h1, html.dark h2, html.dark h3, html.dark h4,
  html.dark .nst-wordmark, html.dark .topbar-context, html.dark .nav-item {
    color: #f1f5f9 !important;
  }
  html.dark p, html.dark .muted, html.dark .topbar-kicker, html.dark .nav-caption, html.dark .sidebar-footer {
    color: #94a3b8 !important;
  }
  html.dark .nav-item:hover {
    background: #1e293b !important;
    color: #ffffff !important;
  }
  html.dark .nav-item.active {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
  }
  html.dark table th {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
  }
  html.dark table td {
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
  }
  html.dark input, html.dark select, html.dark textarea {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
  }
  html.dark .nst-open-theme-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
  }
  html.dark .nst-open-theme-btn:hover {
    background: #334155;
    border-color: #60a5fa;
  }
  html.dark .nst-open-theme-btn svg {
    color: #60a5fa;
  }
}
