/* NALQIVO ERP — Batch 1 shell refinements.
 *
 * Additive layer on top of app.css. It only styles the new header controls,
 * the complete application menu (favourites + pin markers) and the grouped
 * Apps screen. No layout is removed and the horizontal contextual tabs stay
 * exactly as they are.
 */

/* ---- Header: current application identity -------------------------------- */
.topbar-divider {
  width: 1px;
  height: 26px;
  flex: 0 0 auto;
  background: var(--line);
  margin-inline: 2px;
}

.topbar-app {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 190px;
  padding: 4px 10px;
  border-radius: var(--nq-radius-pill);
  background: var(--brand-50);
  color: var(--brand-2);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Header: language control (uses the existing .lang-btn hook) -------- */
.lang-btn {
  height: 31px;
  min-width: 42px;
  border-radius: var(--nq-radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  padding: 0 8px;
  transition: border-color var(--nq-transition), color var(--nq-transition), background var(--nq-transition);
}
.lang-btn:hover { border-color: var(--brand-200); color: var(--brand); background: var(--brand-50); }
.lang-btn:focus-visible { outline: none; box-shadow: var(--nq-focus-ring); }
.lang-btn:disabled { opacity: 0.55; cursor: progress; }

/* Keep the action cluster comfortable without changing existing order. */
.topbar-actions { gap: 4px; }

/* ---- Complete application menu ------------------------------------------ */
.apps-menu {
  --apps-menu-cols: repeat(auto-fill, minmax(178px, 1fr));
}

.apps-menu-item {
  position: relative;
}

.apps-menu-item.is-pinned {
  background: var(--brand-50);
  border-color: var(--brand-100);
}

.apps-menu-pin {
  position: absolute;
  top: 7px;
  inset-inline-end: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(108, 76, 241, 0.3);
}

.apps-menu-pin svg { width: 8px; height: 8px; }

.apps-menu-group[data-apps-group="favorites"] .apps-menu-head {
  color: var(--brand-2);
}

.apps-menu-empty { gap: 8px; }

/* Context menu (shared with the launcher) keeps its right-click behaviour. */
.apps-menu-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted-2);
}

/* ---- Apps screen: functional groups + pinned strip ---------------------- */
.store-group {
  margin-top: 22px;
}

.store-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.store-group-head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.store-pinned {
  margin-top: 18px;
}

.store-pinned .odoo-apps-grid {
  padding: 12px;
  border: 1px solid var(--brand-100);
  border-radius: var(--nq-radius-lg);
  background: var(--brand-50);
}

.store-card-pin {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
}

.store-card-pin svg { width: 9px; height: 9px; }

.odoo-apps-store .odoo-app { position: relative; }

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 1100px) {
  .topbar-inner { gap: 10px; }
  .topbar-app { max-width: 140px; }
  .search-kbd { display: none; }
}

@media (max-width: 980px) {
  .topbar-divider,
  .topbar-app { display: none; }
  .apps-menu { --apps-menu-cols: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 760px) {
  .lang-btn { min-width: 36px; height: 29px; padding: 0 5px; font-size: 10.5px; }
  .store-pinned .odoo-apps-grid { padding: 10px; }
}

@media (max-width: 620px) {
  /* Two compact rows on the phone: brand mark + every action, then search.
     The wordmark is decorative; the logo keeps the identity and the current
     application is named by the contextual bar inside the app. */
  .topbar-inner { gap: 5px; }
  .brand { gap: 0; }
  .brand-name { display: none; }
  .brand img { width: 34px; height: 34px; }
  .topbar-actions { gap: 0; }
  .icon-btn { width: 38px; height: 38px; }
  .lang-btn { min-width: 32px; height: 30px; padding: 0 4px; }
  .user-chip { gap: 2px; padding: 0; }
  .user-chip .avatar { width: 32px; height: 32px; }
  .search-shell { flex-basis: 100%; }
}

@media (max-width: 380px) {
  /* Extra-small phones: approvals stays reachable from its module. */
  .topbar-actions .icon-btn[data-top="approvals"] { display: none; }
}
