.dashboard {
  align-items: stretch;
  display: grid;
  gap: 20px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: 220px minmax(0, 1fr);
}

.page-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.section-heading h2 {
  color: var(--color-highlight);
  margin: 0;
}

.status-banner {
  margin: 0;
}

.page-body {
  align-items: stretch;
  display: grid;
  flex: 1;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
}

.sidebar,
.page-content {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
}

.sidebar {
  position: static;
}

body:not([data-active-tab="chat"]) .page-body {
  grid-template-columns: minmax(0, 1fr);
}

body:not([data-active-tab="chat"]) .sidebar {
  display: none;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.section-copy {
  line-height: 1.75;
  margin: 0 0 12px;
}

.session-list {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.session-heading-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.compact-action {
  font-size: 0.78rem;
  min-height: 32px;
  padding: 6px 10px;
}

.session-item {
  align-items: flex-start;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-soft);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  min-height: 88px;
  min-width: 0;
  overflow: visible;
  padding: 12px 14px 12px 16px;
  position: relative;
  text-align: left;
  width: 100%;
}

.session-select {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  min-height: auto;
  padding: 0;
  text-align: left;
  width: 100%;
}

.session-select:hover,
.session-select:active {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.session-more {
  align-items: center;
  background: var(--color-surface);
  border-color: var(--color-border-soft);
  border-radius: 999px;
  color: var(--color-muted);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  min-height: 28px;
  opacity: 0.78;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
}

.session-more:hover {
  background: var(--color-input-bg);
  border-color: var(--color-accent-strong);
  box-shadow: none;
  opacity: 1;
}

.session-menu {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 34px var(--color-shadow);
  min-width: 92px;
  padding: 6px;
  position: absolute;
  right: 10px;
  top: 42px;
  z-index: 5;
}

.session-menu-item {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 34px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.session-menu-item:hover {
  background: var(--color-input-bg);
  box-shadow: none;
  transform: none;
}

.session-menu-item.danger {
  color: #b42318;
}

.session-item.active {
  background: #eef7fb;
  border-color: var(--color-border-soft);
  border-left-color: var(--color-accent-strong);
  box-shadow: none;
}

.session-item-title {
  color: var(--color-highlight);
  display: block;
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.65;
  width: 100%;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  padding: 2px 36px 2px 0;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.session-meta {
  align-items: center;
  color: var(--color-muted);
  display: flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: space-between;
  min-height: 28px;
  min-width: 0;
  width: 100%;
}

.session-meta .chip {
  max-width: 100%;
}

.chip {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-highlight);
  display: inline-flex;
  font-size: 0.76rem;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
}

.session-time {
  color: var(--color-muted);
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

.tab-pane {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}
