/* ════════════════════════════════════════════════════════════════════════════════
   INJAZ ERP — ONE design system for the portal, Fleet, HR, Employee Affairs,
   Main Settings and Users & Access.

   Layers
   1. Company identity: --ij-co (dark) and --ij-co-2 (bright) come from the companies table
      (Injaz navy, Nabdh burgundy, All = neutral dark). They paint the header, sidebar and hero.
   2. App identity: --ij-accent (Fleet teal, HR violet, Employee Affairs orange, Settings slate,
      Users & Access green) for the active indicator, primary buttons, KPI icons, charts, focus.
   3. Light content everywhere: white cards on a soft background tinted by the accent.

   Motion uses transform/opacity only (clip-path only for the company reveal), never runs in
   print, reports, Excel import or very large tables, and stops for prefers-reduced-motion.
   Printed sheets (.sheet, .a4, .rs-sheet, .a4f) are never restyled.
   ════════════════════════════════════════════════════════════════════════════════ */

:root {
  /* motion */
  --ij-dur-micro: 120ms; --ij-dur: 220ms; --ij-dur-emph: 400ms;
  --ij-ease: cubic-bezier(0.2, 0, 0, 1); --ij-ease-out: cubic-bezier(0, 0, 0.2, 1);
  /* company (painted at runtime from the companies table) */
  --ij-co: #1e242e; --ij-co-2: #546278; --ij-co-rgb: 30 36 46;
  /* app accent */
  --ij-accent: #0f766e; --ij-accent-rgb: 15 118 110; --ij-accent-ink: #ffffff; --ij-accent-on-dark: #5eead4;
  /* surfaces */
  --ij-bg: #f4f6f9; --ij-surface: #ffffff; --ij-surface-2: #f8fafc; --ij-ink: #111827; --ij-ink-2: #344054;
  --ij-muted: #5b6474; --ij-line: rgb(15 23 42 / .08); --ij-line-2: rgb(15 23 42 / .14);
  /* shape */
  --ij-r-xs: 8px; --ij-r-sm: 10px; --ij-r: 14px; --ij-r-lg: 18px; --ij-r-card: 24px; --ij-r-pill: 999px;
  /* depth */
  --ij-shadow-1: 0 1px 2px rgb(15 23 42 / .05), 0 2px 8px -3px rgb(15 23 42 / .07);
  --ij-shadow-2: 0 1px 2px rgb(15 23 42 / .04), 0 12px 28px -14px rgb(15 23 42 / .20);
  --ij-shadow-3: 0 2px 4px rgb(15 23 42 / .05), 0 24px 48px -20px rgb(15 23 42 / .30);
  --ij-glow: 0 8px 22px -8px rgb(var(--ij-accent-rgb) / .55);
  /* type */
  --ij-font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --ij-font-display: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  /* layout */
  --ij-side-w: 264px; --ij-side-w-rail: 78px; --ij-head-h: 64px;
}
/* app accents (WCAG AA on white: ≥ 4.5:1) */
html[data-ij-app="fleet"]     { --ij-accent: #0f766e; --ij-accent-rgb: 15 118 110; --ij-accent-on-dark: #5eead4; }
html[data-ij-app="hr"]        { --ij-accent: #1d4ed8; --ij-accent-rgb: 29 78 216; --ij-accent-on-dark: #93c5fd; } /* professional blue (was violet) */
html[data-ij-app="personnel"] { --ij-accent: #c2410c; --ij-accent-rgb: 194 65 12;  --ij-accent-on-dark: #fdba74; }
html[data-ij-app="command"] { --ij-accent: #3730a3; --ij-accent-rgb: 55 48 163; --ij-accent-on-dark: #a5b4fc; }
html[data-ij-app="reception"] { --ij-accent: #0e7490; --ij-accent-rgb: 14 116 144; --ij-accent-on-dark: #67e8f9; }
html[data-ij-app="approvals"] { --ij-accent: #be123c; --ij-accent-rgb: 190 18 60; --ij-accent-on-dark: #fda4af; }
html[data-ij-app="settings"]  { --ij-accent: #475569; --ij-accent-rgb: 71 85 105;  --ij-accent-on-dark: #cbd5e1; }
html[data-ij-app="users"]     { --ij-accent: #047857; --ij-accent-rgb: 4 120 87;   --ij-accent-on-dark: #6ee7b7; }

/* optional dark theme (explicit choice only; light is the default everywhere) */
html.ij-dark {
  --ij-bg: #0d1117; --ij-surface: #161b24; --ij-surface-2: #1b2130; --ij-ink: #e8ebf1; --ij-ink-2: #c6cbd5;
  --ij-muted: #9aa4b5; --ij-line: rgb(255 255 255 / .08); --ij-line-2: rgb(255 255 255 / .14);
  --ij-shadow-1: 0 1px 2px rgb(0 0 0 / .3); --ij-shadow-2: 0 12px 28px -14px rgb(0 0 0 / .6); --ij-shadow-3: 0 24px 48px -20px rgb(0 0 0 / .7);
}

/* ── page background: light, softly tinted by the app accent and the company ── */
html.ij-ds, html.ij-ds body {
  background-color: var(--ij-bg);
  background-image:
    radial-gradient(1100px 520px at 105% -8%, rgb(var(--ij-accent-rgb) / .10), transparent 62%),
    radial-gradient(900px 480px at -10% 108%, color-mix(in srgb, var(--ij-co-2) 9%, transparent), transparent 60%);
  background-attachment: fixed;
}
html.ij-ds body { font-family: var(--ij-font); color: var(--ij-ink); -webkit-font-smoothing: antialiased; }
html.ij-ds :where(h1, h2, h3, .font-display) { font-family: var(--ij-font-display); }
html.ij-ds ::selection { background: rgb(var(--ij-accent-rgb) / .22); }

/* ════════ SHELL ════════ */
.ij-shell { display: flex; height: 100%; min-height: 0; gap: 0; }
.ij-side {
  position: relative; flex-shrink: 0; width: var(--ij-side-w); margin: 12px; margin-inline-end: 0; border-radius: var(--ij-r-card);
  display: flex; flex-direction: column; min-height: 0; color: #fff; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ij-co) 92%, #fff 0%) 0%, color-mix(in srgb, var(--ij-co) 86%, #000) 100%);
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--ij-co) 80%, transparent), inset 0 1px 0 rgb(255 255 255 / .06);
  transition: width var(--ij-dur) var(--ij-ease), background-color var(--ij-dur-emph);
}
.ij-side::before { /* a soft glow of the app accent at the top, part of the identity */
  content: ''; position: absolute; inset: -40% -30% auto auto; width: 260px; height: 260px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgb(var(--ij-accent-rgb) / .38), transparent 70%); pointer-events: none;
}
[dir="rtl"] .ij-side::before { inset: -40% auto auto -30%; }
.ij-side.is-rail { width: var(--ij-side-w-rail); }
.ij-side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; min-height: 72px; }
.ij-side.is-rail .ij-side-brand { justify-content: center; padding-inline: 8px; }
.ij-side.is-rail .ij-side-brand .ij-brand-text, .ij-side.is-rail .ij-nav-label, .ij-side.is-rail .ij-nav-group, .ij-side.is-rail .ij-nav-badge-wide, .ij-side.is-rail .ij-side-user-text, .ij-side.is-rail .ij-hide-rail { display: none !important; }
.ij-brand-mark { width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--ij-font-display); font-weight: 700; font-size: 18px;
  background: var(--ij-accent); color: #fff; box-shadow: var(--ij-glow); overflow: hidden; }
.ij-brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.ij-brand-text { min-width: 0; line-height: 1.2; }
.ij-brand-text b { display: block; font-family: var(--ij-font-display); font-size: 15.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ij-brand-text small { display: block; font-size: 11px; color: rgb(255 255 255 / .62); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ij-side-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 10px 10px; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .18) transparent; }
.ij-nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.ij-nav-group { padding: 14px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .55); }
.ij-side.is-rail .ij-nav-sep { display: block; height: 1px; margin: 8px 14px; background: rgb(255 255 255 / .1); }
.ij-nav-sep { display: none; }
.ij-nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; border-radius: 13px; width: 100%;
  font-size: 13.5px; font-weight: 500; color: rgb(255 255 255 / .74); text-decoration: none; text-align: start; background: transparent; border: 0; cursor: pointer;
}
.ij-nav-item:hover { color: #fff; background: rgb(255 255 255 / .07); }
.ij-nav-item.is-active { color: #fff; font-weight: 600; }
.ij-nav-item .ij-nav-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; color: rgb(255 255 255 / .78); transition: color var(--ij-dur-micro), background-color var(--ij-dur-micro); }
.ij-nav-item.is-active .ij-nav-ic { color: #fff; }
.ij-nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ij-side.is-rail .ij-nav-item { justify-content: center; padding: 0; }
.ij-nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; background: #dc2626; color: #fff; }
.ij-side.is-rail .ij-nav-item .ij-nav-badge { position: absolute; top: 3px; inset-inline-end: 8px; min-width: 9px; height: 9px; padding: 0; font-size: 0; }
.ij-nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--ij-dur) var(--ij-ease); }
.ij-nav-sub.is-open { grid-template-rows: 1fr; }
.ij-nav-sub > div { overflow: hidden; }
.ij-nav-sub .ij-nav-item { min-height: 36px; font-size: 13px; padding-inline-start: 20px; }
.ij-nav-sub .ij-nav-item::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .3); flex-shrink: 0; margin-inline-end: 6px; }
.ij-nav-sub .ij-nav-item.is-active::before { background: var(--ij-accent-on-dark); }
/* THE active indicator: one glowing pill that glides between items (placed by injaz-motion.js) */
.ij-nav-indicator {
  position: absolute; inset-inline: 0; top: 0; height: 42px; border-radius: 13px; pointer-events: none; z-index: 0; opacity: 0;
  background: linear-gradient(90deg, rgb(var(--ij-accent-rgb) / .95), rgb(var(--ij-accent-rgb) / .78));
  box-shadow: 0 8px 22px -8px rgb(var(--ij-accent-rgb) / .9), inset 0 1px 0 rgb(255 255 255 / .18);
  transition: transform var(--ij-dur) var(--ij-ease), height var(--ij-dur) var(--ij-ease), opacity var(--ij-dur-micro);
}
.ij-side-foot { padding: 10px; border-top: 1px solid rgb(255 255 255 / .08); display: flex; flex-direction: column; gap: 4px; }
.ij-side-tool { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 12px; font-size: 12.5px; font-weight: 600; color: rgb(255 255 255 / .78); background: transparent; border: 0; cursor: pointer; width: 100%; text-align: start; }
.ij-side-tool:hover { background: rgb(255 255 255 / .08); color: #fff; }
.ij-side.is-rail .ij-side-tool { justify-content: center; padding: 0; }
.ij-rail-toggle { position: absolute; top: 24px; inset-inline-end: -1px; }

/* header: glass, sticky, same layout and order in every app */
.ij-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ij-head {
  position: relative; z-index: 20; flex-shrink: 0; margin: 12px 12px 0; border-radius: 20px; min-height: var(--ij-head-h);
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: calc(10px + var(--sat, 0px));
  background: color-mix(in srgb, var(--ij-co) 94%, transparent); color: #fff;
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--ij-co) 85%, transparent), inset 0 1px 0 rgb(255 255 255 / .07);
  transition: background-color var(--ij-dur-emph);
}
.ij-head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ij-head-title b { font-family: var(--ij-font-display); font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ij-head-title small { font-size: 11px; color: rgb(255 255 255 / .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ij-head-tools { display: flex; align-items: center; gap: 6px; }
.ij-hbtn {
  position: relative; height: 40px; min-width: 40px; padding: 0 10px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgb(255 255 255 / .08); color: #fff; border: 1px solid rgb(255 255 255 / .10); font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ij-hbtn:hover { background: rgb(255 255 255 / .16); }
.ij-hbtn.home { background: #fff; color: var(--ij-co); border-color: transparent; font-weight: 700; }
.ij-hbtn.home:hover { background: #f1f5f9; }
.ij-hbtn .ij-dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--ij-co); }
/* the header hosts each app's own notification button: make it look like the others */
.ij-head .ij-slot > button, .ij-head .ij-slot > div > button:first-child { height: 40px; min-width: 40px; border-radius: 12px; background: rgb(255 255 255 / .08) !important; color: #fff !important; border: 1px solid rgb(255 255 255 / .10) !important; box-shadow: none !important; }
.ij-head .ij-slot > button:hover { background: rgb(255 255 255 / .16) !important; }
.ij-head .ij-slot svg { color: #fff; }
.ij-search { position: relative; width: 260px; }
.ij-search input { width: 100%; height: 40px; border-radius: 12px; padding: 0 12px; padding-inline-start: 36px; background: rgb(255 255 255 / .10); border: 1px solid rgb(255 255 255 / .12); color: #fff; font-size: 13px; outline: none; }
.ij-search input::placeholder { color: rgb(255 255 255 / .55); }
.ij-search input:focus { background: rgb(255 255 255 / .16); border-color: var(--ij-accent-on-dark); box-shadow: 0 0 0 3px rgb(var(--ij-accent-rgb) / .35); }
.ij-search > svg { position: absolute; top: 12px; inset-inline-start: 12px; color: rgb(255 255 255 / .6); pointer-events: none; }
.ij-search-pop { position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 40; color: var(--ij-ink); }
.ij-user { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px; padding-inline-end: 10px; border-radius: 12px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .10); color: #fff; cursor: pointer; }
.ij-user .ij-av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--ij-accent); color: #fff; font-weight: 700; font-size: 12.5px; font-family: var(--ij-font-display); }
.ij-user span { max-width: 140px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* company switcher (one component, same order and labels everywhere) */
.ij-co-switch { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 13px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .10); isolation: isolate; }
.ij-co-switch button { position: relative; z-index: 1; height: 32px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: rgb(255 255 255 / .78); background: transparent; border: 0; cursor: pointer; white-space: nowrap; }
.ij-co-switch button[aria-checked="true"] { color: var(--ij-co); }
.ij-co-switch button:hover:not([aria-checked="true"]) { color: #fff; }
.ij-co-switch .ij-co-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .18); transition: transform var(--ij-dur) var(--ij-ease), width var(--ij-dur) var(--ij-ease); }
.ij-co-logo { width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; flex-shrink: 0; font-family: var(--ij-font-display); font-size: 11.5px; font-weight: 700; color: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); }
.ij-co-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ij-co-logo.all { background: linear-gradient(135deg, #0d1b40 0 50%, #4c0d21 50% 100%); }
.ij-co-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40; min-width: 230px; padding: 6px; border-radius: 16px; background: var(--ij-surface); color: var(--ij-ink); border: 1px solid var(--ij-line); box-shadow: var(--ij-shadow-3); }
.ij-co-menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--ij-ink); background: transparent; border: 0; cursor: pointer; text-align: start; }
.ij-co-menu button:hover { background: var(--ij-surface-2); }
.ij-co-menu button[aria-selected="true"] { background: rgb(var(--ij-accent-rgb) / .10); color: var(--ij-accent); }

/* tooltip (one shared style; used by the collapsed sidebar and icon buttons) */
.ij-tip { position: fixed; z-index: 120; pointer-events: none; padding: 6px 10px; border-radius: 9px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
  background: rgb(17 24 39 / .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 8px 20px -8px rgb(0 0 0 / .5);
  opacity: 0; transform: translateY(2px); transition: opacity var(--ij-dur-micro), transform var(--ij-dur-micro); }
.ij-tip.show { opacity: 1; transform: none; }

.ij-content { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.ij-content-inner { width: 100%; margin: 0 auto; padding: 18px 16px 40px; }
@media (min-width: 768px) { .ij-content-inner { padding: 22px 24px 48px; } }

/* phone: header full width, bottom bar, drawer */
@media (max-width: 767px) {
  .ij-side.is-desktop { display: none; }
  .ij-head { margin: 0; border-radius: 0 0 18px 18px; padding: 8px 10px; padding-top: calc(8px + var(--sat, 0px)); }
  .ij-hide-phone { display: none !important; }
  .ij-content-inner { padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 768px) { .ij-only-phone { display: none !important; } }
@media (max-width: 1100px) { .ij-search { width: 200px; } .ij-hide-md { display: none !important; } }
.ij-co-compact { display: none; position: relative; }
@media (max-width: 1280px) { .ij-co-full { display: none; } .ij-co-compact { display: inline-flex; } }
.ij-bottom { position: fixed; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 25; display: flex; padding: 6px; border-radius: 20px;
  background: color-mix(in srgb, var(--ij-co) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 16px 36px -14px rgb(0 0 0 / .45); }
.ij-bottom a, .ij-bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border-radius: 14px; font-size: 10.5px; font-weight: 600; color: rgb(255 255 255 / .66); background: transparent; border: 0; text-decoration: none; }
.ij-bottom .is-active { color: #fff; background: rgb(var(--ij-accent-rgb) / .9); box-shadow: var(--ij-glow); }
.ij-drawer-back { position: fixed; inset: 0; z-index: 40; background: rgb(5 7 13 / .5); animation: ij-fade var(--ij-dur) both; }
.ij-drawer { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 86vw); margin: 0; border-radius: 0; animation: ij-drawer var(--ij-dur-emph) var(--ij-ease-out) both; }
[dir="rtl"] .ij-drawer { border-radius: 24px 0 0 24px; } [dir="ltr"] .ij-drawer { border-radius: 0 24px 24px 0; }
@keyframes ij-drawer { from { transform: translateX(var(--ij-from, 100%)); } }
[dir="ltr"] .ij-drawer { --ij-from: -100%; }

/* ════════ PAGE HERO ════════ */
.ij-hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--ij-r-card); padding: 22px 22px 20px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(120deg, var(--ij-co) 0%, color-mix(in srgb, var(--ij-co) 78%, var(--ij-co-2)) 100%);
  box-shadow: 0 22px 44px -26px color-mix(in srgb, var(--ij-co) 90%, transparent);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.ij-hero::before { content: ''; position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%; inset-inline-end: -120px; top: -220px; background: radial-gradient(circle, rgb(var(--ij-accent-rgb) / .55), transparent 68%); }
.ij-hero::after { content: ''; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(rgb(255 255 255 / .07) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); }
[dir="rtl"] .ij-hero::after { mask-image: linear-gradient(270deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(270deg, transparent, #000 60%); }
.ij-hero-eyebrow { font-size: 12px; font-weight: 600; color: rgb(255 255 255 / .72); display: flex; align-items: center; gap: 8px; }
.ij-hero h1 { margin: 6px 0 0; font-family: var(--ij-font-display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; line-height: 1.25; color: #fff; letter-spacing: -.01em; }
.ij-hero h1 em { font-style: normal; color: var(--ij-accent-on-dark); }
.ij-hero p { margin: 6px 0 0; font-size: 13.5px; color: rgb(255 255 255 / .74); max-width: 640px; line-height: 1.7; }
.ij-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ij-hero .ij-btn.ghost { background: rgb(255 255 255 / .10); color: #fff; border-color: rgb(255 255 255 / .18); }
.ij-hero .ij-btn.ghost:hover { background: rgb(255 255 255 / .18); }
.ij-hero-ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16); color: #fff; flex-shrink: 0; }
/* compact page header (list, form, detail pages) */
.ij-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ij-pagehead-ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; color: #fff;
  background: linear-gradient(135deg, var(--ij-accent), color-mix(in srgb, var(--ij-accent) 70%, var(--ij-co))); box-shadow: var(--ij-glow); }
.ij-pagehead h1 { margin: 0; font-family: var(--ij-font-display); font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; color: var(--ij-ink); line-height: 1.25; letter-spacing: -.01em; }
.ij-pagehead p { margin: 4px 0 0; font-size: 13px; color: var(--ij-muted); line-height: 1.6; max-width: 760px; }

/* ════════ CARDS ════════ */
.ij-card { background: var(--ij-surface); border: 1px solid var(--ij-line); border-radius: var(--ij-r-card); box-shadow: var(--ij-shadow-2);
  transition: transform var(--ij-dur) var(--ij-ease), box-shadow var(--ij-dur) var(--ij-ease), border-color var(--ij-dur); }
.ij-card.pad { padding: 20px; }
.ij-card.hover:hover, a.ij-card:hover, button.ij-card:hover { transform: translateY(-4px); box-shadow: var(--ij-shadow-3); border-color: rgb(var(--ij-accent-rgb) / .22); }
.ij-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--ij-line); }
.ij-card-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ij-ink); font-family: var(--ij-font-display); }

/* KPI card: accent icon chip, muted title, big count-up number, thin bar from baseline */
.ij-kpi { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; text-align: start; overflow: hidden; }
.ij-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ij-kpi-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgb(var(--ij-accent-rgb) / .11); color: var(--ij-accent); flex-shrink: 0; }
.ij-kpi-label { font-size: 12.5px; font-weight: 600; color: var(--ij-muted); }
.ij-kpi-value { font-family: var(--ij-font-display); font-size: 30px; font-weight: 700; line-height: 1; color: var(--ij-ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ij-kpi-sub { font-size: 11.5px; color: var(--ij-muted); }
.ij-meter { height: 6px; border-radius: 99px; background: rgb(var(--ij-accent-rgb) / .10); overflow: hidden; }
.ij-meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ij-accent), color-mix(in srgb, var(--ij-accent) 65%, #fff)); transform-origin: left center; }
[dir="rtl"] .ij-meter > i { transform-origin: right center; background: linear-gradient(270deg, var(--ij-accent), color-mix(in srgb, var(--ij-accent) 65%, #fff)); }

/* company breakdown (Total + one card per company; click filters) */
.ij-co-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ij-co-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; text-align: start; cursor: pointer; overflow: hidden;
  background: var(--ij-surface); border: 1px solid var(--ij-line); box-shadow: var(--ij-shadow-1); color: var(--ij-ink); }
.ij-co-card::after { content: ''; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--c, var(--ij-accent)); }
.ij-co-card:hover { transform: translateY(-4px); box-shadow: var(--ij-shadow-2); }
.ij-co-card[aria-pressed="true"] { border-color: var(--c, var(--ij-accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--ij-accent)) 18%, transparent), var(--ij-shadow-2); }
.ij-co-card b { display: block; font-family: var(--ij-font-display); font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ij-co-card small { display: block; font-size: 12px; color: var(--ij-muted); font-weight: 600; margin-top: 2px; }
.ij-co-card .ij-co-logo { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; background: var(--c); }

/* ════════ BUTTONS ════════ */
.ij-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--ij-r); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; border: 1px solid transparent; text-decoration: none;
  background: var(--ij-accent); color: var(--ij-accent-ink); box-shadow: var(--ij-glow); }
.ij-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.ij-btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 11px; }
.ij-btn.ghost { background: var(--ij-surface); color: var(--ij-ink); border-color: var(--ij-line-2); box-shadow: var(--ij-shadow-1); }
.ij-btn.ghost:hover:not(:disabled) { border-color: rgb(var(--ij-accent-rgb) / .45); color: var(--ij-accent); }
.ij-btn.soft { background: rgb(var(--ij-accent-rgb) / .10); color: var(--ij-accent); box-shadow: none; }
.ij-btn.dark { background: var(--ij-co); color: #fff; box-shadow: 0 8px 20px -10px var(--ij-co); }
.ij-btn.danger { background: #b42318; color: #fff; box-shadow: 0 8px 20px -10px #b42318; }
.ij-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ════════ INPUTS ════════ */
.ij-field { display: flex; flex-direction: column; gap: 6px; }
.ij-label { font-size: 12.5px; font-weight: 600; color: var(--ij-ink-2); }
.ij-input { width: 100%; min-height: 44px; padding: 0 13px; border-radius: var(--ij-r); border: 1px solid var(--ij-line-2); background: var(--ij-surface); color: var(--ij-ink); font-size: 14px; outline: none;
  transition: border-color var(--ij-dur-micro), box-shadow var(--ij-dur), background-color var(--ij-dur-micro); }
textarea.ij-input { padding: 11px 13px; min-height: 96px; line-height: 1.7; }
.ij-input:hover { border-color: rgb(15 23 42 / .24); }
.ij-input:focus { border-color: var(--ij-accent); box-shadow: 0 0 0 4px rgb(var(--ij-accent-rgb) / .15); }

/* segmented control with a sliding selection background (filter pills, tabs) */
.ij-seg { position: relative; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 15px; background: var(--ij-surface); border: 1px solid var(--ij-line); box-shadow: var(--ij-shadow-1); isolation: isolate; }
.ij-seg > button, .ij-seg > a { position: relative; z-index: 1; min-height: 36px; padding: 0 14px; border-radius: 11px; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ij-muted); background: transparent; border: 0; cursor: pointer; white-space: nowrap; text-decoration: none; }
.ij-seg > button:hover { color: var(--ij-ink); }
.ij-seg > .is-on, .ij-seg > [aria-selected="true"], .ij-seg > [aria-pressed="true"] { color: #fff; }
.ij-seg-thumb { position: absolute; z-index: 0; border-radius: 11px; background: var(--ij-accent); box-shadow: var(--ij-glow); transition: transform var(--ij-dur) var(--ij-ease), width var(--ij-dur) var(--ij-ease), height var(--ij-dur) var(--ij-ease); pointer-events: none; }

/* ════════ TABLES ════════ */
.ij-table-wrap { background: var(--ij-surface); border: 1px solid var(--ij-line); border-radius: 20px; box-shadow: var(--ij-shadow-1); overflow: auto; }
.ij-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
:where(.ij-table) thead th { position: sticky; top: 0; z-index: 1; text-align: start; padding: 12px 14px; font-size: 12px; font-weight: 600; color: var(--ij-muted); white-space: nowrap; background: var(--ij-surface-2); border-bottom: 1px solid var(--ij-line); }
:where(.ij-table) tbody td { padding: 12px 14px; border-bottom: 1px solid var(--ij-line); color: var(--ij-ink); vertical-align: middle; }
.ij-table tbody tr { transition: background-color var(--ij-dur-micro); }
.ij-table tbody tr:hover { background: rgb(var(--ij-accent-rgb) / .045); }
.ij-table tbody tr:last-child td { border-bottom: 0; }

/* badges keep each system's own status colours; this only sets the shape */
.ij-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }

/* empty state */
.ij-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 44px 20px; color: var(--ij-muted); }
.ij-empty-ic { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; color: var(--ij-accent); background: rgb(var(--ij-accent-rgb) / .09); box-shadow: inset 0 0 0 1px rgb(var(--ij-accent-rgb) / .14); }
.ij-empty b { color: var(--ij-ink); font-family: var(--ij-font-display); font-size: 15px; }

/* skeleton (reserves the final size, so nothing shifts) */
.ij-skel { position: relative; overflow: hidden; background: rgb(148 163 184 / .16); border-radius: 12px; }
.ij-skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgb(255 255 255 / .55), transparent); animation: ij-shimmer 1.2s infinite; }
@keyframes ij-shimmer { to { transform: translateX(100%); } }

/* modal, drawer, toast */
.ij-modal-back { position: fixed; inset: 0; z-index: 50; background: rgb(5 7 13 / .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: ij-fade var(--ij-dur) both; }
.ij-modal { background: var(--ij-surface); color: var(--ij-ink); border-radius: 26px; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5), 0 0 0 1px var(--ij-line); }
.ij-toast { border-radius: 16px; background: rgb(17 24 39 / .94); color: #fff; box-shadow: var(--ij-shadow-3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ════════ MOTION ════════ */
button, a, [role="button"], [role="tab"], [role="radio"], select, summary {
  transition-property: background-color, border-color, color, box-shadow, opacity, transform, scale, filter;
  transition-duration: var(--ij-dur-micro); transition-timing-function: var(--ij-ease);
}
button:not(:disabled):active, [role="button"]:active, [role="tab"]:active, .ij-card.hover:active { scale: 0.98; }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--ij-accent); outline-offset: 2px; }
.ij-head :where(button, a, input):focus-visible, .ij-side :where(button, a):focus-visible { outline-color: var(--ij-accent-on-dark); }

@keyframes ij-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes ij-fade { from { opacity: 0; } }
@keyframes ij-pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.ij-stagger > *:nth-child(-n + 8) { animation: ij-in var(--ij-dur-emph) var(--ij-ease-out) both; }
.ij-stagger > *:nth-child(2) { animation-delay: 50ms; } .ij-stagger > *:nth-child(3) { animation-delay: 100ms; }
.ij-stagger > *:nth-child(4) { animation-delay: 150ms; } .ij-stagger > *:nth-child(5) { animation-delay: 200ms; }
.ij-stagger > *:nth-child(6) { animation-delay: 250ms; } .ij-stagger > *:nth-child(7) { animation-delay: 300ms; }
.ij-stagger > *:nth-child(8) { animation-delay: 350ms; }
.ij-stagger.ij-tier2 > *:nth-child(-n + 8) { animation: ij-fade 200ms var(--ij-ease-out) both; animation-delay: 0ms; }
@media (max-width: 640px) { .ij-stagger > *:nth-child(n + 7) { animation: none; } }
.ij-seq > * { animation: ij-in var(--ij-dur-emph) var(--ij-ease-out) both; }
.ij-seq > *:nth-child(2) { animation-delay: 40ms; } .ij-seq > *:nth-child(3) { animation-delay: 80ms; } .ij-seq > *:nth-child(4) { animation-delay: 120ms; }
.ij-seq > *:nth-child(5) { animation-delay: 160ms; } .ij-seq > *:nth-child(6) { animation-delay: 200ms; } .ij-seq > *:nth-child(7) { animation-delay: 240ms; }
.ij-seq > *:nth-child(8) { animation-delay: 280ms; } .ij-seq > *:nth-child(n + 9) { animation-delay: 320ms; }

.ij-bar { transform-origin: left center; animation: ij-fill 800ms var(--ij-ease-out) both; }
[dir="rtl"] .ij-bar { transform-origin: right center; }
@keyframes ij-fill { from { transform: scaleX(0); } }
.ij-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: ij-pulse 2s infinite; }
@keyframes ij-pulse { 0% { box-shadow: 0 0 0 0 rgb(16 185 129 / .5); } 70%, 100% { box-shadow: 0 0 0 8px rgb(16 185 129 / 0); } }
[role="dialog"], [aria-modal="true"] { animation: ij-pop var(--ij-dur) var(--ij-ease-out) both; }
[role="menu"], [role="listbox"] { animation: ij-pop var(--ij-dur-micro) var(--ij-ease-out) both; }
.ij-grow-y { transform-box: fill-box; transform-origin: center bottom; animation: ij-grow-y 650ms var(--ij-ease-out) both; }
.ij-grow-x { transform-box: fill-box; transform-origin: left center; animation: ij-grow-x 650ms var(--ij-ease-out) both; }
@keyframes ij-grow-y { from { transform: scaleY(0); } }
@keyframes ij-grow-x { from { transform: scaleX(0); } }
.ij-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ij-draw 900ms var(--ij-ease) forwards; }
@keyframes ij-draw { to { stroke-dashoffset: 0; } }
.ij-slice { transform-box: view-box; transform-origin: center; animation: ij-slice 500ms var(--ij-ease-out) both; }
@keyframes ij-slice { from { opacity: 0; transform: scale(.92) rotate(-6deg); } }
.ij-pop { animation: ij-avatar 380ms var(--ij-ease) both; }
@keyframes ij-avatar { from { opacity: 0; transform: scale(.6); } }
.ij-stamp { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ij-draw 420ms var(--ij-ease) forwards; }
/* toggles snap (Main Settings signature) */
.ij-toggle { position: relative; width: 44px; height: 26px; border-radius: 99px; background: rgb(15 23 42 / .18); border: 0; cursor: pointer; flex-shrink: 0; }
.ij-toggle::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .25); transition: transform 260ms cubic-bezier(.34, 1.56, .64, 1); }
.ij-toggle[aria-checked="true"] { background: var(--ij-accent); }
.ij-toggle[aria-checked="true"]::after { transform: translateX(18px); }
[dir="rtl"] .ij-toggle[aria-checked="true"]::after { transform: translateX(-18px); }
/* lock / unlock (Users & Access signature) */
.ij-lock { display: inline-grid; place-items: center; transition: transform 300ms cubic-bezier(.34, 1.56, .64, 1), color var(--ij-dur); }
.ij-lock.is-open { transform: rotate(-12deg) translateY(-1px); }
@keyframes ij-unlock { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-14deg); } 100% { transform: scale(1) rotate(0); } }
.ij-lock.flip { animation: ij-unlock 420ms var(--ij-ease) both; }

/* company reveal (the only place clip-path is used) */
.ij-veil { position: fixed; inset: 0; z-index: 100; pointer-events: none; clip-path: circle(0 at var(--x) var(--y)); transition: clip-path 420ms var(--ij-ease), opacity 240ms var(--ij-ease-out); }
.ij-veil.cover { clip-path: circle(150vmax at var(--x) var(--y)); }
.ij-veil.leave { opacity: 0; }
.ij-veil.fade { clip-path: none; opacity: 0; transition: opacity 180ms; }
.ij-veil.fade.cover { opacity: 1; }
.ij-veil.fade.leave { opacity: 0; }

/* once-per-session entrance (skippable, ≤ 1.2 s) */
.ij-entrance { position: fixed; inset: 0; z-index: 110; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--ij-co); color: #fff; cursor: pointer; animation: ij-entrance-out 300ms 900ms var(--ij-ease) forwards; }
.ij-entrance .ij-brand-mark { width: 64px; height: 64px; border-radius: 20px; font-size: 28px; animation: ij-avatar 420ms var(--ij-ease) both; }
.ij-entrance b { font-family: var(--ij-font-display); font-size: 20px; animation: ij-in 420ms 120ms var(--ij-ease-out) both; }
@keyframes ij-entrance-out { to { opacity: 0; visibility: hidden; } }

/* tier 3 (reports, print, import, audit, very large tables) and accessibility: no decorative motion */
html.ij-tier3 .ij-content * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .ij-entrance, .ij-veil { display: none !important; }
}
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ij-side, .ij-head, .ij-bottom, .ij-nav-indicator, .ij-tip, .ij-veil, .ij-entrance { display: none !important; }
  html.ij-ds, html.ij-ds body { background: #fff !important; }
  .ij-content { overflow: visible !important; }
}

/* ════════ in-app skin for screens built before the design system ════════
   Tables, fields and white panels inside the content area take the shared look. Layout,
   columns and order are untouched; printed sheets are excluded. */
.ij-content :where(table):not(.rpt):not(:where(.sheet, .a4, .rs-sheet, .a4f, .ij-raw, .print-area, .doc-print) *) > thead th {
  position: sticky; top: 0; z-index: 1; background: var(--ij-surface-2); color: var(--ij-muted); font-weight: 600; border-bottom: 1px solid var(--ij-line);
}
.ij-content :where(table):not(.rpt):not(:where(.sheet, .a4, .rs-sheet, .a4f, .ij-raw, .print-area, .doc-print) *) > tbody > tr { transition: background-color var(--ij-dur-micro); }
.ij-content :where(table):not(.rpt):not(:where(.sheet, .a4, .rs-sheet, .a4f, .ij-raw, .print-area, .doc-print) *) > tbody > tr:hover { background-color: rgb(var(--ij-accent-rgb) / .045); }
.ij-content :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), select, textarea):not(:where(.sheet, .a4, .rs-sheet, .a4f) *):focus {
  border-color: var(--ij-accent) !important; box-shadow: 0 0 0 4px rgb(var(--ij-accent-rgb) / .15) !important; outline: none;
}
.ij-content :where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--ij-accent); }
/* white panels drawn with utility classes get the shared depth and radius */
.ij-content :where(.bg-white.rounded-2xl.border, .bg-white.rounded-3xl.border, .bg-white.rounded-xl.border.shadow-sm):not(:where(.sheet, .a4, .rs-sheet, .a4f) *) {
  border-color: var(--ij-line) !important; box-shadow: var(--ij-shadow-2);
}
.ij-content :where(.bg-white.rounded-2xl.border, .bg-white.rounded-3xl.border):not(:where(.sheet, .a4, .rs-sheet, .a4f) *) { border-radius: 22px; }

/* company cards: the "Total" mark keeps both company colours; three across on phones */
.ij-co-card .ij-co-logo.all { background: linear-gradient(135deg, #0d1b40 0 50%, #4c0d21 50% 100%); }
.ij-hero-eyebrow { flex-wrap: wrap; }
@media (max-width: 640px) {
  .ij-co-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ij-co-card { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border-radius: 16px; }
  .ij-co-card .ij-co-logo { width: 28px !important; height: 28px !important; border-radius: 9px; font-size: 13px !important; }
  .ij-co-card b { font-size: 20px; }
  .ij-co-card small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .ij-co-card::after { top: auto; bottom: 0; inset-inline: 14px; width: auto; height: 3px; }
  .ij-hero { padding: 18px 16px; }
}

/* smooth company change: the company colours are animatable, so header, sidebar and hero glide to
   the new company while the page content cross-fades (no reload, no blank screen) */
@property --ij-co { syntax: '<color>'; inherits: true; initial-value: #1e242e; }
@property --ij-co-2 { syntax: '<color>'; inherits: true; initial-value: #546278; }
/* the company colour changes at once: animating a custom property on <html> restyles the whole page every frame (that was the lag when switching company) — the content cross-fade carries the motion */
html { transition: none; }
.ij-swap-out { opacity: .45; transition: opacity 90ms var(--ij-ease); }
.ij-swap-in { animation: ij-swap 260ms var(--ij-ease-out) both; }
@keyframes ij-swap { from { opacity: .45; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { html { transition: none; } }

/* seasonal layer (one for the whole ERP): a band at the top, never interactive, gone in print */
.seasonal-flags { position: fixed; top: 0; left: 0; right: 0; width: 100%; height: 10vh; z-index: 24; pointer-events: none; user-select: none; -webkit-user-select: none; }
@media print { .seasonal-flags { display: none !important; } }
/* a segmented control without the sliding thumb (plain pages) still shows the chosen option */
.ij-seg:not(:has(> .ij-seg-thumb)) > :is(.is-on, [aria-selected="true"], [aria-pressed="true"], [aria-checked="true"]) { background: var(--ij-accent); color: #fff; box-shadow: var(--ij-glow); }

/* the one popup (replaces the browser's grey alert box in every system) */
.ij-alert-back { display: grid; place-items: center; padding: 20px; z-index: 130; }
.ij-alert-back.leaving { opacity: 0; transition: opacity 160ms; }
.ij-alert { width: min(420px, 100%); padding: 24px 22px 18px; text-align: center; display: grid; justify-items: center; gap: 12px; animation: ij-pop 240ms var(--ij-ease-out) both; }
.ij-alert-ic { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: var(--ij-accent); background: rgb(var(--ij-accent-rgb) / .1); }
.ij-alert-ic.bad { color: #b42318; background: rgb(239 68 68 / .1); }
.ij-alert-msg { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--ij-ink); white-space: pre-line; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; }
.ij-alert-ok { min-width: 120px; }
/* every system's own dialogs open and close with the same motion */
.modal-card, .ij-modal { animation: ij-pop 240ms var(--ij-ease-out) both; }

/* ═════════ portal ⇄ system transition (this side: opening a system) ═════════
   the tile grows into this page; the launcher behind recedes (scale .94, fade, blur 6px); the
   system's content fades in as the growth ends. The page's root element is the shared element. */
@view-transition { navigation: auto; }
#root { view-transition-name: ij-app; }
::view-transition-group(ij-app) { animation-duration: 340ms; animation-timing-function: cubic-bezier(.16, 1, .3, 1); border-radius: 18px; overflow: hidden; background: var(--ij-bg); }
::view-transition-old(ij-app) { animation: ijvt-out 140ms cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(ij-app) { animation: ijvt-in 200ms 130ms cubic-bezier(0, 0, .2, 1) both; }
::view-transition-old(root) { animation: ijvt-recede 320ms cubic-bezier(.16, 1, .3, 1) both; }
::view-transition-new(root) { animation: none; }
@keyframes ijvt-out { to { opacity: 0; } }
@keyframes ijvt-in { from { opacity: 0; } }
@keyframes ijvt-recede { to { opacity: 0; transform: scale(.95); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: ijvt-in 160ms ease both !important; }
  ::view-transition-old(*) { animation-name: ijvt-out !important; }
}

/* ── smart search (records + screens + suggestions) ── */
.ij-search.ij-smart { width: 320px; }
@media (max-width: 1100px) { .ij-search.ij-smart { width: 230px; } }
.ij-smart-pop { min-width: 360px; max-height: min(70vh, 520px); overflow: auto; padding: 8px; }
.ij-smart-pop button { min-height: 48px; align-items: center; }
.ij-smart-kind { flex: none; min-width: 64px; text-align: center; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgb(var(--ij-accent-rgb) / .10); color: var(--ij-accent); }
.ij-smart-label { display: block; font-weight: 700; color: var(--ij-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ij-smart-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--ij-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ij-smart-head { margin: 4px 6px 8px; font-size: 11.5px; font-weight: 800; color: var(--ij-muted); }
.ij-smart-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 6px; }
.ij-smart-chips button { width: auto; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ij-line); background: var(--ij-surface-2); font-size: 12.5px; font-weight: 700; }
.ij-smart-chips button.recent { border-style: dashed; }
.ij-smart-chips button:hover { border-color: var(--ij-accent); color: var(--ij-accent); background: rgb(var(--ij-accent-rgb) / .08); }
.ij-smart-empty { margin: 0; padding: 14px 10px; font-size: 13px; color: var(--ij-muted); text-align: center; }
/* company-coloured text: the company colour in light mode, a light tint of it in dark mode */
.ij-co-text { color: var(--c, var(--ij-co)); }
html.dark .ij-co-text, html.ij-dark .ij-co-text, html[data-theme="dark"] .ij-co-text { color: color-mix(in srgb, var(--c, var(--ij-co)) 38%, #ffffff); }
.ij-ds .bg-red-500.text-white { background-color: #dc2626; }
/* dark mode: accent-coloured text uses the accent's light version (readable on dark surfaces) */
html.ij-dark .ij-btn.soft, html.dark .ij-btn.soft { background: rgb(var(--ij-accent-rgb) / .2); color: var(--ij-accent-on-dark); }

/* ═══ header v2 — ONE header for every system, in the style of the central dashboard: a light glass
   bar (dark glass in dark mode), always on top, shrinking a little once the page is scrolled ═══ */
.ij-head {
  --hd-fg: #0f172a; --hd-mute: #5b6678; --hd-btn: #ffffff; --hd-btn-bd: rgb(15 23 42 / .08); --hd-btn-hov: #f1f5f9; --hd-ring: #ffffff; --hd-ctl: 40px;
  color: var(--hd-fg); border-radius: 999px; padding: 8px; padding-top: calc(8px + var(--sat, 0px)); gap: 10px;
  background: rgb(255 255 255 / .78); border: 1px solid rgb(15 23 42 / .07);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 1px rgb(15 23 42 / .04), 0 18px 40px -24px rgb(15 23 42 / .35);
  transition: padding 220ms cubic-bezier(.2, .8, .2, 1), margin 220ms cubic-bezier(.2, .8, .2, 1), min-height 220ms cubic-bezier(.2, .8, .2, 1), box-shadow 220ms ease;
}
html.ij-dark .ij-head, html.dark .ij-head, html[data-theme="dark"] .ij-head {
  --hd-fg: #eef1f8; --hd-mute: rgb(238 241 248 / .62); --hd-btn: rgb(255 255 255 / .06); --hd-btn-bd: rgb(255 255 255 / .1); --hd-btn-hov: rgb(255 255 255 / .12); --hd-ring: #161c2a;
  background: rgb(22 28 42 / .72); border-color: rgb(255 255 255 / .09);
  box-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 24px 50px -28px rgb(0 0 0 / .8);
}
@media (max-width: 760px) { .ij-head { border-radius: 22px; } }
.ij-head.is-compact { --hd-ctl: 34px; padding: 5px 6px; padding-top: calc(5px + var(--sat, 0px)); margin-top: 6px; min-height: 46px; }
.ij-head.is-compact .ij-head-title small { display: none; }
.ij-head.is-compact .ij-head-mark { width: 30px; height: 30px; font-size: 13px; }
.ij-head-title { flex-direction: row; align-items: center; gap: 10px; }
.ij-head-tt { min-width: 0; display: flex; flex-direction: column; }
.ij-head-title b { color: var(--hd-fg); font-size: 16px; font-weight: 700; transition: font-size 220ms ease; }
.ij-head.is-compact .ij-head-title b { font-size: 14.5px; }
.ij-head-title small { color: var(--hd-mute); }
.ij-head-mark { width: 38px; height: 38px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--ij-font-display); font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--ij-accent), color-mix(in srgb, var(--ij-accent) 70%, #000)); box-shadow: 0 8px 18px -10px rgb(var(--ij-accent-rgb) / .9); transition: width 220ms ease, height 220ms ease; }
.ij-head .ij-hbtn { height: var(--hd-ctl); min-width: var(--hd-ctl); background: var(--hd-btn); color: var(--hd-fg); border-color: var(--hd-btn-bd); border-radius: 999px; transition: height 220ms ease, min-width 220ms ease, background-color 160ms ease; }
.ij-head .ij-hbtn:hover { background: var(--hd-btn-hov); }
.ij-head .ij-hbtn.home { padding: 0 16px; background: var(--hd-btn); color: var(--hd-fg); border: 1px solid var(--hd-btn-bd); box-shadow: 0 1px 2px rgb(15 23 42 / .06); }
.ij-head .ij-hbtn.home:hover { background: var(--hd-btn-hov); }
.ij-head .ijh-btn, .ij-head .ijh-user { border-radius: 999px; }
.ij-head .ijh-av { border-radius: 50%; }
.ij-head .ij-search input { height: var(--hd-ctl); border-radius: 999px; background: var(--hd-btn); border-color: var(--hd-btn-bd); color: var(--hd-fg); transition: height 220ms ease; }
.ij-head .ij-search input::placeholder { color: var(--hd-mute); }
.ij-head .ij-search input:focus { background: var(--hd-btn); border-color: var(--ij-accent); box-shadow: 0 0 0 3px rgb(var(--ij-accent-rgb) / .2); }
.ij-head .ij-search > svg { color: var(--hd-mute); top: 50%; transform: translateY(-50%); }
/* the company switcher in the header: the chosen company is a solid pill in the app colour */
.ij-head .ij-co-switch { background: var(--hd-btn); border-color: var(--hd-btn-bd); border-radius: 999px; }
.ij-head .ij-co-switch button { height: calc(var(--hd-ctl) - 8px); color: var(--hd-mute); border-radius: 999px; transition: height 220ms ease, color 160ms ease; }
.ij-head .ij-co-switch button:hover:not([aria-checked="true"]) { color: var(--hd-fg); }
.ij-head .ij-co-switch button[aria-checked="true"] { color: #fff; }
.ij-head .ij-co-switch .ij-co-thumb { background: var(--ij-accent); border-radius: 999px; box-shadow: 0 6px 14px -8px rgb(var(--ij-accent-rgb) / .9); }
.ij-head .ij-co-compact > * > button, .ij-head .ij-co-compact button { color: var(--hd-fg); }
/* the system's own slot (live pop-ups only now) takes no room */
.ij-head .ij-slot-quiet:empty { display: none; }
.ij-head .ij-search { width: clamp(170px, 17vw, 260px); }
/* company identity in the header: a thin line in the company colour at its base, and the chosen
   company in the switcher is a pill in the company's brand colour (Injaz blue, Nabdh rose) */
.ij-head { background-image: linear-gradient(90deg, transparent 8%, color-mix(in srgb, var(--ij-co-2, #546278) 70%, transparent) 50%, transparent 92%); background-size: 100% 2px; background-position: bottom; background-repeat: no-repeat; }
.ij-head .ij-co-switch .ij-co-thumb { background: linear-gradient(135deg, var(--ij-co-2, var(--ij-accent)), color-mix(in srgb, var(--ij-co, #1e242e) 60%, var(--ij-co-2, #546278))); box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--ij-co-2, #546278) 90%, transparent); }
