body {
  min-height: 100vh;
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-rows: 52px 1fr 74px;
  background: var(--bg);
  overflow-x: hidden;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  gap: var(--space-3);
  position: relative;
  z-index: 250;
  min-width: 0;
}

.topbar-logo {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.topbar-logo span {
  color: var(--muted);
  font-weight: 500;
}

.topbar-logo span::first-letter {
  color: var(--brand-green);
  font-weight: 700;
}

.topbar-tenant {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-currency-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-shrink: 1;
}

.topbar-currency-label {
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-currency-select {
  min-width: 74px;
  max-width: 92px;
  height: 30px;
  font-size: 12px;
  padding-left: 6px;
  padding-right: 18px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.tenant-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.topbar-sep {
  flex: 1;
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shell-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
}

.sidebar {
  display: none;
}

.panel-host {
  --panel-inline-pad: var(--space-4);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4);
  min-width: 0;
}

.mobile-tabbar {
  background: var(--surface);
  border-top: 1px solid var(--divider);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 4px calc(12px + env(safe-area-inset-bottom));
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  width: 100%;
}

@media (min-width: 1024px) {
  .app-shell {
    grid-template-rows: 52px 1fr;
  }

  .shell-body {
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  .sidebar {
    display: block;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 10px 0;
    overflow: auto;
  }

  .panel-host {
    --panel-inline-pad: var(--space-5);
    padding: var(--space-5);
  }

  .mobile-tabbar {
    display: none;
  }
}
