.cet-workbench {
  display: flex;
  flex-direction: column;
  min-height: 650px;
  height: calc(100vh - 310px);
  color: #1f2937;
}

.cet-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  flex: 1;
}

.cet-form-panel,
.cet-table-panel {
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 5%);
  min-height: 0;
}

.cet-form-panel {
  overflow: hidden;
}

.cet-scroll {
  height: 100%;
  overflow: auto;
  padding: 16px;
}

.cet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cet-workbench h3 {
  margin: 0;
  font-size: 16px;
  color: #172033;
}

.cet-workbench label {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.cet-workbench input,
.cet-workbench select,
.cet-workbench textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  padding: 8px 9px;
  font: inherit;
  color: #172033;
}

.cet-workbench textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.cet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cet-actions button,
.cet-link-button {
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.cet-primary {
  background: #2563eb;
  color: #fff;
}

.cet-success {
  background: #15803d;
  color: #fff;
}

.cet-link-button {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
  padding: 5px 9px;
}

.cet-actions button:disabled,
.cet-link-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.cet-table-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  padding: 14px;
}

.cet-table-panel h3 {
  margin-bottom: 8px;
}

.cet-table-scroll {
  min-height: 0;
  overflow: auto;
}

.cet-table-scroll table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}

.cet-table-scroll th,
.cet-table-scroll td {
  border-bottom: 1px solid #e5e7eb;
  padding: 9px 10px;
  text-align: left;
}

.cet-table-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #475569;
}

.cet-table-scroll tbody tr[data-cet-task-id] {
  cursor: pointer;
}

.cet-table-scroll tbody tr[data-cet-task-id]:hover,
.cet-table-scroll tbody tr.selected {
  background: #dcfce7;
}

.cet-title-cell {
  min-width: 250px;
  white-space: normal;
}

.cet-empty {
  text-align: center !important;
  color: #64748b;
  padding: 24px !important;
}

.cet-error {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff1f2;
  padding: 9px 12px;
  color: #991b1b;
  font-size: 12px;
}

.cet-status {
  flex: 0 0 auto;
  margin-top: 8px;
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px 11px;
  color: #475569;
  font-size: 12px;
}

@media (max-width: 1050px) {
  .cet-workbench {
    height: auto;
  }

  .cet-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cet-table-panel {
    min-height: 430px;
  }
}
