/* NALQIVO ERP — interface colour themes.
 *
 * Palettes override the default tokens in tokens.css via html[data-nq-theme].
 * The built-in default (nalqivo / بنفسجي ناليكوفو) is also listed so the
 * picker can restore it. Semantic status colours stay shared.
 *
 * Wallpaper greeting contrast (body.nq-wall-dark / light) in wallpapers.css
 * still wins on the launcher. These --nq-welcome-* values are the fallback
 * when no wallpaper override applies, and they keep the context bar readable.
 */

/* ---- Chrome uses theme surfaces (app.css hard-coded #fff) ---------------- */
.topbar {
  background: color-mix(in srgb, var(--nq-surface) 92%, transparent);
}
.context-bar,
.context-back,
.context-scroll {
  background: var(--nq-surface);
}
.search-box:focus-within {
  background: var(--nq-surface);
  border-color: var(--nq-primary-300);
  box-shadow: var(--nq-focus-ring);
}
.brand img {
  box-shadow: 0 5px 13px color-mix(in srgb, var(--nq-primary) 22%, transparent);
}

/* ---- Default: NALQIVO Violet (matches tokens.css) ------------------------ */
html[data-nq-theme="nalqivo"] {
  --nq-primary: #6c4cf1;
  --nq-primary-600: #5a3ae0;
  --nq-primary-700: #4828c7;
  --nq-primary-800: #371c9e;
  --nq-primary-300: #b9a6ff;
  --nq-primary-200: #d6ccff;
  --nq-primary-100: #e8e2ff;
  --nq-primary-50: #f4f1ff;
  --nq-on-primary: #ffffff;
  --nq-accent: #12b8a6;
  --nq-accent-soft: #e3f8f5;
  --nq-bg: #f6f7fb;
  --nq-bg-soft: #eef0f7;
  --nq-surface: #ffffff;
  --nq-surface-2: #f9fafc;
  --nq-surface-3: #f2f4f9;
  --nq-ink: #191d33;
  --nq-ink-2: #2f3550;
  --nq-ink-strong: #241a4d;
  --nq-muted: #667085;
  --nq-muted-2: #8a91a6;
  --nq-line: #e5e7f0;
  --nq-line-strong: #d3d7e6;
  --nq-focus-ring: 0 0 0 3px rgba(108, 76, 241, 0.18);
  --nq-welcome-ink: #233247;
  --nq-welcome-muted: #5a718d;
  --nq-welcome-shadow: none;
  --nq-welcome-shadow-soft: none;
  color-scheme: light;
}

/* ---- 1. Navy & Gold — كحلي وذهبي ---------------------------------------- */
html[data-nq-theme="navy-gold"] {
  --nq-primary: #1b365d;
  --nq-primary-600: #162c4d;
  --nq-primary-700: #11223c;
  --nq-primary-800: #0c182b;
  --nq-primary-300: #7e97b8;
  --nq-primary-200: #b8c6d9;
  --nq-primary-100: #dde4ee;
  --nq-primary-50: #f0f3f8;
  --nq-on-primary: #ffffff;
  --nq-accent: #c9a227;
  --nq-accent-soft: #f8f1d8;
  --nq-bg: #f6f3eb;
  --nq-bg-soft: #efe9dc;
  --nq-surface: #fffcf6;
  --nq-surface-2: #faf6ee;
  --nq-surface-3: #f2ece0;
  --nq-ink: #162033;
  --nq-ink-2: #2a3a4f;
  --nq-ink-strong: #101a2b;
  --nq-muted: #6e6658;
  --nq-muted-2: #91897a;
  --nq-line: #e5dfd0;
  --nq-line-strong: #d2c9b4;
  --nq-shadow-1: 0 1px 2px rgba(22, 32, 51, 0.06);
  --nq-shadow-2: 0 4px 14px rgba(22, 32, 51, 0.08);
  --nq-shadow-3: 0 14px 40px rgba(22, 32, 51, 0.12);
  --nq-shadow-4: 0 24px 70px rgba(22, 32, 51, 0.16);
  --nq-focus-ring: 0 0 0 3px rgba(27, 54, 93, 0.20);
  --nq-welcome-ink: #162033;
  --nq-welcome-muted: #6e6658;
  --nq-welcome-shadow: none;
  --nq-welcome-shadow-soft: none;
  color-scheme: light;
}

/* ---- 2. Classic Emerald — زمردي كلاسيكي --------------------------------- */
html[data-nq-theme="emerald-classic"] {
  --nq-primary: #0e5f45;
  --nq-primary-600: #0b4e38;
  --nq-primary-700: #093e2d;
  --nq-primary-800: #062e21;
  --nq-primary-300: #6fae96;
  --nq-primary-200: #b3d6c7;
  --nq-primary-100: #d8ebe3;
  --nq-primary-50: #eef6f2;
  --nq-on-primary: #ffffff;
  --nq-accent: #b8860b;
  --nq-accent-soft: #f6eed6;
  --nq-bg: #f3f7f4;
  --nq-bg-soft: #e7f0ea;
  --nq-surface: #fcfffd;
  --nq-surface-2: #f6faf7;
  --nq-surface-3: #eaf3ee;
  --nq-ink: #143028;
  --nq-ink-2: #23463b;
  --nq-ink-strong: #0e241c;
  --nq-muted: #5b7168;
  --nq-muted-2: #84958d;
  --nq-line: #d5e3db;
  --nq-line-strong: #bccfc5;
  --nq-shadow-1: 0 1px 2px rgba(14, 36, 28, 0.06);
  --nq-shadow-2: 0 4px 14px rgba(14, 36, 28, 0.08);
  --nq-shadow-3: 0 14px 40px rgba(14, 36, 28, 0.12);
  --nq-shadow-4: 0 24px 70px rgba(14, 36, 28, 0.16);
  --nq-focus-ring: 0 0 0 3px rgba(14, 95, 69, 0.20);
  --nq-welcome-ink: #143028;
  --nq-welcome-muted: #5b7168;
  --nq-welcome-shadow: none;
  --nq-welcome-shadow-soft: none;
  color-scheme: light;
}

/* ---- 3. Desert Sand — رمال الصحراء -------------------------------------- */
html[data-nq-theme="desert-sand"] {
  --nq-primary: #7a4a24;
  --nq-primary-600: #663d1d;
  --nq-primary-700: #533117;
  --nq-primary-800: #3f2511;
  --nq-primary-300: #c4a07a;
  --nq-primary-200: #e1cdb6;
  --nq-primary-100: #f0e4d6;
  --nq-primary-50: #f8f2ea;
  --nq-on-primary: #ffffff;
  --nq-accent: #c4843c;
  --nq-accent-soft: #f8ecd8;
  --nq-bg: #f8f3eb;
  --nq-bg-soft: #f0e6d6;
  --nq-surface: #fffcf8;
  --nq-surface-2: #fbf6ef;
  --nq-surface-3: #f3eadf;
  --nq-ink: #3b2a1c;
  --nq-ink-2: #53402c;
  --nq-ink-strong: #2a1d13;
  --nq-muted: #7a6a55;
  --nq-muted-2: #9a8b76;
  --nq-line: #e7dccb;
  --nq-line-strong: #d4c5ae;
  --nq-shadow-1: 0 1px 2px rgba(59, 42, 28, 0.06);
  --nq-shadow-2: 0 4px 14px rgba(59, 42, 28, 0.08);
  --nq-shadow-3: 0 14px 40px rgba(59, 42, 28, 0.12);
  --nq-shadow-4: 0 24px 70px rgba(59, 42, 28, 0.16);
  --nq-focus-ring: 0 0 0 3px rgba(122, 74, 36, 0.20);
  --nq-welcome-ink: #3b2a1c;
  --nq-welcome-muted: #7a6a55;
  --nq-welcome-shadow: none;
  --nq-welcome-shadow-soft: none;
  color-scheme: light;
}

/* ---- 4. Graphite Minimal — غرافيت بسيط ---------------------------------- */
html[data-nq-theme="graphite-minimal"] {
  --nq-primary: #3a3f4b;
  --nq-primary-600: #2f333d;
  --nq-primary-700: #25282f;
  --nq-primary-800: #1b1d23;
  --nq-primary-300: #8b90a0;
  --nq-primary-200: #c5c8d0;
  --nq-primary-100: #e2e4e8;
  --nq-primary-50: #f3f4f6;
  --nq-on-primary: #ffffff;
  --nq-accent: #5e7388;
  --nq-accent-soft: #e6ebf0;
  --nq-bg: #f4f5f7;
  --nq-bg-soft: #eceef1;
  --nq-surface: #ffffff;
  --nq-surface-2: #f8f9fa;
  --nq-surface-3: #eef0f3;
  --nq-ink: #1c1f27;
  --nq-ink-2: #333844;
  --nq-ink-strong: #12141a;
  --nq-muted: #667085;
  --nq-muted-2: #8b93a3;
  --nq-line: #e4e6eb;
  --nq-line-strong: #d0d3da;
  --nq-shadow-1: 0 1px 2px rgba(28, 31, 39, 0.05);
  --nq-shadow-2: 0 4px 14px rgba(28, 31, 39, 0.07);
  --nq-shadow-3: 0 14px 40px rgba(28, 31, 39, 0.12);
  --nq-shadow-4: 0 24px 70px rgba(28, 31, 39, 0.16);
  --nq-focus-ring: 0 0 0 3px rgba(58, 63, 75, 0.18);
  --nq-welcome-ink: #1c1f27;
  --nq-welcome-muted: #667085;
  --nq-welcome-shadow: none;
  --nq-welcome-shadow-soft: none;
  color-scheme: light;
}

/* ---- 5. Royal Plum — برقوقي ملكي ---------------------------------------- */
html[data-nq-theme="royal-plum"] {
  --nq-primary: #6a2c4d;
  --nq-primary-600: #582440;
  --nq-primary-700: #471c33;
  --nq-primary-800: #351426;
  --nq-primary-300: #c08aa5;
  --nq-primary-200: #dec0cd;
  --nq-primary-100: #eee0e6;
  --nq-primary-50: #f7f0f3;
  --nq-on-primary: #ffffff;
  --nq-accent: #c9a227;
  --nq-accent-soft: #f6efd4;
  --nq-bg: #f7f2f5;
  --nq-bg-soft: #efe6eb;
  --nq-surface: #fffcfd;
  --nq-surface-2: #fbf6f8;
  --nq-surface-3: #f3e8ee;
  --nq-ink: #2a1522;
  --nq-ink-2: #432536;
  --nq-ink-strong: #1e0e18;
  --nq-muted: #73606a;
  --nq-muted-2: #95848c;
  --nq-line: #e8dce2;
  --nq-line-strong: #d4c3cb;
  --nq-shadow-1: 0 1px 2px rgba(42, 21, 34, 0.06);
  --nq-shadow-2: 0 4px 14px rgba(42, 21, 34, 0.08);
  --nq-shadow-3: 0 14px 40px rgba(42, 21, 34, 0.12);
  --nq-shadow-4: 0 24px 70px rgba(42, 21, 34, 0.16);
  --nq-focus-ring: 0 0 0 3px rgba(106, 44, 77, 0.20);
  --nq-welcome-ink: #2a1522;
  --nq-welcome-muted: #73606a;
  --nq-welcome-shadow: none;
  --nq-welcome-shadow-soft: none;
  color-scheme: light;
}

/* ---- 6. Ocean Teal — فيروزي محيطي --------------------------------------- */
html[data-nq-theme="ocean-teal"] {
  --nq-primary: #0f5f66;
  --nq-primary-600: #0c4e54;
  --nq-primary-700: #0a3e43;
  --nq-primary-800: #072e32;
  --nq-primary-300: #6ba8ae;
  --nq-primary-200: #b0d2d5;
  --nq-primary-100: #d6e8ea;
  --nq-primary-50: #eef6f7;
  --nq-on-primary: #ffffff;
  --nq-accent: #1a8f88;
  --nq-accent-soft: #ddf4f2;
  --nq-bg: #f1f6f6;
  --nq-bg-soft: #e4eeee;
  --nq-surface: #fbfefe;
  --nq-surface-2: #f5f9f9;
  --nq-surface-3: #e8f1f1;
  --nq-ink: #133136;
  --nq-ink-2: #25474c;
  --nq-ink-strong: #0c2428;
  --nq-muted: #5a7174;
  --nq-muted-2: #849396;
  --nq-line: #d5e3e4;
  --nq-line-strong: #b9ccce;
  --nq-shadow-1: 0 1px 2px rgba(19, 49, 54, 0.06);
  --nq-shadow-2: 0 4px 14px rgba(19, 49, 54, 0.08);
  --nq-shadow-3: 0 14px 40px rgba(19, 49, 54, 0.12);
  --nq-shadow-4: 0 24px 70px rgba(19, 49, 54, 0.16);
  --nq-focus-ring: 0 0 0 3px rgba(15, 95, 102, 0.20);
  --nq-welcome-ink: #133136;
  --nq-welcome-muted: #5a7174;
  --nq-welcome-shadow: none;
  --nq-welcome-shadow-soft: none;
  color-scheme: light;
}

/* ---- Theme picker (settings → الثيمات) ----------------------------------- */
.theme-picker {
  background: var(--nq-surface);
  border: 1px solid var(--nq-line);
  border-radius: var(--nq-radius-2, 12px);
  padding: var(--nq-space-5);
  margin-bottom: var(--nq-space-6);
}
.theme-picker h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--nq-ink);
  margin: 0 0 var(--nq-space-2);
}
.theme-picker-hint {
  margin: 0 0 var(--nq-space-4);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--nq-muted);
  max-width: 62ch;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: var(--nq-space-3);
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: start;
  padding: 10px;
  border: 1.5px solid var(--nq-line);
  border-radius: var(--nq-radius-md, 10px);
  background: var(--nq-surface-2);
  color: var(--nq-ink);
  cursor: pointer;
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.theme-card:hover,
.theme-card:focus-visible {
  border-color: var(--nq-primary-300);
  background: var(--nq-surface);
}
.theme-card:focus-visible {
  outline: none;
  box-shadow: var(--nq-focus-ring);
}
.theme-card.is-active {
  border-color: var(--nq-primary);
  background: var(--nq-primary-50);
  box-shadow: 0 0 0 1px var(--nq-primary);
}
.theme-swatches {
  display: flex;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--nq-line);
}
.theme-swatches span {
  flex: 1 1 0;
}
.theme-card-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--nq-ink);
  line-height: 1.3;
}
.theme-card-sub {
  font-size: 11px;
  color: var(--nq-muted);
  line-height: 1.3;
}

@media (max-width: 640px) {
  .theme-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}
