:root {
  --brand-primary: #3C50E0;
  --brand-secondary: #80CAEE;
}

.bg-brand { background-color: var(--brand-primary); }
.text-brand { color: var(--brand-primary); }
.shadow-brand\/30 { --tw-shadow-color: color-mix(in srgb, var(--brand-primary) 30%, transparent); }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  color: #94a3b8;
  transition: 0.15s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active { background: var(--brand-primary); color: #fff; }

.card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  outline: none;
}
.input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.label { display: block; margin-bottom: 0.35rem; font-size: 0.875rem; font-weight: 500; color: #334155; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  background: var(--brand-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  transition: 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
}
.btn-ghost:hover { background: #f8fafc; }

.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  color: #64748b;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}
.table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err { background: #ffe4e6; color: #9f1239; }
.badge-muted { background: #f1f5f9; color: #475569; }

/* Badge / tombol CRUD seragam */
.badge-crud,
.btn-crud {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s ease;
}
.btn-crud:hover { filter: brightness(0.97); transform: translateY(-1px); }
.btn-crud:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.badge-crud-create, .btn-crud.badge-crud-create { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.badge-crud-read, .btn-crud.badge-crud-read { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.badge-crud-update, .btn-crud.badge-crud-update { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-crud-delete, .btn-crud.badge-crud-delete { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.badge-crud-connect, .btn-crud.badge-crud-connect { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge-crud-disconnect, .btn-crud.badge-crud-disconnect { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge-crud-logout, .btn-crud.badge-crud-logout { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }

.crud-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.toast {
  pointer-events: auto;
  margin-top: 0.5rem;
  border-radius: 0.75rem;
  background: #1e293b;
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 10px 30px rgba(15,23,42,0.2);
  display: flex;
  align-items: center;
}

/* Native <dialog> panels */
.dlg-panel {
  width: min(100% - 2rem, 36rem);
  max-height: min(90vh, 720px);
  padding: 0;
  border: none;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dlg-panel::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.dlg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}
.dlg-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.dlg-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1.15rem;
  border-top: 1px solid #f1f5f9;
  background: #fff;
  flex-shrink: 0;
}
.dlg-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
}
.dlg-x:hover { background: #f8fafc; color: #0f172a; }
