/* ============================================================
   App shell — EduCom Hub-style sidebar + routed pages
   ============================================================ */
:root { --sbw: 236px; }

body { padding-left: var(--sbw); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sbw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  z-index: 70;
}

.sb-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.sb-logo {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px;
  color: #fff; background: linear-gradient(135deg, var(--accent) 0%, #0f6e3e 100%);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 65%, transparent);
}
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.sb-brand-name { font-weight: 750; font-size: 14.5px; letter-spacing: -0.01em; }
.sb-brand-sub { font-size: 11px; color: var(--text-muted); }

.sb-label {
  padding: 6px 10px 7px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
}
.sb-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.sb-tab, .sb-foot-btn {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  font-size: 13.5px; font-weight: 550; text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.sb-tab:hover, .sb-foot-btn:hover { background: var(--surface-3); color: var(--text); }
.sb-tab.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-weight: 650;
}
:root[data-theme="dark"] .sb-tab.active { background: color-mix(in srgb, var(--accent) 17%, transparent); }
.sb-tab .nav-ic, .sb-foot-btn .nav-ic { width: 21px; display: grid; place-items: center; flex: none; }
.sb-tab .nav-ic .ic, .sb-foot-btn .nav-ic .ic { width: 18px; height: 18px; }
.sb-tab .sb-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--text-muted); background: var(--surface-3);
  padding: 1px 7px; border-radius: 99px;
}
.sb-tab.active .sb-count { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sb-foot { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; border-top: 1px solid var(--border); }
.sb-sync-status { font-size: 11px; color: var(--text-muted); padding: 2px 10px; min-height: 15px; }

/* Who's signed in, and the way out. Built by js/auth-gate.js and only present
   when there's a session — so these rules match nothing in browser-only mode. */
.sb-account { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.sb-account-who { font-size: 12px; font-weight: 600; color: var(--text-soft); padding: 0 10px;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-account-house { font-size: 11px; color: var(--text-muted); padding: 0 10px 4px;
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-account .sb-foot-btn { text-decoration: none; }

/* fixed layers sit beside the sidebar, not under it */
.page, .overlay { left: var(--sbw); }
#tray { margin-left: calc(var(--sbw) / 2); }

.page-inner.wide { max-width: min(1320px, 100%); }

@media (max-width: 1020px) {
  :root { --sbw: 62px; }
  .sb-brand { justify-content: center; padding: 4px 0 14px; }
  .sb-brand-text, .sb-tab span:not(.nav-ic), .sb-foot-btn span:not(.nav-ic), .sb-label,
  .sb-tab .sb-count, .sb-sync-status,
  .sb-account-who, .sb-account-house { display: none; }
  .sidebar { padding: 12px 8px; }
  .sb-tab, .sb-foot-btn { justify-content: center; padding: 11px 0; }
}
@media (max-width: 640px) {
  :root { --sbw: 54px; }
}

/* ---------- stock status ---------- */
.stockchip {
  font-size: 10.5px; font-weight: 750; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 99px; text-transform: uppercase;
}
.stockchip.ok  { background: var(--accent-soft); color: var(--green-dark); }
.stockchip.low { background: color-mix(in srgb, var(--amber) 14%, transparent); color: var(--amber); }
.stockchip.out { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.minnote { font-size: 11px; color: var(--text-muted); font-weight: 500; }

