:root {
  --bg: #eef4fb;
  --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d8e5f7;
  --line-strong: #c1d5f3;
  --text: #17324d;
  --muted: #68819b;
  --accent: #2b6ff3;
  --accent-soft: #eef4ff;
  --accent-strong: #114fc8;
  --success: #1e8c5f;
  --success-soft: #e6f7f0;
  --warning: #946200;
  --warning-soft: #fff4da;
  --shadow: 0 20px 48px rgba(43, 91, 156, 0.08);
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(86, 145, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 288px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 34px 22px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
}

.brand {
  margin-bottom: 32px;
}

.brand h1,
.page-header h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.page-header p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.5;
}

.sidebar__menu {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.menu-button,
.conversation-card,
.button,
.icon-button {
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.menu-button {
  width: 100%;
  border-radius: 16px;
  border: 1px solid transparent;
  padding: 14px 16px;
  text-align: left;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.menu-button.active,
.menu-button:hover {
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

.sidebar__section {
  display: grid;
  gap: 14px;
}

.section-title,
.subsection-title,
.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 800;
}

.subsection-title {
  margin-bottom: 14px;
}

.conversation-list,
.list {
  display: grid;
  gap: 16px;
}

.conversation-card {
  width: 100%;
  padding: 18px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}

.conversation-card:hover,
.list-item--clickable:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.conversation-card.active {
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(43, 111, 243, 0.14);
}

.conversation-card__title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.conversation-card__stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.content {
  padding: 32px 38px 40px;
  display: grid;
  gap: 28px;
}

.view { display: none; }
.view.active { display: grid; gap: 28px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.page-header,
.panel,
.modal__dialog {
  padding: 28px;
}

.page-header--detail {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.grid {
  display: grid;
  gap: 24px;
  align-items: stretch;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--2-1 {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.gap-sm {
  gap: 20px;
}

.panel--compact,
.panel--aside {
  min-height: 100%;
}

.bullet-card {
  min-height: 220px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.bullet-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 14px;
  line-height: 1.6;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
}

.list-item--clickable {
  width: 100%;
  text-align: left;
  background: #fff;
}

.member-card,
.work-item {
  background: var(--panel-soft);
}

.work-item {
  min-height: 224px;
  display: flex;
  flex-direction: column;
}

.work-item--done {
  opacity: 0.74;
}

.work-item__date {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.work-item__title {
  display: block;
  margin-top: 18px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.work-item__details {
  margin-top: 12px;
  line-height: 1.55;
  min-height: 52px;
}

.list-item__row,
.panel__header,
.modal__header,
.actions-row,
.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.badge--task {
  background: var(--success-soft);
  color: var(--success);
  border-color: #b6e8d2;
}

.badge--promise {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: #f3dfaa;
}

.status-pill {
  background: #eaf2ff;
  color: var(--accent-strong);
}

.status-pill--active { background: #eaf2ff; color: var(--accent-strong); }
.status-pill--paused { background: #f2f5f9; color: var(--muted); }

.button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.button:disabled {
  cursor: default;
  opacity: 0.72;
}

.button--primary {
  background: linear-gradient(180deg, #4c8cff 0%, #2b6ff3 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(43, 111, 243, 0.16);
}

.button--secondary {
  background: #edf4ff;
  color: var(--accent-strong);
  border-color: #cfe0fb;
}

.button--ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.actions-row {
  margin-top: auto;
  padding-top: 22px;
}

.actions-row .button {
  flex: 1 1 200px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #edf4ff;
  color: var(--accent-strong);
  font-size: 24px;
  line-height: 1;
}

.button.is-loading {
  position: relative;
}

.button.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: currentColor;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

.select-wrap,
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select {
  height: 44px;
  min-width: 220px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

.empty {
  color: var(--muted);
  padding: 6px 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.modal.hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 45, 78, 0.26);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal__body {
  margin-top: 18px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1280px) {
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .grid--2-1 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid--2,
  .page-header--detail {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 640px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .panel,
  .page-header,
  .modal__dialog {
    padding: 20px;
  }

  .panel__header--stack-mobile {
    align-items: flex-start;
  }

  .work-item__title {
    font-size: 22px;
  }
}
