/*!
 * CRMTECH Solutions - Enterprise Application Suite
 * Dark developer-IDE design system shared by all 50 applications,
 * the hub, the sign-in page and the admin console.
 * crmtech.in  ·  contact@crmtech.in
 */

/* ======================================================================= *
 * Tokens
 * ======================================================================= */

:root {
  color-scheme: dark;

  --crm-bg: #0a0e17;
  --crm-bg-2: #0d1220;
  --crm-surface: #111827;
  --crm-surface-2: #0e1422;
  --crm-surface-3: #182033;
  --crm-surface-4: #1f2a40;
  --crm-line: #232e45;
  --crm-line-2: #2e3b57;

  --crm-ink: #e6e9f0;
  --crm-ink-2: #c3cad8;
  --crm-muted: #8a96ad;
  --crm-faint: #5d6a82;

  --crm-brand: #8b5cf6;
  --crm-brand-600: #7c3aed;
  --crm-brand-700: #c4b5fd;      /* accent text on dark backgrounds */
  --crm-brand-glow: rgba(139, 92, 246, .35);
  --crm-cyan: #22d3ee;
  --crm-pink: #f472b6;

  --crm-ok: #34d399;
  --crm-warn: #fbbf24;
  --crm-err: #f87171;
  --crm-ok-bg: rgba(52, 211, 153, .10);
  --crm-warn-bg: rgba(251, 191, 36, .10);
  --crm-err-bg: rgba(248, 113, 113, .10);
  --crm-brand-bg: rgba(139, 92, 246, .12);

  --crm-card: var(--crm-surface);
  --crm-radius: 12px;
  --crm-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --crm-hub-h: 60px;
  --crm-mono: "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
  --crm-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

html.crm-dark, html.crm-dark body { background: var(--crm-bg); }

::selection { background: rgba(139, 92, 246, .45); color: #fff; }

html.crm-dark ::-webkit-scrollbar { width: 11px; height: 11px; }
html.crm-dark ::-webkit-scrollbar-track { background: var(--crm-bg-2); }
html.crm-dark ::-webkit-scrollbar-thumb {
  background: var(--crm-surface-4); border-radius: 8px; border: 2px solid var(--crm-bg-2);
}
html.crm-dark ::-webkit-scrollbar-thumb:hover { background: var(--crm-line-2); }

.crm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ======================================================================= *
 * Brand logo
 * ======================================================================= */

.crm-logo { display: block; height: auto; max-width: 100%; user-select: none; -webkit-user-drag: none; }
.crm-logo-h { height: 30px; width: auto; }
.crm-logo-compact { display: none; height: 26px; width: auto; }
.crm-logo-dark, .crm-logo-light { height: 64px; width: auto; }
.crm-logo-icon { height: 22px; width: auto; }

/* legacy text mark, still used by a few static pages */
.crm-logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 55%, #06b6d4 100%);
  color: #fff; font: 800 13px/1 var(--crm-mono); letter-spacing: -.04em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 4px 14px var(--crm-brand-glow);
}
.crm-logo-sm { width: 28px; height: 28px; font-size: 11px; border-radius: 7px; }
.crm-logo-xs { width: 20px; height: 20px; font-size: 8.5px; border-radius: 5px; }

/* ======================================================================= *
 * Header (identical on every page; built by CRMTECH_UI.header)
 * ======================================================================= */

.crm-hubbar {
  position: sticky; top: 0; z-index: 9000;
  display: flex; align-items: center; gap: 12px;
  height: var(--crm-hub-h); padding: 0 20px; box-sizing: border-box;
  background: rgba(9, 12, 21, .88);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--crm-line);
  color: var(--crm-ink-2);
  font: 500 13px/1.2 var(--crm-sans);
  -webkit-user-select: none; user-select: none;
}
.crm-hubbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(139, 92, 246, .7) 25%, rgba(34, 211, 238, .55) 60%, transparent 100%);
}
.crm-hubbar *, .crm-hubbar *::before, .crm-hubbar *::after { box-sizing: border-box; }
.crm-hub-logo {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  height: 100%; padding-right: 16px; margin-right: 2px;
  border-right: 1px solid var(--crm-line);
  text-decoration: none;
}
.crm-hub-logo:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 4px; border-radius: 6px; }

.crm-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.crm-crumb-home {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 6px 10px; border-radius: 8px;
  color: var(--crm-muted) !important; text-decoration: none; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s;
}
.crm-crumb-home:hover { background: var(--crm-surface-3); color: #fff !important; }
.crm-crumb-home svg { width: 15px; height: 15px; }
.crm-hub-sep { color: var(--crm-faint); flex: 0 0 auto; font-size: 14px; }
.crm-hub-cat {
  color: var(--crm-muted) !important; white-space: nowrap; text-decoration: none; flex: 0 0 auto;
  padding: 6px 4px; border-radius: 6px;
}
a.crm-hub-cat:hover { color: #fff !important; }
.crm-hub-name, h1.crm-hub-name, strong.crm-hub-name {
  margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  color: #fff; font: 700 14px/1.2 var(--crm-sans); letter-spacing: -.005em; white-space: nowrap;
}
.crm-hub-spacer { flex: 1 1 auto; min-width: 8px; }

.crm-modules-btn {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  height: 36px; padding: 0 8px 0 12px; border-radius: 10px;
  background: var(--crm-surface-2); border: 1px solid var(--crm-line-2);
  color: var(--crm-ink); font: 600 12.5px var(--crm-sans); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.crm-modules-btn:hover { border-color: var(--crm-brand); background: var(--crm-surface-3); }
.crm-modules-btn svg { width: 16px; height: 16px; color: var(--crm-brand-700); }
.crm-modules-btn kbd, .crm-kbd {
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--crm-line-2); border-bottom-width: 2px;
  background: var(--crm-surface-3); color: var(--crm-faint); font: 600 10.5px var(--crm-mono);
}

.crm-hub-badge {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  height: 30px; padding: 0 11px; border-radius: 999px;
  background: var(--crm-ok-bg); border: 1px solid rgba(52, 211, 153, .35);
  color: var(--crm-ok); font: 700 11px var(--crm-mono); white-space: nowrap;
}
.crm-hub-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto;
  box-shadow: 0 0 8px currentColor; animation: crm-pulse 2.2s ease-in-out infinite;
}
.crm-hub-badge.crm-badge-warn { background: var(--crm-warn-bg); border-color: rgba(251, 191, 36, .35); color: var(--crm-warn); }
.crm-hub-badge.crm-badge-local { background: var(--crm-surface-3); border-color: var(--crm-line-2); color: var(--crm-muted); }
.crm-hub-badge.crm-badge-guest { background: var(--crm-brand-bg); border-color: rgba(139, 92, 246, .4); color: var(--crm-brand-700); }
@keyframes crm-pulse { 50% { opacity: .35; } }

.crm-account { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.crm-account:empty { display: none; }
.crm-account .crm-btn { height: 36px; padding: 0 14px; }

/* user menu */
.crm-user { position: relative; }
.crm-user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px 0 4px; border-radius: 999px;
  background: var(--crm-surface-2); border: 1px solid var(--crm-line-2);
  color: var(--crm-ink); font: 600 12.5px var(--crm-sans); cursor: pointer;
}
.crm-user-btn:hover { border-color: var(--crm-brand); }
.crm-user-btn::after { content: ""; width: 6px; height: 6px; margin-left: 2px; border: solid var(--crm-muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); }
.crm-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #0891b2); color: #fff;
  font: 800 11px var(--crm-sans); letter-spacing: .02em;
}
.crm-user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-role {
  padding: 2px 7px; border-radius: 5px; background: var(--crm-brand-bg); color: var(--crm-brand-700);
  font: 700 10px var(--crm-mono); text-transform: uppercase; letter-spacing: .05em;
}
.crm-usermenu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 9500;
  min-width: 260px; padding: 6px;
  background: var(--crm-surface); border: 1px solid var(--crm-line-2); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: crm-rise .16s ease;
}
.crm-usermenu[hidden] { display: none; }
.crm-usermenu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--crm-line); margin-bottom: 6px; }
.crm-usermenu-head strong { display: block; color: #fff; font-size: 13.5px; }
.crm-usermenu-head small { color: var(--crm-muted); font-size: 12px; overflow-wrap: anywhere; }
.crm-usermenu a, .crm-usermenu button {
  display: flex; width: 100%; gap: 10px; align-items: center;
  padding: 9px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--crm-ink-2) !important; text-align: left; text-decoration: none;
  font: 500 13px var(--crm-sans); cursor: pointer;
}
.crm-usermenu a:hover, .crm-usermenu button:hover { background: var(--crm-surface-3); color: #fff !important; }
.crm-usermenu .crm-danger { color: var(--crm-err) !important; }
.crm-usermenu hr { border: 0; border-top: 1px solid var(--crm-line); margin: 6px 0; }

/* A page's own toolbar sits under the shared header; its duplicate brand block is hidden. */
[data-crm-brand-dup] { display: none !important; }
header[data-crm-app-toolbar].sticky, header[data-crm-app-toolbar][class*="sticky"] { top: var(--crm-hub-h) !important; }

/* ======================================================================= *
 * Studio: full-window workspace for editor-style modules (logo maker,
 * website builder). Fills the window under the shared header; the page
 * then scrolls on to the related modules and footer. Stacks on phones.
 * ======================================================================= */

.crm-studio {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--crm-hub-h));
  height: calc(100dvh - var(--crm-hub-h));
  min-height: 580px; overflow: hidden;
  border-bottom: 1px solid var(--crm-line);
}
.crm-studio > * { flex: 0 0 auto; }
.crm-studio > .crm-studio-body, .crm-studio > main:not(.hidden) { flex: 1 1 auto; min-height: 0; }
@media (max-width: 1023px) {
  .crm-studio { height: auto; min-height: 0; overflow: visible; }
  .crm-studio > header { height: auto !important; flex-wrap: wrap; gap: 8px; padding-top: 8px !important; padding-bottom: 8px !important; }
  .crm-studio > header > div { max-width: 100%; overflow-x: auto; }
  .crm-studio > header button { white-space: nowrap; }
  .crm-studio > .crm-studio-body, .crm-studio > main:not(.hidden) { flex: none; }
  .crm-studio-body { flex-direction: column !important; overflow: visible !important; }
  .crm-studio-body > aside { width: 100% !important; border-left: 0 !important; border-right: 0 !important; border-top: 1px solid var(--crm-line) !important; }
}

/* ======================================================================= *
 * Related modules (links every module to the ones it works with)
 * ======================================================================= */

.crm-related {
  max-width: 1320px; margin: 44px auto 0; padding: 0 22px; box-sizing: border-box;
  font: 14px/1.5 var(--crm-sans); color: var(--crm-ink-2);
}
.crm-related-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.crm-related-head h2 { margin: 0; color: #fff; font: 700 17px var(--crm-sans); letter-spacing: -.01em; }
.crm-related-head p { margin: 3px 0 0; color: var(--crm-muted); font-size: 12.5px; }
.crm-related-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.crm-mod {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: 12px; border: 1px solid var(--crm-line);
  background: var(--crm-surface); color: inherit !important; text-decoration: none !important;
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.crm-mod:hover { transform: translateY(-2px); border-color: var(--accent, var(--crm-brand)); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.crm-mod-ico {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent, var(--crm-brand)); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent, #8b5cf6) 35%, transparent);
}
.crm-mod-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crm-mod-txt small { color: var(--crm-brand-700); font: 700 10px var(--crm-mono); text-transform: uppercase; letter-spacing: .07em; }
.crm-mod-txt strong { color: #fff; font-size: 13.5px; line-height: 1.3; }
.crm-mod-txt span { color: var(--crm-muted); font-size: 12px; line-height: 1.45; }

/* ======================================================================= *
 * Footer (identical on every page; built by CRMTECH_UI.footer)
 * ======================================================================= */

.crm-brandfoot {
  position: relative; margin-top: 56px;
  border-top: 1px solid var(--crm-line);
  background:
    radial-gradient(800px 240px at 10% 0%, rgba(139, 92, 246, .10), transparent 70%),
    radial-gradient(600px 200px at 95% 100%, rgba(34, 211, 238, .06), transparent 70%),
    #080b13;
  color: var(--crm-muted); font: 13px/1.6 var(--crm-sans);
  -webkit-user-select: none; user-select: none;
}
.crm-brandfoot::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, .55), rgba(34, 211, 238, .4), transparent);
}
.crm-brandfoot *, .crm-brandfoot *::before { box-sizing: border-box; }
.crm-foot-main {
  max-width: 1320px; margin: 0 auto; padding: 40px 22px 30px;
  display: grid; gap: 30px 36px;
  grid-template-columns: minmax(250px, 1.5fr) repeat(3, minmax(150px, 1fr));
}
.crm-foot-brand .crm-logo { height: 58px; margin: 0 0 14px -4px; }
.crm-foot-brand p { margin: 0 0 16px; max-width: 42ch; color: var(--crm-muted); font-size: 13px; }
.crm-foot-contact { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-foot-contact a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 9px; border: 1px solid var(--crm-line-2); background: var(--crm-surface-2);
  color: var(--crm-ink) !important; text-decoration: none !important; font: 600 12px var(--crm-sans);
}
.crm-foot-contact a:hover { border-color: var(--crm-brand); }
.crm-foot-contact svg { width: 14px; height: 14px; color: var(--crm-brand-700); }
.crm-foot-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crm-foot-col strong {
  margin-bottom: 8px; color: #fff; font: 700 11px var(--crm-sans); text-transform: uppercase; letter-spacing: .1em;
}
.crm-foot-col a, .crm-foot-col .crm-linkbtn {
  display: block; padding: 4px 0; color: var(--crm-muted) !important; text-decoration: none !important;
  font: 500 13px var(--crm-sans); text-align: left; transition: color .12s, transform .12s;
}
.crm-foot-col [hidden] { display: none !important; }
.crm-foot-col a:hover, .crm-foot-col .crm-linkbtn:hover { color: #fff !important; transform: translateX(2px); }
.crm-foot-base {
  max-width: 1320px; margin: 0 auto; padding: 16px 22px 84px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  border-top: 1px solid var(--crm-line);
  color: var(--crm-faint); font: 12px var(--crm-sans);
}
.crm-foot-base b { color: var(--crm-ink-2); font-weight: 600; }
.crm-foot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.crm-foot-mode { font: 600 11px var(--crm-mono); color: var(--crm-muted); }
.crm-foot-mode::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--crm-ok); box-shadow: 0 0 8px var(--crm-ok); vertical-align: 1px; }
.crm-foot-mode[data-kind="local"]::before { background: var(--crm-faint); box-shadow: none; }
.crm-foot-mode[data-kind="guest"]::before { background: var(--crm-brand); box-shadow: 0 0 8px var(--crm-brand); }
.crm-foot-mode:empty { display: none; }
.crm-foot-shield { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--crm-mono); color: var(--crm-muted); }

/* shared small controls */
.crm-linkbtn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--crm-brand-700); }
.crm-btn-ghost { background: transparent; border-color: var(--crm-line-2); }
.crm-btn-ghost:hover { background: var(--crm-surface-3); }
.crm-btn-block { width: 100%; padding-top: 11px; padding-bottom: 11px; font-size: 13.5px; }
.crm-check { display: flex; align-items: flex-start; gap: 9px; color: var(--crm-ink-2); font-size: 12.5px; line-height: 1.45; cursor: pointer; }
.crm-check input { margin: 2px 0 0; width: 15px; height: 15px; flex: 0 0 auto; }
.crm-dialog-text { margin: 0; color: var(--crm-ink-2); font-size: 13.5px; line-height: 1.6; }

/* ======================================================================= *
 * Module switcher (Ctrl K)
 * ======================================================================= */

.crm-switcher { align-items: flex-start; padding-top: min(12vh, 110px); }
.crm-switcher-box {
  width: min(680px, 100%); max-height: min(640px, 78vh); overflow: hidden;
  display: flex; flex-direction: column;
}
.crm-switcher-search {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--crm-line); color: var(--crm-muted); font-size: 18px;
}
.crm-switcher-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: #fff; font: 500 15px var(--crm-sans);
}
.crm-switcher-search input::placeholder { color: var(--crm-faint); }
.crm-switcher-search kbd { padding: 2px 7px; border-radius: 5px; border: 1px solid var(--crm-line-2); color: var(--crm-faint); font: 600 10.5px var(--crm-mono); }
.crm-switcher-list { flex: 1 1 auto; overflow-y: auto; padding: 6px 8px 10px; }
.crm-switcher-cat {
  padding: 12px 10px 5px; color: var(--crm-faint);
  font: 700 10.5px var(--crm-sans); text-transform: uppercase; letter-spacing: .09em;
}
.crm-switcher-item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
  color: var(--crm-ink) !important; text-decoration: none !important;
}
.crm-switcher-item .crm-mod-ico { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; box-shadow: none; }
.crm-switcher-item strong { display: block; color: #fff; font-size: 13.5px; line-height: 1.3; }
.crm-switcher-item small { display: block; color: var(--crm-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-switcher-item.is-active { background: var(--crm-brand-bg); border-color: rgba(139, 92, 246, .45); }
.crm-switcher-item.is-current strong::after { content: "  · current"; color: var(--crm-faint); font-weight: 500; font-size: 11.5px; }
.crm-switcher-item em { font: 700 10px var(--crm-mono); font-style: normal; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.crm-acc-ok { background: var(--crm-ok-bg); color: var(--crm-ok); border: 1px solid rgba(52, 211, 153, .3); }
.crm-acc-no { background: var(--crm-surface-3); color: var(--crm-muted); border: 1px solid var(--crm-line-2); }
.crm-switcher-foot {
  display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--crm-line);
  color: var(--crm-faint); font: 11px var(--crm-mono); background: var(--crm-surface-2);
}
.crm-switcher-empty { padding: 30px 10px; text-align: center; color: var(--crm-muted); }

/* ======================================================================= *
 * Sign-in page and sign-in panel
 * ======================================================================= */

.crm-login {
  max-width: 1180px; margin: 0 auto; padding: 48px 22px 20px; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 460px); gap: 48px; align-items: center;
  min-height: calc(100vh - var(--crm-hub-h) - 120px);
}
.crm-login-story { color: var(--crm-ink-2); }
.crm-login-story .crm-login-logo { height: 76px; margin: 0 0 26px -6px; }
.crm-login-story h1 { margin: 0 0 14px; color: #fff; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.1; letter-spacing: -.03em; }
.crm-login-story h1 span { background: linear-gradient(90deg, #c4b5fd, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crm-login-story > p { margin: 0 0 24px; max-width: 54ch; font-size: 15px; }
.crm-login-points { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.crm-login-points li {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px;
  border-radius: 12px; border: 1px solid var(--crm-line); background: rgba(17, 24, 39, .6);
  font-size: 12.5px; color: var(--crm-muted);
}
.crm-login-points li > span {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--crm-brand-bg); border: 1px solid rgba(139, 92, 246, .35); color: var(--crm-brand-700); font-size: 15px;
}
.crm-login-points b { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }
.crm-login-card {
  position: relative; padding: 28px 28px 24px;
  background: rgba(17, 24, 39, .92); border: 1px solid var(--crm-line-2); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(139, 92, 246, .12);
}
.crm-login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 18px; pointer-events: none; padding: 1px;
  background: linear-gradient(140deg, rgba(139, 92, 246, .6), transparent 40%, transparent 70%, rgba(34, 211, 238, .4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.crm-login-card h2 { margin: 0 0 4px; color: #fff; font-size: 21px; letter-spacing: -.01em; }
.crm-login-card > .crm-note { margin: 12px 0 0; }
.crm-auth { display: grid; gap: 12px; margin-top: 8px; }
.crm-auth > .crm-note { margin: 0; }
.crm-auth-tabs { margin-bottom: 0; }
.crm-auth-tabs .crm-tab { flex: 1 1 0; }
.crm-auth-tabs .crm-tab[hidden] { display: none; }
.crm-auth .crm-auth-form { margin-top: 6px; }
.crm-auth .crm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.crm-auth .crm-hint { margin: 0; }
.crm-note[hidden] { display: none; }

.crm-modal-mark {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--crm-brand-bg); border: 1px solid rgba(139, 92, 246, .35);
}
.crm-modal-mark .crm-logo { height: 15px; width: auto; }

/* ======================================================================= *
 * Buttons, inputs, cards (shared shell)
 * ======================================================================= */

.crm-app {
  margin: 0; background: var(--crm-bg); color: var(--crm-ink);
  font: 14px/1.6 var(--crm-sans); -webkit-font-smoothing: antialiased;
}
.crm-app a { color: var(--crm-brand-700); }
.crm-wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 40px; }

.crm-masthead {
  position: relative; overflow: hidden;
  padding: 26px 28px 24px; margin-bottom: 20px;
  border: 1px solid var(--crm-line); border-radius: 16px;
  background:
    radial-gradient(1200px 300px at 0% 0%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(700px 260px at 100% 0%, rgba(34, 211, 238, .14), transparent 60%),
    var(--crm-surface);
  color: #fff;
}
.crm-masthead::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000, transparent 90%);
}
.crm-masthead h1 { position: relative; margin: 0 0 8px; font-size: clamp(22px, 3.2vw, 31px); font-weight: 800; letter-spacing: -.02em; }
.crm-masthead p { position: relative; margin: 0; max-width: 80ch; color: var(--crm-ink-2); font-size: 14px; }
.crm-kicker {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 10px; padding: 4px 11px; border-radius: 6px;
  background: var(--crm-brand-bg); border: 1px solid rgba(139, 92, 246, .35);
  color: var(--crm-brand-700); font: 700 10.5px var(--crm-mono); letter-spacing: .1em; text-transform: uppercase;
}

.crm-card {
  padding: 20px; margin-bottom: 18px;
  border: 1px solid var(--crm-line); border-radius: var(--crm-radius);
  background: var(--crm-card); box-shadow: var(--crm-shadow);
}
.crm-card > h2 {
  margin: 0 0 4px; font-size: 15.5px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 9px;
}
.crm-card > h2::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--crm-brand), var(--crm-cyan));
}
.crm-card > h2 + .crm-sub, .crm-sub { margin: 0 0 16px; color: var(--crm-muted); font-size: 12.5px; }
.crm-card h3 { color: var(--crm-ink); }

.crm-grid { display: grid; gap: 14px; }
.crm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.crm-grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.crm-grid-4 { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

.crm-field { display: flex; flex-direction: column; gap: 6px; }
.crm-field > label, .crm-field > span:first-child {
  font-size: 11.5px !important; font-weight: 700; color: var(--crm-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.crm-field > .crm-hint, .crm-hint { font-size: 11.5px; color: var(--crm-faint); }

.crm-input, .crm-select, .crm-textarea {
  width: 100%; box-sizing: border-box;
  padding: 9px 11px; border: 1px solid var(--crm-line-2); border-radius: 8px;
  background: var(--crm-surface-2); color: var(--crm-ink);
  font: 13px var(--crm-sans);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.crm-input::placeholder, .crm-textarea::placeholder { color: var(--crm-faint); }
.crm-textarea { min-height: 130px; font-family: var(--crm-mono); font-size: 12.5px; resize: vertical; }
.crm-select { appearance: auto; }
.crm-select option { background: var(--crm-surface); color: var(--crm-ink); }
.crm-input:focus, .crm-select:focus, .crm-textarea:focus {
  outline: 0; border-color: var(--crm-brand); background: var(--crm-bg-2);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .22);
}
.crm-input.crm-invalid { border-color: var(--crm-err); box-shadow: 0 0 0 3px rgba(248, 113, 113, .2); }
.crm-mono { font-family: var(--crm-mono); }
.crm-app input[type="checkbox"], .crm-app input[type="radio"] { accent-color: var(--crm-brand); }
.crm-app input[type="date"], .crm-app input[type="month"], .crm-app input[type="time"],
.crm-app input[type="datetime-local"] { color-scheme: dark; }

.crm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }

.crm-action, .crm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--crm-line-2); border-radius: 8px;
  background: var(--crm-surface-3); color: var(--crm-ink);
  font: 600 12.5px var(--crm-sans); cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, transform .08s, box-shadow .12s;
}
.crm-action:hover, .crm-btn:hover { background: var(--crm-surface-4); border-color: var(--crm-brand); }
.crm-action:active, .crm-btn:active { transform: translateY(1px); }
.crm-action-primary, .crm-btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9); border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, .35), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.crm-action-primary:hover, .crm-btn-primary:hover {
  background: linear-gradient(135deg, #9f7aea, #7c3aed); border-color: transparent;
  box-shadow: 0 6px 22px rgba(124, 58, 237, .5);
}
.crm-action-danger, .crm-btn-danger { background: var(--crm-err-bg); border-color: rgba(248, 113, 113, .4); color: var(--crm-err); }
.crm-action-danger:hover, .crm-btn-danger:hover { background: rgba(248, 113, 113, .2); border-color: var(--crm-err); }
.crm-action:disabled, .crm-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.crm-table-wrap { overflow-x: auto; border: 1px solid var(--crm-line); border-radius: 10px; background: var(--crm-surface-2); }
.crm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--crm-ink-2); }
.crm-table th, .crm-table td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--crm-line); white-space: nowrap; }
.crm-table th {
  background: var(--crm-surface-3); color: var(--crm-muted); position: sticky; top: 0; z-index: 1;
  font: 700 11px var(--crm-sans); text-transform: uppercase; letter-spacing: .05em;
}
.crm-table tbody tr:hover { background: rgba(139, 92, 246, .06); }
.crm-table td.crm-num, .crm-table th.crm-num { text-align: right; font-family: var(--crm-mono); }
.crm-table strong { color: var(--crm-ink); }

.crm-stat {
  margin: 0; padding: 14px 16px;
  border: 1px solid var(--crm-line); border-radius: 11px;
  background: linear-gradient(180deg, var(--crm-surface-3), var(--crm-surface-2));
}
.crm-stat dt { margin: 0 0 5px; font: 700 10.5px var(--crm-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--crm-muted); }
.crm-stat dd { margin: 0; font: 800 21px var(--crm-mono); letter-spacing: -.02em; color: #fff; }
.crm-stat-ok { border-color: rgba(52, 211, 153, .3); } .crm-stat-ok dd { color: var(--crm-ok); }
.crm-stat-warn { border-color: rgba(251, 191, 36, .3); } .crm-stat-warn dd { color: var(--crm-warn); }
.crm-stat-err { border-color: rgba(248, 113, 113, .3); } .crm-stat-err dd { color: var(--crm-err); }

.crm-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--crm-line); }
.crm-tab {
  padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; color: var(--crm-muted); font: 600 13px var(--crm-sans); cursor: pointer;
}
.crm-tab:hover { color: var(--crm-ink); }
.crm-tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--crm-brand); background: linear-gradient(180deg, transparent, rgba(139,92,246,.08)); }
.crm-panel[hidden] { display: none; }

.crm-note {
  padding: 11px 14px; border: 1px solid var(--crm-line); border-left: 3px solid var(--crm-brand);
  border-radius: 8px; background: var(--crm-brand-bg); color: var(--crm-ink-2); font-size: 12.5px;
}
.crm-note strong { color: #fff; }
.crm-note-warn { border-left-color: var(--crm-warn); background: var(--crm-warn-bg); }
.crm-note-err { border-left-color: var(--crm-err); background: var(--crm-err-bg); }
.crm-note-ok { border-left-color: var(--crm-ok); background: var(--crm-ok-bg); }

.crm-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--crm-brand-bg); color: var(--crm-brand-700); font: 700 11px var(--crm-sans);
}

.crm-out {
  padding: 13px; border: 1px solid var(--crm-line); border-radius: 9px;
  background: #070a12; color: #d6deeb; font: 12.5px/1.55 var(--crm-mono);
  white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto;
}

code { font-family: var(--crm-mono); }
.crm-app code { background: var(--crm-surface-3); color: var(--crm-cyan); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

.crm-seo { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--crm-line); color: var(--crm-ink-2); }
.crm-seo h2 { font-size: 17px; margin: 0 0 10px; color: #fff; }
.crm-seo h3 { font-size: 13.5px; margin: 18px 0 5px; color: var(--crm-ink); }
.crm-seo p, .crm-seo li { font-size: 13px; max-width: 82ch; }
.crm-seo details { margin: 7px 0; padding: 10px 13px; border: 1px solid var(--crm-line); border-radius: 8px; background: var(--crm-surface); }
.crm-seo summary { font-weight: 700; cursor: pointer; font-size: 13px; color: var(--crm-ink); }
.crm-seo details p { margin: 8px 0 0; color: var(--crm-muted); }

/* ======================================================================= *
 * Modals: export verification, password
 * ======================================================================= */

html.crm-modal-open { overflow: hidden; }
.crm-modal-backdrop {
  position: fixed; inset: 0; z-index: 9600;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(3, 6, 12, .72); backdrop-filter: blur(6px);
  animation: crm-fade .15s ease;
}
.crm-modal-backdrop[hidden] { display: none; }
.crm-modal {
  width: min(620px, 100%); max-height: 92vh; overflow: auto;
  background: var(--crm-surface); color: var(--crm-ink);
  border: 1px solid var(--crm-line-2); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 92, 246, .15);
  font: 14px/1.5 var(--crm-sans);
  animation: crm-rise .2s ease;
}
.crm-modal-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--crm-line);
  background: linear-gradient(180deg, rgba(139, 92, 246, .1), transparent);
}
.crm-modal-head h2 { margin: 0; font-size: 16.5px; color: #fff; }
.crm-modal-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--crm-muted); }
.crm-modal-head > div { flex: 1; }
.crm-modal-x { border: 0; background: none; color: var(--crm-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.crm-modal-x:hover { color: var(--crm-err); }
.crm-modal-body { padding: 16px 20px; display: grid; gap: 14px; }
.crm-modal-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 20px 18px; border-top: 1px solid var(--crm-line);
}
.crm-x-legal { flex: 1 1 200px; font-size: 11px; color: var(--crm-faint); }
.crm-x-file {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 9px; background: var(--crm-surface-2); border: 1px dashed var(--crm-line-2);
  font-size: 12.5px; color: var(--crm-muted);
}
.crm-x-file span { color: var(--crm-ink); font-weight: 700; }
.crm-x-file code { color: var(--crm-cyan); background: none; padding: 0; }
.crm-x-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.crm-x-wide { grid-column: 1 / -1; }
.crm-x-captcha {
  display: grid; grid-template-columns: auto auto 1fr; gap: 12px; align-items: end;
  padding: 12px; border-radius: 10px; background: var(--crm-surface-2); border: 1px solid var(--crm-line);
}
.crm-x-captcha canvas { display: block; margin-top: 5px; border-radius: 8px; border: 1px solid var(--crm-line-2); }
.crm-x-label { font: 700 11px var(--crm-sans); letter-spacing: .05em; text-transform: uppercase; color: var(--crm-muted); }
.crm-x-error {
  margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 12.5px;
  background: var(--crm-err-bg); border: 1px solid rgba(248, 113, 113, .35); color: #fecaca;
}
.crm-x-error[hidden] { display: none; }
.crm-x-limit { font: 12px var(--crm-mono); color: var(--crm-muted); }
.crm-x-cool { color: var(--crm-warn); }
.crm-x-cool strong { font-size: 14px; }
@media (max-width: 560px) {
  .crm-x-grid { grid-template-columns: 1fr; }
  .crm-x-captcha { grid-template-columns: 1fr auto; }
  .crm-x-captcha > .crm-field { grid-column: 1 / -1; }
}

/* click-burst cooldown */
.crm-cooldown {
  position: fixed; inset: 0; z-index: 9700; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 6, 12, .55); backdrop-filter: blur(3px);
}
.crm-cooldown[hidden] { display: none; }
.crm-cooldown > div {
  display: grid; gap: 6px; justify-items: center; text-align: center; max-width: 360px;
  padding: 24px 28px; border-radius: 16px; background: var(--crm-surface);
  border: 1px solid rgba(251, 191, 36, .4); box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.crm-cooldown strong { color: var(--crm-warn); font-size: 17px; }
.crm-cooldown span { color: var(--crm-ink-2); font-size: 13px; }
.crm-cooldown em { font: 800 34px var(--crm-mono); font-style: normal; color: #fff; }

@keyframes crm-fade { from { opacity: 0; } }
@keyframes crm-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ======================================================================= *
 * Audit drawer
 * ======================================================================= */

.crm-audit-root { font: 13px/1.45 var(--crm-sans); }
.crm-audit-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 9200;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 1px solid rgba(139, 92, 246, .5); border-radius: 999px;
  background: linear-gradient(135deg, #1e1b4b, #312e81); color: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5), 0 0 20px rgba(139, 92, 246, .25);
  transition: transform .15s;
}
.crm-audit-fab:hover { transform: translateY(-2px); }
.crm-audit-fab:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.crm-audit-count { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.15); font: 700 11px var(--crm-mono); text-align: center; }
.crm-audit-drawer {
  position: fixed; right: 18px; bottom: 74px; z-index: 9200;
  display: flex; flex-direction: column;
  width: min(480px, calc(100vw - 36px)); max-height: min(640px, calc(100vh - 130px));
  padding: 14px; border: 1px solid var(--crm-line-2); border-radius: 16px;
  background: var(--crm-surface); color: var(--crm-ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
.crm-audit-drawer[hidden] { display: none; }
.crm-audit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--crm-line); }
.crm-audit-head strong { display: block; font-size: 14px; color: #fff; }
.crm-audit-head small { display: block; color: var(--crm-muted); font-size: 11px; }
.crm-audit-x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--crm-muted); cursor: pointer; padding: 0 4px; }
.crm-audit-x:hover { color: var(--crm-err); }
.crm-audit-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.crm-audit-bar .crm-btn { padding: 6px 11px; font-size: 12px; }
.crm-audit-status { margin: 0 0 8px; color: var(--crm-muted); font: 11px var(--crm-mono); }
.crm-audit-filter {
  width: 100%; box-sizing: border-box; padding: 7px 10px; margin-bottom: 8px;
  border: 1px solid var(--crm-line-2); border-radius: 8px; background: var(--crm-surface-2); color: var(--crm-ink); font-size: 12px;
}
.crm-audit-list { flex: 1 1 auto; overflow-y: auto; border-top: 1px solid var(--crm-line); }
.crm-audit-empty { padding: 24px 8px; text-align: center; color: var(--crm-muted); }
.crm-audit-row { display: grid; grid-template-columns: 132px 1fr; gap: 2px 10px; padding: 7px 4px; border-bottom: 1px solid var(--crm-line); font-size: 11.5px; }
.crm-audit-row time { color: var(--crm-faint); font-family: var(--crm-mono); }
.crm-audit-act { font-weight: 700; color: var(--crm-brand-700); word-break: break-word; }
.crm-audit-det { grid-column: 2; color: var(--crm-muted); font-family: var(--crm-mono); word-break: break-word; }
.crm-lv-error .crm-audit-act { color: var(--crm-err); }
.crm-lv-warn .crm-audit-act { color: var(--crm-warn); }

/* ======================================================================= *
 * Toasts
 * ======================================================================= */

.crm-toast-host { position: fixed; left: 50%; bottom: 24px; z-index: 9800; display: flex; flex-direction: column; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.crm-toast {
  padding: 10px 18px; border-radius: 10px; max-width: min(540px, 92vw);
  background: var(--crm-surface-4); border: 1px solid var(--crm-line-2); color: #fff;
  font: 600 13px var(--crm-sans); box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  animation: crm-rise .22s ease;
}
.crm-toast-ok { border-color: rgba(52, 211, 153, .5); box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 18px rgba(52, 211, 153, .15); }
.crm-toast-err { border-color: rgba(248, 113, 113, .6); background: #3b1219; }
.crm-toast-warn { border-color: rgba(251, 191, 36, .6); background: #3a2a0c; }
.crm-toast-out { opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }

/* ======================================================================= *
 * Sign-in and installer pages
 * ======================================================================= */

.crm-auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(700px 400px at 90% 90%, rgba(34, 211, 238, .15), transparent 60%),
    var(--crm-bg);
}
.crm-auth-card {
  width: min(460px, 100%); padding: 30px 30px 24px;
  background: rgba(17, 24, 39, .88); border: 1px solid var(--crm-line-2); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); backdrop-filter: blur(10px);
}
.crm-auth-card h1 { margin: 18px 0 6px; font-size: 22px; color: #fff; letter-spacing: -.01em; }
.crm-auth-brand { display: flex; align-items: center; gap: 12px; }
.crm-auth-brand strong { display: block; color: #fff; font-size: 15px; }
.crm-auth-brand small { color: var(--crm-muted); font-size: 12px; }
.crm-auth-form { display: grid; gap: 14px; margin-top: 18px; }
.crm-auth-form[hidden], .crm-modal-foot[hidden], .crm-panel[hidden] { display: none !important; }
.crm-auth-foot { margin: 20px 0 0; text-align: center; color: var(--crm-faint); font: 11.5px var(--crm-mono); }

/* ======================================================================= *
 * Dark mapping for inline light colours in the generated apps.
 * Rendered documents (invoices, certificates, payslips, ID cards, resume
 * previews...) sit inside [data-user-content] and keep their print colours.
 * ======================================================================= */

html.crm-dark body.crm-app :is([style*="background:#fff;"],[style*="background:#fff\""],[style*="background:#ffffff"],[style*="background: #fff"],[style*="background:#fcfcfd"],[style*="background:#fffdf7"],[style*="background:#fffefb"]):not([data-user-content],[data-user-content] *) {
  background: var(--crm-surface) !important;
}
html.crm-dark body.crm-app :is([style*="background:#f8fafc"],[style*="background:#f1f5f9"],[style*="background:#e2e8f0"]):not([data-user-content],[data-user-content] *) {
  background: var(--crm-surface-3) !important;
}
html.crm-dark body.crm-app [style*="background:#faf5ff"]:not([data-user-content],[data-user-content] *) { background: var(--crm-brand-bg) !important; }
html.crm-dark body.crm-app [style*="background:#ede9fe"]:not([data-user-content],[data-user-content] *) { background: rgba(139,92,246,.18) !important; }
html.crm-dark body.crm-app :is([style*="background:#fef2f2"],[style*="background:#fee2e2"],[style*="background:#fecaca"]):not(.crm-pill,[data-user-content],[data-user-content] *) { background: var(--crm-err-bg) !important; }
html.crm-dark body.crm-app :is([style*="background:#fffbeb"],[style*="background:#fef3c7"]):not(.crm-pill,[data-user-content],[data-user-content] *) { background: var(--crm-warn-bg) !important; }
html.crm-dark body.crm-app :is([style*="background:#ecfdf5"],[style*="background:#d1fae5"],[style*="background:#f0fdf4"]):not(.crm-pill,[data-user-content],[data-user-content] *) { background: var(--crm-ok-bg) !important; }
html.crm-dark body.crm-app [style*="color:#0f172a"]:not([data-user-content],[data-user-content] *,svg *) { color: var(--crm-ink) !important; }
html.crm-dark body.crm-app :is([style*="color:#334155"],[style*="color:#475569"]):not([data-user-content],[data-user-content] *,svg *) { color: var(--crm-ink-2) !important; }
html.crm-dark body.crm-app :is([style*="border:1px solid #e2e8f0"],[style*="border:1px solid var(--crm-line)"]):not([data-user-content],[data-user-content] *) { border-color: var(--crm-line) !important; }
html.crm-dark body.crm-app [style*="color:#991b1b"]:not(.crm-pill,[data-user-content],[data-user-content] *) { color: var(--crm-err) !important; }
html.crm-dark body.crm-app [style*="color:#92400e"]:not(.crm-pill,[data-user-content],[data-user-content] *) { color: var(--crm-warn) !important; }
html.crm-dark body.crm-app [style*="color:#065f46"]:not(.crm-pill,[data-user-content],[data-user-content] *) { color: var(--crm-ok) !important; }
html.crm-dark body.crm-app .crm-pill[style*="background:#"] { filter: saturate(.9) brightness(.95); }

/* Form controls a module renders without its own styling follow the dark theme. */
html.crm-dark body.crm-app :is(textarea, select, input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=button], [type=submit])):not([class*="bg-"], [data-user-content] *, .crm-hubbar *, .crm-switcher *) {
  background-color: var(--crm-surface-2); color: var(--crm-ink); border-color: var(--crm-line-2);
}

/* Rendered documents keep a white "paper" look on the dark desk. */
html.crm-dark [data-user-content] { color-scheme: light; }
html.crm-dark #page-wrap, html.crm-dark #stage { background: #070a12 !important; }

/* Markdown preview is a reading pane, so it follows the dark theme. */
html.crm-dark .md-body { color: var(--crm-ink-2); }
html.crm-dark .md-body h1, html.crm-dark .md-body h2, html.crm-dark .md-body h3, html.crm-dark .md-body h4 { color: #fff; border-color: var(--crm-line) !important; }
html.crm-dark .md-body code { background: var(--crm-surface-3) !important; color: var(--crm-pink) !important; }
html.crm-dark .md-body blockquote { background: var(--crm-brand-bg) !important; color: var(--crm-ink-2) !important; }
html.crm-dark .md-body th { background: var(--crm-surface-3) !important; }
html.crm-dark .md-body th, html.crm-dark .md-body td { border-color: var(--crm-line) !important; }
html.crm-dark .md-body tr:nth-child(even) td { background: var(--crm-surface-2) !important; }
html.crm-dark #md { background: var(--crm-surface-2) !important; color: var(--crm-ink) !important; }

/* ======================================================================= *
 * Dark mapping for the four light Tailwind pages
 * (calculator, pdftoolkit, projectestimator, qrcode)
 * ======================================================================= */

html.crm-tw-dark body { background: var(--crm-bg) !important; color: var(--crm-ink-2) !important; }
html.crm-tw-dark .bg-white, html.crm-tw-dark .focus\:bg-white:focus { background-color: var(--crm-surface) !important; }
html.crm-tw-dark .bg-slate-50, html.crm-tw-dark .bg-gray-50 { background-color: var(--crm-surface-2) !important; }
html.crm-tw-dark .bg-slate-50\/50 { background-color: rgba(14, 20, 34, .6) !important; }
html.crm-tw-dark .bg-slate-100, html.crm-tw-dark .bg-gray-100 { background-color: var(--crm-surface-3) !important; }
html.crm-tw-dark .bg-slate-200, html.crm-tw-dark .bg-slate-300 { background-color: var(--crm-surface-4) !important; }
html.crm-tw-dark .hover\:bg-slate-50:hover, html.crm-tw-dark .hover\:bg-slate-100:hover,
html.crm-tw-dark .hover\:bg-slate-200:hover { background-color: var(--crm-surface-4) !important; }
html.crm-tw-dark .text-slate-900, html.crm-tw-dark .text-slate-800, html.crm-tw-dark .text-gray-900,
html.crm-tw-dark .text-gray-800 { color: var(--crm-ink) !important; }
html.crm-tw-dark .text-slate-700, html.crm-tw-dark .text-gray-700 { color: var(--crm-ink-2) !important; }
html.crm-tw-dark .text-slate-600, html.crm-tw-dark .text-gray-600 { color: #aab4c6 !important; }
html.crm-tw-dark .text-slate-500 { color: var(--crm-muted) !important; }
/* Page-specific near-black brand colours would disappear on the dark theme. */
html.crm-tw-dark .text-brandNavy, html.crm-tw-dark .text-brandSlate { color: #fff !important; }
html.crm-tw-dark .bg-white.text-brandNavy { background-color: var(--crm-brand-600) !important; }
html.crm-tw-dark .hover\:text-slate-700:hover, html.crm-tw-dark .hover\:text-slate-900:hover { color: #fff !important; }
html.crm-tw-dark .border-slate-100, html.crm-tw-dark .border-slate-200, html.crm-tw-dark .border-slate-300,
html.crm-tw-dark .border-gray-200, html.crm-tw-dark .divide-slate-100 > * + * { border-color: var(--crm-line) !important; }
html.crm-tw-dark input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
html.crm-tw-dark select, html.crm-tw-dark textarea {
  background-color: var(--crm-surface-2) !important; color: var(--crm-ink) !important; border-color: var(--crm-line-2) !important;
  color-scheme: dark;
}
html.crm-tw-dark .shadow-sm, html.crm-tw-dark .shadow, html.crm-tw-dark .shadow-md,
html.crm-tw-dark .shadow-lg { box-shadow: 0 10px 30px rgba(0, 0, 0, .35) !important; }
/* Light Tailwind tints (bg-*-50/100, borders, dark text) become translucent tints of the same hue. */
html.crm-tw-dark .bg-blue-50,
html.crm-tw-dark .bg-blue-50\/50,
html.crm-tw-dark .bg-blue-50\/60,
html.crm-tw-dark .bg-blue-50\/70,
html.crm-tw-dark .bg-blue-50\/80,
html.crm-tw-dark .bg-blue-50\/90,
html.crm-tw-dark .bg-blue-100,
html.crm-tw-dark .bg-blue-100\/50,
html.crm-tw-dark .bg-blue-100\/60,
html.crm-tw-dark .bg-blue-100\/70,
html.crm-tw-dark .bg-blue-100\/80,
html.crm-tw-dark .bg-blue-100\/90 { background-color: rgba(96,165,250, .12) !important; }
html.crm-tw-dark .border-blue-100, html.crm-tw-dark .border-blue-200, html.crm-tw-dark .border-blue-300 { border-color: rgba(96,165,250, .38) !important; }
html.crm-tw-dark .text-blue-600, html.crm-tw-dark .text-blue-700, html.crm-tw-dark .text-blue-800, html.crm-tw-dark .text-blue-900 { color: #bfdbfe !important; }
html.crm-tw-dark .bg-indigo-50,
html.crm-tw-dark .bg-indigo-50\/50,
html.crm-tw-dark .bg-indigo-50\/60,
html.crm-tw-dark .bg-indigo-50\/70,
html.crm-tw-dark .bg-indigo-50\/80,
html.crm-tw-dark .bg-indigo-50\/90,
html.crm-tw-dark .bg-indigo-100,
html.crm-tw-dark .bg-indigo-100\/50,
html.crm-tw-dark .bg-indigo-100\/60,
html.crm-tw-dark .bg-indigo-100\/70,
html.crm-tw-dark .bg-indigo-100\/80,
html.crm-tw-dark .bg-indigo-100\/90 { background-color: rgba(129,140,248, .12) !important; }
html.crm-tw-dark .border-indigo-100, html.crm-tw-dark .border-indigo-200, html.crm-tw-dark .border-indigo-300 { border-color: rgba(129,140,248, .38) !important; }
html.crm-tw-dark .text-indigo-600, html.crm-tw-dark .text-indigo-700, html.crm-tw-dark .text-indigo-800, html.crm-tw-dark .text-indigo-900 { color: #c7d2fe !important; }
html.crm-tw-dark .bg-violet-50,
html.crm-tw-dark .bg-violet-50\/50,
html.crm-tw-dark .bg-violet-50\/60,
html.crm-tw-dark .bg-violet-50\/70,
html.crm-tw-dark .bg-violet-50\/80,
html.crm-tw-dark .bg-violet-50\/90,
html.crm-tw-dark .bg-violet-100,
html.crm-tw-dark .bg-violet-100\/50,
html.crm-tw-dark .bg-violet-100\/60,
html.crm-tw-dark .bg-violet-100\/70,
html.crm-tw-dark .bg-violet-100\/80,
html.crm-tw-dark .bg-violet-100\/90 { background-color: rgba(167,139,250, .12) !important; }
html.crm-tw-dark .border-violet-100, html.crm-tw-dark .border-violet-200, html.crm-tw-dark .border-violet-300 { border-color: rgba(167,139,250, .38) !important; }
html.crm-tw-dark .text-violet-600, html.crm-tw-dark .text-violet-700, html.crm-tw-dark .text-violet-800, html.crm-tw-dark .text-violet-900 { color: #ddd6fe !important; }
html.crm-tw-dark .bg-purple-50,
html.crm-tw-dark .bg-purple-50\/50,
html.crm-tw-dark .bg-purple-50\/60,
html.crm-tw-dark .bg-purple-50\/70,
html.crm-tw-dark .bg-purple-50\/80,
html.crm-tw-dark .bg-purple-50\/90,
html.crm-tw-dark .bg-purple-100,
html.crm-tw-dark .bg-purple-100\/50,
html.crm-tw-dark .bg-purple-100\/60,
html.crm-tw-dark .bg-purple-100\/70,
html.crm-tw-dark .bg-purple-100\/80,
html.crm-tw-dark .bg-purple-100\/90 { background-color: rgba(192,132,252, .12) !important; }
html.crm-tw-dark .border-purple-100, html.crm-tw-dark .border-purple-200, html.crm-tw-dark .border-purple-300 { border-color: rgba(192,132,252, .38) !important; }
html.crm-tw-dark .text-purple-600, html.crm-tw-dark .text-purple-700, html.crm-tw-dark .text-purple-800, html.crm-tw-dark .text-purple-900 { color: #e9d5ff !important; }
html.crm-tw-dark .bg-sky-50,
html.crm-tw-dark .bg-sky-50\/50,
html.crm-tw-dark .bg-sky-50\/60,
html.crm-tw-dark .bg-sky-50\/70,
html.crm-tw-dark .bg-sky-50\/80,
html.crm-tw-dark .bg-sky-50\/90,
html.crm-tw-dark .bg-sky-100,
html.crm-tw-dark .bg-sky-100\/50,
html.crm-tw-dark .bg-sky-100\/60,
html.crm-tw-dark .bg-sky-100\/70,
html.crm-tw-dark .bg-sky-100\/80,
html.crm-tw-dark .bg-sky-100\/90 { background-color: rgba(56,189,248, .12) !important; }
html.crm-tw-dark .border-sky-100, html.crm-tw-dark .border-sky-200, html.crm-tw-dark .border-sky-300 { border-color: rgba(56,189,248, .38) !important; }
html.crm-tw-dark .text-sky-600, html.crm-tw-dark .text-sky-700, html.crm-tw-dark .text-sky-800, html.crm-tw-dark .text-sky-900 { color: #bae6fd !important; }
html.crm-tw-dark .bg-cyan-50,
html.crm-tw-dark .bg-cyan-50\/50,
html.crm-tw-dark .bg-cyan-50\/60,
html.crm-tw-dark .bg-cyan-50\/70,
html.crm-tw-dark .bg-cyan-50\/80,
html.crm-tw-dark .bg-cyan-50\/90,
html.crm-tw-dark .bg-cyan-100,
html.crm-tw-dark .bg-cyan-100\/50,
html.crm-tw-dark .bg-cyan-100\/60,
html.crm-tw-dark .bg-cyan-100\/70,
html.crm-tw-dark .bg-cyan-100\/80,
html.crm-tw-dark .bg-cyan-100\/90 { background-color: rgba(34,211,238, .12) !important; }
html.crm-tw-dark .border-cyan-100, html.crm-tw-dark .border-cyan-200, html.crm-tw-dark .border-cyan-300 { border-color: rgba(34,211,238, .38) !important; }
html.crm-tw-dark .text-cyan-600, html.crm-tw-dark .text-cyan-700, html.crm-tw-dark .text-cyan-800, html.crm-tw-dark .text-cyan-900 { color: #a5f3fc !important; }
html.crm-tw-dark .bg-teal-50,
html.crm-tw-dark .bg-teal-50\/50,
html.crm-tw-dark .bg-teal-50\/60,
html.crm-tw-dark .bg-teal-50\/70,
html.crm-tw-dark .bg-teal-50\/80,
html.crm-tw-dark .bg-teal-50\/90,
html.crm-tw-dark .bg-teal-100,
html.crm-tw-dark .bg-teal-100\/50,
html.crm-tw-dark .bg-teal-100\/60,
html.crm-tw-dark .bg-teal-100\/70,
html.crm-tw-dark .bg-teal-100\/80,
html.crm-tw-dark .bg-teal-100\/90 { background-color: rgba(45,212,191, .12) !important; }
html.crm-tw-dark .border-teal-100, html.crm-tw-dark .border-teal-200, html.crm-tw-dark .border-teal-300 { border-color: rgba(45,212,191, .38) !important; }
html.crm-tw-dark .text-teal-600, html.crm-tw-dark .text-teal-700, html.crm-tw-dark .text-teal-800, html.crm-tw-dark .text-teal-900 { color: #99f6e4 !important; }
html.crm-tw-dark .bg-emerald-50,
html.crm-tw-dark .bg-emerald-50\/50,
html.crm-tw-dark .bg-emerald-50\/60,
html.crm-tw-dark .bg-emerald-50\/70,
html.crm-tw-dark .bg-emerald-50\/80,
html.crm-tw-dark .bg-emerald-50\/90,
html.crm-tw-dark .bg-emerald-100,
html.crm-tw-dark .bg-emerald-100\/50,
html.crm-tw-dark .bg-emerald-100\/60,
html.crm-tw-dark .bg-emerald-100\/70,
html.crm-tw-dark .bg-emerald-100\/80,
html.crm-tw-dark .bg-emerald-100\/90 { background-color: rgba(52,211,153, .12) !important; }
html.crm-tw-dark .border-emerald-100, html.crm-tw-dark .border-emerald-200, html.crm-tw-dark .border-emerald-300 { border-color: rgba(52,211,153, .38) !important; }
html.crm-tw-dark .text-emerald-600, html.crm-tw-dark .text-emerald-700, html.crm-tw-dark .text-emerald-800, html.crm-tw-dark .text-emerald-900 { color: #a7f3d0 !important; }
html.crm-tw-dark .bg-green-50,
html.crm-tw-dark .bg-green-50\/50,
html.crm-tw-dark .bg-green-50\/60,
html.crm-tw-dark .bg-green-50\/70,
html.crm-tw-dark .bg-green-50\/80,
html.crm-tw-dark .bg-green-50\/90,
html.crm-tw-dark .bg-green-100,
html.crm-tw-dark .bg-green-100\/50,
html.crm-tw-dark .bg-green-100\/60,
html.crm-tw-dark .bg-green-100\/70,
html.crm-tw-dark .bg-green-100\/80,
html.crm-tw-dark .bg-green-100\/90 { background-color: rgba(74,222,128, .12) !important; }
html.crm-tw-dark .border-green-100, html.crm-tw-dark .border-green-200, html.crm-tw-dark .border-green-300 { border-color: rgba(74,222,128, .38) !important; }
html.crm-tw-dark .text-green-600, html.crm-tw-dark .text-green-700, html.crm-tw-dark .text-green-800, html.crm-tw-dark .text-green-900 { color: #bbf7d0 !important; }
html.crm-tw-dark .bg-lime-50,
html.crm-tw-dark .bg-lime-50\/50,
html.crm-tw-dark .bg-lime-50\/60,
html.crm-tw-dark .bg-lime-50\/70,
html.crm-tw-dark .bg-lime-50\/80,
html.crm-tw-dark .bg-lime-50\/90,
html.crm-tw-dark .bg-lime-100,
html.crm-tw-dark .bg-lime-100\/50,
html.crm-tw-dark .bg-lime-100\/60,
html.crm-tw-dark .bg-lime-100\/70,
html.crm-tw-dark .bg-lime-100\/80,
html.crm-tw-dark .bg-lime-100\/90 { background-color: rgba(163,230,53, .12) !important; }
html.crm-tw-dark .border-lime-100, html.crm-tw-dark .border-lime-200, html.crm-tw-dark .border-lime-300 { border-color: rgba(163,230,53, .38) !important; }
html.crm-tw-dark .text-lime-600, html.crm-tw-dark .text-lime-700, html.crm-tw-dark .text-lime-800, html.crm-tw-dark .text-lime-900 { color: #d9f99d !important; }
html.crm-tw-dark .bg-amber-50,
html.crm-tw-dark .bg-amber-50\/50,
html.crm-tw-dark .bg-amber-50\/60,
html.crm-tw-dark .bg-amber-50\/70,
html.crm-tw-dark .bg-amber-50\/80,
html.crm-tw-dark .bg-amber-50\/90,
html.crm-tw-dark .bg-amber-100,
html.crm-tw-dark .bg-amber-100\/50,
html.crm-tw-dark .bg-amber-100\/60,
html.crm-tw-dark .bg-amber-100\/70,
html.crm-tw-dark .bg-amber-100\/80,
html.crm-tw-dark .bg-amber-100\/90 { background-color: rgba(251,191,36, .12) !important; }
html.crm-tw-dark .border-amber-100, html.crm-tw-dark .border-amber-200, html.crm-tw-dark .border-amber-300 { border-color: rgba(251,191,36, .38) !important; }
html.crm-tw-dark .text-amber-600, html.crm-tw-dark .text-amber-700, html.crm-tw-dark .text-amber-800, html.crm-tw-dark .text-amber-900 { color: #fde68a !important; }
html.crm-tw-dark .bg-yellow-50,
html.crm-tw-dark .bg-yellow-50\/50,
html.crm-tw-dark .bg-yellow-50\/60,
html.crm-tw-dark .bg-yellow-50\/70,
html.crm-tw-dark .bg-yellow-50\/80,
html.crm-tw-dark .bg-yellow-50\/90,
html.crm-tw-dark .bg-yellow-100,
html.crm-tw-dark .bg-yellow-100\/50,
html.crm-tw-dark .bg-yellow-100\/60,
html.crm-tw-dark .bg-yellow-100\/70,
html.crm-tw-dark .bg-yellow-100\/80,
html.crm-tw-dark .bg-yellow-100\/90 { background-color: rgba(250,204,21, .12) !important; }
html.crm-tw-dark .border-yellow-100, html.crm-tw-dark .border-yellow-200, html.crm-tw-dark .border-yellow-300 { border-color: rgba(250,204,21, .38) !important; }
html.crm-tw-dark .text-yellow-600, html.crm-tw-dark .text-yellow-700, html.crm-tw-dark .text-yellow-800, html.crm-tw-dark .text-yellow-900 { color: #fef08a !important; }
html.crm-tw-dark .bg-orange-50,
html.crm-tw-dark .bg-orange-50\/50,
html.crm-tw-dark .bg-orange-50\/60,
html.crm-tw-dark .bg-orange-50\/70,
html.crm-tw-dark .bg-orange-50\/80,
html.crm-tw-dark .bg-orange-50\/90,
html.crm-tw-dark .bg-orange-100,
html.crm-tw-dark .bg-orange-100\/50,
html.crm-tw-dark .bg-orange-100\/60,
html.crm-tw-dark .bg-orange-100\/70,
html.crm-tw-dark .bg-orange-100\/80,
html.crm-tw-dark .bg-orange-100\/90 { background-color: rgba(251,146,60, .12) !important; }
html.crm-tw-dark .border-orange-100, html.crm-tw-dark .border-orange-200, html.crm-tw-dark .border-orange-300 { border-color: rgba(251,146,60, .38) !important; }
html.crm-tw-dark .text-orange-600, html.crm-tw-dark .text-orange-700, html.crm-tw-dark .text-orange-800, html.crm-tw-dark .text-orange-900 { color: #fed7aa !important; }
html.crm-tw-dark .bg-red-50,
html.crm-tw-dark .bg-red-50\/50,
html.crm-tw-dark .bg-red-50\/60,
html.crm-tw-dark .bg-red-50\/70,
html.crm-tw-dark .bg-red-50\/80,
html.crm-tw-dark .bg-red-50\/90,
html.crm-tw-dark .bg-red-100,
html.crm-tw-dark .bg-red-100\/50,
html.crm-tw-dark .bg-red-100\/60,
html.crm-tw-dark .bg-red-100\/70,
html.crm-tw-dark .bg-red-100\/80,
html.crm-tw-dark .bg-red-100\/90 { background-color: rgba(248,113,113, .12) !important; }
html.crm-tw-dark .border-red-100, html.crm-tw-dark .border-red-200, html.crm-tw-dark .border-red-300 { border-color: rgba(248,113,113, .38) !important; }
html.crm-tw-dark .text-red-600, html.crm-tw-dark .text-red-700, html.crm-tw-dark .text-red-800, html.crm-tw-dark .text-red-900 { color: #fecaca !important; }
html.crm-tw-dark .bg-rose-50,
html.crm-tw-dark .bg-rose-50\/50,
html.crm-tw-dark .bg-rose-50\/60,
html.crm-tw-dark .bg-rose-50\/70,
html.crm-tw-dark .bg-rose-50\/80,
html.crm-tw-dark .bg-rose-50\/90,
html.crm-tw-dark .bg-rose-100,
html.crm-tw-dark .bg-rose-100\/50,
html.crm-tw-dark .bg-rose-100\/60,
html.crm-tw-dark .bg-rose-100\/70,
html.crm-tw-dark .bg-rose-100\/80,
html.crm-tw-dark .bg-rose-100\/90 { background-color: rgba(251,113,133, .12) !important; }
html.crm-tw-dark .border-rose-100, html.crm-tw-dark .border-rose-200, html.crm-tw-dark .border-rose-300 { border-color: rgba(251,113,133, .38) !important; }
html.crm-tw-dark .text-rose-600, html.crm-tw-dark .text-rose-700, html.crm-tw-dark .text-rose-800, html.crm-tw-dark .text-rose-900 { color: #fecdd3 !important; }
html.crm-tw-dark .bg-pink-50,
html.crm-tw-dark .bg-pink-50\/50,
html.crm-tw-dark .bg-pink-50\/60,
html.crm-tw-dark .bg-pink-50\/70,
html.crm-tw-dark .bg-pink-50\/80,
html.crm-tw-dark .bg-pink-50\/90,
html.crm-tw-dark .bg-pink-100,
html.crm-tw-dark .bg-pink-100\/50,
html.crm-tw-dark .bg-pink-100\/60,
html.crm-tw-dark .bg-pink-100\/70,
html.crm-tw-dark .bg-pink-100\/80,
html.crm-tw-dark .bg-pink-100\/90 { background-color: rgba(244,114,182, .12) !important; }
html.crm-tw-dark .border-pink-100, html.crm-tw-dark .border-pink-200, html.crm-tw-dark .border-pink-300 { border-color: rgba(244,114,182, .38) !important; }
html.crm-tw-dark .text-pink-600, html.crm-tw-dark .text-pink-700, html.crm-tw-dark .text-pink-800, html.crm-tw-dark .text-pink-900 { color: #fbcfe8 !important; }
html.crm-tw-dark .bg-fuchsia-50,
html.crm-tw-dark .bg-fuchsia-50\/50,
html.crm-tw-dark .bg-fuchsia-50\/60,
html.crm-tw-dark .bg-fuchsia-50\/70,
html.crm-tw-dark .bg-fuchsia-50\/80,
html.crm-tw-dark .bg-fuchsia-50\/90,
html.crm-tw-dark .bg-fuchsia-100,
html.crm-tw-dark .bg-fuchsia-100\/50,
html.crm-tw-dark .bg-fuchsia-100\/60,
html.crm-tw-dark .bg-fuchsia-100\/70,
html.crm-tw-dark .bg-fuchsia-100\/80,
html.crm-tw-dark .bg-fuchsia-100\/90 { background-color: rgba(232,121,249, .12) !important; }
html.crm-tw-dark .border-fuchsia-100, html.crm-tw-dark .border-fuchsia-200, html.crm-tw-dark .border-fuchsia-300 { border-color: rgba(232,121,249, .38) !important; }
html.crm-tw-dark .text-fuchsia-600, html.crm-tw-dark .text-fuchsia-700, html.crm-tw-dark .text-fuchsia-800, html.crm-tw-dark .text-fuchsia-900 { color: #f5d0fe !important; }
html.crm-tw-dark .bg-slate-200\/80, html.crm-tw-dark .bg-slate-100\/80, html.crm-tw-dark .bg-slate-50\/80 { background-color: var(--crm-surface-4) !important; }
html.crm-tw-dark .bg-white\/80, html.crm-tw-dark .bg-white\/90, html.crm-tw-dark .bg-white\/95 { background-color: rgba(13, 18, 32, .94) !important; }
html.crm-tw-dark canvas, html.crm-tw-dark #qr-canvas-wrap, html.crm-tw-dark [id*="preview"] canvas { color-scheme: light; }

/* ======================================================================= *
 * Tool tiles (dashboard, category pages) - markup from CRMTECH_UI.markup.card
 * ======================================================================= */

.crm-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.crm-tile-group { margin-bottom: 30px; scroll-margin-top: 80px; }
.crm-tile-group h3 { margin: 0 0 3px; color: #fff; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.crm-tile-group h3 a { color: #fff !important; text-decoration: none; }
.crm-tile-group h3 a:hover { color: var(--crm-brand-700) !important; }
.crm-tile-group h3 span { font: 600 11px var(--crm-mono); color: var(--crm-faint); }
.crm-tile-group > p { margin: 0 0 12px; color: var(--crm-muted); font-size: 12.5px; }
.crm-tile {
  position: relative; display: flex; flex-direction: column; padding: 16px 16px 13px;
  border-radius: 13px; border: 1px solid var(--crm-line); background: var(--crm-surface);
  color: inherit !important; text-decoration: none !important; overflow: hidden;
  transition: transform .14s, border-color .14s, box-shadow .14s;
}
.crm-tile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(500px 120px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
}
.crm-tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.crm-tile:hover::before { opacity: 1; }
.crm-tile:focus-visible { outline: 2px solid var(--crm-brand); outline-offset: 2px; }
.crm-tile-top { position: relative; display: flex; gap: 11px; align-items: flex-start; margin-bottom: 8px; }
.crm-tile-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700; background: var(--accent);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}
.crm-tile-name { display: block; margin: 0 0 2px; color: #fff; font-size: 14px; line-height: 1.3; }
.crm-tile-cat { display: block; font: 11px var(--crm-mono); color: var(--crm-faint); }
.crm-tile-text { position: relative; display: block; margin: 0 0 12px; color: var(--crm-muted); font-size: 12.5px; line-height: 1.5; flex: 1; }
.crm-tile-feats { position: relative; display: flex; flex-wrap: wrap; gap: 5px; margin: -4px 0 12px; }
.crm-tile-feats span { padding: 2px 8px; border-radius: 6px; background: var(--crm-surface-3); color: var(--crm-ink-2); font-size: 11px; }
.crm-tile-foot { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--crm-line); font-size: 11px; }
.crm-tile-open { color: var(--crm-brand-700); font-weight: 700; white-space: nowrap; }
.crm-acc { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font: 700 10.5px var(--crm-mono); white-space: nowrap; }
.crm-acc.crm-acc-ok { background: var(--crm-ok-bg); color: var(--crm-ok); border: 1px solid rgba(52, 211, 153, .3); }
.crm-acc.crm-acc-view { background: var(--crm-surface-3); color: var(--crm-muted); border: 1px solid var(--crm-line-2); }
.crm-acc.crm-acc-guest { background: var(--crm-brand-bg); color: var(--crm-brand-700); border: 1px solid rgba(139, 92, 246, .3); }
.crm-acc.crm-acc-free { background: var(--crm-ok-bg); color: var(--crm-ok); border: 1px solid rgba(52, 211, 153, .25); }

/* Share button in the header */
.crm-share-btn {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: transparent; border: 1px solid var(--crm-line-2);
  color: var(--crm-ink); font: 600 12.5px var(--crm-sans); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.crm-share-btn:hover { border-color: var(--crm-brand); background: var(--crm-surface-3); }
.crm-share-btn svg { width: 15px; height: 15px; color: var(--crm-brand-700); }

/* ======================================================================= *
 * About section at the foot of every tool (written by tools/build-site.js)
 * ======================================================================= */

.crm-about {
  max-width: 1320px; margin: 40px auto 0; padding: 26px 22px 0; box-sizing: border-box;
  border-top: 1px solid var(--crm-line); color: var(--crm-ink-2); font: 14px/1.6 var(--crm-sans);
  display: grid; gap: 8px 40px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}
.crm-about > div { min-width: 0; }
.crm-about h2 { margin: 0 0 10px; color: #fff; font-size: 18px; letter-spacing: -.01em; }
.crm-about h3 { margin: 18px 0 6px; color: var(--crm-ink); font-size: 14px; }
.crm-about p { margin: 0 0 10px; font-size: 13.5px; max-width: 75ch; }
.crm-about ul, .crm-about ol { margin: 0 0 10px; padding-left: 20px; font-size: 13.5px; }
.crm-about li { margin: 3px 0; }
.crm-about a { color: var(--crm-brand-700); }
.crm-about details { margin: 0 0 8px; padding: 10px 13px; border: 1px solid var(--crm-line); border-radius: 9px; background: var(--crm-surface); }
.crm-about summary { cursor: pointer; font-weight: 700; color: var(--crm-ink); font-size: 13.5px; }
.crm-about details p { color: var(--crm-muted); margin: 8px 0 0; }

/* ======================================================================= *
 * Category pages and the 404 page
 * ======================================================================= */

.crm-cat-page { max-width: 1320px; margin: 0 auto; padding: 26px 22px 10px; box-sizing: border-box; }
.crm-cat-hero {
  position: relative; overflow: hidden; padding: 28px; margin-bottom: 22px;
  border-radius: 18px; border: 1px solid var(--crm-line);
  background:
    radial-gradient(900px 320px at 0% 0%, rgba(139, 92, 246, .26), transparent 60%),
    radial-gradient(600px 260px at 100% 100%, rgba(34, 211, 238, .14), transparent 60%),
    var(--crm-surface);
}
.crm-cat-hero h1 { margin: 10px 0 8px; color: #fff; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
.crm-cat-hero p { margin: 0; max-width: 75ch; color: var(--crm-ink-2); font-size: 14.5px; }
.crm-cat-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.crm-cat-nav a {
  padding: 7px 13px; border: 1px solid var(--crm-line); border-radius: 999px; background: rgba(10, 14, 23, .5);
  color: var(--crm-ink-2) !important; text-decoration: none !important; font: 600 12px var(--crm-sans);
}
.crm-cat-nav a:hover { border-color: var(--crm-brand); color: #fff !important; }
.crm-cat-nav a[aria-current="page"] { background: var(--crm-brand); border-color: var(--crm-brand); color: #fff !important; }
.crm-cat-page .crm-about { padding-left: 0; padding-right: 0; }
.crm-404 { text-align: center; padding: 60px 0 20px; }
.crm-404 h1 { margin: 0 0 10px; color: #fff; font-size: clamp(26px, 4vw, 40px); }
.crm-404 p { margin: 0 auto 18px; max-width: 60ch; color: var(--crm-ink-2); }
.crm-404 form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.crm-404 input { max-width: 340px; }

@media (max-width: 900px) {
  .crm-about { grid-template-columns: 1fr; }
  .crm-share-btn span { display: none; }
  .crm-share-btn { width: 36px; padding: 0; justify-content: center; }
}
@media (max-width: 640px) {
  .crm-cat-page { padding: 16px 14px 6px; }
  .crm-cat-hero { padding: 18px; border-radius: 14px; }
  .crm-about { padding: 22px 14px 0; margin-top: 30px; }
  .crm-cat-page .crm-about { padding: 22px 0 0; }
  .crm-share-btn { display: none; }
}

/* ======================================================================= *
 * Content protection (see guard in crmtech-ui.js)
 * ======================================================================= */

html.crm-guard body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.crm-guard :is(input, textarea, select, [contenteditable=""], [contenteditable="true"], [data-allow-copy]),
html.crm-guard :is([contenteditable=""], [contenteditable="true"], [data-allow-copy]) * {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
html.crm-guard img { -webkit-user-drag: none; }
html.crm-route-locked body { visibility: hidden; }

.crm-watermark {
  position: fixed; inset: 0; z-index: 8990; pointer-events: none;
  background-repeat: repeat; opacity: .035;
}
.crm-shield {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(5, 8, 14, .97);
  backdrop-filter: blur(28px) saturate(40%); -webkit-backdrop-filter: blur(28px) saturate(40%);
}
.crm-shield[hidden] { display: none; }
.crm-shield-box {
  display: grid; justify-items: center; gap: 8px; max-width: 380px; text-align: center;
  padding: 28px 30px; border-radius: 18px; border: 1px solid var(--crm-line-2); background: var(--crm-surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); font: 13px/1.5 var(--crm-sans); color: var(--crm-ink-2);
}
.crm-shield-mark {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--crm-brand-bg); border: 1px solid rgba(139, 92, 246, .4);
}
.crm-shield-mark .crm-logo { height: 18px; width: auto; }
.crm-shield-box strong { color: #fff; font-size: 17px; }
.crm-shield-box small { color: var(--crm-faint); font: 11px var(--crm-mono); }
html.crm-shielded, html.crm-shielded body { overflow: hidden; }

/* ======================================================================= *
 * Small screens and print
 * ======================================================================= */

@media (max-width: 1280px) {
  .crm-modules-btn kbd { display: none; }
}
@media (max-width: 1100px) {
  .crm-logo-h { height: 26px; }
  .crm-hub-cat, .crm-sep-cat { display: none; }
  .crm-foot-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .crm-hubbar { gap: 8px; padding: 0 14px; }
  .crm-crumb-home span, .crm-modules-btn span, .crm-user-name, .crm-role { display: none; }
  .crm-crumb-home { padding: 6px; }
  .crm-modules-btn { width: 36px; padding: 0; justify-content: center; }
  .crm-hub-badge { width: 30px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .crm-login { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; min-height: 0; }
  .crm-login-story .crm-login-logo { height: 60px; }
  .crm-login-card { order: -1; }
  .crm-login-story .crm-login-logo { display: none; }
}
@media (max-width: 640px) {
  :root { --crm-hub-h: 56px; }
  .crm-hubbar { padding: 0 10px; gap: 6px; }
  .crm-logo-h { display: none; }
  .crm-logo-compact { display: block; }
  .crm-hub-logo { padding-right: 10px; }
  .crm-crumb-home, .crm-crumbs > .crm-hub-sep:first-of-type { display: none; }
  .crm-hub-name, h1.crm-hub-name, strong.crm-hub-name { font-size: 13px; }
  .crm-account [data-acct="register"] { display: none; }
  .crm-account .crm-btn { padding: 0 11px; font-size: 12px; }
  .crm-user-btn { padding: 0 8px 0 3px; }
  .crm-foot-main { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 30px 16px 22px; gap: 24px; }
  .crm-foot-base { padding: 14px 16px 84px; }
  .crm-related { padding: 0 14px; margin-top: 32px; }
  .crm-login { padding: 20px 14px 10px; }
  .crm-login-points { grid-template-columns: 1fr; }
  .crm-login-card { padding: 22px 18px 18px; }
  .crm-switcher { padding-top: 12px; }
  .crm-switcher-item em { display: none; }
}
@media (max-width: 720px) {
  .crm-wrap { padding: 16px 14px 30px; }
  /* Print-size documents and wide tables scroll inside their own frame on phones. */
  .crm-app [data-user-content]:not([data-user-content] [data-user-content]) { max-width: 100%; overflow-x: auto; }
  .crm-app .crm-doc-scroll { overflow-x: auto; max-width: 100%; justify-content: flex-start !important; }
  .crm-app .crm-doc-scroll [data-user-content] { max-width: none; overflow: visible; }
  .crm-app :not(.crm-table-wrap) > table.crm-table { display: block; overflow-x: auto; max-width: 100%; }
  /* Side-by-side layouts a module sets inline stack on phones. */
  .crm-app .crm-grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .crm-app .crm-grid > * { min-width: 0; }
  .crm-masthead { padding: 20px 18px; }
  .crm-audit-drawer { right: 10px; left: 10px; width: auto; }
  .crm-audit-row { grid-template-columns: 1fr; }
  .crm-audit-det { grid-column: 1; }
  .crm-audit-fab-txt { display: none; }
}

@media print {
  :root { color-scheme: light; }
  /* Printing only through the declared export flow (window.print is gated). */
  html.crm-guard:not(.crm-print-ok) body > * { display: none !important; }
  html.crm-guard:not(.crm-print-ok) body::after {
    content: "Printing is available from the module's export or print button, after sign-in and declaration.";
    display: block; padding: 48px; font: 15px/1.6 sans-serif; color: #000;
  }
  .crm-watermark, .crm-shield { display: none !important; }
  html.crm-dark, html.crm-dark body, .crm-app { background: #fff !important; color: #000 !important; }
  .crm-hubbar, .crm-audit-root, .crm-toast-host, .crm-actions, .crm-tabs, .crm-seo,
  .crm-brandfoot, .crm-modal-backdrop, .crm-cooldown { display: none !important; }
  .crm-card { break-inside: avoid; box-shadow: none; background: #fff !important; border-color: #cbd5e1; color: #000; }
}
