/* Atlys Online - maps the --atlys-* tokens (atlys-themes.css, generated) onto the desk's own variables.
   VERIFY every desk variable name below against the built v16 css (the platform's desk variables stylesheet).
   Anything that does not take effect is a name mismatch, not a design problem. */

:root,
[data-atlys-theme] {
  --primary: var(--atlys-green);
  --primary-color: var(--atlys-green);
  --bg-color: var(--atlys-surface);
  --fg-color: var(--atlys-surface-raised);
  --navbar-bg: var(--atlys-bg);
  --card-bg: var(--atlys-surface-raised);
  --modal-bg: var(--atlys-surface-raised);
  --control-bg: var(--atlys-surface);
  --border-color: var(--atlys-border);
  --text-color: var(--atlys-ink);
  --heading-color: var(--atlys-ink);
  --link-color: var(--atlys-green);
  --btn-primary: var(--atlys-green);
}

/* primary buttons: Atlys green, white text, a lighter green on hover */
.btn-primary,
.btn.btn-primary { background: var(--atlys-green); border-color: var(--atlys-green); color: #fff; }
.btn-primary:hover,
.btn-primary:focus,
.btn.btn-primary:hover { background: color-mix(in srgb, var(--atlys-green) 86%, #fff); border-color: transparent; color: #fff; }
.btn-primary:active { background: color-mix(in srgb, var(--atlys-green) 80%, #000); }

/* gold is the secondary accent: active tabs, focus rings, indicator pills */
.nav-link.active,
.nav-tabs .nav-link.active,
.form-tabs .nav-link.active { border-bottom-color: var(--atlys-gold) !important; }
:focus-visible { outline: 2px solid var(--atlys-gold); outline-offset: 2px; }

/* Anything that still advertises upstream. Selectors are best-effort; rebrand-audit.js is the source of truth. */
.footer-powered,
.web-footer .footer-powered,
.desk-footer .powered-by,
.promotional-banners,
[data-label="About"] { display: none !important; }

/* Layered, runtime-recolourable logo:  <div class="atlys-logo"><span data-l="ink"></span>...</div> */
.atlys-logo { position: relative; aspect-ratio: 862 / 827; width: var(--atlys-logo-width, 220px); }
.atlys-logo > span {
  position: absolute; inset: 0;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  background: var(--c);
}
.atlys-logo > span[data-l="ink"]   { --m: url(/assets/atlys_online/brand/logo/layers/ink.png);   --c: var(--atlys-logo-ink); }
.atlys-logo > span[data-l="gold"]  { --m: url(/assets/atlys_online/brand/logo/layers/gold.png);  --c: var(--atlys-logo-gold); }
.atlys-logo > span[data-l="green"] { --m: url(/assets/atlys_online/brand/logo/layers/green.png); --c: var(--atlys-logo-green); }

/* ---- desk: Atlys colour coding -------------------------------------------------------------------------------------
   App tiles on the home screen and the sidebar header are images drawn in the platform's blue. Rotating their hue
   moves them onto the Atlys green; greys and whites are unaffected by a hue rotation. */
img[src*="/icons/desktop_icons/"] { filter: hue-rotate(-47deg) saturate(.78) brightness(.86); }
/* our own logo must keep its colours */
.navbar-brand img,
img.app-logo[src*="/brand/logo/"] { filter: none; }

/* navbar logo: a little larger so the wordmark reads */
.navbar-home img { height: 40px; width: auto; max-height: 40px; }

/* home screen tiles: the stock padding leaves 95px for the name, so Manufacturing, Subcontracting and Administration were
   cut short with an ellipsis; a slimmer side padding gives them the room (the tile itself stays the same size) */
.icons .desktop-icon { padding-left: 6px; padding-right: 6px; }
.desktop-modal-body .icons .desktop-icon { padding-left: 6px !important; padding-right: 6px !important; }

/* ---- home screen quick actions (built in atlys.js) ------------------------------------------------------------------ */
.atlys-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 1100px; margin: 56px auto 0; padding: 0 20px; }
.desktop-container:has(> .atlys-quick) { flex-direction: column; justify-content: flex-start; }
.desktop-container > .atlys-quick + .icons-container { margin-top: 24px; }
.atlys-quick-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--atlys-border);
  background: var(--atlys-surface-raised); color: var(--atlys-ink); font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.atlys-quick-btn span { color: var(--atlys-green); font-weight: 700; font-size: 1rem; line-height: 1; }
.atlys-quick-btn:hover { border-color: var(--atlys-green); }
.atlys-quick-btn.is-primary { background: var(--atlys-green); border-color: var(--atlys-green); color: #fff; }
.atlys-quick-btn.is-primary span { color: #fff; }
.atlys-quick-btn.is-primary:hover { background: color-mix(in srgb, var(--atlys-green) 86%, #fff); }

/* simple interface: items hidden on module pages and sidebars (atlys.js, trim_pages) */
.atlys-hide { display: none !important; }

/* ---- About box (our own dialog, built in atlys.js) --------------------------------------------------------------- */
.atlys-about { text-align: center; padding: 6px 4px 2px; }
.atlys-about-logo { display: block; width: 140px; height: auto; margin: 2px auto 10px; }
.atlys-about-name { font-size: 1.25rem; font-weight: 600; color: var(--atlys-ink); }
.atlys-about-tag { color: var(--text-muted, var(--atlys-ink)); margin: 2px 0 16px; }
.atlys-about-rows { text-align: left; border-top: 1px solid var(--atlys-border); }
.atlys-about-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--atlys-border); }
.atlys-about-row a { color: var(--atlys-green); font-weight: 500; }
.atlys-about-foot { margin-top: 14px; font-size: 0.8125rem; color: var(--text-muted, var(--atlys-ink)); }

/* ---- Appearance picker (administrators; built in atlys.js) ---------------------------------------------------------- */
.atlys-appearance-note { color: var(--text-muted, var(--atlys-ink)); margin: 0 0 12px; }
.atlys-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.atlys-swatch { display: block; padding: 6px; border: 2px solid var(--border-color, var(--atlys-border)); border-radius: 10px; background: transparent; text-align: center; cursor: pointer; }
.atlys-swatch:hover { border-color: var(--atlys-green); }
.atlys-swatch.is-current { border-color: var(--atlys-gold); }
.atlys-swatch-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; border: 1px solid var(--atlys-border); background-color: var(--atlys-bg); background-size: cover; background-position: center; }
.atlys-swatch-art img { width: 44%; height: auto; }
.atlys-swatch-name { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--text-color, var(--atlys-ink)); }
