.component-card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background-color: #fff;
  padding: 1.25rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.component-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.component-table {
  width: 100%;
  border-collapse: collapse;
}

.component-table th,
.component-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.component-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-muted);
}

.component-modal {
  display: none;
}

.component-modal.active {
  display: flex;
}

.component-btn {
  padding: 0.55rem 1.1rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
}

.component-btn.primary {
  background-color: var(--brand-primary);
  color: #fff;
}

.component-btn.secondary {
  border-color: var(--border);
  background-color: #fff;
  color: var(--text);
}

.component-btn.ghost {
  background-color: transparent;
  color: var(--brand-muted);
}

.component-badge {
  display: inline-flex;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: rgba(15, 23, 42, 0.08);
}

.component-badge.success {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.component-badge.warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.component-badge.danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.component-form {
  display: grid;
  gap: 1rem;
}

.component-form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.component-form-row .field {
  flex: 1;
  min-width: 220px;
}

.component-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
}

.component-input:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.component-timeline {
  position: relative;
  padding-left: 1.5rem;
}

.component-timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--border);
}

.component-timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.component-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.2rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background-color: var(--brand-primary);
}

.component-chart {
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 1rem;
  background-color: #fff;
}

.component-chart canvas {
  width: 100%;
  height: 240px;
}

.component-table-wrapper {
  border-radius: 1rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.component-table-wrapper .table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-muted);
}

.product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  object-fit: cover;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-radius: 50%;
  border-top-color: var(--brand-primary);
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Rich Text Editor */
.rich-text-editor {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rich-text-editor:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.rich-text-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-muted);
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background-color: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-btn:hover {
  background-color: var(--surface-muted);
  border-color: var(--brand-primary);
}

.toolbar-btn.active {
  background-color: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.toolbar-select {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background-color: #fff;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.toolbar-select:hover,
.toolbar-select:focus {
  border-color: var(--brand-primary);
  outline: none;
}

.rich-text-content {
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
}

.rich-text-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.rich-text-content:focus {
  outline: none;
}

.rich-text-content p {
  margin: 0 0 0.5rem 0;
}

.rich-text-content p:last-child {
  margin-bottom: 0;
}

