/* Shell (owner 20.11): grouped menu with icons, on top or on the side (user's choice), side menu shrinks to icons. */

.ico { width: 18px; height: 18px; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn .ico { width: 16px; height: 16px; }
.btn .ico { width: 16px; height: 16px; }

.app { min-height: 100vh; }
.shell-main { min-width: 0; }

/* ---- menu on top */
.shell-top .nav { display: flex; align-items: stretch; gap: 8px; padding: 0 12px; }
.shell-top .nav-groups { display: flex; flex-wrap: wrap; align-items: stretch; flex: 1; min-width: 0; }
.shell-top .nav-group { display: flex; align-items: stretch; }
.shell-top .nav-group + .nav-group { border-inline-start: 1px solid var(--border); margin-inline-start: 6px; padding-inline-start: 6px; }
.shell-top .nav ul { display: flex; flex-wrap: wrap; gap: 2px; }
.shell-top .nav a { display: flex; align-items: center; gap: 7px; padding: 10px 10px 8px; }
.shell-top .nav a .ico { width: 17px; height: 17px; }
.shell-top .nav-tools { display: flex; align-items: center; }

/* ---- menu on the side (start side: right in Hebrew, left in English) */
.shell-side .shell-body { display: grid; grid-template-columns: 216px minmax(0, 1fr); align-items: start; }
.shell-side.nav-collapsed .shell-body { grid-template-columns: 60px minmax(0, 1fr); }
.shell-side .nav {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px 8px; border-bottom: 0; border-inline-end: 1px solid var(--border);
}
.shell-side .nav-group { margin-bottom: 10px; }
.shell-side .nav-group-title { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 10px; }
.shell-side .nav ul { display: flex; flex-direction: column; gap: 1px; flex-wrap: nowrap; }
.shell-side .nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  border-bottom: 0; white-space: nowrap;
}
.shell-side .nav a:hover { background: var(--surface-2); }
.shell-side .nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.shell-side .nav-tools { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.shell-side.nav-collapsed .nav { padding: 10px 6px; }
.shell-side.nav-collapsed .nav a, .shell-side.nav-collapsed .nav-tool { justify-content: center; padding: 9px 0; }
.shell-side.nav-collapsed .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell-side.nav-collapsed .nav-group + .nav-group { border-top: 1px solid var(--border); padding-top: 8px; }

/* collapse arrow points toward the menu's own edge in both directions */
html[dir="rtl"] .ico-collapse, html[dir="rtl"] .ico-expand { transform: scaleX(-1); }

.nav-tool {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; border-radius: var(--radius);
  color: var(--muted); padding: 8px 10px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.nav-tool:hover { background: var(--surface-2); color: var(--text); }

/* the page fills the space beside the side menu */
.shell-side .page { max-width: none; }

/* owner 21.11 (plan ui1): on top, one button per group opening its pages */
.shell-top .nav-groups { flex-wrap: nowrap; gap: 2px; }
.shell-top .nav-group + .nav-group { border-inline-start: 0; margin-inline-start: 0; padding-inline-start: 0; }
.shell-top .nav-drop { position: relative; }
.shell-top .nav-drop-btn { display: flex; align-items: center; gap: 7px; padding: 10px 10px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.shell-top .nav-drop-btn .ico { width: 17px; height: 17px; }
.shell-top .nav-drop-btn:hover { background: var(--surface-2); }
.shell-top .nav-drop.is-current > .nav-drop-btn { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.shell-top .nav-caret { width: 0; height: 0; border-inline: 4px solid transparent; border-top: 5px solid currentColor; opacity: .7; }
.shell-top .nav-drop.is-open .nav-caret { transform: rotate(180deg); }
.shell-top .nav-drop-menu { position: absolute; top: 100%; inset-inline-start: 0; z-index: 40; min-width: 220px; display: flex; flex-direction: column; gap: 1px;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.shell-top .nav-drop-menu[hidden] { display: none; }
.shell-top .nav-drop-menu a { padding: 8px 10px; border-radius: 6px; border-bottom: 0; white-space: nowrap; }
.shell-top .nav-drop-menu a:hover { background: var(--surface-2); }
.shell-top .nav-drop-menu a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* owner 22.11: a rep whose only screen is the bar sees no menu */
body.bar-only .nav { display: none !important; }
body.bar-only .shell-side { grid-template-columns: minmax(0, 1fr) !important; }

/* owner 23.11 (phones): the grouped top menu needed ~770px on one line, so phones zoomed the whole page out and pop-ups
   centred off-screen. On a narrow screen the groups wrap, a group's pages open full width under the menu, and the side
   menu shrinks to icons. */
@media (max-width: 760px) {
  .shell-top .nav { position: relative; padding: 0 6px; }
  .shell-top .nav-groups { flex-wrap: wrap; }
  .shell-top .nav-drop { position: static; }
  .shell-top .nav-drop-btn, .shell-top .nav a { padding: 9px 7px 7px; gap: 5px; }
  .shell-top .nav-drop-menu { inset-inline: 6px; min-width: 0; max-height: 70vh; overflow-y: auto; }
  .shell-top .nav-drop-menu a { white-space: normal; }
  .shell-side .shell-body, .shell-side.nav-collapsed .shell-body { grid-template-columns: 52px minmax(0, 1fr); }
  .shell-side .nav { padding: 10px 4px; }
  .shell-side .nav a, .shell-side .nav-tool { justify-content: center; padding: 9px 0; }
  .shell-side .nav-label, .shell-side .nav-group-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* side-by-side screens stack; rows of choices wrap (found by the phone sweep 23.11) */
  .kit-cards, .mx-split, .pbx-console, .qgrid, .kit-page, .kit-grid, .cp-grid, .gc-grid { grid-template-columns: minmax(0, 1fr); }
  .mx-detail, .dw-body > .card > .card-body { overflow-x: auto; }
  .seg { flex-wrap: wrap; max-width: 100%; }
  .am-channels { flex-wrap: wrap; gap: 8px 18px; }
  .sw { min-width: 0; }
  .sw-ticks span:nth-child(even) { display: none; }
}
