/* PriCoSoft Cloud Launcher
   Colors: only the shared tokens of appearance.css (light/dark mode and color schemes); the only literal colors are
   the generic application tile colors below, with a light and a dark value. Known applications use their own icons
   (assets/apps/{key}.svg). */
:root {
  /* Aliases of the appearance.css color tokens. */
  --blue: var(--accent);
  --ink: var(--text);
  --muted: var(--text-muted);
  --line: var(--border);
  --canvas: var(--bg);
  --card: var(--surface);
  /* Generic application tile (gradient from → to, white glyph) for catalog entries without an own icon; it does not
     follow the color scheme, like the application icons. */
  --tile-glyph: #ffffff;
  --tile-default-from: #5b7fb8;
  --tile-default-to: #1b3a6b;
  --font: "Segoe UI", Inter, system-ui, sans-serif;
  /* Top bar height, the same in all PriCoSoft Cloud portals (CRM, Launcher, License Management, License Admin). */
  --bar: 64px;
}
/* Dark mode: tile colors slightly lighter and less deep, so the tiles stand out from dark surfaces. */
:root[data-mode="dark"] {
  --tile-default-from: #6a8dc6;
  --tile-default-to: #2a4c80;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
button {
  font: inherit;
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: var(--bar);
  background: var(--topbar);
  color: var(--topbar-text);
  display: flex;
  align-items: center;
  gap: 8px;
  /* Side padding matches the embedded CRM bar, so the waffle and the avatar stay in place when switching apps. */
  padding: 0 26px 0 11px;
  z-index: 40;
}
.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button:hover {
  background: var(--topbar-hover);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  white-space: nowrap;
  padding: 0 6px;
}
.brand strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.current-app {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 12px;
  border-left: 1px solid color-mix(in srgb, var(--topbar-text) 25%, transparent);
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.account-button {
  border: 0;
  background: transparent;
  padding: 4px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.app-menu,
.account-menu {
  position: fixed;
  top: calc(var(--bar) + 6px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px var(--shadow);
  z-index: 50;
}
.app-menu {
  left: 8px;
  width: 300px;
  padding: 8px;
  display: grid;
  gap: 2px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
}
.menu-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.menu-item > .icon {
  margin: 0 6px;
  color: var(--muted);
}
.menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tile-glyph);
  background: linear-gradient(135deg, var(--tile-default-from), var(--tile-default-to));
}
.account-menu {
  right: 12px;
  width: 300px;
  padding: 20px;
}
.account-menu p {
  margin: 2px 0 16px;
  color: var(--muted);
  word-break: break-all;
}
.secondary,
.primary {
  border-radius: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-accent);
}
main {
  padding-top: var(--bar);
  height: 100%;
}
.boot {
  min-height: calc(100vh - var(--bar));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  text-align: center;
}
.boot-logo {
  max-width: 80vw;
  height: auto;
}
.boot-hero {
  max-width: 80vw;
  height: auto;
  margin: 12px 0 8px;
}
.home {
  max-width: 1680px;
  margin: 0 auto;
  padding: 40px 24px;
}
.home h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.6px;
  margin: 0 0 4px;
}
.lead {
  color: var(--muted);
  margin: 0 0 28px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}
.tile:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px var(--shadow);
}
.tile-main {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 48px 20px 20px;
  color: inherit;
  border-radius: 12px;
}
.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tile-glyph);
  flex: none;
  background: linear-gradient(135deg, var(--tile-default-from), var(--tile-default-to));
}
.tile-icon .icon {
  width: 26px;
  height: 26px;
}
/* PriCoSoft Cloud application icon (assets/apps/{key}.svg): the image brings its own tile and corners. */
.tile-icon.app-image,
.menu-icon.app-image {
  background: none;
}
.app-image img {
  display: block;
  width: 100%;
  height: 100%;
}
.tile-text {
  display: grid;
  gap: 4px;
}
.tile-text strong {
  font-size: 16px;
  font-weight: 600;
}
.tile-text span {
  color: var(--muted);
}
.tile-external {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.tile-external:hover {
  background: var(--surface-2);
  color: var(--blue);
}
.empty,
.notice {
  margin-top: 24px;
  color: var(--muted);
}
.notice {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--surface));
}
.frames {
  height: calc(100vh - var(--bar));
}
.app-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}
/* Tenant links ("Your organization's apps"): own icon image, always open in a new tab. */
.links-section h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 36px 0 14px;
}
/* A link tile is .tile and .tile-main in one element; restore the card frame that .tile-main removes. */
.link-tile {
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
}
.link-tile:hover {
  text-decoration: none;
}
.link-icon {
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}
.link-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tile-icon.link-icon img {
  padding: 6px;
}
.link-external {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--muted);
}
.menu-secondary {
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  margin-top: 4px;
  color: var(--muted);
}
/* Shared top bar: the embedded app (e.g. CRM) draws the only bar; the Launcher bar is hidden and the
   app menu opens below the app's bar (CRM bar height 64px). */
.app-topbar .topbar {
  display: none;
}
.app-topbar main {
  padding-top: 0;
}
.app-topbar .frames {
  height: 100vh;
}
.app-topbar .app-menu {
  top: calc(var(--bar) + 6px);
}
@media (max-width: 600px) {
  .brand strong,
  .current-app {
    font-size: 14px;
  }
  .home {
    padding: 24px 16px;
  }
  .app-menu {
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* Bell: notifications of all applications. */
.bell {
  position: relative;
}
.bell-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}
.bell-menu {
  position: fixed;
  top: calc(var(--bar) + 6px);
  right: 12px;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100vh - var(--bar) - 24px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px var(--shadow);
  z-index: 50;
}
.bell-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--card);
}
.spacer {
  flex: 1;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 13px;
}
.text-button:hover {
  background: var(--surface-2);
}
.notice-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
  background: transparent;
  padding: 10px 14px;
  color: var(--ink);
}
.notice-item:hover {
  background: var(--surface-2);
}
.notice-item.unread {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.notice-item.notice-warning {
  border-left-color: var(--warning);
}
.notice-item.notice-critical {
  border-left-color: var(--danger);
}
.notice-item span,
.notice-item small,
.bell-hint,
.bell-empty {
  color: var(--muted);
}
.bell-empty,
.bell-hint {
  margin: 0;
  padding: 14px;
}
.bell-preferences {
  border-top: 1px solid var(--line);
  padding-bottom: 8px;
}
.bell-option {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 14px;
}
