.cad-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
}

.page-header h1 {
  margin: 0;
  font-size: 1.45rem;
}

.page-header p {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
}

button {
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  background: var(--color-brand);
  color: var(--color-neutral-900);
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.create-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  padding: var(--space-4);
}

.create-box h2 {
  margin: 0 0 var(--space-3);
  font-size: 1.05rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-grid span {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.form-grid input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}

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

.form-grid textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  resize: vertical;
}

.create-actions {
  margin-top: var(--space-3);
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-2);
  text-align: left;
}

.notes-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.error {
  color: var(--color-danger-500);
}

.success {
  color: var(--color-success-500);
}

@media (max-width: 880px) {
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

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