/* Enhetligt app-skal: en beständig vänster-sidebar på alla sidor (modulväxlare + konto),
   så de fem sidorna känns som EN produkt — en "business suite". Drop-in, inom paper&ink:
   bläck, skarpa hörn, hårstreck, versal spärrad sans. Injiceras av shell.js; layouten
   skiftar innehållet åt höger och demoterar den gamla topbaren till en innehålls-header. */

:root {
  --hq-sidebar: 232px;
}

body.has-shell {
  padding-left: var(--hq-sidebar);
}

.shell-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--hq-sidebar);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.7rem;
  background: var(--panel, #fbf7ec);
  border-right: 1px solid var(--ink, #141210);
  z-index: 50;
}

/* Varumärke (återanvänder .logo från paper-ink, omdimensionerad). */
.shell-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink, #141210);
  padding: 0.2rem 0.45rem 1rem;
}

.shell-brand .logo {
  width: 30px;
  height: 30px;
}

.shell-word {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--sans, system-ui, sans-serif);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.92rem;
  line-height: 1;
}

.shell-word small {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--muted, #6b6557);
  font-weight: 600;
}

/* Modulväxlare. */
.shell-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.4rem;
}

.shell-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem;
  text-decoration: none;
  color: var(--ink, #141210);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.shell-item:hover {
  background: var(--bg-alt, #f3eedf);
}

.shell-item.active {
  background: var(--ink, #141210);
  color: var(--bg, #fffcf2);
}

.shell-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: none;
}

.shell-icon svg {
  width: 18px;
  height: 18px;
}

/* Konto-block längst ner. */
.shell-account {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line, #e6e0d4);
}

.shell-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.4rem;
}

.shell-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--ink, #141210);
  font-family: var(--mono, monospace);
  font-size: 0.72rem;
}

.shell-id {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.shell-name {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-role {
  font-family: var(--mono, monospace);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b6557);
}

.shell-logout,
.shell-login {
  width: 100%;
  margin-top: 0.55rem;
}

/* Demotera den gamla topbaren → innehålls-header (skalet äger varumärke + nav). */
.topbar .brand .logo {
  display: none;
}

.topbar-side .navlink {
  display: none;
}

/* ⌘K-kommandopalett — overlay + centrerat kort (paper&ink: skarpa hörn, hård skugga,
   inverterat valt läge). */
.hq-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(20, 18, 16, 0.28);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
}

.hq-palette {
  width: min(36rem, 92vw);
  background: var(--bg, #fffcf2);
  border: 1px solid var(--ink, #141210);
  box-shadow: 4px 4px 0 rgba(20, 18, 16, 0.18);
}

.hq-palette-input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--serif, inherit);
  font-size: 1.05rem;
  padding: 0.8rem 0.95rem;
  border: none;
  border-bottom: 1px solid var(--line, #e6e0d4);
  background: transparent;
  color: var(--ink, #141210);
  outline: none;
}

.hq-palette-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 22rem;
  overflow-y: auto;
}

.hq-palette-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
}

.hq-palette-item.sel {
  background: var(--ink, #141210);
  color: var(--bg, #fffcf2);
}

.hq-pi-label {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.9rem;
}

.hq-pi-hint {
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b6557);
  white-space: nowrap;
}

.hq-palette-item.sel .hq-pi-hint {
  color: var(--bg, #fffcf2);
}

.hq-palette-empty {
  padding: 0.8rem 0.95rem;
  color: var(--muted, #6b6557);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.85rem;
}

/* Smal skärm → ikon-rail (etiketter dolda); identitet kvar som avatar. */
@media (max-width: 900px) {
  :root {
    --hq-sidebar: 60px;
  }

  .shell-label,
  .shell-word,
  .shell-name,
  .shell-role,
  .shell-logout,
  .shell-login {
    display: none;
  }

  .shell-brand,
  .shell-item,
  .shell-user {
    justify-content: center;
  }

  .shell-item {
    gap: 0;
  }
}
