.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.top-chrome {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; background: rgba(247,248,245,.92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.chrome-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.app-name { font-family: var(--font-display); font-size: 1.25rem; }
.app-switch {
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: 0 1px 0 rgba(26, 34, 28, 0.04);
}
.app-tab {
  border: 0; background: transparent; cursor: pointer; font: inherit;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  letter-spacing: -0.02em; padding: 7px 14px; color: var(--muted);
  border-right: 1px solid var(--line);
}
.app-tab:last-child { border-right: 0; }
.app-tab:hover { color: var(--ink); background: rgba(15, 107, 92, 0.06); }
.app-tab.active {
  color: #f4fffb; background: var(--accent);
}
.app-shell[data-app="materijalno"] .app-tab.active {
  background: #8a4b1f;
}
.app-shell[data-app="os"] .app-tab.active {
  background: #1f4b7a;
}
.app-shell[data-app="plati"] .app-tab.active {
  background: #5a3d7a;
}
.chrome-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.inline select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; }
.user-chip {
  font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  background: #e7efe9; color: var(--accent); padding: 6px 10px; border-radius: 999px;
}

.menubar {
  display: flex; gap: 2px; padding: 0 8px;
  background: linear-gradient(#f3f5f1, #e6ebe4);
  border-bottom: 1px solid #c5cdc4;
  position: relative; z-index: 40;
}
.menubar > .menu-root {
  position: relative;
}
.menubar > .menu-root > button {
  border: 0; background: transparent; padding: 9px 12px; cursor: pointer;
  font: inherit; color: var(--ink); border-radius: 0;
}
.menubar > .menu-root > button:hover,
.menubar > .menu-root.open > button {
  background: #0b6bcb; color: #fff;
}
.menu-panel,
.menu-sub {
  display: none;
  position: fixed; /* viewport-aware; coords set by JS */
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: nowrap;
  min-width: 210px;
  max-width: min(960px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f2f2f2;
  border: 1px solid #9aa39b;
  box-shadow: 2px 4px 12px rgba(0,0,0,.18);
  padding: 4px 0;
  z-index: 50;
}
.menu-sub { z-index: 60; }
.menu-sub .menu-sub { z-index: 70; }
.menu-root.open > .menu-panel,
.menu-item.open-sub > .menu-sub {
  display: flex;
}
.menu-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 420px;
}
.menu-panel.menu-matrix,
.menu-sub.menu-matrix {
  padding: 4px;
}
.menu-item {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 7px 14px; cursor: pointer; font-size: .92rem; white-space: nowrap;
  border: 0; background: transparent; width: 100%; text-align: left; color: var(--ink); font: inherit;
  box-sizing: border-box;
}
.menu-item:hover, .menu-item.active, .menu-item.open-sub {
  background: #0b6bcb; color: #fff;
}
.menu-item .arrow { opacity: .7; font-size: .75rem; }
.menu-item.sep {
  height: 1px; padding: 0; margin: 4px 8px; background: #c8c8c8; pointer-events: none;
}
.menu-item.disabled { opacity: .55; }
.badge-wip {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .85;
}

.app-shell .main { flex: 1; padding: 22px 28px 40px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 900px) {
  .top-chrome { flex-direction: column; align-items: stretch; }
  .menubar { flex-wrap: wrap; }
  .menu-col { min-width: 180px; max-width: 320px; }
}
