/* NEP ERP v1.0.0 - interface styles - BY NEPTUNE LC
   Colours, corners and spacing come from the theme variables (see core/lib/theme.php). */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--canvas-text);
  background: var(--canvas);
  font-feature-settings: "tnum" 0;
}
[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
kbd {
  font: 500 11px/1 "IBM Plex Sans", system-ui, sans-serif;
  padding: 3px 6px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--chip); color: var(--muted);
}
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.mono-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.link { font-weight: 500; font-size: 13px; }

/* ================= Rail ================= */
.rail {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 30;
  width: 88px; display: flex; flex-direction: column; align-items: center;
  background: var(--ink); color: var(--on-ink);
  padding: 14px 0 12px;
}
.rail-brand {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: var(--r-lg); margin-bottom: 14px;
  background: var(--ink-2); color: var(--accent);
}
.rail-brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; }
img.brand-mark.is-logo { width: 42px; height: 42px; object-fit: contain; }
.rail-nav { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; overflow-y: auto; scrollbar-width: none; }
.rail-item {
  position: relative; width: 74px; padding: 10px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: 0; background: transparent; color: var(--on-ink-muted);
  font-family: inherit; font-weight: 500; font-size: 11.5px; line-height: 1.2; text-align: center;
  border-radius: var(--r); cursor: pointer;
}
.rail-item i { font-size: 19px; }
.rail-item:hover { background: var(--ink-2); color: var(--on-ink); text-decoration: none; }
.rail-item.is-active, .rail-item.is-open { background: var(--ink-2); color: var(--on-ink); }
.rail-item.is-active i, .rail-item.is-open i { color: var(--rail-accent); }
.rail-item.is-active::before {
  content: ""; position: absolute; inset-inline-start: -7px; top: 12px; bottom: 12px;
  width: 3px; border-radius: 3px; background: var(--accent);
}
.rail-sign { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; color: var(--on-ink-muted); padding-top: 10px; }
.rail-sign b { font-weight: 600; letter-spacing: .02em; color: var(--on-ink); font-size: 10.5px; }

/* ================= Flyouts ================= */
.flyout {
  position: fixed; z-index: 29; inset-block: 0; inset-inline-start: 88px; width: 330px;
  background: var(--card); color: var(--text);
  border-inline-end: 1px solid var(--line);
  box-shadow: 18px 0 40px -24px rgba(10, 16, 28, .45);
  padding: 22px 14px; overflow-y: auto;
  animation: fly-in .16s ease-out;
}
[dir="rtl"] .flyout { box-shadow: -18px 0 40px -24px rgba(10, 16, 28, .45); }
@keyframes fly-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .flyout { animation-name: fly-in-rtl; }
@keyframes fly-in-rtl { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.flyout-head { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; color: var(--muted); }
.flyout-head h2 { font-size: 17px; color: var(--text); }
.flyout ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.flyout a { display: flex; gap: 12px; align-items: center; padding: 9px 8px; border-radius: var(--r); color: var(--text); }
.flyout a:hover, .flyout a.is-active { background: var(--hover); text-decoration: none; }
.flyout a.is-active b { color: var(--accent-deep); }
.fl-text { display: flex; flex-direction: column; min-width: 0; }
.fl-text b { font-weight: 500; }
.fl-text small { color: var(--muted); font-size: 12.5px; }

/* Coloured icon wells shared by tiles, flyouts, tables */
.well {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r); font-size: 17px;
  background: color-mix(in srgb, var(--tile, var(--accent)) 14%, var(--card));
  color: color-mix(in srgb, var(--tile, var(--accent)) 88%, var(--text));
}
.well-sm { width: 32px; height: 32px; font-size: 14px; border-radius: var(--r-sm); }

/* ================= Shell / top bar ================= */
.shell { margin-inline-start: 88px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; background: var(--topbar); color: var(--on-topbar);
  border-bottom: 1px solid var(--topbar-line);
}
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--on-topbar-muted); font-size: 13.5px; }
.crumbs a { color: var(--on-topbar-muted); }
.crumbs .sep { font-size: 9px; opacity: .7; }
.crumb-current { color: var(--on-topbar); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.palette-open {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; min-width: 230px;
  border: 1px solid var(--topbar-line); border-radius: var(--r); background: var(--topbar-soft);
  color: var(--on-topbar-muted); font: inherit; cursor: pointer;
}
.palette-open span { flex: 1; text-align: start; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px;
  border: 0; border-radius: var(--r); background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.topbar .icon-btn:hover { background: var(--topbar-soft); }
.lang-switch { margin: 0; }
.usermenu { position: relative; }
.avatar-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: var(--r); }
.avatar-btn:hover { background: var(--topbar-soft); }
.avatar-btn .who { display: flex; flex-direction: column; text-align: start; line-height: 1.2; }
.avatar-btn .who small { color: var(--on-topbar-muted); font-size: 11.5px; }
.avatar-btn > i { font-size: 10px; color: var(--on-topbar-muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13px;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 76px; height: 76px; font-size: 26px; }
.popover {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 220px; z-index: 40;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 6px; box-shadow: 0 16px 40px -16px rgba(10, 16, 28, .35);
}
.popover a, .popover button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; background: transparent; color: var(--text); font: inherit; text-align: start;
  border-radius: var(--r-sm); cursor: pointer;
}
.popover a:hover, .popover button:hover { background: var(--hover); text-decoration: none; }
.popover i { width: 16px; color: var(--muted); }
.popover form { margin: 0; border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 4px; }

.content { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 32px 40px; }
.content.is-wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--canvas-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.app-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 32px; font-size: 12px; color: var(--canvas-muted); border-top: 1px solid var(--canvas-line);
}
.signature b { color: var(--canvas-text); font-weight: 600; letter-spacing: .03em; }

/* ================= Controls ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid transparent; background: var(--accent); color: var(--on-accent);
  font-family: inherit; font-weight: 500; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--hover); filter: none; }
.btn-danger { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea, .color-pair input[data-hex] {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit;
}
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field .hint { color: var(--faint); font-size: 12px; }
.field .error { color: var(--danger); font-size: 12.5px; font-weight: 500; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.pw { position: relative; display: block; }
.pw input { padding-inline-end: 44px; }
.pw .icon-btn { position: absolute; inset-inline-end: 2px; top: 1px; color: var(--muted); }
.check-line { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 40px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--accent); }

.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--r); background: var(--chip); border: 1px solid var(--line-2); flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; font-weight: 500; color: var(--muted); }
.seg input:checked + span { background: var(--card); color: var(--accent-deep); box-shadow: 0 1px 2px rgba(10, 16, 28, .12); }
.seg input:focus-visible + span { outline: 3px solid var(--accent-ring); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-neutral { background: var(--chip); color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent-deep); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); margin-bottom: 16px; font-weight: 500; }
.notice i { margin-top: 3px; }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-info { background: var(--info-soft); color: var(--info); }

/* ================= Cards, forms, grids ================= */
.card { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: var(--pad) var(--pad-l); border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 15px; }
.form-stack { display: grid; gap: 18px; }
.form-card { padding: var(--pad-l); display: grid; gap: 18px; }
.form-card-head { display: flex; gap: 14px; align-items: flex-start; }
.form-card-head > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-deep); flex: none; }
.form-card-head h2 { font-size: 16px; }
.form-card-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5; padding: 14px var(--pad-l);
  background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(6px);
  border-top: 1px solid var(--canvas-line); margin: 0 calc(var(--pad-l) * -1);
}
.sticky-actions .muted { margin-inline-end: auto; color: var(--canvas-muted); }
.sticky-actions .is-unsaved { color: var(--warn); font-weight: 500; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state > i { font-size: 34px; color: var(--faint); }
.empty-state h2 { font-size: 17px; color: var(--text); }
.empty-state p { max-width: 46ch; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts-wide { padding: var(--pad-l); }
.plain-list { list-style: none; margin: 0; padding: var(--pad) var(--pad-l); display: grid; gap: 2px; }
.plain-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.plain-list li:last-child { border-bottom: 0; }

/* ================= Tables and lists ================= */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: var(--pad) var(--pad-l); margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text);
}
.field-inline { min-width: 150px; flex: 0 1 200px; }
.field-inline:first-of-type { flex: 1 1 240px; }
.filters-actions { display: flex; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: var(--pad-s) var(--pad); background: var(--chip); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: var(--pad) var(--pad); border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.th-sort { color: inherit; display: inline-flex; align-items: center; gap: 6px; }
.th-sort i { font-size: 10px; opacity: .45; }
.th-sort.is-active { color: var(--accent-deep); }
.th-sort.is-active i { opacity: 1; }
.th-sort:hover { text-decoration: none; color: var(--text); }
.col-actions { text-align: end; white-space: nowrap; }
.col-actions form { display: inline; }
.col-details details summary { cursor: pointer; color: var(--accent-deep); font-weight: 500; }
.col-details pre { margin: 8px 0 0; max-width: 420px; max-height: 240px; overflow: auto; font-size: 12px; background: var(--chip); padding: 8px 10px; border-radius: var(--r-sm); }
.cell-title { display: flex; align-items: center; gap: 12px; }
.cell-title div { display: flex; flex-direction: column; }
.pager { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: var(--pad-s) var(--pad); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager-size { margin: 0; }
.pager-size label { display: flex; align-items: center; gap: 8px; }
.pager-size select { height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--text); padding: 0 6px; font: inherit; }
.pager-nav { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

/* ================= Home launcher ================= */
.launch-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 6px 0 26px; }
.launch-hello h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 600; letter-spacing: -0.02em; }
.launch-hello p { color: var(--canvas-muted); margin-top: 6px; }
.launch-search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px 0 16px; width: min(420px, 100%);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--muted);
  box-shadow: 0 1px 2px rgba(10, 16, 28, .05);
}
.launch-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.launch-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; min-width: 0; }
.launch-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.launch-body:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.launch-apps { display: grid; gap: 26px; }
.app-group h2 { font-size: 14px; font-weight: 600; color: var(--canvas-muted); display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; min-height: 124px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg);
  position: relative; overflow: hidden;
}
.tile::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px;
  background: var(--tile); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
[dir="rtl"] .tile::after { transform-origin: right; }
.tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tile) 45%, var(--line)); }
.tile:hover::after, .tile:focus-visible::after { transform: scaleX(1); }
.tile .well { margin-bottom: 10px; }
.tile b { font-weight: 600; font-size: 14.5px; }
.tile small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.launch-none { padding: 20px 0; }
.launch-side { position: sticky; top: 80px; }
.activity { list-style: none; margin: 0; padding: 6px var(--pad-l) var(--pad); }
.activity li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.activity li:last-child { border-bottom: 0; }
.activity b { font-weight: 600; }
.activity small { display: block; color: var(--faint); font-size: 12px; }

.setup { padding: var(--pad-l); margin-bottom: 26px; border-inline-start: 4px solid var(--accent); }
.setup-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.setup-head h2 { font-size: 16px; }
.setup-head form { margin: 0; }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 20px; }
.setup-list li { display: flex; gap: 10px; align-items: center; }
.setup-list li i { color: var(--faint); font-size: 14px; }
.setup-list li.is-done { color: var(--muted); text-decoration: line-through; }
.setup-list li.is-done i { color: var(--ok); }
.setup-list a { font-weight: 500; }

/* ================= Palette ================= */
.palette { position: fixed; inset: 0; z-index: 60; background: rgba(8, 12, 20, .45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette-box { width: min(560px, 100%); background: var(--card); color: var(--text); border-radius: var(--r-xl); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
#palette-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
#palette-list a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); color: var(--text); }
#palette-list a b { font-weight: 500; flex: 1; }
#palette-list a small { color: var(--faint); }
#palette-list li.is-sel a, #palette-list a:hover { background: var(--accent-soft); text-decoration: none; }
.palette-empty { padding: 14px 18px 18px; color: var(--muted); }

/* ================= Appearance ================= */
.appearance { display: grid; gap: 18px; margin-bottom: 18px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.preset {
  display: flex; flex-direction: column; gap: 8px; padding: 8px; text-align: start;
  border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--card); color: var(--text);
  font-family: inherit; font-weight: 500; font-size: 13px; line-height: 1.3; cursor: pointer;
}
.preset:hover { border-color: var(--faint); }
.preset.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.preset-swatch { position: relative; display: block; height: 64px; border-radius: var(--r); overflow: hidden; }
.preset-swatch i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 22%; }
.preset-swatch em { position: absolute; top: 0; inset-inline-start: 22%; inset-inline-end: 0; height: 22%; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.preset-swatch u { position: absolute; inset-inline-start: 32%; bottom: 14%; width: 38%; height: 18%; border-radius: 4px; }
.color-pair { display: flex; gap: 8px; }
.color-pair input[type="color"] { width: 48px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); cursor: pointer; flex: none; }
.color-pair input[data-hex] { text-transform: uppercase; font-variant-numeric: tabular-nums; }
.logo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.logo-box { width: 160px; height: 100px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--chip); padding: 10px; }
.logo-box img { max-height: 80px; object-fit: contain; }
.logo-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; }
.logo-form .hint { width: 100%; color: var(--faint); font-size: 12px; }
.logo-row > form:last-child { margin: 0; }

/* ================= Account / about ================= */
.account-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { padding: 28px var(--pad-l); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.profile-card h2 { font-size: 18px; margin-top: 6px; }
.profile-card .facts { text-align: start; width: 100%; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.about-hero { display: flex; align-items: center; gap: 22px; padding: 26px var(--pad-l); margin-bottom: 20px; }
.about-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: var(--r-xl); background: var(--ink); color: var(--accent); padding: 16px; }
img.about-mark { object-fit: contain; background: var(--chip); padding: 8px; }
.about-hero h2 { font-size: 30px; letter-spacing: -0.02em; }
.about-version { color: var(--muted); }
.about-sign { margin-top: 6px; font-weight: 600; letter-spacing: .08em; color: var(--accent-deep); }
.about-grid { align-items: start; }

/* ================= Sign in ================= */
.login-page { background: var(--canvas); }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.login-brand {
  background: var(--ink); color: var(--on-ink); padding: 40px 48px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 30px; position: relative; overflow: hidden;
}
.login-brand::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  inset-inline-end: -220px; bottom: -200px; border: 70px solid var(--accent); opacity: .12;
}
.login-brand-top { display: flex; align-items: center; gap: 14px; position: relative; }
.login-brand-top b { display: block; font-size: 16px; }
.login-brand-top span { color: var(--on-ink-muted); font-size: 13px; }
.login-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--ink-2); color: var(--accent); padding: 11px; }
img.login-mark { object-fit: contain; background: #fff; padding: 6px; }
.login-brand-body { position: relative; }
.login-product { font-size: clamp(54px, 7vw, 92px); font-weight: 700; letter-spacing: -0.045em; line-height: .95; color: var(--on-ink); }
.login-lede { margin-top: 18px; font-size: 17px; max-width: 30ch; color: var(--on-ink-muted); }
.login-sign { position: relative; font-size: 12px; color: var(--on-ink-muted); }
.login-sign b { color: var(--rail-accent); letter-spacing: .06em; }
.login-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 18px; }
.login-form { width: min(380px, 100%); display: grid; gap: 16px; color: var(--canvas-text); }
.login-form h1 { font-size: 26px; }
.login-form .field > span:first-child { color: var(--canvas-muted); }
.login-lang { margin: 0; }

/* ================= Installer ================= */
.install-page { background: var(--canvas); }
.install { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.install-side { background: var(--ink); color: var(--on-ink); padding: 32px 26px; display: flex; flex-direction: column; gap: 30px; }
.install-brand { display: flex; align-items: center; gap: 12px; }
.install-brand b { display: block; font-size: 18px; }
.install-brand span { color: var(--on-ink-muted); font-size: 12.5px; }
.install-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; flex: 1; align-content: start; }
.install-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: var(--on-ink-muted); font-weight: 500; }
.install-steps li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--ink-3); font-size: 12px; }
.install-steps li.is-current { background: var(--ink-2); color: var(--on-ink); }
.install-steps li.is-current span { border-color: var(--accent); color: var(--rail-accent); }
.install-steps li.is-done span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.install-lang { color: var(--on-ink-muted); font-size: 13px; }
.install-sign { font-size: 11.5px; letter-spacing: .08em; color: var(--rail-accent); font-weight: 600; }
.install-main { padding: 48px clamp(20px, 5vw, 64px); max-width: 900px; width: 100%; color: var(--canvas-text); }
.inst-step { display: grid; gap: 18px; }
.inst-step h1 { font-size: 28px; }
.inst-step .field > span:first-child { color: var(--canvas-muted); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--card); color: var(--text); border: 1px solid var(--line); }
.checks li small { margin-inline-start: auto; color: var(--faint); }
.checks .is-ok i { color: var(--ok); }
.checks .is-bad { border-color: var(--danger); }
.checks .is-bad i { color: var(--danger); }
.checks .is-warn i { color: var(--warn); }
.acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.acc-card { margin: 0; padding: var(--pad-l); display: grid; gap: 12px; }
.acc-card legend { font-weight: 600; font-size: 16px; padding: 0 6px; display: flex; gap: 8px; align-items: center; }
.acc-card legend i { color: var(--accent-deep); }
.acc-card p { font-size: 13px; }
.install-finished { text-align: center; padding: 30px; display: grid; gap: 10px; justify-items: center; }
.install-finished > i { font-size: 44px; color: var(--ok); }
.install-done { max-width: 520px; margin: 12vh auto; padding: 32px; display: grid; gap: 14px; }

/* ================= Density ================= */
.density-compact { font-size: 13.5px; }
.density-compact .btn { height: 34px; }
.density-compact .field input, .density-compact .field select { height: 36px; }
.density-compact .tile { min-height: 108px; padding: 13px; }

/* ================= Responsive ================= */
@media (max-width: 1100px) {
  .launch-body { grid-template-columns: minmax(0, 1fr); }
  .launch-side { position: static; }
  .palette-open span, .palette-open kbd { display: none; }
  .palette-open { min-width: 0; }
}
@media (max-width: 860px) {
  .rail { inset-block: auto 0; inset-inline: 0; width: 100%; height: 66px; flex-direction: row; padding: 0 6px; }
  .rail-brand, .rail-sign { display: none; }
  .rail-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 2px; }
  .rail-item { width: 70px; flex: none; padding: 8px 2px 6px; }
  .rail-item.is-active::before { inset-inline: 18px; top: -1px; bottom: auto; width: auto; height: 3px; }
  .flyout { inset: auto 0 66px 0; width: auto; max-height: 70vh; border-radius: var(--r-xl) var(--r-xl) 0 0; border: 1px solid var(--line); }
  .shell { margin-inline-start: 0; padding-bottom: 66px; }
  .topbar { padding: 0 14px; }
  .avatar-btn .who, .avatar-btn > i, .lang-switch span { display: none; }
  .content { padding: 20px 16px 32px; }
  .grid-2, .grid-3, .acc-grid, .account-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-direction: column; align-items: flex-start; }
  .login, .install { grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 28px 24px; }
  .login-product { font-size: 52px; }
  .install-side { padding: 20px; gap: 16px; }
  .install-steps { grid-auto-flow: column; overflow-x: auto; }
  .install-steps li { white-space: nowrap; }
  .app-foot { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .rail, .topbar, .flyout, .filters, .pager, .app-foot, .page-actions { display: none !important; }
  .shell { margin: 0; }
  body { background: #fff; }
}

/* ================= Build 2: User management - BY NEPTUNE LC ================= */
.num { text-align: end; font-variant-numeric: tabular-nums; }
.table th.num { text-align: end; }
.num-input { text-align: end; font-variant-numeric: tabular-nums; }
.table tr.is-muted td { color: var(--faint); }
.cell-link { color: var(--text); }
.cell-link:hover { text-decoration: none; }
.cell-link:hover b { color: var(--accent-deep); text-decoration: underline; }
.pad { padding: var(--pad) var(--pad-l); }
.ok-ic { color: var(--ok); }
.danger-ic { color: var(--danger); }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-deep); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.is-dimmed { opacity: .5; }
.check-sm { min-height: 0; font-size: 13px; color: var(--muted); }
.check-sm input { width: 16px; height: 16px; }
.card-head h2 i { color: var(--muted); margin-inline-end: 6px; font-size: 14px; }
.form-card-head .well { width: 38px; height: 38px; }
.form-card.is-required { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

.user-card-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.user-card-grid .profile-card { position: sticky; top: 80px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.card-actions { width: 100%; display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.card-actions form { margin: 0; }
.reset-pw summary { list-style: none; }
.reset-pw summary::-webkit-details-marker { display: none; }
.reset-pw[open] summary { margin-bottom: 10px; }
.reset-pw .form-stack { gap: 10px; text-align: start; }
.facts-cols { grid-template-columns: max-content 1fr max-content 1fr; padding: var(--pad) var(--pad-l) var(--pad-l); gap: 10px 18px; }
.notes { white-space: normal; border-top: 1px solid var(--line-2); color: var(--muted); }

.grant-form { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(110px, 1fr)) auto; gap: 12px; align-items: end; padding: var(--pad) var(--pad-l) var(--pad-l); border-top: 1px solid var(--line-2); }

.member-list { list-style: none; margin: 0; padding: var(--pad) var(--pad-l); display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.member-list a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); color: var(--text); }
.member-list a:hover { background: var(--hover); text-decoration: none; }
.member-list span span { display: flex; flex-direction: column; line-height: 1.3; }
.members { margin-top: 18px; }
.org-form { margin-bottom: 18px; border-color: var(--accent); }

/* Permission matrix */
.matrix { display: grid; gap: 16px; }
.matrix-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: var(--pad) var(--pad-l); border-bottom: 1px solid var(--line); }
.matrix-head h3 { font-size: 15px; }
.matrix-table th[scope="row"] { background: transparent; color: var(--text); font-size: 14px; font-weight: 500; padding: var(--pad-s) var(--pad); white-space: nowrap; }
.matrix-table th[scope="row"] .linkish { margin-inline-start: 10px; opacity: 0; }
.matrix-table tr:hover th[scope="row"] .linkish, .matrix-table .linkish:focus-visible { opacity: 1; }
.matrix-table td { padding: var(--pad-s) var(--pad); }
.matrix-table .c { text-align: center; width: 1%; }
.matrix-table select, .matrix-table .num-input { height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--text); font: inherit; font-size: 13px; padding: 0 8px; }
.matrix-table .num-input { width: 120px; }
.mx { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); cursor: pointer; color: transparent; font-size: 13px; }
.mx input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.mx:hover { border-color: var(--faint); }
.mx.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mx:has(input:focus-visible) { outline: 3px solid var(--accent-ring); outline-offset: 1px; }
.mx:has(input:disabled) { cursor: not-allowed; opacity: .45; }
.mx:has(input:disabled) input { cursor: not-allowed; }
.mx.is-dev { border-style: dashed; }
.mx.demo { width: 20px; height: 20px; font-size: 10px; vertical-align: middle; cursor: default; }
.matrix-na { color: var(--faint); }
.matrix-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--canvas-muted); align-items: center; }

@media (max-width: 1100px) {
  .grant-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grant-form .grant-perm { grid-column: 1 / -1; }
  .facts-cols { grid-template-columns: max-content 1fr; }
}
@media (max-width: 860px) {
  .user-card-grid { grid-template-columns: minmax(0, 1fr); }
  .user-card-grid .profile-card { position: static; }
  .grant-form { grid-template-columns: minmax(0, 1fr); }
}
