:root {
  color-scheme: light;
  --bg: #fafafa;
  --panel: #ffffff;
  --panel-soft: #fafafa;
  --text: #09090b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --ink: #18181b;
  --purple: #6d28d9;
  --blue: #2563eb;
  --teal: #0f766e;
  --orange: #c2410c;
  --green: #15803d;
  --red: #b91c1c;
  --amber: #b45309;
  --radius: 8px;
  font-family: Geist, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  -webkit-font-smoothing: antialiased;
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100%;
}

.app-shell.platform {
  grid-template-columns: 216px minmax(0, 1fr);
}

.sidebar {
  background: var(--panel-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100vh;
  overflow: auto;
  padding: 10px 8px;
}

.platform .sidebar {
  background: #18181b;
  color: #f4f4f5;
}

.brand {
  align-items: center;
  border-radius: 7px;
  display: flex;
  gap: 9px;
  padding: 7px 8px;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 5px;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 12px;
  font-weight: 600;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.platform .brand-mark {
  background: #fff;
  color: #18181b;
}

.brand-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-subtitle {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.25;
}

.platform .brand-subtitle {
  color: #a1a1aa;
}

.nav-section {
  color: var(--faint);
  display: flex;
  font-size: 10.5px;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: 0;
  margin: 14px 8px 4px;
  text-transform: uppercase;
}

.sidebar-project-picker {
  margin: 0 8px 8px;
}

.sidebar-project-picker label {
  color: var(--faint);
  display: block;
  font-size: 11px;
  margin: 0 0 5px;
}

.sidebar-project-picker select {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  height: 32px;
  max-width: 100%;
  padding: 0 8px;
  width: 100%;
}

.sidebar-project-picker select:focus {
  border-color: var(--blue);
  outline: 2px solid color-mix(in srgb, var(--blue) 18%, transparent);
  outline-offset: 1px;
}

.nav-link,
.nav-button {
  align-items: center;
  background: transparent;
  border-radius: 6px;
  color: #3f4652;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  gap: 9px;
  min-height: 27px;
  padding: 5px 8px;
  text-align: left;
  width: 100%;
}

.nav-link span,
.nav-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link:hover,
.nav-button:hover {
  background: #eff1f5;
  color: var(--text);
}

.nav-link.active,
.nav-button.active {
  background: #ececef;
  color: var(--text);
  font-weight: 500;
}

.platform .nav-link,
.platform .nav-button {
  color: #d4d4d8;
}

.platform .nav-link:hover,
.platform .nav-button:hover {
  background: #27272a;
  color: #fff;
}

.platform .nav-link.active,
.platform .nav-button.active {
  background: #3f3f46;
  color: #fff;
}

.main-area {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  min-width: 0;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
}

.content {
  background: #fff;
  min-width: 0;
  overflow: auto;
  padding: 20px 24px;
}

.page-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.page-subtitle {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin: 2px 0 0;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-header-actions {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.rich-text-editor-shell {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.rich-text-toolbar {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 36px;
  padding: 4px;
}

.rich-text-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #344054;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  height: 26px;
  justify-content: center;
  min-width: 26px;
  padding: 0 5px;
}

.rich-text-button:hover,
.rich-text-button:focus-visible {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  outline: none;
}

.rich-text-button .icon {
  height: 15px;
  width: 15px;
}

.rich-text-divider {
  background: var(--line);
  height: 18px;
  margin: 0 3px;
  width: 1px;
}

.rich-text-editor {
  color: var(--text);
  line-height: 1.55;
  min-height: 156px;
  padding: 10px;
}

.rich-text-editor:focus {
  box-shadow: inset 0 0 0 1px #667085;
  outline: none;
}

.rich-text-display {
  color: var(--text);
  line-height: 1.55;
}

.rich-text-display > :first-child,
.rich-text-editor > :first-child {
  margin-top: 0;
}

.rich-text-display > :last-child,
.rich-text-editor > :last-child {
  margin-bottom: 0;
}

.rich-text-display ul,
.rich-text-display ol,
.rich-text-editor ul,
.rich-text-editor ol {
  padding-left: 22px;
}

.rich-text-display blockquote,
.rich-text-editor blockquote {
  border-left: 3px solid #98a2b3;
  color: #475467;
  margin-left: 0;
  padding-left: 10px;
}

.integration-catalog {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.catalog-heading h2 {
  font-size: 14px;
  margin: 0;
}

.catalog-heading p,
.integration-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.integration-cards {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.integration-card {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  min-height: 100px;
  padding: 12px;
}

.integration-card-icon {
  align-items: center;
  background: #f2f4f7;
  border-radius: 6px;
  color: #344054;
  display: inline-flex;
  flex: 0 0 30px;
  height: 30px;
  justify-content: center;
}

.integration-card-content {
  flex: 1;
  min-width: 0;
}

.integration-card-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.integration-card .btn {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .integration-cards {
    grid-template-columns: 1fr;
  }
}

.btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #344054;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
  height: 28px;
  justify-content: center;
  padding: 0 10px;
  white-space: nowrap;
}

.btn:hover {
  background: #f4f6f8;
  color: var(--text);
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn.primary:hover {
  background: #3f3f46;
  color: #fff;
}

.btn.ai {
  background: #faf7ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.btn.danger {
  color: var(--red);
}

.btn.icon-only {
  padding: 0;
  width: 30px;
}

.btn[disabled],
.disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.topbar select.btn {
  color: #3f3f46;
  max-width: 154px;
}

.topbar .project-context-select {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
  max-width: 210px;
}

.icon {
  align-items: center;
  display: inline-flex;
  fill: none;
  flex: none;
  height: 14px;
  justify-content: center;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 14px;
}

.search-box {
  align-items: center;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex: 1;
  gap: 8px;
  font-size: 13px;
  height: 30px;
  max-width: 520px;
  min-width: 190px;
  padding: 0 9px;
}

.search-box input,
.field input,
.field textarea,
.field select {
  background: transparent;
  border: 0;
  color: var(--text);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.kbd {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  padding: 1px 4px;
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

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

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
}

.panel-body {
  padding: 12px;
}

.metric {
  padding: 11px 12px;
}

.metric-label {
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 5px;
}

.metric-value {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.metric-note {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.segmented {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-flex;
  overflow: hidden;
}

.segmented .tab {
  border: 0;
  border-radius: 0;
  height: 26px;
}

.segmented .tab + .tab {
  border-left: 1px solid var(--line);
}

.tab,
.chip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #475467;
  cursor: default;
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  white-space: nowrap;
}

.tab,
a.chip,
button.chip,
label.chip,
.chip[data-action] {
  cursor: pointer;
}

.tab.active,
.chip.active {
  background: #18181b;
  border-color: #18181b;
  color: #fff;
  font-weight: 500;
}

.chip.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--red);
}

.empty-cell,
.empty-state {
  color: var(--muted);
  font-size: 12px;
  padding: 18px 12px;
  text-align: center;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  white-space: nowrap;
}

.pill.green {
  background: #ecfdf3;
  color: #166534;
}

.pill.red {
  background: #fef2f2;
  color: var(--red);
}

.pill.amber {
  background: #fffbeb;
  color: var(--amber);
}

.pill.blue {
  background: #eff6ff;
  color: #1d4ed8;
}

.pill.purple {
  background: #f5f3ff;
  color: var(--purple);
}

.pill.teal {
  background: #f0fdfa;
  color: var(--teal);
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 920px;
  width: 100%;
}

th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 8px;
  text-align: left;
}

td {
  border-bottom: 1px solid #f0f2f5;
  font-size: 12px;
  padding: 7px 8px;
  vertical-align: middle;
}

tr:hover td {
  background: #fafafa;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.board {
  align-items: start;
  display: flex;
  gap: 12px;
  min-width: max-content;
  overflow-x: auto;
  padding-bottom: 10px;
}

.column {
  background: transparent;
  border: 0;
  border-radius: 0;
  flex: none;
  min-height: 420px;
  padding: 0;
  width: 272px;
}

.column-head {
  align-items: center;
  display: flex;
  gap: 7px;
  min-height: 28px;
  padding: 0 2px 8px;
}

.drop-zone {
  align-content: start;
  display: grid;
  gap: 8px;
  grid-auto-rows: max-content;
  min-height: 60px;
}

.drop-zone.drag-over {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.ticket-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: grab;
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 10px 11px;
}

.ticket-card:active {
  cursor: grabbing;
}

.ticket-card.dragging {
  opacity: 0.42;
}

.card-row {
  align-items: center;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f7f7f8;
}

.clickable-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

tr.inline-editing td {
  background: #fafafa;
}

.inline-input {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  min-height: 28px;
  min-width: 72px;
  padding: 3px 6px;
  width: 100%;
}

.card-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.avatar {
  align-items: center;
  background: var(--purple);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 9px;
  font-weight: 600;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-width: 0;
  padding: 6px 9px;
}

.field label {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 4px;
}

.field.full {
  grid-column: 1 / -1;
}

.drawer,
.modal,
.command {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  position: fixed;
  z-index: 30;
}

.drawer {
  bottom: 12px;
  max-width: calc(100vw - 24px);
  right: 12px;
  top: 12px;
  width: 520px;
}

.modal {
  left: 50%;
  max-width: calc(100vw - 28px);
  top: 52%;
  transform: translate(-50%, -50%);
  width: 560px;
}

.command {
  left: 50%;
  max-width: calc(100vw - 28px);
  top: 80px;
  transform: translateX(-50%);
  width: 680px;
}

.overlay {
  background: rgba(15, 23, 42, 0.22);
  inset: 0;
  position: fixed;
  z-index: 25;
}

.toast {
  align-items: center;
  background: #101828;
  border-radius: 7px;
  bottom: 18px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
  color: #fff;
  display: flex;
  font-size: 12.5px;
  gap: 8px;
  max-width: calc(100vw - 36px);
  padding: 9px 12px;
  position: fixed;
  right: 18px;
  z-index: 50;
}

.drag-list {
  display: grid;
  gap: 8px;
}

.drag-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: grab;
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  min-height: 32px;
  padding: 6px 9px;
}

.drag-item.dragging {
  opacity: 0.45;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  font-size: 12.5px;
  padding: 7px 0;
}

.mobile-bar {
  display: none;
}

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

  .sidebar {
    display: none;
  }

  .mobile-bar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 8px;
    height: 44px;
    padding: 0 10px;
  }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 49px;
    padding: 8px 10px;
  }

  .content {
    padding: 14px 12px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .grid.five,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    display: grid;
  }

  table {
    min-width: 780px;
  }
}
