/*
 * layout.css: the shell only. Left navigation attached to the left edge
 * (collapsible to a slim rail; a drawer on phones), and the content side.
 * Markup is written by js/shell.js.
 */

.app {
  display: flex;
  min-height: 100svh;
}

/* ---------- left navigation ----------
   Redesigned 1 Oct to the reference's look (sizes scaled to our 14px type):
   a white panel with a hairline edge, a 60px head under a hairline, quiet
   36px rows, small uppercase group labels, Settings and the person at the
   foot between faint lines. */
.sidebar {
  --sb-w: 256px;
  --sb-pad: 14px; /* rows sit this far in from both edges */
  position: sticky;
  top: 0;
  flex: none;
  width: var(--sb-w);
  height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  color: var(--nav-text);
  background: var(--nav-bg);
  border-inline-end: 1px solid var(--nav-line);
  z-index: 20;
  transition: width 0.2s ease;
}
.sidebar[data-collapsed="true"] {
  --sb-w: 64px;
}

/* head: logo tile and name, a hairline under it */
.sidebar__head {
  height: 60px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: 0;
  padding-inline: 16px 12px;
  border-bottom: 1px solid var(--nav-line);
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
}
.brand__mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--nav-logo);
  color: var(--nav-logo-ink);
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.brand__dot {
  color: var(--om-accent);
}
.brand__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--nav-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collapse-btn {
  margin-inline-start: auto;
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--nav-label);
  transition: color 0.15s ease, background 0.15s ease;
}
.collapse-btn:hover {
  color: var(--nav-text-strong);
  background: var(--nav-hover);
}
[dir="rtl"] .collapse-btn svg {
  transform: scaleX(-1);
}

/* the menu */
.sidebar__nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px var(--sb-pad) 16px;
}
.nav-group + .nav-group {
  margin-top: 20px;
}
.nav-group__label {
  height: 16px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nav-label);
  white-space: nowrap;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--nav-text);
  white-space: nowrap;
  overflow: hidden;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-item svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--nav-icon);
}
.nav-item:hover {
  background: var(--nav-hover);
  color: var(--nav-text-strong);
}
.nav-item[aria-current="page"] {
  background: var(--nav-active);
  color: var(--nav-text-strong);
  font-weight: 500;
}
.nav-item[aria-current="page"] svg,
.nav-item:hover svg {
  color: var(--nav-text-strong);
}
/* Alerts: how many are open (red, like the open dot in Alerts History) */
.nav-item {
  position: relative;
}
.nav-badge {
  min-width: 20px;
  height: 20px;
  margin-inline-start: auto;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ag-red);
  color: var(--ag-on-colour);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nav-item[aria-expanded="true"] {
  background: var(--nav-hover);
  color: var(--nav-text-strong);
}

/* the in-app alerts list that opens from it */
.al-popmenu {
  max-width: min(400px, calc(100vw - 16px));
}
.al-pop {
  align-items: flex-start;
  gap: 10px;
  padding-block: 10px;
}
.al-pop__dot {
  width: 8px;
  height: 8px;
  flex: none;
  margin-top: 6px;
  border-radius: 999px;
}
.al-pop__dot--open {
  background: var(--ag-red);
}
.al-pop__dot--done {
  background: var(--ag-live);
}
.al-pop .menu__item-text {
  flex: 1;
  min-width: 0;
}
.al-pop__title {
  font-weight: 600;
}
.al-pop__go {
  flex: none;
  margin-top: 1px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.al-pop__none {
  padding: 10px 12px 12px;
  font-size: 13.5px;
  color: var(--muted-foreground);
}

/* foot: Settings, then the project and the person, each above a faint line */
.sidebar__foot {
  flex: none;
  display: flex;
  flex-direction: column;
}
.sidebar__settings {
  padding: 2px var(--sb-pad);
  border-top: 1px solid var(--nav-line-faint);
}
.sidebar__people {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px var(--sb-pad) 12px;
  border-top: 1px solid var(--nav-line-faint);
}
.foot-row {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 6px;
  padding-inline: 4px 8px;
  border-radius: 8px;
  text-align: start;
  color: var(--nav-text);
  transition: background 0.15s ease;
}
.foot-row:hover,
.foot-row[aria-expanded="true"] {
  background: var(--nav-hover);
}
.foot-row__tile {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--nav-active);
  color: var(--nav-icon);
}
.foot-row__text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.foot-row__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: var(--nav-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.foot-row__sub {
  font-size: 12px;
  line-height: 16px;
  color: var(--nav-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.foot-row__chev {
  margin-inline-start: auto;
  display: grid;
  color: var(--nav-label);
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--nav-active);
  color: var(--nav-text);
  font-size: 12px;
  font-weight: 500;
}

/* collapsed: a 64px rail of centred icons */
.sidebar[data-collapsed="true"] .sidebar__head {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  height: 96px;
  padding: 0;
}
.sidebar[data-collapsed="true"] .collapse-btn {
  margin: 0;
}
.sidebar[data-collapsed="true"] .sidebar__nav,
.sidebar[data-collapsed="true"] .sidebar__settings,
.sidebar[data-collapsed="true"] .sidebar__people {
  padding-inline: 0;
  align-items: center;
}
.sidebar[data-collapsed="true"] .nav-group__label {
  display: none;
}
.sidebar[data-collapsed="true"] .nav-group + .nav-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--nav-line-faint);
}
.sidebar[data-collapsed="true"] .nav-item {
  width: 36px;
  padding: 0;
  justify-content: center;
}
/* collapsed: the count becomes a small dot on the bell */
.sidebar[data-collapsed="true"] .nav-item .nav-badge {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  min-width: 8px;
  width: 8px;
  height: 8px;
  padding: 0;
  font-size: 0;
  box-shadow: 0 0 0 2px var(--nav-bg, var(--background));
}
.sidebar[data-collapsed="true"] .nav-item span:not(.nav-badge),
.sidebar[data-collapsed="true"] .brand__name,
.sidebar[data-collapsed="true"] .foot-row__text,
.sidebar[data-collapsed="true"] .foot-row__chev {
  display: none;
}
.sidebar[data-collapsed="true"] .foot-row {
  width: 40px;
  min-height: 40px;
  padding: 4px;
  justify-content: center;
}

/* ---------- the content side ---------- */
.inset {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
/* Agents list and Create agent: the faint trace of the haze */
.inset[data-surface="faint"] {
  background: color-mix(in srgb, var(--om-plain) var(--om-plain-veil), transparent);
}
/* agent screens: a solid warm off-white (white fields stand out on it) */
.inset[data-surface="solid"] {
  background: var(--om-solid);
}

.mobile-bar {
  display: none;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 16px;
}
.inset[data-surface="solid"] .mobile-bar {
  height: 48px;
  border-bottom: 1px solid var(--om-tray-edge);
}

.main {
  width: 100%;
  min-width: 0;
  padding: 0 40px 64px;
}
.main__inner {
  width: 100%;
  min-width: 0;
  max-width: 1152px;
  margin: 0 auto;
}
/* agent screens fill the height so the Back / Next bar sits at the bottom */
.inset[data-surface="solid"] .main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
.inset[data-surface="solid"] .main__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- phones: the navigation becomes a drawer ---------- */
.sidebar-scrim {
  display: none;
}
@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 256px;
    max-width: 85vw;
    background: var(--nav-bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 60;
  }
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }
  .sidebar[data-mobile-open="true"] {
    transform: none;
  }
  /* the phone drawer always opens at full width, even if the rail was chosen */
  .sidebar[data-collapsed="true"] {
    --sb-w: 256px;
  }
  .sidebar[data-collapsed="true"] .sidebar__head {
    flex-direction: row;
    height: 60px;
    padding-block: 0;
    padding-inline: 16px 12px;
  }
  .sidebar[data-collapsed="true"] .collapse-btn {
    margin-inline-start: auto;
  }
  .sidebar[data-collapsed="true"] :is(.sidebar__nav, .sidebar__settings, .sidebar__people) {
    padding-inline: var(--sb-pad);
    align-items: stretch;
  }
  .sidebar[data-collapsed="true"] .nav-group__label {
    display: flex;
  }
  .sidebar[data-collapsed="true"] .nav-group + .nav-group {
    margin-top: 20px;
    padding-top: 0;
    border-top: 0;
  }
  .sidebar[data-collapsed="true"] .nav-item {
    width: auto;
    padding: 0 10px;
    justify-content: flex-start;
  }
  .sidebar[data-collapsed="true"] :is(.nav-item span, .brand__name, .foot-row__text) {
    display: revert;
  }
  .sidebar[data-collapsed="true"] .foot-row__text {
    display: grid;
  }
  .sidebar[data-collapsed="true"] .foot-row__chev {
    display: grid;
  }
  .sidebar[data-collapsed="true"] .foot-row {
    width: 100%;
    min-height: 48px;
    padding-block: 6px;
    padding-inline: 4px 8px;
    justify-content: flex-start;
  }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: var(--overlay);
  }
  .sidebar[data-mobile-open="true"] + .sidebar-scrim {
    display: block;
  }
  .mobile-bar {
    display: flex;
  }
  .main {
    padding: 0 16px 64px;
  }
}

/* ---------- a group in the menu (Conversations: All conversations, Customer 360) ---------- */
.nav-item--group {
  width: 100%;
  text-align: start;
}
.nav-item--group[aria-expanded="true"] {
  background: transparent;
  color: var(--nav-text);
}
.nav-item--group[aria-expanded="true"]:hover {
  background: var(--nav-hover);
  color: var(--nav-text-strong);
}
.nav-item__chev {
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  color: var(--nav-icon);
  transition: transform 0.15s ease;
}
.nav-item--group[aria-expanded="false"] .nav-item__chev {
  transform: rotate(-90deg);
}
[dir="rtl"] .nav-item--group[aria-expanded="false"] .nav-item__chev {
  transform: rotate(90deg);
}
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 0;
  padding: 0;
  padding-inline-start: 28px;
  list-style: none;
}
.nav-sub[hidden] {
  display: none;
}
.nav-item--sub {
  height: 32px;
  font-size: 13.5px;
}

/* Live calls: how many calls are going on now (green, like the live dot) */
.nav-badge--live {
  background: var(--ag-live);
}

/* ---------- the account menu (board 21A) ---------- */
.avatar {
  overflow: hidden;
}
.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar--md {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.acct-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 6px;
}
.acct-head__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.acct-head__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}
.acct-head__mail {
  font-size: 12px;
  color: var(--om-ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: start;
  unicode-bidi: plaintext;
}
.acct-head__role {
  margin-top: 3px;
  font-size: 12px;
  color: var(--om-ink-soft);
}
/* Language and Theme: a label and a small switch */
.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding-inline: 10px 4px;
}
.acct-row__label {
  font-size: 14px;
}
.acct-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--om-select);
}
.menu .acct-seg__opt {
  width: 30px;
  min-height: 26px;
  padding: 0;
  justify-content: center;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--om-ink-soft);
}
.menu .acct-seg__opt svg {
  width: 15px;
  height: 15px;
}
.menu .acct-seg__opt:hover,
.menu .acct-seg__opt[data-active="true"] {
  background: transparent;
  color: var(--foreground);
}
.menu .acct-seg__opt[aria-checked="true"] {
  background: var(--popover);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

/* ---------- the project switcher (board 21B) ---------- */
.prj-menu {
  padding: 6px;
  max-height: min(480px, calc(100vh - 16px));
  display: flex;
  flex-direction: column;
}
.prj-find {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
}
.prj-find > svg {
  position: absolute;
  inset-inline-start: 10px;
  color: var(--om-ink-soft);
  pointer-events: none;
}
.prj-find__input {
  width: 100%;
  height: 36px;
  padding-inline: 32px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 13.5px;
}
.prj-find__input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.prj-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 4px;
}
.prj-org {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
  padding: 6px 10px;
  font-size: 13.5px;
  font-weight: 600;
}
.prj-dep {
  margin: 6px 0 2px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--om-ink-soft);
}
.prj-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: start;
  color: var(--foreground);
}
.prj-item:hover,
.prj-item:focus-visible,
.prj-item[aria-selected="true"] {
  background: var(--om-select);
  outline: none;
}
.prj-item__text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.prj-item__name {
  font-size: 14px;
  font-weight: 500;
}
.prj-item__sub {
  font-size: 12.5px;
  color: var(--om-ink-soft);
}
.prj-item__check {
  flex: none;
}
.prj-none {
  margin: 0;
  padding: 14px 10px;
  font-size: 13.5px;
  color: var(--om-ink-soft);
}
.prj-act {
  color: var(--foreground);
  text-decoration: none;
}
.menu.acct-menu {
  max-height: calc(100vh - 16px);
}
/* the account menu and the project switcher open over the white sidebar:
   a clear edge and a deeper shadow so they stand out from it (3 Oct 2026) */
.menu.acct-menu,
.menu.prj-menu,
.ap-skin .menu.acct-menu,
.ap-skin .menu.prj-menu {
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.38), 0 8px 20px -8px rgba(0, 0, 0, 0.22);
}
:root[data-theme="dark"] .menu.acct-menu,
:root[data-theme="dark"] .menu.prj-menu,
:root[data-theme="dark"] .ap-skin .menu.acct-menu,
:root[data-theme="dark"] .ap-skin .menu.prj-menu {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 40px -10px rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .menu.acct-menu,
  :root:not([data-theme="light"]) .menu.prj-menu,
  :root:not([data-theme="light"]) .ap-skin .menu.acct-menu,
  :root:not([data-theme="light"]) .ap-skin .menu.prj-menu {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 40px -10px rgba(0, 0, 0, 0.7);
  }
}

/* project thumbnails (5 Oct 2026, trial): a round picture per project, shell.js projectThumb */
.prj-thumb {
  flex: none;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}
.foot-row__thumb {
  width: 32px;
  height: 32px;
}
.prj-item__thumb {
  width: 28px;
  height: 28px;
}

/* agent thumbnails (5 Oct 2026): a round picture per agent, shell.js agentThumb */
.agent-thumb {
  flex: none;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}
.ag-card__thumb {
  width: 36px;
  height: 36px;
}
.agent-head__thumb {
  width: 40px;
  height: 40px;
}
/* the agent's picture in a frame that used to hold the voice's face (Shell.agentFace) */
.ag-face.agent-face {
  background: none;
}
.ag-face.agent-face img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
}
/* beside an agent's name in a row, table cell or drawer line */
.agent-thumb--inline {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-inline-end: 8px;
  vertical-align: -5px;
}
