/* ── Layout ─────────────────────────────────────────────────────────── */
.layout { display: flex; height: calc(100vh - 60px); }

/* ── Sidebar — frozen glass panel ──────────────────────────────────── */
.sidebar {
  width: 234px; min-width: 234px;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;

  background: var(--glass-dark);
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
  border-right: 1px solid var(--border-dim);
  box-shadow: inset -1px 0 0 var(--border-dim);
  transition: background .3s ease;
}

.sidebar--agent {
  width: 240px; min-width: 240px;
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 0;
}

.agent-sidebar-item {
  padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 12px;
  color: var(--text2); transition: background .12s; position: relative;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: transparent;
}
.agent-sidebar-item:hover { background: rgba(255,255,255,.07); }
.agent-sidebar-item:hover .agent-sidebar-del { opacity: 1; }
.agent-sidebar-item.active { background: rgba(139,0,0,.3); color: var(--text); }
.agent-sidebar-del {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  opacity: 0; background: none; border: none; color: var(--muted-hi);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 4px;
  transition: opacity .12s, color .12s;
}
.agent-sidebar-del:hover { color: var(--danger); }

.main {
  flex: 1; overflow-y: auto;
  padding: 24px 28px;
}
body.page-agent footer { display: none !important; }
body.page-agent .layout { min-height: 100vh !important; height: 100vh !important; }
body.page-agent .main {
  overflow: hidden !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch;
}
body.page-agent #page-agent.active {
  flex: 1 1 0%;
  min-height: 0;
}
body.page-agent .agent-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
}
/* History grows only when there are messages */
body.page-agent .agent-wrap.has-messages .agent-history {
  flex: 1 1 0%;
  min-height: 0;
}
/* Empty: history takes no space so input zone can be centred */
body.page-agent .agent-wrap:not(.has-messages) .agent-history {
  flex: 0 0 0;
  overflow: hidden;
  padding: 0 !important;
}

/* ── Sidebar controls ───────────────────────────────────────────────── */
.sb-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin-bottom: 8px;
}

.period-options { display: flex; flex-direction: column; gap: 2px; }
.period-option {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px; color: var(--text2);
  transition: background .14s;
}
.period-option:hover { background: rgba(255,255,255,0.08); }
.period-option input[type=radio] { accent-color: var(--accent); }

.custom-dates { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.custom-dates input {
  background: var(--glass-input);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-dim);
  color: var(--text); border-radius: var(--r-sm);
  padding: 7px 10px; font-size: 13px; width: 100%;
}
.custom-dates input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}


.project-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 260px; overflow-y: auto;
}
.project-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; border-radius: var(--r-xs);
  cursor: pointer; transition: background .12s;
}
.project-item:hover { background: rgba(255,255,255,0.07); }
.project-item input { accent-color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.project-item label { cursor: pointer; font-size: 13px; color: var(--text2); line-height: 1.35; }
.project-site { color: var(--muted); font-size: 11px; }

